diff options
Diffstat (limited to 'lib/util.php')
-rw-r--r-- | lib/util.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/util.php b/lib/util.php index ab1272309..9872d97c4 100644 --- a/lib/util.php +++ b/lib/util.php @@ -900,6 +900,34 @@ function common_enqueue_notice($notice) return $result; } +function common_post_inbox_transports() +{ + $transports = array('omb', 'sms'); + + if (common_config('xmpp', 'enabled')) { + $transports = array_merge($transports, array('jabber', 'public')); + } + + return $transports; +} + +function common_enqueue_notice_transport($notice, $transport) +{ + $qi = new Queue_item(); + $qi->notice_id = $notice->id; + $qi->transport = $transport; + $qi->created = $notice->created; + $result = $qi->insert(); + if (!$result) { + $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError'); + common_log(LOG_ERR, 'DB error inserting queue item: ' . $last_error->message); + throw new ServerException('DB error inserting queue item: ' . $last_error->message); +>>>>>>> 0.7.x:lib/util.php + } + common_log(LOG_DEBUG, 'complete queueing notice ID = ' . $notice->id . ' for ' . $transport); + return true; +} + function common_real_broadcast($notice, $remote=false) { $success = true; |