diff --git a/src/gajim.py b/src/gajim.py index c73aa35b0..1abb35352 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -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)) diff --git a/src/groupchat_window.py b/src/groupchat_window.py index cfaf00cb7..cb453f81e 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -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) diff --git a/src/vcard.py b/src/vcard.py index d4fc14cde..b5147ed09 100644 --- a/src/vcard.py +++ b/src/vcard.py @@ -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: