[SamWhited] fix jingleFT. Fixes #7931

This commit is contained in:
Yann Leboulanger 2015-01-19 13:37:28 +01:00
parent 662ff44cb5
commit 7edff79486
4 changed files with 8 additions and 7 deletions

View File

@ -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]

View File

@ -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

View File

@ -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"

View File

@ -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]