From 3e0a02f52daa802ba347654fd40c1a25399aff11 Mon Sep 17 00:00:00 2001 From: Jean Baptiste Favre Date: Sun, 18 Dec 2011 12:13:42 +0100 Subject: [PATCH 1/7] Enhance is_twitter_bound function from file plugins/TwitterBridge/twitter.php to deal with new-style replies from Web UI not using at-mention replies anymore, which caused all replies to be sent to Twitter. Definitely fix #3386 --- plugins/TwitterBridge/twitter.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/TwitterBridge/twitter.php b/plugins/TwitterBridge/twitter.php index 3da974df93..ac61cc6160 100644 --- a/plugins/TwitterBridge/twitter.php +++ b/plugins/TwitterBridge/twitter.php @@ -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; } } From 184290b5cf8448bb58b4ccd7d3bef39bd12a73f6 Mon Sep 17 00:00:00 2001 From: Jean Baptiste Favre Date: Sun, 18 Dec 2011 12:17:28 +0100 Subject: [PATCH 2/7] Add my name to TwitterBridgePlugin onPluginVersion function --- plugins/TwitterBridge/TwitterBridgePlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/TwitterBridge/TwitterBridgePlugin.php b/plugins/TwitterBridge/TwitterBridgePlugin.php index b37d01274d..d733f71c56 100644 --- a/plugins/TwitterBridge/TwitterBridgePlugin.php +++ b/plugins/TwitterBridge/TwitterBridgePlugin.php @@ -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 ' . From 23bafaba26fb30b1277863a1df00057bdef74ce2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 26 Jan 2012 11:02:29 -0500 Subject: [PATCH 3/7] add canonical rel --- actions/public.php | 5 +++++ actions/showgroup.php | 8 ++++++++ actions/showstream.php | 5 +++++ 3 files changed, 18 insertions(+) diff --git a/actions/public.php b/actions/public.php index 7bcdd3fae2..8c72446636 100644 --- a/actions/public.php +++ b/actions/public.php @@ -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'))); + } } /** diff --git a/actions/showgroup.php b/actions/showgroup.php index eba3191f6f..10601e58b4 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -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())); + } + } } diff --git a/actions/showstream.php b/actions/showstream.php index a3b1794313..9e89b1b48c 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -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() From d625364354171159ee82e51e77c82c2b681c9acc Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 27 Jan 2012 15:01:51 -0500 Subject: [PATCH 4/7] LOG_ERROR -> LOG_ERR for SubMirror --- plugins/SubMirror/classes/SubMirror.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SubMirror/classes/SubMirror.php b/plugins/SubMirror/classes/SubMirror.php index 5a9d0be5d9..b36677e58a 100644 --- a/plugins/SubMirror/classes/SubMirror.php +++ b/plugins/SubMirror/classes/SubMirror.php @@ -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; } From d28f726c5ccef559ff4bbe173786b232be52d5ba Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 27 Jan 2012 15:27:46 -0500 Subject: [PATCH 5/7] weird error with SubMirror --- plugins/SubMirror/SubMirrorPlugin.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/SubMirror/SubMirrorPlugin.php b/plugins/SubMirror/SubMirrorPlugin.php index 95fccabe9d..427153ab22 100644 --- a/plugins/SubMirror/SubMirrorPlugin.php +++ b/plugins/SubMirror/SubMirrorPlugin.php @@ -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; } From e4085087f13852412f0b97b5c3d2178796c0de7a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 27 Jan 2012 15:32:13 -0500 Subject: [PATCH 6/7] non-existent poco --- plugins/Blacklist/BlacklistPlugin.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/plugins/Blacklist/BlacklistPlugin.php b/plugins/Blacklist/BlacklistPlugin.php index babf703131..33d0bf430b 100644 --- a/plugins/Blacklist/BlacklistPlugin.php +++ b/plugins/Blacklist/BlacklistPlugin.php @@ -505,14 +505,16 @@ class BlacklistPlugin extends Plugin } } - $nickname = strtolower($actor->poco->preferredUsername); + 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); + 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); + } } } From 5b6ecef24b85304661c6b33ae4b15bf8805ad6a2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 27 Jan 2012 16:12:54 -0500 Subject: [PATCH 7/7] script to gc all feeds --- plugins/OStatus/scripts/gcfeeds.php | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 plugins/OStatus/scripts/gcfeeds.php diff --git a/plugins/OStatus/scripts/gcfeeds.php b/plugins/OStatus/scripts/gcfeeds.php new file mode 100644 index 0000000000..59656aff9b --- /dev/null +++ b/plugins/OStatus/scripts/gcfeeds.php @@ -0,0 +1,41 @@ +#!/usr/bin/env php +. + */ + +define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..')); + +$helptext = <<fetch()) { + print $feedsub->uri . "(" . $feedsub->sub_state . ")"; + $result = $feedsub->garbageCollect(); + if ($result) { + print " INACTIVE\n"; + } else { + print " ACTIVE\n"; + } +}