From f355cb043a892e9668fa56974c28f5f7e6c60810 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Tue, 14 Mar 2006 18:09:09 +0000 Subject: [PATCH] replace / in gc nicks by _ before we save vcard / avatars --- src/common/connection.py | 4 +++- src/gtkgui_helpers.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/connection.py b/src/common/connection.py index f9872ce58..78fc9a56c 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -273,6 +273,7 @@ class Connection: def save_vcard_to_hd(self, full_jid, card): jid, nick = gajim.get_room_and_nick_from_fjid(full_jid) + nick = nick.replace('/', '_') puny_jid = punycode_encode(jid) path = os.path.join(gajim.VCARD_PATH, puny_jid) if jid in self.room_jids: @@ -328,7 +329,7 @@ class Connection: puny_nick = None begin_path = os.path.join(gajim.AVATAR_PATH, puny_jid) if frm in self.room_jids: - puny_nick = punycode_encode(resource) + puny_nick = punycode_encode(resource.replace('/', '_')) # create folder if needed if not os.path.isdir(begin_path): os.mkdir(begin_path, 0700) @@ -2371,6 +2372,7 @@ class Connection: return {} if vcard was too old return None if we don't have cached vcard''' jid, nick = gajim.get_room_and_nick_from_fjid(fjid) + nick = nick.replace('/', '_') puny_jid = punycode_encode(jid) if is_fake_jid: puny_nick = punycode_encode(nick) diff --git a/src/gtkgui_helpers.py b/src/gtkgui_helpers.py index de0aa150c..760524f5c 100644 --- a/src/gtkgui_helpers.py +++ b/src/gtkgui_helpers.py @@ -439,6 +439,7 @@ def get_avatar_pixbuf_from_cache(fjid, is_fake_jid = False): so we have new sha) or if we don't have the vcard''' jid, nick = gajim.get_room_and_nick_from_fjid(fjid) + nick = nick.replace('/', '_') if gajim.config.get('hide_avatar_of_transport') and\ gajim.jid_is_transport(jid): # don't show avatar for the transport itself