diff options
author | Evan Prodromou <evan@status.net> | 2010-03-17 09:38:39 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-03-17 09:38:39 -0500 |
commit | 4761c07ad8d76f7c34d4db53d32d15e806ba1e88 (patch) | |
tree | eb3d78ccde1778037165c92b6ec36c7465b54345 /plugins/OStatus/actions | |
parent | f21f78364a9cbde2ca535a3983b384707ad097ae (diff) | |
parent | f62b8a80cf33ac8529d0736c51dc060a9d235369 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'plugins/OStatus/actions')
-rw-r--r-- | plugins/OStatus/actions/usersalmon.php | 3 | ||||
-rw-r--r-- | plugins/OStatus/actions/userxrd.php | 15 |
2 files changed, 11 insertions, 7 deletions
diff --git a/plugins/OStatus/actions/usersalmon.php b/plugins/OStatus/actions/usersalmon.php index c8a16e06f..15e8c1869 100644 --- a/plugins/OStatus/actions/usersalmon.php +++ b/plugins/OStatus/actions/usersalmon.php @@ -82,7 +82,8 @@ class UsersalmonAction extends SalmonAction throw new ClientException("In reply to a notice not by this user"); } } else if (!empty($context->attention)) { - if (!in_array($this->user->uri, $context->attention)) { + if (!in_array($this->user->uri, $context->attention) && + !in_array(common_profile_url($this->user->nickname), $context->attention)) { common_log(LOG_ERR, "{$this->user->uri} not in attention list (".implode(',', $context->attention).")"); throw new ClientException("To the attention of user(s) not including this one!"); } diff --git a/plugins/OStatus/actions/userxrd.php b/plugins/OStatus/actions/userxrd.php index 414de9364..eb80a5ad4 100644 --- a/plugins/OStatus/actions/userxrd.php +++ b/plugins/OStatus/actions/userxrd.php @@ -32,12 +32,15 @@ class UserxrdAction extends XrdAction parent::prepare($args); $this->uri = $this->trimmed('uri'); - $acct = Discovery::normalize($this->uri); - - list($nick, $domain) = explode('@', substr(urldecode($acct), 5)); - $nick = common_canonical_nickname($nick); - - $this->user = User::staticGet('nickname', $nick); + $this->uri = Discovery::normalize($this->uri); + + if (Discovery::isWebfinger($this->uri)) { + list($nick, $domain) = explode('@', substr(urldecode($this->uri), 5)); + $nick = common_canonical_nickname($nick); + $this->user = User::staticGet('nickname', $nick); + } else { + $this->user = User::staticGet('uri', $this->uri); + } if (!$this->user) { $this->clientError(_('No such user.'), 404); return false; |