Philipp Hörist pushed to branch master at gajim / gajim
Commits: b7bb36fb by lovetox at 2020-09-04T12:48:15+02:00 Chatstates: Don’t play message-sent sound when sending chatstate
Fixes #10245
- - - - -
3 changed files:
- gajim/common/modules/chatstates.py - gajim/common/structs.py - gajim/gui_interface.py
Changes:
===================================== gajim/common/modules/chatstates.py ===================================== @@ -317,7 +317,8 @@ class Chatstate(BaseModule): contact=contact, message=None, type_=type_, - chatstate=chatstate) + chatstate=chatstate, + play_sound=False)
self._con.send_message(message)
===================================== gajim/common/structs.py ===================================== @@ -63,7 +63,8 @@ class OutgoingMessage: correct_id=None, oob_url=None, xhtml=None, - nodes=None): + nodes=None, + play_sound=True):
if type_ not in ('chat', 'groupchat', 'normal', 'headline'): raise ValueError('Unknown message type: %s' % type_) @@ -108,6 +109,7 @@ class OutgoingMessage: self.additional_data.set_value('gajim', 'xhtml', xhtml)
self.nodes = nodes + self.play_sound = play_sound
self.timestamp = None self.message_id = None
===================================== gajim/gui_interface.py ===================================== @@ -245,9 +245,9 @@ class Interface:
@staticmethod def handle_event_msgsent(obj): - # ('MSGSENT', account, (jid, msg)) - # Do not play sound if it is a standalone chatstate message (eg no msg) - # or if it is a message to more than one recipient + if not obj.play_sound: + return + enabled = app.settings.get_soundevent_settings('message_sent')['enabled'] if enabled: if isinstance(obj.jid, list) and len(obj.jid) > 1:
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/b7bb36fbdc38e69e113aac6f06f03ab13...