From 980492e33bef0cca257e391f355c22f7aea4d7d3 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Tue, 22 Jan 2013 17:38:43 +0100
Subject: [PATCH] don't try to escape JID when we get a subscription request
 from it, it's already escaped. Fixes #7277

---
 src/dialogs.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/dialogs.py b/src/dialogs.py
index 2cf0e66f08..0173bc2176 100644
--- a/src/dialogs.py
+++ b/src/dialogs.py
@@ -947,6 +947,7 @@ class AddNewContactWindow:
         liststore = gtk.ListStore(str)
         self.protocol_jid_combobox.set_model(liststore)
         if jid:
+            self.jid_escaped = True
             type_ = gajim.get_transport_name_from_jid(jid)
             if not type_:
                 type_ = 'jabber'
@@ -981,6 +982,7 @@ class AddNewContactWindow:
                 self.nickname_entry.set_text(user_nick)
             self.nickname_entry.grab_focus()
         else:
+            self.jid_escaped = False
             self.uid_entry.grab_focus()
         group_names = []
         for acct in accounts:
@@ -1055,7 +1057,7 @@ class AddNewContactWindow:
         model = self.protocol_combobox.get_model()
         iter_ = self.protocol_combobox.get_active_iter()
         type_ = model[iter_][2]
-        if type_ != 'jabber':
+        if type_ != 'jabber' and not self.jid_escaped:
             transport = self.protocol_jid_combobox.get_active_text().decode(
                 'utf-8')
             if self.account:
-- 
GitLab