diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-06-27 22:01:57 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-06-27 22:01:57 +0200 |
commit | b470c7875f79563ffc0c05f68c917866c2ca4d54 (patch) | |
tree | 02e23ba64d0ea1c5795d119e5074911192184ee2 /src | |
parent | d0231331fa3796c286621f76132698b9f664a373 (diff) | |
download | poezio-b470c7875f79563ffc0c05f68c917866c2ca4d54.tar.gz poezio-b470c7875f79563ffc0c05f68c917866c2ca4d54.tar.bz2 poezio-b470c7875f79563ffc0c05f68c917866c2ca4d54.tar.xz poezio-b470c7875f79563ffc0c05f68c917866c2ca4d54.zip |
Beep() on highlight/message/private-messages (configurable)
Diffstat (limited to 'src')
-rw-r--r-- | src/core.py | 6 | ||||
-rw-r--r-- | src/room.py | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py index f3c406ad..c4c0edaa 100644 --- a/src/core.py +++ b/src/core.py @@ -516,6 +516,8 @@ class Core(object): conversation.remote_wants_chatstates = True else: conversation.remote_wants_chatstates = False + if 'private' in config.get('beep_on', 'highlight private').split(): + curses.beep() logger.log_message(jid.full.replace('/', '\\'), nick_from, body) if conversation is self.current_tab(): self.refresh_window() @@ -568,6 +570,8 @@ class Core(object): else: conversation.remote_wants_chatstates = False logger.log_message(jid.bare, remote_nick, body) + if 'private' in config.get('beep_on', 'highlight private').split(): + curses.beep() if self.current_tab() is not conversation: conversation.set_color_state(theme.COLOR_TAB_PRIVATE) self.refresh_tab_win() @@ -986,6 +990,8 @@ class Core(object): if tab is self.current_tab(): tab.text_win.refresh(tab._room) self.refresh_tab_win() + if 'message' in config.get('beep_on', 'highlight private').split(): + curses.beep() def add_message_to_text_buffer(self, room, txt, time=None, nickname=None, history=None): """ diff --git a/src/room.py b/src/room.py index a112fc7b..5d4c4ce6 100644 --- a/src/room.py +++ b/src/room.py @@ -24,6 +24,7 @@ import common import theme import logging +import curses log = logging.getLogger(__name__) @@ -77,6 +78,10 @@ class Room(TextBuffer): self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) color = theme.COLOR_HIGHLIGHT_NICK break + if color: + beep_on = config.get('beep_on', 'highlight private').split() + if 'highlight' in beep_on and 'message' not in beep_on: + curses.beep() return color def get_user_by_name(self, nick): |