From 38ee2def5d2e1b5b704df0831860ee6c415bd829 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Fri, 1 Jan 2016 13:05:05 +0100 Subject: [PATCH] Don't send messages to contacts that are archived --- include/notifier.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/notifier.php b/include/notifier.php index 01337335d5..99a736db0a 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -310,7 +310,7 @@ function notifier_run(&$argv, &$argc){ if ($parent["network"] == NETWORK_OSTATUS) { // Distribute the message to the DFRN contacts as if this wasn't a followup since OStatus can't relay comments // Currently it is work at progress - $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `network` = '%s' AND NOT `blocked` AND NOT `pending`", + $r = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `network` = '%s' AND NOT `blocked` AND NOT `pending` AND NOT `archive`", intval($uid), dbesc(NETWORK_DFRN) ); @@ -409,7 +409,7 @@ function notifier_run(&$argv, &$argc){ } else $sql_extra = " AND `network` IN ('".NETWORK_OSTATUS."', '".NETWORK_DFRN."', '".NETWORK_DIASPORA."', '".NETWORK_MAIL."', '".NETWORK_MAIL2."')"; - $r = q("SELECT * FROM `contact` WHERE `id` IN ($conversant_str) AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0".$sql_extra); + $r = q("SELECT * FROM `contact` WHERE `id` IN ($conversant_str) AND NOT `blocked` AND NOT `pending` AND NOT `archive`".$sql_extra); if(count($r)) $contacts = $r; @@ -444,7 +444,7 @@ function notifier_run(&$argv, &$argc){ if ($relocate) $r = $recipients_relocate; else - $r = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND NOT `blocked` AND NOT `pending`", + $r = q("SELECT * FROM `contact` WHERE `id` IN (%s) AND NOT `blocked` AND NOT `pending` AND NOT `archive`", dbesc($recip_str) ); @@ -548,7 +548,7 @@ function notifier_run(&$argv, &$argc){ ); $r2 = q("SELECT `id`, `name`,`network` FROM `contact` - WHERE `network` in ( '%s', '%s') AND `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0 + WHERE `network` in ( '%s', '%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `rel` != %d order by rand() ", dbesc(NETWORK_DFRN), dbesc(NETWORK_MAIL2), -- 2.39.5