summaryrefslogtreecommitdiff
path: root/plugins/OStatus
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-09-01 16:17:18 -0400
committerEvan Prodromou <evan@status.net>2010-09-01 16:17:18 -0400
commit2d4e0693c88bb8cad47f917db3ac5ecfacf28619 (patch)
tree775524ffdd6afba3d1fc091e9f9d2bbd0b40a2f8 /plugins/OStatus
parent3baff9aa98005c6f72d295f681bc211102614946 (diff)
save URIs of remote profiles marked for attention
Diffstat (limited to 'plugins/OStatus')
-rw-r--r--plugins/OStatus/classes/Ostatus_profile.php28
1 files changed, 26 insertions, 2 deletions
diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php
index a95612a7f..fe3946d24 100644
--- a/plugins/OStatus/classes/Ostatus_profile.php
+++ b/plugins/OStatus/classes/Ostatus_profile.php
@@ -699,14 +699,16 @@ class Ostatus_profile extends Memcached_DataObject
}
// Is the recipient a remote group?
- $oprofile = Ostatus_profile::staticGet('uri', $recipient);
+ $oprofile = Ostatus_profile::ensureProfileURI($recipient);
+
if ($oprofile) {
if ($oprofile->isGroup()) {
// Deliver to local members of this remote group.
// @fixme sender verification?
$groups[] = $oprofile->group_id;
} else {
- common_log(LOG_DEBUG, "Skipping reply to remote profile $recipient");
+ // may be canonicalized or something
+ $replies[] = $oprofile->uri;
}
continue;
}
@@ -1763,6 +1765,28 @@ class Ostatus_profile extends Memcached_DataObject
return $file;
}
+
+ static function ensureProfileURI($uri)
+ {
+ $oprofile = null;
+
+ if (preg_match("/^(\w+)\:(.*)/", $uri, $match)) {
+ $protocol = $match[1];
+ switch ($protocol) {
+ case 'http':
+ case 'https':
+ $oprofile = Ostatus_profile::ensureProfileURL($uri);
+ break;
+ case 'acct':
+ case 'mailto':
+ $rest = $match[2];
+ $oprofile = Ostatus_profile::ensureWebfinger($rest);
+ default:
+ common_log("Unrecognized URI protocol for profile: $protocol ($uri)");
+ break;
+ }
+ }
+ }
}
/**