[SamWhited] fix jingleFT. Fixes #7931
This commit is contained in:
parent
662ff44cb5
commit
7edff79486
4 changed files with 8 additions and 7 deletions
|
@ -2951,7 +2951,7 @@ class ChatControl(ChatControlBase):
|
||||||
|
|
||||||
def _on_drag_data_received(self, widget, context, x, y, selection,
|
def _on_drag_data_received(self, widget, context, x, y, selection,
|
||||||
target_type, timestamp):
|
target_type, timestamp):
|
||||||
if not selection.data:
|
if not selection.get_data():
|
||||||
return
|
return
|
||||||
if self.TYPE_ID == message_control.TYPE_PM:
|
if self.TYPE_ID == message_control.TYPE_PM:
|
||||||
c = self.gc_contact
|
c = self.gc_contact
|
||||||
|
@ -2960,7 +2960,7 @@ class ChatControl(ChatControlBase):
|
||||||
if target_type == self.TARGET_TYPE_URI_LIST:
|
if target_type == self.TARGET_TYPE_URI_LIST:
|
||||||
if not c.resource: # If no resource is known, we can't send a file
|
if not c.resource: # If no resource is known, we can't send a file
|
||||||
return
|
return
|
||||||
uri = selection.data.strip()
|
uri = selection.get_data().strip()
|
||||||
uri_splitted = uri.split() # we may have more than one file dropped
|
uri_splitted = uri.split() # we may have more than one file dropped
|
||||||
for uri in uri_splitted:
|
for uri in uri_splitted:
|
||||||
path = helpers.get_file_path_from_dnd_dropped_uri(uri)
|
path = helpers.get_file_path_from_dnd_dropped_uri(uri)
|
||||||
|
@ -2972,7 +2972,7 @@ class ChatControl(ChatControlBase):
|
||||||
# chat2muc
|
# chat2muc
|
||||||
treeview = gajim.interface.roster.tree
|
treeview = gajim.interface.roster.tree
|
||||||
model = treeview.get_model()
|
model = treeview.get_model()
|
||||||
data = selection.data
|
data = selection.get_data()
|
||||||
path = treeview.get_selection().get_selected_rows()[1][0]
|
path = treeview.get_selection().get_selected_rows()[1][0]
|
||||||
iter_ = model.get_iter(path)
|
iter_ = model.get_iter(path)
|
||||||
type_ = model[iter_][2]
|
type_ = model[iter_][2]
|
||||||
|
|
|
@ -410,7 +410,7 @@ def build_command(executable, parameter):
|
||||||
return command
|
return command
|
||||||
|
|
||||||
def get_file_path_from_dnd_dropped_uri(uri):
|
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
|
path = path.strip('\r\n\x00') # remove \r\n and NULL
|
||||||
# get the path to file
|
# get the path to file
|
||||||
if re.match('^file:///[a-zA-Z]:/', path): # windows
|
if re.match('^file:///[a-zA-Z]:/', path): # windows
|
||||||
|
|
|
@ -222,7 +222,8 @@ class JingleContent(object):
|
||||||
cert = load_cert_file(certpath)
|
cert = load_cert_file(certpath)
|
||||||
if cert:
|
if cert:
|
||||||
try:
|
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:
|
except AttributeError as e:
|
||||||
# Old py-OpenSSL is missing get_signature_algorithm
|
# Old py-OpenSSL is missing get_signature_algorithm
|
||||||
digest_algo = "sha256"
|
digest_algo = "sha256"
|
||||||
|
|
|
@ -2276,10 +2276,10 @@ class GroupchatControl(ChatControlBase):
|
||||||
# Invite contact to groupchat
|
# Invite contact to groupchat
|
||||||
treeview = gajim.interface.roster.tree
|
treeview = gajim.interface.roster.tree
|
||||||
model = treeview.get_model()
|
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
|
# target_type = 80 means a file is dropped
|
||||||
return
|
return
|
||||||
data = selection.data
|
data = selection.get_data()
|
||||||
path = treeview.get_selection().get_selected_rows()[1][0]
|
path = treeview.get_selection().get_selected_rows()[1][0]
|
||||||
iter_ = model.get_iter(path)
|
iter_ = model.get_iter(path)
|
||||||
type_ = model[iter_][2]
|
type_ = model[iter_][2]
|
||||||
|
|
Loading…
Add table
Reference in a new issue