From d9942a558a7dfd14980788399ca6aa578039a324 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 12 Aug 2010 15:18:16 -0700 Subject: [PATCH 01/13] Fix regression in replies made from web (was saving reply_to value in wrong array key) --- actions/newnotice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/newnotice.php b/actions/newnotice.php index 8f1fb1c40f..61b38786bd 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -161,7 +161,7 @@ class NewnoticeAction extends Action $replyto = intval($this->trimmed('inreplyto')); if ($replyto) { - $options['replyto'] = $replyto; + $options['reply_to'] = $replyto; } $upload = null; From dcfc13cc0873e1a3815d3fa473d96e004af996b9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 12 Aug 2010 15:18:50 -0700 Subject: [PATCH 02/13] Fix PHP notice spew when Notice::saveNew() called without passing any options; default empty vars weren't being set. --- classes/Notice.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/Notice.php b/classes/Notice.php index 0eeebfadf3..fe014b942d 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -245,6 +245,8 @@ class Notice extends Memcached_DataObject if (!empty($options)) { $options = $options + $defaults; extract($options); + } else { + extract($defaults); } if (!isset($is_local)) { From 6787b377c0b91fa3503077e4ba0efc75565a2ded Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 12 Aug 2010 15:19:47 -0700 Subject: [PATCH 03/13] Fix for ticket 2513: "Can't linkify" error when some links are shortened When bogus SSL sites etc were hit through a shortening redirect, sometimes link resolution kinda blew up and the user would get a "Can't linkify" error, aborting their post. Now catching this case and just passing through the URL without attempting to resolve it. Could benefit from an overall scrubbing of the freaky link/attachment code though...! :) http://status.net/open-source/issues/2513 --- classes/File_redirection.php | 8 ++++++++ lib/util.php | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/classes/File_redirection.php b/classes/File_redirection.php index f128b3e07c..51b8be3b06 100644 --- a/classes/File_redirection.php +++ b/classes/File_redirection.php @@ -210,6 +210,14 @@ class File_redirection extends Memcached_DataObject } else if (is_string($redir_data)) { // The file is a known redirect target. $file = File::staticGet('url', $redir_data); + if (empty($file)) { + // @fixme should we save a new one? + // this case was triggering sometimes for redirects + // with unresolvable targets; found while fixing + // "can't linkify" bugs with shortened links to + // SSL sites with cert issues. + return null; + } $file_id = $file->id; } } else { diff --git a/lib/util.php b/lib/util.php index 9f62097d54..66600c766f 100644 --- a/lib/util.php +++ b/lib/util.php @@ -830,7 +830,10 @@ function common_linkify($url) { } elseif (is_string($longurl_data)) { $longurl = $longurl_data; } else { - throw new ServerException("Can't linkify url '$url'"); + // Unable to reach the server to verify contents, etc + // Just pass the link on through for now. + common_log(LOG_ERR, "Can't linkify url '$url'"); + $longurl = $url; } } $attrs = array('href' => $canon, 'title' => $longurl, 'rel' => 'external'); From f7d599f8eac0a9e3d47c3ff2f074bed0b6e9c124 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 12 Aug 2010 15:19:47 -0700 Subject: [PATCH 04/13] Fix for ticket 2513: "Can't linkify" error when some links are shortened When bogus SSL sites etc were hit through a shortening redirect, sometimes link resolution kinda blew up and the user would get a "Can't linkify" error, aborting their post. Now catching this case and just passing through the URL without attempting to resolve it. Could benefit from an overall scrubbing of the freaky link/attachment code though...! :) http://status.net/open-source/issues/2513 --- classes/File_redirection.php | 8 ++++++++ lib/util.php | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/classes/File_redirection.php b/classes/File_redirection.php index f128b3e07c..51b8be3b06 100644 --- a/classes/File_redirection.php +++ b/classes/File_redirection.php @@ -210,6 +210,14 @@ class File_redirection extends Memcached_DataObject } else if (is_string($redir_data)) { // The file is a known redirect target. $file = File::staticGet('url', $redir_data); + if (empty($file)) { + // @fixme should we save a new one? + // this case was triggering sometimes for redirects + // with unresolvable targets; found while fixing + // "can't linkify" bugs with shortened links to + // SSL sites with cert issues. + return null; + } $file_id = $file->id; } } else { diff --git a/lib/util.php b/lib/util.php index 9f62097d54..66600c766f 100644 --- a/lib/util.php +++ b/lib/util.php @@ -830,7 +830,10 @@ function common_linkify($url) { } elseif (is_string($longurl_data)) { $longurl = $longurl_data; } else { - throw new ServerException("Can't linkify url '$url'"); + // Unable to reach the server to verify contents, etc + // Just pass the link on through for now. + common_log(LOG_ERR, "Can't linkify url '$url'"); + $longurl = $url; } } $attrs = array('href' => $canon, 'title' => $longurl, 'rel' => 'external'); From d06bdfa54bab19c04d4e4dd74801df57bcd5a19c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 12 Aug 2010 18:42:09 -0700 Subject: [PATCH 05/13] add note about software subscription --- README | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README b/README index c202443545..93b63c2acf 100644 --- a/README +++ b/README @@ -43,6 +43,10 @@ on status.net is identical to the software available for download, so you can move back and forth between a hosted version or a version installed on your own servers. +A commercial software subscription is available from StatusNet Inc. It +includes 24-hour technical support and developer support. More +information at http://status.net/contact or email sales@status.net. + License ======= From 115231f917c9c9c67fe3768310c4852d8e1cada1 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 13 Aug 2010 10:51:00 -0700 Subject: [PATCH 06/13] Suppress whinging during HTML parsing in profile page discovery for things that turn out to be XML feeds with funny namespaces. --- plugins/OStatus/lib/discoveryhints.php | 5 +++-- plugins/OStatus/lib/feeddiscovery.php | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/OStatus/lib/discoveryhints.php b/plugins/OStatus/lib/discoveryhints.php index 34c9be2777..fa2ead7320 100644 --- a/plugins/OStatus/lib/discoveryhints.php +++ b/plugins/OStatus/lib/discoveryhints.php @@ -114,9 +114,10 @@ class DiscoveryHints { static function _hcard($body, $url) { - // DOMDocument::loadHTML may throw warnings on unrecognized elements. + // DOMDocument::loadHTML may throw warnings on unrecognized elements, + // and notices on unrecognized namespaces. - $old = error_reporting(error_reporting() & ~E_WARNING); + $old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE)); $doc = new DOMDocument(); $doc->loadHTML($body); diff --git a/plugins/OStatus/lib/feeddiscovery.php b/plugins/OStatus/lib/feeddiscovery.php index a55399d7c8..8a166a0be5 100644 --- a/plugins/OStatus/lib/feeddiscovery.php +++ b/plugins/OStatus/lib/feeddiscovery.php @@ -196,8 +196,9 @@ class FeedDiscovery */ function discoverFromHTML($url, $body) { - // DOMDocument::loadHTML may throw warnings on unrecognized elements. - $old = error_reporting(error_reporting() & ~E_WARNING); + // DOMDocument::loadHTML may throw warnings on unrecognized elements, + // and notices on unrecognized namespaces. + $old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE)); $dom = new DOMDocument(); $ok = $dom->loadHTML($body); error_reporting($old); From 85693884994bda3067d2b9a46d279fd3a5c1c9f5 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 13 Aug 2010 11:02:21 -0700 Subject: [PATCH 07/13] SubMirror: check feel-url discovery if profile-url discovery failed; should help when giving direct feeds to subscribe to --- plugins/SubMirror/actions/basemirror.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/SubMirror/actions/basemirror.php b/plugins/SubMirror/actions/basemirror.php index 5be0699f09..be6942efa7 100644 --- a/plugins/SubMirror/actions/basemirror.php +++ b/plugins/SubMirror/actions/basemirror.php @@ -92,7 +92,13 @@ abstract class BaseMirrorAction extends Action */ protected function profileForFeed($url) { - $oprofile = Ostatus_profile::ensureProfileURL($url); + try { + // Maybe we got a web page? + $oprofile = Ostatus_profile::ensureProfileURL($url); + } catch (Exception $e) { + // Direct feed URL? + $oprofile = Ostatus_profile::ensureFeedURL($url); + } if ($oprofile->isGroup()) { $this->clientError(_m("Can't mirror a StatusNet group at this time.")); } From 185f18024a208e0d981721e492a4ca54263e2520 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 13 Aug 2010 11:41:44 -0700 Subject: [PATCH 08/13] Fixes for RSS subscriptions: accept posts with no ActivityStreams object-type set; be more liberal about accepting posts from feeds where the author info doesn't match (we'll post under the feed's profile and just not try to update the profile info). --- plugins/OStatus/classes/Ostatus_profile.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 8f8eb773f8..e76683a1c2 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -456,8 +456,10 @@ class Ostatus_profile extends Memcached_DataObject case ActivityObject::NOTE: case ActivityObject::STATUS: case ActivityObject::COMMENT: + case null: // Unspecified type is assumed to be a blog post; as we get from RSS. break; default: + common_log(LOG_INFO, "Aborting processing for unrecognized activity type " . $activity->objects[0]->type); throw new ClientException("Can't handle that kind of post."); } @@ -496,8 +498,11 @@ class Ostatus_profile extends Memcached_DataObject } else if ($actor->id) { // We have an ActivityStreams actor with an explicit ID that doesn't match the feed owner. // This isn't what we expect from mainline OStatus person feeds! - // Group feeds go down another path, with different validation. - throw new Exception("Got an actor '{$actor->title}' ({$actor->id}) on single-user feed for {$this->uri}"); + // Group feeds go down another path, with different validation... + // Most likely this is a plain ol' blog feed of some kind which + // doesn't match our expectations. We'll take the entry, but ignore + // the info. + common_log(LOG_WARNING, "Got an actor '{$actor->title}' ({$actor->id}) on single-user feed for {$this->uri}"); } else { // Plain without ActivityStreams actor info. // We'll just ignore this info for now and save the update under the feed's identity. From 4217277d14ef1b244a15a8c2fe5dd41e7be6ed1e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 13 Aug 2010 13:07:25 -0700 Subject: [PATCH 09/13] typo mixing up and in salmonaction --- plugins/OStatus/lib/salmonaction.php | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/plugins/OStatus/lib/salmonaction.php b/plugins/OStatus/lib/salmonaction.php index fa9dc3b1da..9d6c6b269a 100644 --- a/plugins/OStatus/lib/salmonaction.php +++ b/plugins/OStatus/lib/salmonaction.php @@ -47,7 +47,6 @@ class SalmonAction extends Action $xml = file_get_contents('php://input'); - // Check the signature $salmon = new Salmon; if (!$salmon->verifyMagicEnv($xml)) { @@ -58,7 +57,6 @@ class SalmonAction extends Action $env = $magic_env->parse($xml); $xml = $magic_env->unfold($env); } - $dom = DOMDocument::loadXML($xml); if ($dom->documentElement->namespaceURI != Activity::ATOM || @@ -67,7 +65,7 @@ class SalmonAction extends Action $this->clientError(_m('Salmon post must be an Atom entry.')); } - $this->act = new Activity($dom->documentElement); + $this->activity = new Activity($dom->documentElement); return true; } @@ -79,9 +77,9 @@ class SalmonAction extends Action { StatusNet::setApi(true); // Send smaller error pages - common_log(LOG_DEBUG, "Got a " . $this->act->verb); + common_log(LOG_DEBUG, "Got a " . $this->activity->verb); if (Event::handle('StartHandleSalmon', array($this->activity))) { - switch ($this->act->verb) + switch ($this->activity->verb) { case ActivityVerb::POST: $this->handlePost(); @@ -164,12 +162,12 @@ class SalmonAction extends Action */ function handleUpdateProfile() { - $oprofile = Ostatus_profile::getActorProfile($this->act); + $oprofile = Ostatus_profile::getActorProfile($this->activity); if ($oprofile) { common_log(LOG_INFO, "Got a profile-update ping from $oprofile->uri"); - $oprofile->updateFromActivityObject($this->act->actor); + $oprofile->updateFromActivityObject($this->activity->actor); } else { - common_log(LOG_INFO, "Ignoring profile-update ping from unknown " . $this->act->actor->id); + common_log(LOG_INFO, "Ignoring profile-update ping from unknown " . $this->activity->actor->id); } } @@ -178,10 +176,10 @@ class SalmonAction extends Action */ function ensureProfile() { - $actor = $this->act->actor; + $actor = $this->activity->actor; if (empty($actor->id)) { common_log(LOG_ERR, "broken actor: " . var_export($actor, true)); - common_log(LOG_ERR, "activity with no actor: " . var_export($this->act, true)); + common_log(LOG_ERR, "activity with no actor: " . var_export($this->activity, true)); throw new Exception("Received a salmon slap from unidentified actor."); } @@ -191,6 +189,6 @@ class SalmonAction extends Action function saveNotice() { $oprofile = $this->ensureProfile(); - return $oprofile->processPost($this->act, 'salmon'); + return $oprofile->processPost($this->activity, 'salmon'); } } From 8dec16aeebc723d36e31f4a3fa5e695bdf92647b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 13 Aug 2010 13:14:47 -0700 Subject: [PATCH 10/13] add hooks to allow plugins to handle different kinds of activities --- plugins/OStatus/classes/Ostatus_profile.php | 35 ++++++++++++--------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 8f8eb773f8..1fae468f66 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -445,26 +445,31 @@ class Ostatus_profile extends Memcached_DataObject * @param DOMElement $feed for context * @param string $source identifier ("push" or "salmon") */ + public function processEntry($entry, $feed, $source) { $activity = new Activity($entry, $feed); - // @todo process all activity objects - switch ($activity->objects[0]->type) { - case ActivityObject::ARTICLE: - case ActivityObject::BLOGENTRY: - case ActivityObject::NOTE: - case ActivityObject::STATUS: - case ActivityObject::COMMENT: - break; - default: - throw new ClientException("Can't handle that kind of post."); - } + if (Event::handle('StartHandleFeedEntry', array($activity))) { - if ($activity->verb == ActivityVerb::POST) { - $this->processPost($activity, $source); - } else { - common_log(LOG_INFO, "Ignoring activity with unrecognized verb $activity->verb"); + // @todo process all activity objects + switch ($activity->objects[0]->type) { + case ActivityObject::ARTICLE: + case ActivityObject::BLOGENTRY: + case ActivityObject::NOTE: + case ActivityObject::STATUS: + case ActivityObject::COMMENT: + if ($activity->verb == ActivityVerb::POST) { + $this->processPost($activity, $source); + } else { + common_log(LOG_INFO, "Ignoring activity with unrecognized verb $activity->verb"); + } + break; + default: + throw new ClientException("Can't handle that kind of post."); + } + + Event::handle('EndHandleFeedEntry', array($activity)); } } From f60ee85f680edbce549331f897368319f44623f4 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Fri, 13 Aug 2010 22:21:33 +0200 Subject: [PATCH 11/13] Update extension configuration file creation (doesn't work yet in translatewiki.net). --- scripts/update_po_templates.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/update_po_templates.php b/scripts/update_po_templates.php index af9ed8d208..f10f208424 100755 --- a/scripts/update_po_templates.php +++ b/scripts/update_po_templates.php @@ -94,15 +94,15 @@ function do_translatewiki_plugin($basedir, $plugin) BASIC: id: out-statusnet-{$pluginlc} label: StatusNet - {$plugin} - description: "{{int:bw-desc-statusnet-plugin-{$pluginlc}}}" namespace: NS_STATUSNET + description: "{{int:bw-desc-statusnet-plugin}}" + class: FileBasedMessageGroup display: out/statusnet/{$pluginlc} - class: GettextMessageGroup FILES: class: GettextFFS - sourcePattern: %GROUPROOT%/plugins/{$plugin}/locale/%CODE%/LC_MESSAGES/{$plugin}.po - targetPattern: plugins/{$plugin}/locale/%CODE%/LC_MESSAGES/{$plugin}.po + sourcePattern: %GROUPROOT%/statusnet/plugins/{$plugin}/locale/{$plugin}.pot + targetPattern: statusnet/plugins/{$plugin}/locale/%CODE%/LC_MESSAGES/{$plugin}.po codeMap: en-gb: en_GB no: nb From 028f9a7b1defefbec67c55b5f146960c022c87e0 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Fri, 13 Aug 2010 20:52:05 +0000 Subject: [PATCH 12/13] A plugin for adding the Echo (formerly JS-Kit) commenting widget to notice pages --- plugins/EchoPlugin.php | 154 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 plugins/EchoPlugin.php diff --git a/plugins/EchoPlugin.php b/plugins/EchoPlugin.php new file mode 100644 index 0000000000..2ebfbceb33 --- /dev/null +++ b/plugins/EchoPlugin.php @@ -0,0 +1,154 @@ +. + * + * @category Plugin + * @package StatusNet + * @author Zach Copley + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + exit(1); +} + +/** + * Plugin to use Echo (formerly JS-Kit) + * + * This plugin adds an Echo commenting widget to each notice page on + * your site. To get it to work, first you'll have to sign up for Echo + * (a commercial service) and register your site's URL. + * + * http://aboutecho.com/ + * + * Once you've done that it's pretty straight forward to turn the + * plugin on, just add: + * + * addPlugin('Echo'); + * + * to your config.php. The defaults should work OK with the default + * theme, but there are a lot of options to customize the look and + * feel of the comment widget. You can control both the CSS for the + * div that contains the widget, as well as the CSS for the widget + * itself via config parameters that can be passed into the plugin. + * See below for a more complex example: + * + * // Custom stylesheet for Echo commenting widget + * // See: http://wiki.js-kit.com/Skinning-Guide#UsingCSSnbsptocustomizefontsandcolors + * $stylesheet = << 'width:675px; padding-top:10px; position:relative; float:left;', + * // stylesheet is the CSS for the comment widget itself + * 'stylesheet' => $stylesheet + * ) + * ); + * + * @category Plugin + * @package StatusNet + * @author Zach Copley + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + * + * @see Event + */ + +class EchoPlugin extends Plugin +{ + // NOTE: The Echo documentation says that this script will change on + // a per site basis, but I think that's incorrect. It always seems to + // be the same. + public $script = 'http://cdn.js-kit.com/scripts/comments.js'; + + function onEndShowScripts($action) + { + if (get_class($action) == 'ShownoticeAction') { + $action->script($this->script); + } + + return true; + } + + function onEndShowContentBlock($action) + { + if (get_class($action) == 'ShownoticeAction') { + + $attrs = array(); + $attrs['class'] = 'js-kit-comments'; + $attrs['permalink'] = $action->notice->uri; + $attrs['uniq'] = $action->notice->id; + + // NOTE: there are some other attributes that could be useful + // http://wiki.js-kit.com/Echo-Behavior + + if (empty($this->div_css)) { + // This CSS seems to work OK with the default theme + $attrs['style'] = 'width:675px; padding-top:10px; position:relative; float:left;'; + } else { + $attrs['style'] = $this->css; + } + + $action->element('div', $attrs, null); + } + } + + function onEndShowStyles($action) + { + if (get_class($action) == 'ShownoticeAction' && !empty($this->stylesheet)) { + $action->style($this->stylesheet); + } + } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => 'Echo', + 'version' => STATUSNET_VERSION, + 'author' => 'Zach Copley', + 'homepage' => 'http://status.net/wiki/Plugin:Echo', + 'rawdescription' => + _m('Use Echo'. + ' to add commenting to notice pages.')); + return true; + } +} From 029aa0c61c9942c0688fd3dc9aa2893311543db1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 13 Aug 2010 14:18:54 -0700 Subject: [PATCH 13/13] fix use of activity rather than act in salmonaction subclasses, too --- plugins/OStatus/actions/groupsalmon.php | 4 ++-- plugins/OStatus/actions/usersalmon.php | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/OStatus/actions/groupsalmon.php b/plugins/OStatus/actions/groupsalmon.php index d60725a71b..5094dccf0f 100644 --- a/plugins/OStatus/actions/groupsalmon.php +++ b/plugins/OStatus/actions/groupsalmon.php @@ -61,7 +61,7 @@ class GroupsalmonAction extends SalmonAction function handlePost() { // @fixme process all objects? - switch ($this->act->objects[0]->type) { + switch ($this->activity->objects[0]->type) { case ActivityObject::ARTICLE: case ActivityObject::BLOGENTRY: case ActivityObject::NOTE: @@ -74,7 +74,7 @@ class GroupsalmonAction extends SalmonAction // Notice must be to the attention of this group - $context = $this->act->context; + $context = $this->activity->context; if (empty($context->attention)) { throw new ClientException("Not to the attention of anyone."); diff --git a/plugins/OStatus/actions/usersalmon.php b/plugins/OStatus/actions/usersalmon.php index 6c360c49f9..641e131abc 100644 --- a/plugins/OStatus/actions/usersalmon.php +++ b/plugins/OStatus/actions/usersalmon.php @@ -55,10 +55,10 @@ class UsersalmonAction extends SalmonAction */ function handlePost() { - common_log(LOG_INFO, "Received post of '{$this->act->objects[0]->id}' from '{$this->act->actor->id}'"); + common_log(LOG_INFO, "Received post of '{$this->activity->objects[0]->id}' from '{$this->activity->actor->id}'"); // @fixme: process all activity objects? - switch ($this->act->objects[0]->type) { + switch ($this->activity->objects[0]->type) { case ActivityObject::ARTICLE: case ActivityObject::BLOGENTRY: case ActivityObject::NOTE: @@ -72,7 +72,7 @@ class UsersalmonAction extends SalmonAction // Notice must either be a) in reply to a notice by this user // or b) to the attention of this user - $context = $this->act->context; + $context = $this->activity->context; if (!empty($context->replyToID)) { $notice = Notice::staticGet('uri', $context->replyToID); @@ -92,7 +92,7 @@ class UsersalmonAction extends SalmonAction throw new ClientException("Not to anyone in reply to anything!"); } - $existing = Notice::staticGet('uri', $this->act->objects[0]->id); + $existing = Notice::staticGet('uri', $this->activity->objects[0]->id); if (!empty($existing)) { common_log(LOG_ERR, "Not saving notice '{$existing->uri}'; already exists."); @@ -143,7 +143,7 @@ class UsersalmonAction extends SalmonAction function handleFavorite() { - $notice = $this->getNotice($this->act->objects[0]); + $notice = $this->getNotice($this->activity->objects[0]); $profile = $this->ensureProfile()->localProfile(); $old = Fave::pkeyGet(array('user_id' => $profile->id, @@ -164,7 +164,7 @@ class UsersalmonAction extends SalmonAction */ function handleUnfavorite() { - $notice = $this->getNotice($this->act->objects[0]); + $notice = $this->getNotice($this->activity->objects[0]); $profile = $this->ensureProfile()->localProfile(); $fave = Fave::pkeyGet(array('user_id' => $profile->id,