From c42b00702d22a40211af4cbc765f3acce0b5ff24 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Fri, 24 Aug 2012 12:54:27 +0200
Subject: [PATCH] improve decline implementation

---
 src/common/connection_handlers.py | 8 ++++----
 src/gui_interface.py              | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/common/connection_handlers.py b/src/common/connection_handlers.py
index bd962cdfef..9953e2dbc8 100644
--- a/src/common/connection_handlers.py
+++ b/src/common/connection_handlers.py
@@ -1035,10 +1035,6 @@ class ConnectionHandlersBase:
             self.dispatch_error_message(obj.stanza, obj.msgtxt,
                 obj.session, obj.fjid, obj.timestamp)
             return True
-        elif obj.mtype == 'groupchat':
-            gajim.nec.push_incoming_event(GcMessageReceivedEvent(None,
-                conn=self, msg_obj=obj))
-            return True
         elif obj.invite_tag is not None:
             gajim.nec.push_incoming_event(GcInvitationReceivedEvent(None,
                 conn=self, msg_obj=obj))
@@ -1047,6 +1043,10 @@ class ConnectionHandlersBase:
             gajim.nec.push_incoming_event(GcDeclineReceivedEvent(None,
                 conn=self, msg_obj=obj))
             return True
+        elif obj.mtype == 'groupchat':
+            gajim.nec.push_incoming_event(GcMessageReceivedEvent(None,
+                conn=self, msg_obj=obj))
+            return True
 
     # process and dispatch an error message
     def dispatch_error_message(self, msg, msgtxt, session, frm, tim):
diff --git a/src/gui_interface.py b/src/gui_interface.py
index bfda4ea864..d9ba07c711 100644
--- a/src/gui_interface.py
+++ b/src/gui_interface.py
@@ -621,7 +621,7 @@ class Interface:
         if gc_control:
             gc_control.print_conversation(
                 _('%(jid)s declined the invitation: %(reason)s') % {
-                'jid': obj.room_jid, 'reason': obj.reason}, graphics=False)
+                'jid': obj.jid_from, 'reason': obj.reason}, graphics=False)
 
     def handle_event_gc_invitation(self, obj):
         #('GC_INVITATION', (room_jid, jid_from, reason, password, is_continued))
-- 
GitLab