get_actor --> get_name_from_jid so it is visible it is on gajim level and not on xmppy (lower) lever

This commit is contained in:
Nikos Kouremenos 2006-01-20 17:50:01 +00:00
parent bbc42cc115
commit 912207c098
4 changed files with 12 additions and 11 deletions

View File

@ -279,7 +279,8 @@ def get_notification_image_prefix(jid):
prefix = 'jabber' prefix = 'jabber'
return prefix return prefix
def get_actor(account, jid): def get_name_from_jid(account, jid):
'''returns from JID's shown name and if no contact returns jids'''
contact = contacts.get_first_contact_from_jid(account, jid) contact = contacts.get_first_contact_from_jid(account, jid)
if contact: if contact:
actor = contact.get_shown_name() actor = contact.get_shown_name()

View File

@ -884,7 +884,7 @@ class PopupNotificationWindow:
'<span foreground="black" weight="bold">%s</span>' % event_type) '<span foreground="black" weight="bold">%s</span>' % event_type)
if not text: if not text:
text = gajim.get_actor(account, jid) # default value of text text = gajim.get_name_from_jid(account, jid) # default value of text
# set colors [ http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html ] # set colors [ http://www.pitt.edu/~nisg/cis/web/cgi/rgb.html ]
self.window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('black')) self.window.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse('black'))

View File

@ -478,7 +478,7 @@ class Interface:
elif gajim.connections[account].connected in (2, 3): # we're online or chat elif gajim.connections[account].connected in (2, 3): # we're online or chat
show_notification = True show_notification = True
if show_notification: if show_notification:
txt = _('%s has sent you a new message.') % gajim.get_actor(account, jid) txt = _('%s has sent you a new message.') % gajim.get_name_from_jid(account, jid)
if msg_type == 'normal': # single message if msg_type == 'normal': # single message
img = 'single_msg_recv.png' img = 'single_msg_recv.png'
path = os.path.abspath(os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', img)) path = os.path.abspath(os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', img))
@ -965,7 +965,7 @@ class Interface:
if gajim.show_notification(account): if gajim.show_notification(account):
img = 'ft_request.png' img = 'ft_request.png'
path = os.path.abspath(os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', img)) path = os.path.abspath(os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', img))
txt = _('%s wants to send you a file.') % gajim.get_actor(account, jid) txt = _('%s wants to send you a file.') % gajim.get_name_from_jid(account, jid)
notify.notify(_('File Transfer Request'), jid, account, 'file-request', path_to_image = path, text = txt) notify.notify(_('File Transfer Request'), jid, account, 'file-request', path_to_image = path, text = txt)
def handle_event_file_progress(self, account, file_props): def handle_event_file_progress(self, account, file_props):

View File

@ -107,7 +107,7 @@ class DesktopNotification:
self.msg_type = msg_type self.msg_type = msg_type
if not text: if not text:
text = gajim.get_actor(account, jid) # default value of text text = gajim.get_name_from_jid(account, jid) # default value of text
if event_type == _('Contact Signed In'): if event_type == _('Contact Signed In'):
ntype = 'presence.online' ntype = 'presence.online'