Update httpupload action on discovery

This commit is contained in:
Philipp Hörist 2018-01-27 10:44:04 +01:00
parent afc3075415
commit 36f23c9cf2
2 changed files with 5 additions and 3 deletions

View File

@ -165,7 +165,6 @@ class CommonConnection:
# the fake jid
self.groupchat_jids = {} # {ID : groupchat_jid}
self.httpupload = False
self.privacy_rules_supported = False
self.vcard_supported = False
self.private_storage_supported = False
@ -1970,8 +1969,6 @@ class Connection(CommonConnection, ConnectionHandlers):
self._continue_connection_request_privacy()
if nbxmpp.NS_HTTPUPLOAD in obj.features:
self.httpupload = True
if nbxmpp.NS_BYTESTREAM in obj.features and \
app.config.get_per('accounts', self.name, 'use_ft_proxies'):
our_fjid = helpers.parse_jid(our_jid + '/' + \

View File

@ -47,6 +47,7 @@ class ConnectionHTTPUpload:
(XEP-0363, https://xmpp.org/extensions/xep-0363.html)
"""
def __init__(self):
self.httpupload = False
self.encrypted_upload = False
self.component = None
self.max_file_size = None # maximum file size in bytes
@ -103,6 +104,10 @@ class ConnectionHTTPUpload:
log.info('%s has a maximum file size of: %s MiB',
account, self.max_file_size/(1024*1024))
self.httpupload = True
for ctrl in app.interface.msg_win_mgr.get_controls(acct=self.name):
ctrl.update_actions()
def handle_outgoing_stanza(self, event):
if event.conn.name != self.name:
return