]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
OStatus: Auto subscribe to forum accounts
[friendica.git] / include / items.php
index 6945f8894d2819f0e98d461089e049e6d04441d8..a67971cf57b90d833f263b0ece1ae24df3040f19 100644 (file)
@@ -761,10 +761,20 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
                $arr["author-id"] = get_contact($arr["author-link"], 0);
        }
 
+       if (blockedContact($arr["author-id"])) {
+               logger('Contact '.$arr["author-id"].' is blocked, item '.$arr["uri"].' will not be stored');
+               return 0;
+       }
+
        if ($arr["owner-id"] == 0) {
                $arr["owner-id"] = get_contact($arr["owner-link"], 0);
        }
 
+       if (blockedContact($arr["owner-id"])) {
+               logger('Contact '.$arr["owner-id"].' is blocked, item '.$arr["uri"].' will not be stored');
+               return 0;
+       }
+
        if ($arr['guid'] != "") {
                // Checking if there is already an item with the same guid
                logger('checking for an item for user '.$arr['uid'].' on network '.$arr['network'].' with the guid '.$arr['guid'], LOGGER_DEBUG);
@@ -1693,7 +1703,7 @@ function new_follower($importer, $contact, $datarray, $item, $sharing = false) {
                        intval($importer['uid'])
                );
 
-               if (dbm::is_result($r) && !in_array($r[0]['page-flags'], array(PAGE_SOAPBOX, PAGE_FREELOVE))) {
+               if (dbm::is_result($r) && !in_array($r[0]['page-flags'], array(PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_COMMUNITY))) {
 
                        // create notification
                        $hash = random_string();
@@ -1729,7 +1739,7 @@ function new_follower($importer, $contact, $datarray, $item, $sharing = false) {
                                ));
 
                        }
-               } elseif (dbm::is_result($r) && in_array($r[0]['page-flags'], array(PAGE_SOAPBOX, PAGE_FREELOVE))) {
+               } elseif (dbm::is_result($r) && in_array($r[0]['page-flags'], array(PAGE_SOAPBOX, PAGE_FREELOVE, PAGE_COMMUNITY))) {
                        $r = q("UPDATE `contact` SET `pending` = 0 WHERE `uid` = %d AND `url` = '%s' AND `pending` LIMIT 1",
                                        intval($importer['uid']),
                                        dbesc($url)