]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Realtime/RealtimePlugin.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / plugins / Realtime / RealtimePlugin.php
index 25fa921ffec9709047f8f555d84b13a040be9879..bf847acca3ea487ca471a775c7c9b117a0bd62ab 100644 (file)
@@ -85,7 +85,7 @@ class RealtimePlugin extends Plugin
         return true;
     }
 
-    function onEndShowScripts($action)
+    function onEndShowScripts(Action $action)
     {
         $channel = $this->_getChannel($action);
 
@@ -173,8 +173,9 @@ class RealtimePlugin extends Plugin
 
         // Add to the public timeline
 
-        if ($notice->is_local == Notice::LOCAL_PUBLIC ||
-            ($notice->is_local == Notice::REMOTE && !common_config('public', 'localonly'))) {
+        $is_local = intval($notice->is_local);
+        if ($is_local === Notice::LOCAL_PUBLIC ||
+                ($is_local === Notice::REMOTE && !common_config('public', 'localonly'))) {
             $paths[] = array('public', null, null);
         }
 
@@ -310,7 +311,7 @@ class RealtimePlugin extends Plugin
         return false; // No default processing
     }
 
-    function noticeAsJson($notice)
+    function noticeAsJson(Notice $notice)
     {
         // FIXME: this code should be abstracted to a neutral third
         // party, like Notice::asJson(). I'm not sure of the ethics
@@ -320,7 +321,7 @@ class RealtimePlugin extends Plugin
         $act = new ApiAction('/dev/null');
 
         $arr = $act->twitterStatusArray($notice, true);
-        $arr['url'] = $notice->getUrl();
+        $arr['url'] = $notice->getUrl(true);
         $arr['html'] = htmlspecialchars($notice->rendered);
         $arr['source'] = htmlspecialchars($arr['source']);
         $arr['conversation_url'] = $notice->getConversationUrl();
@@ -333,7 +334,7 @@ class RealtimePlugin extends Plugin
         if (!empty($notice->repeat_of)) {
             $original = Notice::getKV('id', $notice->repeat_of);
             if ($original instanceof Notice) {
-                $arr['retweeted_status']['url'] = $original->getUrl();
+                $arr['retweeted_status']['url'] = $original->getUrl(true);
                 $arr['retweeted_status']['html'] = htmlspecialchars($original->rendered);
                 $arr['retweeted_status']['source'] = htmlspecialchars($original->source);
                 $originalProfile = $original->getProfile();
@@ -346,7 +347,7 @@ class RealtimePlugin extends Plugin
         return $arr;
     }
 
-    function getNoticeTags($notice)
+    function getNoticeTags(Notice $notice)
     {
         $tags = null;
 
@@ -381,7 +382,7 @@ class RealtimePlugin extends Plugin
      *
      * @return boolean hook return value
      */
-    function onEndScriptMessages($action, &$messages)
+    function onEndScriptMessages(Action $action, &$messages)
     {
         // TRANS: Text label for realtime view "play" button, usually replaced by an icon.
         $messages['realtime_play'] = _m('BUTTON', 'Play');