]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/TwitterBridge/TwitterBridgePlugin.php
Merge branch '1.0.x' of gitorious.org:statusnet/mainline into 1.0.x
[quix0rs-gnu-social.git] / plugins / TwitterBridge / TwitterBridgePlugin.php
index 6df48eff3bcb9766207cbddd2abb0a9741784e5b..29192cf53b05c8853ac87b8135153a5c5990e422 100644 (file)
@@ -137,11 +137,11 @@ class TwitterBridgePlugin extends Plugin
     /*
      * Add a login tab for 'Sign in with Twitter'
      *
-     * @param Action &action the current action
+     * @param Action $action the current action
      *
      * @return void
      */
-    function onEndLoginGroupNav(&$action)
+    function onEndLoginGroupNav($action)
     {
         $action_name = $action->trimmed('action');
 
@@ -160,11 +160,11 @@ class TwitterBridgePlugin extends Plugin
     /**
      * Add the Twitter Settings page to the Connect Settings menu
      *
-     * @param Action &$action The calling page
+     * @param Action $action The calling page
      *
      * @return boolean hook return
      */
-    function onEndConnectSettingsNav(&$action)
+    function onEndConnectSettingsNav($action)
     {
         if (self::hasKeys()) {
             $action_name = $action->trimmed('action');
@@ -228,7 +228,7 @@ class TwitterBridgePlugin extends Plugin
      */
     function onStartEnqueueNotice($notice, &$transports)
     {
-        if (self::hasKeys() && $notice->isLocal()) {
+        if (self::hasKeys() && $notice->isLocal() && $notice->inScope(null)) {
             // Avoid a possible loop
             if ($notice->source != 'twitter') {
                 array_push($transports, 'twitter');
@@ -530,4 +530,13 @@ class TwitterBridgePlugin extends Plugin
 
         return true;
     }
+
+    function onStartGetProfileUri($profile, &$uri)
+    {
+        if (preg_match('!^https?://twitter.com/!', $profile->profileurl)) {
+            $uri = $profile->profileurl;
+            return false;
+        }
+        return true;
+    }
 }