]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Twitter integration - added $config option for source attribute when posting to Twitter
authorZach Copley <zach@controlyourself.ca>
Sun, 7 Sep 2008 06:21:18 +0000 (02:21 -0400)
committerZach Copley <zach@controlyourself.ca>
Sun, 7 Sep 2008 06:21:18 +0000 (02:21 -0400)
darcs-hash:20080907062118-7b5ce-b4412446bbf245b1d14a78b01ecde0f71f621185.gz

config.php.sample
lib/common.php
lib/util.php

index 875dc8b2548b57bac92641221a4ee8e20243540c..900d99c410e5318b1c803fa3187613d0a1a13fdd 100644 (file)
@@ -86,3 +86,6 @@ $config['db']['database'] = 'mysql://laconica:microblog@localhost/laconica';
 
 #optionally show non-local messages in public timeline
 #$config['public']['localonly'] = false;
+
+#Twitter integration source attribute. Note: default is Laconica
+#$config['integration']['source'] = 'Laconica';
index d1bab51a64aa14b8412916d4020189f3193bd1e9..8ea8fa0fad81b09164e44a8f84acb3ce8d01ff09 100644 (file)
@@ -97,11 +97,7 @@ $config =
                'daemon' =>
                array('piddir' => '/var/run',
                          'user' => false,
-                         'group' => false),
-               'memcached' => 
-               array('enabled' => false,
-                         'server' => 'localhost',
-                         'port' => 11211)
+                         'group' => false)
                );
 
 $config['db'] = &PEAR::getStaticProperty('DB_DataObject','options');
index 5b6b59f8055f7d4c1e4dc50c2644657b7d09f909..b67782af3474507150505be7f38bd20631d16fa1 100644 (file)
@@ -1104,6 +1104,7 @@ function common_broadcast_notice($notice, $remote=false) {
 }
 
 function common_twitter_broadcast($notice, $flink) {   
+       global $config;
        $success = true;
        $fuser = $flink->getForeignUser();
        $twitter_user = $fuser->nickname;
@@ -1116,13 +1117,13 @@ function common_twitter_broadcast($notice, $flink) {
                CURLOPT_POST                    => true,
                CURLOPT_POSTFIELDS              => array(
                                                                        'status'        => $statustxt,
-                                                                       'source'        => 'Laconica'
+                                                                       'source'        => $config['integration']['source']
                                                                        ),
                CURLOPT_RETURNTRANSFER  => true,
                CURLOPT_FAILONERROR             => true,
                CURLOPT_HEADER                  => false,
                CURLOPT_FOLLOWLOCATION  => true,
-               // CURLOPT_USERAGENT            => "identi.ca",
+               CURLOPT_USERAGENT               => "Laconica",
                CURLOPT_CONNECTTIMEOUT  => 120,  // XXX: Scary!!!! How long should this be?
                CURLOPT_TIMEOUT                 => 120
        );