From 8ce18615292c3ed954ba9e6957d1eb4551ee3953 Mon Sep 17 00:00:00 2001 From: Goffi Date: Sat, 16 Mar 2019 14:39:02 +0100 Subject: [PATCH] plugin android: don't send notification if message comes from ourself (from an other device) --- sat/plugins/plugin_misc_android.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sat/plugins/plugin_misc_android.py b/sat/plugins/plugin_misc_android.py index 1cbdfad5..d3ffd934 100644 --- a/sat/plugins/plugin_misc_android.py +++ b/sat/plugins/plugin_misc_android.py @@ -155,8 +155,14 @@ class AndroidPlugin(object): pass def _notifyMessage(self, mess_data, client): - # send notification if there is a message and it is not a groupchat - if mess_data["message"] and mess_data["type"] != C.MESS_TYPE_GROUPCHAT: + """Send notification when suitable + + notification is sent if: + - there is a message and it is not a groupchat + - message is not coming from ourself + """ + if (mess_data["message"] and mess_data["type"] != C.MESS_TYPE_GROUPCHAT + and not mess_data["from"].userhostJID() == client.jid.userhostJID()): message = mess_data["message"].itervalues().next() try: subject = mess_data["subject"].itervalues().next()