]> git.mxchange.org Git - friendica.git/commitdiff
Hopefully final fix for false notifications
authorMichael <heluecht@pirati.ca>
Thu, 7 Feb 2019 05:38:43 +0000 (05:38 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 7 Feb 2019 05:38:43 +0000 (05:38 +0000)
src/Model/Item.php
src/Protocol/ActivityPub/Transmitter.php

index b460d5f79fdf886364acfe50a0c7ddf99a4580e6..6a5ff01d596c32faa5ff6cd67ea42ffb5483d6cb 100644 (file)
@@ -1535,17 +1535,10 @@ class Item extends BaseObject
                                        $item['private'] = 0;
                                }
 
-                               // If its a post from myself then tag the thread as "mention"
-                               Logger::log("Checking if parent ".$parent_id." has to be tagged as mention for user ".$item['uid'], Logger::DEBUG);
-                               $user = DBA::selectFirst('user', ['nickname'], ['uid' => $item['uid']]);
-                               if (DBA::isResult($user)) {
-                                       $self = Strings::normaliseLink(System::baseUrl() . '/profile/' . $user['nickname']);
-                                       $self_id = Contact::getIdForURL($self, 0, true);
-                                       Logger::log("'myself' is ".$self_id." for parent ".$parent_id." checking against ".$item['author-id']." and ".$item['owner-id'], Logger::DEBUG);
-                                       if (($item['author-id'] == $self_id) || ($item['owner-id'] == $self_id)) {
-                                               DBA::update('thread', ['mention' => true], ['iid' => $parent_id]);
-                                               Logger::log("tagged thread ".$parent_id." as mention for user ".$self, Logger::DEBUG);
-                                       }
+                               // If its a post that originated here then tag the thread as "mention"
+                               if ($item['origin'] && $item['uid']) {
+                                       DBA::update('thread', ['mention' => true], ['iid' => $parent_id]);
+                                       Logger::log('tagged thread ' . $parent_id . ' as mention for user ' . $item['uid'], Logger::DEBUG);
                                }
                        } else {
                                /*
index 0ee619a7321c27b20cb55e658496b77e52b4a0b4..f5953e7c5fcdab1e5bc54aba944b48d0440d53ee 100644 (file)
@@ -1298,10 +1298,6 @@ class Transmitter
         */
        public static function sendFollowObject($object, $target, $uid = 0)
        {
-               // Currently deactivated, due to notification problems.
-               // The follow message is reflected back and then causes false notifications.
-               return true;
-
                $profile = APContact::getByURL($target);
 
                if (empty($uid)) {