From 95bdf480b4ba3022f4a4ca0c158a54d4b8a10c05 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 17 Jul 2006 10:06:04 +0000 Subject: [PATCH] indentation --- src/gajim.py | 10 ++++++---- src/notify.py | 9 ++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/gajim.py b/src/gajim.py index 35e65d7cf..7fcbce3c4 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -453,20 +453,21 @@ class Interface: gajim.connections[account].remove_transfers_for_contact(contact1) self.roster.chg_contact_status(contact1, array[1], status_message, account) - # play sound + # Notifications if old_show < 2 and new_show > 1: notify.notify('contact_connected', jid, account, status_message) if self.remote_ctrl: self.remote_ctrl.raise_signal('ContactPresence', (account, array)) - + elif old_show > 1 and new_show < 2: notify.notify('contact_disconnected', jid, account, status_message) if self.remote_ctrl: self.remote_ctrl.raise_signal('ContactAbsence', (account, array)) # FIXME: stop non active file transfers elif new_show > 1: # Status change (not connected/disconnected or error (<1)) - notify.notify('status_change', jid, account, [new_show, status_message]) + notify.notify('status_change', jid, account, [new_show, + status_message]) else: # FIXME: Msn transport (CMSN1.2.1 and PyMSN0.10) doesn't follow the JEP # remove in 2007 @@ -567,7 +568,8 @@ class Interface: msg_type, array[5], resource, msg_id, array[9]) nickname = gajim.get_name_from_jid(account, jid) # Check and do wanted notifications - notify.notify('new_message', jid, account, [msg_type, first, nickname, message]) + notify.notify('new_message', jid, account, [msg_type, first, nickname, + message]) if self.remote_ctrl: self.remote_ctrl.raise_signal('NewMessage', (account, array)) diff --git a/src/notify.py b/src/notify.py index 72346f890..e25c47d29 100644 --- a/src/notify.py +++ b/src/notify.py @@ -143,8 +143,7 @@ def notify(event, jid, account, parameters): text = message elif message_type == 'pm': # private message event_type = _('New Private Message') - room_name, t = gajim.get_room_name_and_server_from_room_jid( - jid) + room_name, t = gajim.get_room_name_and_server_from_room_jid(jid) img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', 'priv_msg_recv.png') title = _('New Private Message from room %s') % room_name @@ -156,7 +155,7 @@ def notify(event, jid, account, parameters): 'chat_msg_recv.png') title = _('New Message from %(nickname)s') % \ {'nickname': nickname} - text = message + text = message path = gtkgui_helpers.get_path_to_generic_or_avatar(img) popup(event_type, jid, account, message_type, path_to_image = path, title = title, text = text) @@ -167,8 +166,8 @@ def notify(event, jid, account, parameters): helpers.play_sound('first_message_received') else: helpers.play_sound('next_message_received') - elif (event == 'contact_connected' or event == 'contact_disconnected'): - helpers.play_sound(event) + elif event in ('contact_connected', 'contact_disconnected'): + helpers.play_sound(event) def popup(event_type, jid, account, msg_type = '', path_to_image = None,