From 7893827652076386d9b5b8d2f56e0d080a19b40f Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 11 Feb 2019 14:51:59 +0100 Subject: [PATCH] fixed query notifications pending Former-commit-id: ac8c5b5cb1276c16b9339e2e86c88d856540be0d --- pandora_console/include/functions_messages.php | 4 ++-- pandora_console/include/functions_notifications.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_messages.php b/pandora_console/include/functions_messages.php index 63c810d684..4b9c66c1c1 100644 --- a/pandora_console/include/functions_messages.php +++ b/pandora_console/include/functions_messages.php @@ -372,7 +372,7 @@ function messages_get_count( AND up.id_grupo=ng.id_group ) ON tm.id_mensaje=ng.id_mensaje WHERE utimestamp_erased is null - AND (up.id_usuario="%s" OR nu.id_user="%s" OR ng.id_group=0) + AND (nu.id_user="%s" OR (up.id_usuario="%s" AND ng.id_group=0)) ) t %s', $user, @@ -479,7 +479,7 @@ function messages_get_overview( ) ON tm.id_mensaje=ng.id_mensaje %s WHERE utimestamp_erased is null - AND (up.id_usuario="%s" OR nu.id_user="%s" OR ng.id_group=0) + AND (nu.id_user="%s" OR (up.id_usuario="%s" AND ng.id_group=0)) ) t %s %s diff --git a/pandora_console/include/functions_notifications.php b/pandora_console/include/functions_notifications.php index 5058f50591..1901e47e7b 100644 --- a/pandora_console/include/functions_notifications.php +++ b/pandora_console/include/functions_notifications.php @@ -142,7 +142,7 @@ function check_notification_readable(int $id_message) AND up.id_grupo=ng.id_group ) ON tm.id_mensaje=ng.id_mensaje WHERE utimestamp_erased is null - AND (up.id_usuario="%s" OR nu.id_user="%s" OR ng.id_group=0)', + AND (nu.id_user="%s" OR (up.id_usuario="%s" AND ng.id_group=0))', $id_message, $config['id_user'], $config['id_user']