Philipp Hörist pushed to branch master at gajim / gajim
Commits:
-
b7bb36fb
by lovetox at 2020-09-04T12:48:15+02:00
3 changed files:
Changes:
| ... | ... | @@ -317,7 +317,8 @@ class Chatstate(BaseModule): |
| 317 | 317 |
contact=contact,
|
| 318 | 318 |
message=None,
|
| 319 | 319 |
type_=type_,
|
| 320 |
- chatstate=chatstate)
|
|
| 320 |
+ chatstate=chatstate,
|
|
| 321 |
+ play_sound=False)
|
|
| 321 | 322 |
|
| 322 | 323 |
self._con.send_message(message)
|
| 323 | 324 |
|
| ... | ... | @@ -63,7 +63,8 @@ class OutgoingMessage: |
| 63 | 63 |
correct_id=None,
|
| 64 | 64 |
oob_url=None,
|
| 65 | 65 |
xhtml=None,
|
| 66 |
- nodes=None):
|
|
| 66 |
+ nodes=None,
|
|
| 67 |
+ play_sound=True):
|
|
| 67 | 68 |
|
| 68 | 69 |
if type_ not in ('chat', 'groupchat', 'normal', 'headline'):
|
| 69 | 70 |
raise ValueError('Unknown message type: %s' % type_)
|
| ... | ... | @@ -108,6 +109,7 @@ class OutgoingMessage: |
| 108 | 109 |
self.additional_data.set_value('gajim', 'xhtml', xhtml)
|
| 109 | 110 |
|
| 110 | 111 |
self.nodes = nodes
|
| 112 |
+ self.play_sound = play_sound
|
|
| 111 | 113 |
|
| 112 | 114 |
self.timestamp = None
|
| 113 | 115 |
self.message_id = None
|
| ... | ... | @@ -245,9 +245,9 @@ class Interface: |
| 245 | 245 |
|
| 246 | 246 |
@staticmethod
|
| 247 | 247 |
def handle_event_msgsent(obj):
|
| 248 |
- # ('MSGSENT', account, (jid, msg))
|
|
| 249 |
- # Do not play sound if it is a standalone chatstate message (eg no msg)
|
|
| 250 |
- # or if it is a message to more than one recipient
|
|
| 248 |
+ if not obj.play_sound:
|
|
| 249 |
+ return
|
|
| 250 |
+ |
|
| 251 | 251 |
enabled = app.settings.get_soundevent_settings('message_sent')['enabled']
|
| 252 | 252 |
if enabled:
|
| 253 | 253 |
if isinstance(obj.jid, list) and len(obj.jid) > 1:
|