]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Use in_array instead. Now we get third party responses to contextually interesting...
authorMikael Nordfeldth <mmn@hethane.se>
Tue, 23 Feb 2016 23:19:27 +0000 (00:19 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Tue, 23 Feb 2016 23:19:27 +0000 (00:19 +0100)
I think this solves much of the "third party conversation" issues, assuming involved parties
are using modern GNU social instances.

plugins/OStatus/actions/usersalmon.php

index 1c4c64efccd322c3a492ed66300bfc8f1eaa79d3..ea5262aa3bc0a351ee0e20212724d4ba9f7da0b7 100644 (file)
@@ -42,7 +42,7 @@ class UsersalmonAction extends SalmonAction
 
         if (!empty($this->activity->context->replyToID)) {
             try {
-                $notice = Notice::getKV('uri', $this->activity->context->replyToID);
+                $notice = Notice::getByUri($this->activity->context->replyToID);
             } catch (NoResultException $e) {
                 $notice = false;
             }
@@ -50,7 +50,7 @@ class UsersalmonAction extends SalmonAction
 
         if ($notice instanceof Notice &&
                 ($this->target->sameAs($notice->getProfile())
-                    || array_key_exists($this->target->getID(), $notice->getAttentionProfileIDs())
+                    || in_array($this->target->getID(), $notice->getAttentionProfileIDs())
                 )) {
             // In reply to a notice either from or mentioning this user.
             common_debug('User is the owner or was in the attention list of thr:in-reply-to activity.');