vcard now works in gc

This commit is contained in:
Yann Leboulanger 2005-07-20 12:48:11 +00:00
parent 903a466f83
commit b4ff6fd116
3 changed files with 13 additions and 4 deletions

View File

@ -582,9 +582,13 @@ class Interface:
self.windows[account]['chats'][array['jid']].set_avatar(array)
def handle_event_os_info(self, account, array):
win = None
if self.windows[account]['infos'].has_key(array[0]):
self.windows[account]['infos'][array[0]].set_os_info(array[1], \
array[2], array[3])
win = self.windows[account]['infos'][array[0]]
elif self.windows[account]['infos'].has_key(array[0] + '/' + array[1]):
win = self.windows[account]['infos'][array[0] + '/' + array[1]]
if win:
win.set_os_info(array[1], array[2], array[3])
if self.remote and self.remote.is_enabled():
self.remote.raise_signal('OsInfo', (account, array))

View File

@ -708,8 +708,12 @@ class GroupchatWindow(chat.Chat):
if self.plugin.windows[self.account]['infos'].has_key(jid):
self.plugin.windows[self.account]['infos'][jid].window.present()
else:
# we copy contact because c.jid must contain the fakeJid for vcard
c2 = Contact(jid = jid, name = c.name, groups = c.groups,
show = c.show, status = c.status, sub = c.sub,
resource = c.resource, role = c.role, affiliation = c.affiliation)
self.plugin.windows[self.account]['infos'][jid] = \
dialogs.VcardWindow(c, self.plugin, self.account, False)
dialogs.VcardWindow(c2, self.plugin, self.account, False)
def on_add_to_roster(self, widget, jid):
dialogs.AddNewContactWindow(self.plugin, self.account, jid)

View File

@ -232,7 +232,8 @@ class VcardWindow:
client = ''
os = ''
while self.os_info.has_key(i):
if self.os_info[i]['resource'] == resource:
if not self.os_info[i]['resource'] or \
self.os_info[i]['resource'] == resource:
self.os_info[i]['client'] = client_info
self.os_info[i]['os'] = os_info
if i > 0: