public indexers in config file

darcs-hash:20080717134331-84dde-b63c9b7e318d74e2cfea14cc962ec2d519f20d43.gz
This commit is contained in:
Evan Prodromou 2008-07-17 09:43:31 -04:00
parent fb62662650
commit 753a03d895
3 changed files with 19 additions and 2 deletions

View File

@ -48,8 +48,9 @@ $config['db']['database'] = 'mysql://laconica:microblog@localhost/laconica';
#$config['xmpp']['user'] = 'update'; #$config['xmpp']['user'] = 'update';
#$config['xmpp']['resource'] = 'uniquename'; #$config['xmpp']['resource'] = 'uniquename';
#$config['xmpp']['password'] = 'blahblahblah'; #$config['xmpp']['password'] = 'blahblahblah';
#$config['xmpp']['public'][] = 'someindexer@example.net';
#Do notice broadcasts offline #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) #as a daemon (with, say, start-stop-daemon)
#$config['queue']['enabled'] = true; #$config['queue']['enabled'] = true;

View File

@ -73,7 +73,8 @@ $config =
'resource' => 'uniquename', 'resource' => 'uniquename',
'password' => 'blahblahblah', 'password' => 'blahblahblah',
'host' => NULL, # only set if != server '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'); $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');

View File

@ -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; return true;
} }