diff options
author | Evan Prodromou <evan@status.net> | 2010-02-24 22:03:01 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-02-24 22:03:01 -0500 |
commit | 75cf4d4312f591d7a7c3d5d777f6bf5cb789dd56 (patch) | |
tree | 86875c50899e3643c86b869f4e8d932a5a67e242 | |
parent | 942521ef3058ee4416d737a144f7e48d9f0f342c (diff) | |
parent | 58e232a10ad45808caeb1bbd72641aea535e00e8 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
-rw-r--r-- | plugins/OStatus/OStatusPlugin.php | 14 | ||||
-rw-r--r-- | plugins/OStatus/lib/pushinqueuehandler.php | 6 |
2 files changed, 17 insertions, 3 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 5feb53b26..7f75b7b2b 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -210,7 +210,7 @@ class OStatusPlugin extends Plugin * */ - function onStartFindMentions($sender, $text, &$mentions) + function onEndFindMentions($sender, $text, &$mentions) { preg_match_all('/(?:^|\s+)@((?:\w+\.)*\w+@(?:\w+\.)*\w+(?:\w+\-\w+)*\.\w+)/', $text, @@ -233,11 +233,21 @@ class OStatusPlugin extends Plugin $this->log(LOG_INFO, "Ostatus_profile found for address '$webfinger'"); + if ($oprofile->isGroup()) { + continue; + } $profile = $oprofile->localProfile(); + $pos = $wmatch[1]; + foreach ($mentions as $i => $other) { + // If we share a common prefix with a local user, override it! + if ($other['position'] == $pos) { + unset($mentions[$i]); + } + } $mentions[] = array('mentioned' => array($profile), 'text' => $wmatch[0], - 'position' => $wmatch[1], + 'position' => $pos, 'url' => $profile->profileurl); } } diff --git a/plugins/OStatus/lib/pushinqueuehandler.php b/plugins/OStatus/lib/pushinqueuehandler.php index a90f52df2..1fd29ae30 100644 --- a/plugins/OStatus/lib/pushinqueuehandler.php +++ b/plugins/OStatus/lib/pushinqueuehandler.php @@ -40,7 +40,11 @@ class PushInQueueHandler extends QueueHandler $feedsub = FeedSub::staticGet('id', $feedsub_id); if ($feedsub) { - $feedsub->receive($post, $hmac); + try { + $feedsub->receive($post, $hmac); + } catch(Exception $e) { + common_log(LOG_ERR, "Exception during PuSH input processing for $feedsub->uri: " . $e->getMessage()); + } } else { common_log(LOG_ERR, "Discarding POST to unknown feed subscription id $feedsub_id"); } |