]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Comet/CometPlugin.php
Removed hanging skin crapola
[quix0rs-gnu-social.git] / plugins / Comet / CometPlugin.php
index 48ac9dcad6d79f986e4439343489ad7729de3131..45251c66f04c5384127329352aa9f6fe67e52723 100644 (file)
@@ -45,9 +45,11 @@ class CometPlugin extends Plugin
 {
     var $server = null;
 
-    function __construct($server=null)
+    function __construct($server=null, $username=null, $password=null)
     {
-        $this->server = $server;
+        $this->server   = $server;
+        $this->username = $username;
+        $this->password = $password;
 
         parent::__construct();
     }
@@ -131,7 +133,7 @@ class CometPlugin extends Plugin
             $json = $this->noticeAsJson($notice);
 
             // Bayeux? Comet? Huh? These terms confuse me
-            $bay = new Bayeux($this->server);
+            $bay = new Bayeux($this->server, $this->user, $this->password);
 
             foreach ($timelines as $timeline) {
                 $this->log(LOG_INFO, "Posting notice $notice->id to '$timeline'.");
@@ -158,6 +160,15 @@ class CometPlugin extends Plugin
         $arr = $act->twitter_status_array($notice, true);
         $arr['url'] = $notice->bestUrl();
         $arr['html'] = htmlspecialchars($notice->rendered);
+        $arr['source'] = htmlspecialchars($arr['source']);
+
+        if (!empty($notice->reply_to)) {
+            $reply_to = Notice::staticGet('id', $notice->reply_to);
+            if (!empty($reply_to)) {
+                $arr['in_reply_to_status_url'] = $reply_to->bestUrl();
+            }
+            $reply_to = null;
+        }
 
         $profile = $notice->getProfile();
         $arr['user']['profile_url'] = $profile->profileurl;