Commit 77ed800a authored by Philipp Hörist's avatar Philipp Hörist

HTTPUpload: Remove session argument

parent 274b22db
......@@ -819,19 +819,18 @@ class ChatControlBase(ChatCommandProcessor, CommandTools, EventHelper):
if httpupload.get_enabled():
# use httpupload
con.get_module('HTTPUpload').check_file_before_transfer(
path, self.encryption, self.contact,
self.session, groupchat=True)
path, self.encryption, self.contact, groupchat=True)
else:
if httpupload.get_enabled() and jingle.get_enabled():
if ft_pref == 'httpupload':
con.get_module('HTTPUpload').check_file_before_transfer(
path, self.encryption, self.contact, self.session)
path, self.encryption, self.contact)
else:
ft = app.interface.instances['file_transfers']
ft.send_file(self.account, self.contact, path)
elif httpupload.get_enabled():
con.get_module('HTTPUpload').check_file_before_transfer(
path, self.encryption, self.contact, self.session)
path, self.encryption, self.contact)
elif jingle.get_enabled():
ft = app.interface.instances['file_transfers']
ft.send_file(self.account, self.contact, path)
......@@ -999,19 +998,18 @@ class ChatControlBase(ChatCommandProcessor, CommandTools, EventHelper):
if httpupload.get_enabled():
# use httpupload
con.get_module('HTTPUpload').check_file_before_transfer(
path, self.encryption, contact,
self.session, groupchat=True)
path, self.encryption, contact, groupchat=True)
else:
if httpupload.get_enabled() and jingle.get_enabled():
if ft_pref == 'httpupload':
con.get_module('HTTPUpload').check_file_before_transfer(
path, self.encryption, contact, self.session)
path, self.encryption, contact)
else:
ft = app.interface.instances['file_transfers']
ft.send_file(self.account, contact, path)
elif httpupload.get_enabled():
con.get_module('HTTPUpload').check_file_before_transfer(
path, self.encryption, contact, self.session)
path, self.encryption, contact)
elif jingle.get_enabled():
ft = app.interface.instances['file_transfers']
ft.send_file(self.account, contact, path)
......
......@@ -109,7 +109,7 @@ class HTTPUpload(BaseModule):
oob.addChild('url').setData(body)
event.additional_data.set_value('gajim', 'oob_url', body)
def check_file_before_transfer(self, path, encryption, contact, session,
def check_file_before_transfer(self, path, encryption, contact,
groupchat=False):
if not path or not os.path.exists(path):
return
......@@ -148,7 +148,6 @@ class HTTPUpload(BaseModule):
self._account,
mime,
encryption,
session,
groupchat)
app.interface.show_httpupload_progress(file)
except Exception as error:
......@@ -316,15 +315,20 @@ class HTTPUpload(BaseModule):
self._text.append(uri)
if file.is_groupchat:
app.nec.push_outgoing_event(GcMessageOutgoingEvent(
None, account=self._account, jid=file.contact.jid,
message=uri, automatic_message=False,
session=file.session))
app.nec.push_outgoing_event(
GcMessageOutgoingEvent(None,
account=self._account,
jid=file.contact.jid,
message=uri,
automatic_message=False))
else:
app.nec.push_outgoing_event(MessageOutgoingEvent(
None, account=self._account, jid=file.contact.jid,
message=uri, type_='chat',
automatic_message=False, session=file.session))
app.nec.push_outgoing_event(
MessageOutgoingEvent(None,
account=self._account,
jid=file.contact.jid,
message=uri,
type_='chat',
automatic_message=False))
else:
phrase = Soup.Status.get_phrase(message.props.status_code)
......@@ -360,7 +364,6 @@ class File:
account,
mime,
encryption,
session,
groupchat):
self._path = path
......@@ -369,7 +372,6 @@ class File:
self._contact = contact
self._account = account
self._mime = mime
self._session = session
self.size = os.stat(path).st_size
self.put_uri = None
......@@ -393,10 +395,6 @@ class File:
def contact(self):
return self._contact
@property
def session(self):
return self._session
@property
def is_groupchat(self):
return self._groupchat
......
......@@ -875,7 +875,6 @@ class Interface:
path,
chat_control.encryption,
chat_control.contact,
chat_control.session,
chat_control.is_groupchat)
def encrypt_file(self, file, account, callback):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment