diff options
author | Zach Copley <zach@status.net> | 2010-02-22 01:23:24 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-02-22 01:23:24 -0800 |
commit | 35be39e30eacda1b0425a2ae9f8e58cd0867d157 (patch) | |
tree | df86f17a666e5d0bb775dbcef0fc4eb5b1c777f3 /plugins/OStatus/actions/usersalmon.php | |
parent | 47300a2ae9a51108fbf59a57cf5ab6e8867b54a6 (diff) | |
parent | 17ed30dffc1c05259baf2f0387089547e39684d7 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'plugins/OStatus/actions/usersalmon.php')
-rw-r--r-- | plugins/OStatus/actions/usersalmon.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/OStatus/actions/usersalmon.php b/plugins/OStatus/actions/usersalmon.php index 12c74798f..c8a16e06f 100644 --- a/plugins/OStatus/actions/usersalmon.php +++ b/plugins/OStatus/actions/usersalmon.php @@ -55,6 +55,8 @@ class UsersalmonAction extends SalmonAction */ function handlePost() { + common_log(LOG_INFO, "Received post of '{$this->act->object->id}' from '{$this->act->actor->id}'"); + switch ($this->act->object->type) { case ActivityObject::ARTICLE: case ActivityObject::BLOGENTRY: @@ -80,13 +82,21 @@ class UsersalmonAction extends SalmonAction throw new ClientException("In reply to a notice not by this user"); } } else if (!empty($context->attention)) { - if (!in_array($context->attention, $this->user->uri)) { + if (!in_array($this->user->uri, $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!"); } } else { throw new ClientException("Not to anyone in reply to anything!"); } + $existing = Notice::staticGet('uri', $this->act->object->id); + + if (!empty($existing)) { + common_log(LOG_ERR, "Not saving notice '{$existing->uri}'; already exists."); + return; + } + $this->saveNotice(); } |