]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of gitorious.org:statusnet/mainline
authorEvan Prodromou <evan@status.net>
Tue, 7 Feb 2012 15:27:40 +0000 (16:27 +0100)
committerEvan Prodromou <evan@status.net>
Tue, 7 Feb 2012 15:27:40 +0000 (16:27 +0100)
actions/public.php
actions/showgroup.php
actions/showstream.php
plugins/Blacklist/BlacklistPlugin.php
plugins/OStatus/scripts/gcfeeds.php [new file with mode: 0644]
plugins/SubMirror/SubMirrorPlugin.php
plugins/SubMirror/classes/SubMirror.php
plugins/TwitterBridge/TwitterBridgePlugin.php
plugins/TwitterBridge/twitter.php

index 7bcdd3fae208de3eb1c175cb743b07a9a3aa4057..8c724466368624ab98932f9e6179852b70fd4876 100644 (file)
@@ -159,6 +159,11 @@ class PublicAction extends Action
         $this->element('link', array('rel' => 'EditURI',
                                      'type' => 'application/rsd+xml',
                                      'href' => $rsd));
+
+        if ($this->page != 1) {
+            $this->element('link', array('rel' => 'canonical',
+                                         'href' => common_local_url('public')));
+        }
     }
 
     /**
index eba3191f6f2d1df22dc6e5198b4337c8c601abfe..10601e58b4e95192ebe1356dc8912e2114d6d00b 100644 (file)
@@ -233,4 +233,12 @@ class ShowgroupAction extends GroupAction
         $this->raw(common_markup_to_html($m));
         $this->elementEnd('div');
     }
+
+    function extraHead()
+    {
+        if ($this->page != 1) {
+            $this->element('link', array('rel' => 'canonical',
+                                         'href' => $this->group->homeUrl()));
+        }
+    }
 }
index a3b1794313f4a08ab1856229d0d52dc782dcff67..9e89b1b48ceccd767df5f0d49664d4b70aac2462 100644 (file)
@@ -212,6 +212,11 @@ class ShowstreamAction extends ProfileAction
         $this->element('link', array('rel' => 'EditURI',
                                      'type' => 'application/rsd+xml',
                                      'href' => $rsd));
+
+        if ($this->page != 1) {
+            $this->element('link', array('rel' => 'canonical',
+                                         'href' => $this->profile->profileurl));
+        }
     }
 
     function showEmptyListMessage()
index babf7031313e22565e0a0b366a009940834e585d..33d0bf430b7b2ecad59de85ac72d5bb90c5f689c 100644 (file)
@@ -505,14 +505,16 @@ class BlacklistPlugin extends Plugin
             }
         }
 
-        $nickname = strtolower($actor->poco->preferredUsername);
-
-        if (!empty($nickname)) {
-            if (!$this->_checkNickname($nickname)) {
-                // TRANS: Exception thrown trying to post a notice while having a blocked nickname. %s is the blocked nickname.
-                $msg = sprintf(_m("Notices from nickname \"%s\" disallowed."),
-                               $nickname);
-                throw new ClientException($msg);
+        if (!empty($actor->poco)) {
+            $nickname = strtolower($actor->poco->preferredUsername);
+
+            if (!empty($nickname)) {
+                if (!$this->_checkNickname($nickname)) {
+                    // TRANS: Exception thrown trying to post a notice while having a blocked nickname. %s is the blocked nickname.
+                    $msg = sprintf(_m("Notices from nickname \"%s\" disallowed."),
+                                   $nickname);
+                    throw new ClientException($msg);
+                }
             }
         }
 
diff --git a/plugins/OStatus/scripts/gcfeeds.php b/plugins/OStatus/scripts/gcfeeds.php
new file mode 100644 (file)
index 0000000..59656af
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/env php
+<?php
+/*
+ * StatusNet - a distributed open-source microblogging tool
+ * Copyright (C) 2010, StatusNet, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
+
+$helptext = <<<END_OF_HELP
+gcfeeds.php [options]
+Clean up feeds that no longer have subscribers.
+
+END_OF_HELP;
+
+require_once INSTALLDIR.'/scripts/commandline.inc';
+
+$feedsub = new FeedSub();
+
+while ($feedsub->fetch()) {
+    print $feedsub->uri . "(" . $feedsub->sub_state . ")";
+    $result = $feedsub->garbageCollect();
+    if ($result) {
+        print " INACTIVE\n";
+    } else {
+        print " ACTIVE\n";
+    }
+}
index 95fccabe9dc859256969fe3a5d4077fbeee41b1f..427153ab22ff7c2b35f5d5fb865cf807ddd30350 100644 (file)
@@ -157,6 +157,10 @@ class SubMirrorPlugin extends Plugin
      */
     function onOstatus_profileSubscriberCount($oprofile, &$count)
     {
+        if (empty($oprofile) || !($oprofile instanceof Ostatus_profile)) {
+            return true;
+        }
+
         if ($oprofile->profile_id) {
             $mirror = new SubMirror();
             $mirror->subscribed = $oprofile->profile_id;
@@ -166,6 +170,7 @@ class SubMirrorPlugin extends Plugin
                 }
             }
         }
+
         return true;
     }
 
index 5a9d0be5d9ca204bd1829c7c48006462b1ef5666..b36677e58a03df8835078b54628d45775b36573a 100644 (file)
@@ -157,7 +157,7 @@ class SubMirror extends Memcached_DataObject
     {
         $profile = Profile::staticGet('id', $this->subscriber);
         if (!$profile) {
-            common_log(LOG_ERROR, "SubMirror plugin skipping auto-repeat of notice $notice->id for missing user $profile->id");
+            common_log(LOG_ERR, "SubMirror plugin skipping auto-repeat of notice $notice->id for missing user $profile->id");
             return false;
         }
 
index b37d01274d9989170608b732f1f8f317cafda05a..d733f71c56fee621cf6ba084d59977e7d27cd4dd 100644 (file)
@@ -339,7 +339,7 @@ class TwitterBridgePlugin extends Plugin
         $versions[] = array(
             'name' => 'TwitterBridge',
             'version' => self::VERSION,
-            'author' => 'Zach Copley, Julien C',
+            'author' => 'Zach Copley, Julien C, Jean Baptiste Favre',
             'homepage' => 'http://status.net/wiki/Plugin:TwitterBridge',
             // TRANS: Plugin description.
             'rawdescription' => _m('The Twitter "bridge" plugin allows integration ' .
index 3da974df93e2b866c0fa640f296e388abedb1e53..ac61cc6160d8f695a72cf4886c7a5937d8ffefc3 100644 (file)
@@ -120,9 +120,9 @@ function is_twitter_bound($notice, $flink) {
 
         // If it's not a Twitter-style reply, or if the user WANTS to send replies,
         // or if it's in reply to a twitter notice
-        if (!preg_match('/^@[a-zA-Z0-9_]{1,15}\b/u', $notice->content) ||
-            (($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) == FOREIGN_NOTICE_SEND_REPLY) ||
-            is_twitter_notice($notice->reply_to)) {
+        if ( (($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) == FOREIGN_NOTICE_SEND_REPLY) ||
+             (is_twitter_notice($notice->reply_to) || is_twitter_notice($notice->repeat_of)) ||
+             (empty($notice->reply_to) && !preg_match('/^@[a-zA-Z0-9_]{1,15}\b/u', $notice->content)) ){
             return true;
         }
     }