From 1663c42b661f27808e55312a447409c0b04f2622 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Sat, 25 Aug 2012 11:32:14 +0200
Subject: [PATCH] don't print reason where there is none

---
 src/gui_interface.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/gui_interface.py b/src/gui_interface.py
index abfbca9fca..ab78961541 100644
--- a/src/gui_interface.py
+++ b/src/gui_interface.py
@@ -619,9 +619,14 @@ class Interface:
         account = obj.conn.name
         gc_control = self.msg_win_mgr.get_gc_control(obj.room_jid, account)
         if gc_control:
-            gc_control.print_conversation(
-                _('%(jid)s declined the invitation: %(reason)s') % {
-                'jid': obj.jid_from, 'reason': obj.reason}, graphics=False)
+            if obj.reason:
+                gc_control.print_conversation(
+                    _('%(jid)s declined the invitation: %(reason)s') % {
+                    'jid': obj.jid_from, 'reason': obj.reason}, graphics=False)
+            else:
+                gc_control.print_conversation(
+                    _('%(jid)s declined the invitation') % {
+                    'jid': obj.jid_from}, graphics=False)
 
     def handle_event_gc_invitation(self, obj):
         #('GC_INVITATION', (room_jid, jid_from, reason, password, is_continued))
-- 
GitLab