Skip to content
Snippets Groups Projects
Commit 95bdf480 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

indentation

parent a54ee022
No related branches found
No related tags found
No related merge requests found
......@@ -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))
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment