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,13 +279,14 @@ def get_notification_image_prefix(jid):
prefix = 'jabber'
return prefix
def get_actor(account, jid):
contact = contacts.get_first_contact_from_jid(account, jid)
if contact:
actor = contact.get_shown_name()
else:
actor = jid
return actor
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)
if contact:
actor = contact.get_shown_name()
else:
actor = jid
return actor
def popup_window(account):
autopopup = config.get('autopopup')

View File

@ -884,7 +884,7 @@ class PopupNotificationWindow:
'<span foreground="black" weight="bold">%s</span>' % event_type)
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 ]
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
show_notification = True
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
img = 'single_msg_recv.png'
path = os.path.abspath(os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', img))
@ -965,7 +965,7 @@ class Interface:
if gajim.show_notification(account):
img = 'ft_request.png'
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)
def handle_event_file_progress(self, account, file_props):

View File

@ -107,7 +107,7 @@ class DesktopNotification:
self.msg_type = msg_type
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'):
ntype = 'presence.online'