]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
public indexers in config file
authorEvan Prodromou <evan@prodromou.name>
Thu, 17 Jul 2008 13:43:31 +0000 (09:43 -0400)
committerEvan Prodromou <evan@prodromou.name>
Thu, 17 Jul 2008 13:43:31 +0000 (09:43 -0400)
darcs-hash:20080717134331-84dde-b63c9b7e318d74e2cfea14cc962ec2d519f20d43.gz

config.php.sample
lib/common.php
lib/jabber.php

index 3f732d109f6320df25d1983252828883629552fc..80aede557bdf1792fe65228fa337dd8a46f65198 100644 (file)
@@ -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
index 0203c2dea5f154f7872ce98bf634443f8e08b1ea..a49806b05c3e1d6b1c04b3a8a0744a8709f7200e 100644 (file)
@@ -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');
index d772cd92c49749acfac8032f4e468a9454724ca8..1e609377fd31b334e0b65a46532086270c55ca89 100644 (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;
 }