]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
don't save replies from a blocked profile to the blocking user
authorEvan Prodromou <evan@controlyourself.ca>
Mon, 8 Dec 2008 03:14:08 +0000 (22:14 -0500)
committerEvan Prodromou <evan@controlyourself.ca>
Mon, 8 Dec 2008 03:14:08 +0000 (22:14 -0500)
darcs-hash:20081208031408-5ed1f-dfdb46fbcf5390d890b4db47c64da0b70ace8096.gz

lib/util.php

index f6d5440f0d33eee495d5d968bdb6ca3bbd21f608..4fb58e7dcc3494a91b161453e2691b16e5aff581 100644 (file)
@@ -1401,6 +1401,11 @@ function common_save_replies($notice) {
                                $notice->update($orig);
                        }
                }
+        # Don't save replies from blocked profile to local user
+        $recipient_user = User::staticGet('id', $recipient->id);
+        if ($recipient_user && $recipient_user->hasBlocked($sender)) {
+            continue;
+        }
                $reply = new Reply();
                $reply->notice_id = $notice->id;
                $reply->profile_id = $recipient->id;
@@ -1422,6 +1427,11 @@ function common_save_replies($notice) {
                        $tagged = Profile_tag::getTagged($sender->id, $tag);
                        foreach ($tagged as $t) {
                                if (!$replied[$t->id]) {
+                    # Don't save replies from blocked profile to local user
+                    $t_user = User::staticGet('id', $t->id);
+                    if ($t_user && $t_user->hasBlocked($sender)) {
+                        continue;
+                    }
                                        $reply = new Reply();
                                        $reply->notice_id = $notice->id;
                                        $reply->profile_id = $t->id;