Fix #3322 (send a beep when we get disconnected)

This commit is contained in:
mathieui 2017-10-09 01:06:53 +02:00
parent 156cfb5546
commit 3b5ea1a961
4 changed files with 5 additions and 3 deletions

View file

@ -355,7 +355,7 @@ use_bookmarks_method =
# someone from a chatroiom)
# - message (any message from a chatroom)
# - invite (when you receive an invitation for joining a chatroom)
#beep_on = highlight private invite
#beep_on = highlight private invite disconnect
# Theme

View file

@ -820,7 +820,7 @@ Options that change the behavior of poezio in a non-visual manner.
beep_on
**Default value:** ``highlight private``
**Default value:** ``highlight private invite disconnect``
The terminal can beep on various event. Put the event you want in a list
(separated by spaces).

View file

@ -32,7 +32,7 @@ DEFAULT_CONFIG = {
'auto_reconnect': True,
'autorejoin_delay': '5',
'autorejoin': False,
'beep_on': 'highlight private invite',
'beep_on': 'highlight private invite disconnect',
'ca_cert_path': '',
'certificate': '',
'certfile': '',

View file

@ -1033,6 +1033,8 @@ class HandlerCore:
"""
When we are disconnected from remote server
"""
if 'disconnect' in config.get('beep_on').split():
curses.beep()
roster.connected = 0
# Stop the ping plugin. It would try to send stanza on regular basis
self.core.xmpp.plugin['xep_0199'].disable_keepalive()