indentation
This commit is contained in:
parent
a54ee0229d
commit
95bdf480b4
10
src/gajim.py
10
src/gajim.py
|
@ -453,20 +453,21 @@ class Interface:
|
||||||
gajim.connections[account].remove_transfers_for_contact(contact1)
|
gajim.connections[account].remove_transfers_for_contact(contact1)
|
||||||
self.roster.chg_contact_status(contact1, array[1], status_message,
|
self.roster.chg_contact_status(contact1, array[1], status_message,
|
||||||
account)
|
account)
|
||||||
# play sound
|
# Notifications
|
||||||
if old_show < 2 and new_show > 1:
|
if old_show < 2 and new_show > 1:
|
||||||
notify.notify('contact_connected', jid, account, status_message)
|
notify.notify('contact_connected', jid, account, status_message)
|
||||||
if self.remote_ctrl:
|
if self.remote_ctrl:
|
||||||
self.remote_ctrl.raise_signal('ContactPresence',
|
self.remote_ctrl.raise_signal('ContactPresence',
|
||||||
(account, array))
|
(account, array))
|
||||||
|
|
||||||
elif old_show > 1 and new_show < 2:
|
elif old_show > 1 and new_show < 2:
|
||||||
notify.notify('contact_disconnected', jid, account, status_message)
|
notify.notify('contact_disconnected', jid, account, status_message)
|
||||||
if self.remote_ctrl:
|
if self.remote_ctrl:
|
||||||
self.remote_ctrl.raise_signal('ContactAbsence', (account, array))
|
self.remote_ctrl.raise_signal('ContactAbsence', (account, array))
|
||||||
# FIXME: stop non active file transfers
|
# FIXME: stop non active file transfers
|
||||||
elif new_show > 1: # Status change (not connected/disconnected or error (<1))
|
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:
|
else:
|
||||||
# FIXME: Msn transport (CMSN1.2.1 and PyMSN0.10) doesn't follow the JEP
|
# FIXME: Msn transport (CMSN1.2.1 and PyMSN0.10) doesn't follow the JEP
|
||||||
# remove in 2007
|
# remove in 2007
|
||||||
|
@ -567,7 +568,8 @@ class Interface:
|
||||||
msg_type, array[5], resource, msg_id, array[9])
|
msg_type, array[5], resource, msg_id, array[9])
|
||||||
nickname = gajim.get_name_from_jid(account, jid)
|
nickname = gajim.get_name_from_jid(account, jid)
|
||||||
# Check and do wanted notifications
|
# 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:
|
if self.remote_ctrl:
|
||||||
self.remote_ctrl.raise_signal('NewMessage', (account, array))
|
self.remote_ctrl.raise_signal('NewMessage', (account, array))
|
||||||
|
|
|
@ -143,8 +143,7 @@ def notify(event, jid, account, parameters):
|
||||||
text = message
|
text = message
|
||||||
elif message_type == 'pm': # private message
|
elif message_type == 'pm': # private message
|
||||||
event_type = _('New Private Message')
|
event_type = _('New Private Message')
|
||||||
room_name, t = gajim.get_room_name_and_server_from_room_jid(
|
room_name, t = gajim.get_room_name_and_server_from_room_jid(jid)
|
||||||
jid)
|
|
||||||
img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events',
|
img = os.path.join(gajim.DATA_DIR, 'pixmaps', 'events',
|
||||||
'priv_msg_recv.png')
|
'priv_msg_recv.png')
|
||||||
title = _('New Private Message from room %s') % room_name
|
title = _('New Private Message from room %s') % room_name
|
||||||
|
@ -156,7 +155,7 @@ def notify(event, jid, account, parameters):
|
||||||
'chat_msg_recv.png')
|
'chat_msg_recv.png')
|
||||||
title = _('New Message from %(nickname)s') % \
|
title = _('New Message from %(nickname)s') % \
|
||||||
{'nickname': nickname}
|
{'nickname': nickname}
|
||||||
text = message
|
text = message
|
||||||
path = gtkgui_helpers.get_path_to_generic_or_avatar(img)
|
path = gtkgui_helpers.get_path_to_generic_or_avatar(img)
|
||||||
popup(event_type, jid, account, message_type,
|
popup(event_type, jid, account, message_type,
|
||||||
path_to_image = path, title = title, text = text)
|
path_to_image = path, title = title, text = text)
|
||||||
|
@ -167,8 +166,8 @@ def notify(event, jid, account, parameters):
|
||||||
helpers.play_sound('first_message_received')
|
helpers.play_sound('first_message_received')
|
||||||
else:
|
else:
|
||||||
helpers.play_sound('next_message_received')
|
helpers.play_sound('next_message_received')
|
||||||
elif (event == 'contact_connected' or event == 'contact_disconnected'):
|
elif event in ('contact_connected', 'contact_disconnected'):
|
||||||
helpers.play_sound(event)
|
helpers.play_sound(event)
|
||||||
|
|
||||||
|
|
||||||
def popup(event_type, jid, account, msg_type = '', path_to_image = None,
|
def popup(event_type, jid, account, msg_type = '', path_to_image = None,
|
||||||
|
|
Loading…
Reference in New Issue