]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Realtime/RealtimePlugin.php
Ignore user language settings that aren't listed in language config; we'll then fall...
[quix0rs-gnu-social.git] / plugins / Realtime / RealtimePlugin.php
index 31e75221be85ef98a7255fd63c89138d09319efb..cbfa6bae0058d4595f1365be4f56739003f656d4 100644 (file)
@@ -101,8 +101,8 @@ class RealtimePlugin extends Plugin
             $realtimeUI = ' RealtimeUpdate.initPopupWindow();';
         }
         else {
-            $iconurl = common_path('plugins/Realtime/icon_external.gif');
-            $realtimeUI = ' RealtimeUpdate.addPopup("'.$url.'", "'.$timeline.'", "'. $iconurl .'");';
+            $pluginPath = common_path('plugins/Realtime/');
+            $realtimeUI = ' RealtimeUpdate.initActions("'.$url.'", "'.$timeline.'", "'. $pluginPath .'");';
         }
 
         $action->elementStart('script', array('type' => 'text/javascript'));
@@ -118,7 +118,14 @@ class RealtimePlugin extends Plugin
         return true;
     }
 
-    function onEndNoticeSave($notice)
+    function onEndShowStatusNetStyles($action)
+    {
+        $action->cssLink(common_path('plugins/Realtime/realtimeupdate.css'), 
+                         null, 'screen, projection, tv');
+        return true;
+    }
+
+    function onHandleQueuedNotice($notice)
     {
         $paths = array();
 
@@ -132,8 +139,8 @@ class RealtimePlugin extends Plugin
 
         // Add to the public timeline
 
-        if ($notice->is_local ||
-            ($notice->is_local == 0 && !common_config('public', 'localonly'))) {
+        if ($notice->is_local == Notice::LOCAL_PUBLIC ||
+            ($notice->is_local == Notice::REMOTE_OMB && !common_config('public', 'localonly'))) {
             $paths[] = array('public');
         }
 
@@ -213,8 +220,9 @@ class RealtimePlugin extends Plugin
 
         $action->elementStart('body',
                               (common_current_user()) ? array('id' => $action->trimmed('action'),
-                                                              'class' => 'user_in')
-                              : array('id' => $action->trimmed('action')));
+                                                              'class' => 'user_in realtime-popup')
+                              : array('id' => $action->trimmed('action'),
+                                      'class'=> 'realtime-popup'));
 
         // XXX hack to deal with JS that tries to get the
         // root url from page output
@@ -240,13 +248,13 @@ class RealtimePlugin extends Plugin
         // FIXME: this code should be abstracted to a neutral third
         // party, like Notice::asJson(). I'm not sure of the ethics
         // of refactoring from within a plugin, so I'm just abusing
-        // the TwitterApiAction method. Don't do this unless you're me!
+        // the ApiAction method. Don't do this unless you're me!
 
         require_once(INSTALLDIR.'/lib/api.php');
 
-        $act = new TwitterApiAction('/dev/null');
+        $act = new ApiAction('/dev/null');
 
-        $arr = $act->twitter_status_array($notice, true);
+        $arr = $act->twitterStatusArray($notice, true);
         $arr['url'] = $notice->bestUrl();
         $arr['html'] = htmlspecialchars($notice->rendered);
         $arr['source'] = htmlspecialchars($arr['source']);