summaryrefslogtreecommitdiff
path: root/plugins/OStatus/OStatusPlugin.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-23 21:47:14 +0000
committerBrion Vibber <brion@pobox.com>2010-02-23 21:47:14 +0000
commitd6ad7332475f1cc4ab45d55fc04ef491d5f3999d (patch)
treedf1913452d0aeb88706f9c660bd99df6399f1c57 /plugins/OStatus/OStatusPlugin.php
parent5f9a8ca64bee5247358238c26b4f54003337d11b (diff)
OStatus: fixes for link/id and text extraction gets import of Buzz feeds working.
Diffstat (limited to 'plugins/OStatus/OStatusPlugin.php')
-rw-r--r--plugins/OStatus/OStatusPlugin.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index 3a9e77c2a..724634924 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -287,13 +287,19 @@ class OStatusPlugin extends Plugin
function onStartNoticeSourceLink($notice, &$name, &$url, &$title)
{
if ($notice->source == 'ostatus') {
- $bits = parse_url($notice->uri);
- $domain = $bits['host'];
-
- $name = $domain;
- $url = $notice->uri;
- $title = sprintf(_m("Sent from %s via OStatus"), $domain);
- return false;
+ if ($notice->url) {
+ $bits = parse_url($notice->url);
+ $domain = $bits['host'];
+ if (substr($domain, 0, 4) == 'www.') {
+ $name = substr($domain, 4);
+ } else {
+ $name = $domain;
+ }
+
+ $url = $notice->url;
+ $title = sprintf(_m("Sent from %s via OStatus"), $domain);
+ return false;
+ }
}
}
@@ -509,12 +515,8 @@ class OStatusPlugin extends Plugin
$oprofile = Ostatus_profile::staticGet('group_id', $group->id);
if ($oprofile) {
// Drop the PuSH subscription if there are no other subscribers.
+ $oprofile->garbageCollect();
- $members = $group->getMembers(0, 1);
- if ($members->N == 0) {
- common_log(LOG_INFO, "Unsubscribing from now-unused group feed $oprofile->feeduri");
- $oprofile->unsubscribe();
- }
$member = Profile::staticGet($user->id);