summaryrefslogtreecommitdiff
path: root/lib/util.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-08 11:55:32 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-08 11:55:32 -0700
commitadfb79a9bbdfb43f35c0f022c1de6118b10ce115 (patch)
treee14ec0cc5161cfd5cc321eaaa5b8eed07df952de /lib/util.php
parent1a126032efbcb265a59f4d682bd072251f857c97 (diff)
parent265e2bd58de2a01e0d7840310eb44b21b70e3914 (diff)
Merge branch '0.7.x' into 0.8.x
Conflicts: classes/Notice.php classes/Profile.php lib/common.php lib/util.php scripts/getvaliddaemons.php scripts/stopdaemons.sh
Diffstat (limited to 'lib/util.php')
-rw-r--r--lib/util.php28
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;