summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2017-10-09 01:06:53 +0200
committermathieui <mathieui@mathieui.net>2017-10-09 01:06:53 +0200
commit3b5ea1a961cccf0a45d5df39a904df73931325a4 (patch)
tree25e32714f361dc306db1f274167e60b7ee6c2411
parent156cfb55465371ae95ea61cd02cfcfda442cb1f4 (diff)
downloadpoezio-3b5ea1a961cccf0a45d5df39a904df73931325a4.tar.gz
poezio-3b5ea1a961cccf0a45d5df39a904df73931325a4.tar.bz2
poezio-3b5ea1a961cccf0a45d5df39a904df73931325a4.tar.xz
poezio-3b5ea1a961cccf0a45d5df39a904df73931325a4.zip
Fix #3322 (send a beep when we get disconnected)
-rw-r--r--data/default_config.cfg2
-rw-r--r--doc/source/configuration.rst2
-rw-r--r--poezio/config.py2
-rw-r--r--poezio/core/handlers.py2
4 files changed, 5 insertions, 3 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg
index 7efded0b..89794a94 100644
--- a/data/default_config.cfg
+++ b/data/default_config.cfg
@@ -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
diff --git a/doc/source/configuration.rst b/doc/source/configuration.rst
index 8d88a071..d9b3d6e9 100644
--- a/doc/source/configuration.rst
+++ b/doc/source/configuration.rst
@@ -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).
diff --git a/poezio/config.py b/poezio/config.py
index 155b11ba..f70f75e2 100644
--- a/poezio/config.py
+++ b/poezio/config.py
@@ -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': '',
diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py
index b52f5d9d..0e74d02d 100644
--- a/poezio/core/handlers.py
+++ b/poezio/core/handlers.py
@@ -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()