diff --git a/gajim/common/commands.py b/gajim/common/commands.py index d800b30c0..24908cb03 100644 --- a/gajim/common/commands.py +++ b/gajim/common/commands.py @@ -85,6 +85,10 @@ class ChangeStatusCommand(AdHocCommand): commandnode = 'change-status' commandname = _('Change status information') + def __init__(self, conn, jid, sessionid): + AdHocCommand.__init__(self, conn, jid, sessionid) + self.cb = self.first_step + @staticmethod def isVisibleFor(samejid): """ @@ -93,6 +97,9 @@ class ChangeStatusCommand(AdHocCommand): return samejid def execute(self, request): + return self.cb(request) + + def first_step(self, request): # first query... response, cmd = self.buildResponse(request, defaultaction = 'execute', actions = ['execute']) @@ -120,11 +127,11 @@ class ChangeStatusCommand(AdHocCommand): self.connection.connection.send(response) # for next invocation - self.execute = self.changestatus + self.cb = self.second_step return True # keep the session - def changestatus(self, request): + def second_step(self, request): # check if the data is correct try: form = dataforms.SimpleDataForm(extend = request.getTag('command').\ @@ -184,6 +191,10 @@ class LeaveGroupchatsCommand(AdHocCommand): commandnode = 'leave-groupchats' commandname = _('Leave Groupchats') + def __init__(self, conn, jid, sessionid): + AdHocCommand.__init__(self, conn, jid, sessionid) + self.cb = self.first_step + @staticmethod def isVisibleFor(samejid): """ @@ -192,6 +203,9 @@ class LeaveGroupchatsCommand(AdHocCommand): return samejid def execute(self, request): + return self.cb(request) + + def first_step(self, request): # first query... response, cmd = self.buildResponse(request, defaultaction = 'execute', actions=['execute']) @@ -220,11 +234,11 @@ class LeaveGroupchatsCommand(AdHocCommand): self.connection.connection.send(response) # for next invocation - self.execute = self.leavegroupchats + self.cb = self.second_step return True # keep the session - def leavegroupchats(self, request): + def second_step(self, request): # check if the data is correct try: form = dataforms.SimpleDataForm(extend = request.getTag('command').\ diff --git a/gajim/common/dataforms.py b/gajim/common/dataforms.py index 9ad76c100..2c83e6370 100644 --- a/gajim/common/dataforms.py +++ b/gajim/common/dataforms.py @@ -305,7 +305,7 @@ class Media(nbxmpp.Node): for uri in value: self.addChild(node=uri) - def fdel(self, value): + def fdel(self): for element in self.getTags('uri'): self.delChild(element) diff --git a/gajim/common/protocol/bytestream.py b/gajim/common/protocol/bytestream.py index 606dc432b..9bf53dab9 100644 --- a/gajim/common/protocol/bytestream.py +++ b/gajim/common/protocol/bytestream.py @@ -720,7 +720,7 @@ class ConnectionSocks5Bytestream(ConnectionBytestream): if file_props.stopped: self.remove_transfer(file_props) else: - app.socks5queue.send_file(file_props, self.name) + app.socks5queue.send_file(file_props, self.name, 'server') raise nbxmpp.NodeProcessed proxy = None diff --git a/gajim/common/socks5.py b/gajim/common/socks5.py index 90013683b..ed9e7cd51 100644 --- a/gajim/common/socks5.py +++ b/gajim/common/socks5.py @@ -730,7 +730,7 @@ class Socks5(object): try: fd = self.get_fd() except IOError: - self.disconnect(False) + self.disconnect() self.file_props.error = -6 # file system error return 0 fd.write(self.remaining_buff) @@ -751,7 +751,7 @@ class Socks5(object): try: fd = self.get_fd() except IOError: - self.disconnect(False) + self.disconnect() self.file_props.error = -6 # file system error return 0 try: diff --git a/gajim/common/zeroconf/client_zeroconf.py b/gajim/common/zeroconf/client_zeroconf.py index 67cd2e4a4..e75adff74 100644 --- a/gajim/common/zeroconf/client_zeroconf.py +++ b/gajim/common/zeroconf/client_zeroconf.py @@ -375,7 +375,7 @@ class P2PConnection(IdleObject, PlugIn): self.ais = socket.getaddrinfo(address['host'], address['port'], socket.AF_UNSPEC, socket.SOCK_STREAM) except socket.gaierror as e: - log.info('Lookup failure for %s: %s[%s]', host, e[1], + log.info('Lookup failure for %s: %s[%s]', self.host, e[1], repr(e[0]), exc_info=True) if len(self.addresses_) > 0: return self.get_next_addrinfo() else: diff --git a/gajim/gui_interface.py b/gajim/gui_interface.py index 3b0eb71de..e3f9b5515 100644 --- a/gajim/gui_interface.py +++ b/gajim/gui_interface.py @@ -2582,7 +2582,7 @@ class Interface: win.hide() return True window.connect('delete_event', on_delete) - view.updateNamespace({'gajim': gajim}) + view.updateNamespace({'gajim': app}) app.ipython_window = window def run(self, application): diff --git a/gajim/plugins/pluginmanager.py b/gajim/plugins/pluginmanager.py index b08837824..b81d985f7 100644 --- a/gajim/plugins/pluginmanager.py +++ b/gajim/plugins/pluginmanager.py @@ -568,7 +568,7 @@ class PluginManager(metaclass=Singleton): for option in fields: if conf.get('info', option) is '': - raise configparser.NoOptionError('field empty') + raise configparser.NoOptionError(option, 'info') if option == 'description': setattr(module_attr, option, _(conf.get('info', option))) continue