summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.php.sample3
-rw-r--r--lib/common.php3
-rw-r--r--lib/jabber.php15
3 files changed, 19 insertions, 2 deletions
diff --git a/config.php.sample b/config.php.sample
index 3f732d109..80aede557 100644
--- a/config.php.sample
+++ b/config.php.sample
@@ -48,8 +48,9 @@ $config['db']['database'] = 'mysql://laconica:microblog@localhost/laconica';
#$config['xmpp']['user'] = 'update';
#$config['xmpp']['resource'] = 'uniquename';
#$config['xmpp']['password'] = 'blahblahblah';
+#$config['xmpp']['public'][] = 'someindexer@example.net';
#Do notice broadcasts offline
-#If you set this, you must run the queuehandler.php
+#If you set this, you must run the xmppdaemon.php
#as a daemon (with, say, start-stop-daemon)
#$config['queue']['enabled'] = true; \ No newline at end of file
diff --git a/lib/common.php b/lib/common.php
index 0203c2dea..a49806b05 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -73,7 +73,8 @@ $config =
'resource' => 'uniquename',
'password' => 'blahblahblah',
'host' => NULL, # only set if != server
- 'debug' => false), # print extra debug info
+ 'debug' => false, # print extra debug info
+ 'public' => array()), # JIDs of users who want to receive the public stream
);
$config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');
diff --git a/lib/jabber.php b/lib/jabber.php
index d772cd92c..1e609377f 100644
--- a/lib/jabber.php
+++ b/lib/jabber.php
@@ -255,6 +255,21 @@ function jabber_broadcast_notice($notice) {
}
}
+ # Now, users who want everything
+
+ $public = common_config('xmpp', 'public');
+
+ # FIXME PRIV don't send out private messages here
+
+ if ($public) {
+ foreach ($public as $address) {
+ common_log(LOG_INFO,
+ 'Sending notice ' . $notice->id . ' to public listener ' . $address,
+ __FILE__);
+ jabber_send_notice($address, $notice);
+ }
+ }
+
return true;
}