From 4e5671a2cf71fab5c05f693b0eb5a81e5c73f531 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Thu, 3 Mar 2005 01:41:15 +0000 Subject: [PATCH] new message minor code fix --- plugins/gtkgui/dialogs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/gtkgui/dialogs.py b/plugins/gtkgui/dialogs.py index 134d7c81e..29936becf 100644 --- a/plugins/gtkgui/dialogs.py +++ b/plugins/gtkgui/dialogs.py @@ -582,12 +582,12 @@ class new_message_window: #FIXME: NOT READY #SO USER ID SHOULD BECOME JID and sent to new_chat() jid = userid - # use User class, new_chat expects it that way - user = gtkgui.User(jid, jid, ['not in the roster'], \ + if not self.contacts[account].has_key(jid): + # use User class, new_chat expects it that way + user = gtkgui.User(jid, jid, ['not in the roster'], \ 'not in the roster', 'not in the roster', 'none', None, '', 0, '') - self.plugin.roster.contacts[self.account][jid] = [user] - #FIXME: don't add him if we already have him (see on_message code on gtkgui.py) - self.plugin.roster.add_user_to_roster(user.jid, self.account) + self.plugin.roster.contacts[self.account][jid] = [user] + self.plugin.roster.add_user_to_roster(user.jid, self.account) self.plugin.roster.new_chat(user, self.account) widget.get_toplevel().destroy()