changeset 152ff279defb in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=152ff279defb
description: don't allow to join a groupchat if we have a contact with the same 
JID. Fixes #5799

diffstat:

 src/dialogs.py       |  11 ++++-------
 src/gui_interface.py |   8 +++++++-
 2 files changed, 11 insertions(+), 8 deletions(-)

diffs (46 lines):

diff -r 23e066966b60 -r 152ff279defb src/dialogs.py
--- a/src/dialogs.py    Thu Jan 06 21:01:43 2011 +0100
+++ b/src/dialogs.py    Thu Apr 21 15:00:32 2011 +0200
@@ -2335,13 +2335,10 @@
                     _('The group chat Jabber ID has not allowed characters.'))
             return
 
-        if gajim.interface.msg_win_mgr.has_window(room_jid, self.account):
-            ctrl = gajim.interface.msg_win_mgr.get_gc_control(room_jid,
-                    self.account)
-            if ctrl.type_id != message_control.TYPE_GC:
-                ErrorDialog(_('This is not a group chat'),
-                        _('%s is not the name of a group chat.') % room_jid)
-                return
+        if gajim.contacts.get_contact(self.account, room_jid):
+            ErrorDialog(_('This is not a group chat'),
+                _('%s is not the name of a group chat.') % room_jid)
+            return
         if room_jid in self.recently_groupchat:
             self.recently_groupchat.remove(room_jid)
         self.recently_groupchat.insert(0, room_jid)
diff -r 23e066966b60 -r 152ff279defb src/gui_interface.py
--- a/src/gui_interface.py      Thu Jan 06 21:01:43 2011 +0100
+++ b/src/gui_interface.py      Thu Apr 21 15:00:32 2011 +0200
@@ -2666,6 +2666,12 @@
         """
         Join the room immediately
         """
+
+        if gajim.contacts.get_contact(account, room_jid):
+            dialogs.ErrorDialog(_('This is not a group chat'),
+                _('%s is not the name of a group chat.') % room_jid)
+            return
+
         if not nick:
             nick = gajim.nicks[account]
 
@@ -3158,7 +3164,7 @@
                 if not jid in gajim.gc_connected[account]:
                     # we are not already connected
                     minimize = bm['minimize'] in ('1', 'true')
-                    gajim.interface.join_gc_room(account, jid, bm['nick'],
+                    self.join_gc_room(account, jid, bm['nick'],
                     bm['password'], minimize = minimize)
                 elif jid in self.minimized_controls[account]:
                     # more or less a hack:
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to