From 7edff794865ad49f2d0b07338d645261d2ca2a3b Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 19 Jan 2015 13:37:28 +0100 Subject: [PATCH] [SamWhited] fix jingleFT. Fixes #7931 --- src/chat_control.py | 6 +++--- src/common/helpers.py | 2 +- src/common/jingle_content.py | 3 ++- src/groupchat_control.py | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index e29474ff7..0d5dd4194 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -2951,7 +2951,7 @@ class ChatControl(ChatControlBase): def _on_drag_data_received(self, widget, context, x, y, selection, target_type, timestamp): - if not selection.data: + if not selection.get_data(): return if self.TYPE_ID == message_control.TYPE_PM: c = self.gc_contact @@ -2960,7 +2960,7 @@ class ChatControl(ChatControlBase): if target_type == self.TARGET_TYPE_URI_LIST: if not c.resource: # If no resource is known, we can't send a file return - uri = selection.data.strip() + uri = selection.get_data().strip() uri_splitted = uri.split() # we may have more than one file dropped for uri in uri_splitted: path = helpers.get_file_path_from_dnd_dropped_uri(uri) @@ -2972,7 +2972,7 @@ class ChatControl(ChatControlBase): # chat2muc treeview = gajim.interface.roster.tree model = treeview.get_model() - data = selection.data + data = selection.get_data() path = treeview.get_selection().get_selected_rows()[1][0] iter_ = model.get_iter(path) type_ = model[iter_][2] diff --git a/src/common/helpers.py b/src/common/helpers.py index b15d70509..e41b56bda 100644 --- a/src/common/helpers.py +++ b/src/common/helpers.py @@ -410,7 +410,7 @@ def build_command(executable, parameter): return command def get_file_path_from_dnd_dropped_uri(uri): - path = urllib.parse.unquote(uri) # escape special chars + path = urllib.parse.unquote(uri.decode('utf-8')) # escape special chars path = path.strip('\r\n\x00') # remove \r\n and NULL # get the path to file if re.match('^file:///[a-zA-Z]:/', path): # windows diff --git a/src/common/jingle_content.py b/src/common/jingle_content.py index dbf03a396..eba958767 100644 --- a/src/common/jingle_content.py +++ b/src/common/jingle_content.py @@ -222,7 +222,8 @@ class JingleContent(object): cert = load_cert_file(certpath) if cert: try: - digest_algo = cert.get_signature_algorithm().split('With')[0] + digest_algo = cert.get_signature_algorithm().decode('utf-8' + ).split('With')[0] except AttributeError as e: # Old py-OpenSSL is missing get_signature_algorithm digest_algo = "sha256" diff --git a/src/groupchat_control.py b/src/groupchat_control.py index 9e7da7abd..0d64da6e8 100644 --- a/src/groupchat_control.py +++ b/src/groupchat_control.py @@ -2276,10 +2276,10 @@ class GroupchatControl(ChatControlBase): # Invite contact to groupchat treeview = gajim.interface.roster.tree model = treeview.get_model() - if not selection.data or target_type == 80: + if not selection.get_data() or target_type == 80: # target_type = 80 means a file is dropped return - data = selection.data + data = selection.get_data() path = treeview.get_selection().get_selected_rows()[1][0] iter_ = model.get_iter(path) type_ = model[iter_][2]