add new FT in FT window when we are requesting file
This commit is contained in:
parent
d73d11d3be
commit
bfc4dccc0f
3 changed files with 18 additions and 5 deletions
|
@ -196,7 +196,8 @@ class ConnectionJingle(object):
|
||||||
|
|
||||||
def get_files_info(self, hash_=None, name=None):
|
def get_files_info(self, hash_=None, name=None):
|
||||||
if hash_:
|
if hash_:
|
||||||
for f in self.files:
|
for f in self.files: # DEBUG
|
||||||
|
#if f['hash'] == '1294809248109223':
|
||||||
if f['hash'] == hash_:
|
if f['hash'] == hash_:
|
||||||
return f
|
return f
|
||||||
elif name:
|
elif name:
|
||||||
|
|
|
@ -254,10 +254,20 @@ class FileTransfersWindow:
|
||||||
contact = gajim.contacts.get_contact_with_highest_priority(account,
|
contact = gajim.contacts.get_contact_with_highest_priority(account,
|
||||||
jid)
|
jid)
|
||||||
fjid = contact.get_full_jid()
|
fjid = contact.get_full_jid()
|
||||||
sid = gajim.connections[account].start_file_transfer(fjid,
|
sid = helpers.get_random_string_16()
|
||||||
file_props,
|
new_file_props = FilesProp.getNewFileProp(account, sid)
|
||||||
|
new_file_props.file_name = file_props.file_name
|
||||||
|
new_file_props.name = file_props.name
|
||||||
|
new_file_props.desc = file_props.desc
|
||||||
|
new_file_props.size = file_props.size
|
||||||
|
new_file_props.date = file_props.date
|
||||||
|
new_file_props.hash_ = file_props.hash_
|
||||||
|
new_file_props.type_ = 'r'
|
||||||
|
tsid = gajim.connections[account].start_file_transfer(fjid,
|
||||||
|
new_file_props,
|
||||||
True)
|
True)
|
||||||
file_props.transport_sid = sid
|
new_file_props.transport_sid = tsid
|
||||||
|
self.add_transfer(account, contact, new_file_props)
|
||||||
|
|
||||||
if file_props.type_ == 'r':
|
if file_props.type_ == 'r':
|
||||||
file_name = os.path.basename(file_props.file_name)
|
file_name = os.path.basename(file_props.file_name)
|
||||||
|
|
|
@ -912,13 +912,15 @@ class Interface:
|
||||||
account=account, keyID=keyID)
|
account=account, keyID=keyID)
|
||||||
gajim.contacts.add_contact(account, contact)
|
gajim.contacts.add_contact(account, contact)
|
||||||
self.roster.add_contact(obj.jid, account)
|
self.roster.add_contact(obj.jid, account)
|
||||||
|
contact = gajim.contacts.get_first_contact_from_jid(account, obj.jid)
|
||||||
if obj.file_props.session_type == 'jingle':
|
if obj.file_props.session_type == 'jingle':
|
||||||
request = obj.stanza.getTag('jingle').getTag('content')\
|
request = obj.stanza.getTag('jingle').getTag('content')\
|
||||||
.getTag('description').getTag('request')
|
.getTag('description').getTag('request')
|
||||||
if request:
|
if request:
|
||||||
# If we get a request instead
|
# If we get a request instead
|
||||||
|
ft_win = self.instances['file_transfers']
|
||||||
|
ft_win.add_transfer(account, contact, obj.file_props)
|
||||||
return
|
return
|
||||||
contact = gajim.contacts.get_first_contact_from_jid(account, obj.jid)
|
|
||||||
if helpers.allow_popup_window(account):
|
if helpers.allow_popup_window(account):
|
||||||
self.instances['file_transfers'].show_file_request(account, contact,
|
self.instances['file_transfers'].show_file_request(account, contact,
|
||||||
obj.file_props)
|
obj.file_props)
|
||||||
|
|
Loading…
Add table
Reference in a new issue