Philipp Hörist pushed to branch master at gajim / python-nbxmpp
Commits:
-
efd417bf
by Philipp Hörist at 2020-01-23T19:09:20+01:00
3 changed files:
Changes:
| ... | ... | @@ -89,7 +89,7 @@ class NonBlockingBind(PlugIn): |
| 89 | 89 |
|
| 90 | 90 |
self._owner.Dispatcher.SendAndCallForResponse(node, func=self._on_bind)
|
| 91 | 91 |
|
| 92 |
- def _on_bind(self, stanza):
|
|
| 92 |
+ def _on_bind(self, _client, stanza):
|
|
| 93 | 93 |
if isResultNode(stanza):
|
| 94 | 94 |
bind = stanza.getTag('bind')
|
| 95 | 95 |
if bind is not None:
|
| ... | ... | @@ -115,7 +115,7 @@ class NonBlockingBind(PlugIn): |
| 115 | 115 |
self._owner.Dispatcher.Event(Realm.CONNECTING, Event.BIND_FAILED)
|
| 116 | 116 |
self.PlugOut()
|
| 117 | 117 |
|
| 118 |
- def _on_session(self, stanza):
|
|
| 118 |
+ def _on_session(self, _client, stanza):
|
|
| 119 | 119 |
if isResultNode(stanza):
|
| 120 | 120 |
log.info('Successfully started session')
|
| 121 | 121 |
self._on_bind_successful()
|
| ... | ... | @@ -613,7 +613,7 @@ class XMPPDispatcher(PlugIn): |
| 613 | 613 |
cb, args)
|
| 614 | 614 |
try:
|
| 615 | 615 |
if args is None:
|
| 616 |
- cb(stanza)
|
|
| 616 |
+ cb(self, stanza)
|
|
| 617 | 617 |
else:
|
| 618 | 618 |
cb(self, stanza, **args)
|
| 619 | 619 |
except NodeProcessed:
|
| ... | ... | @@ -21,7 +21,7 @@ Different stuff that wasn't worth separating it into modules |
| 21 | 21 |
from .protocol import NS_REGISTER, NS_PRIVACY, NS_DATA, Iq, isResultNode, Node
|
| 22 | 22 |
|
| 23 | 23 |
def _on_default_response(disp, iq, cb):
|
| 24 |
- def _on_response(resp):
|
|
| 24 |
+ def _on_response(_client, resp):
|
|
| 25 | 25 |
if isResultNode(resp):
|
| 26 | 26 |
if cb:
|
| 27 | 27 |
cb(True)
|
| ... | ... | @@ -47,7 +47,7 @@ def getRegInfo(disp, host, info={}, sync=True): |
| 47 | 47 |
for i in info.keys():
|
| 48 | 48 |
iq.setTagData(i, info[i])
|
| 49 | 49 |
if sync:
|
| 50 |
- disp.SendAndCallForResponse(iq, lambda resp:
|
|
| 50 |
+ disp.SendAndCallForResponse(iq, lambda _client, resp:
|
|
| 51 | 51 |
_ReceivedRegInfo(disp.Dispatcher, resp, host))
|
| 52 | 52 |
else:
|
| 53 | 53 |
disp.SendAndCallForResponse(iq, _ReceivedRegInfo, {'agent': host })
|
| ... | ... | @@ -127,7 +127,7 @@ def getPrivacyLists(disp): |
| 127 | 127 |
lists on success.
|
| 128 | 128 |
"""
|
| 129 | 129 |
iq = Iq('get', NS_PRIVACY)
|
| 130 |
- def _on_response(resp):
|
|
| 130 |
+ def _on_response(_client, resp):
|
|
| 131 | 131 |
dict_ = {'lists': []}
|
| 132 | 132 |
if not isResultNode(resp):
|
| 133 | 133 |
disp.Event(NS_PRIVACY, PRIVACY_LISTS_RECEIVED, False)
|
| ... | ... | @@ -142,7 +142,7 @@ def getPrivacyLists(disp): |
| 142 | 142 |
|
| 143 | 143 |
def getActiveAndDefaultPrivacyLists(disp):
|
| 144 | 144 |
iq = Iq('get', NS_PRIVACY)
|
| 145 |
- def _on_response(resp):
|
|
| 145 |
+ def _on_response(_client, resp):
|
|
| 146 | 146 |
dict_ = {'active': '', 'default': ''}
|
| 147 | 147 |
if not isResultNode(resp):
|
| 148 | 148 |
disp.Event(NS_PRIVACY, PRIVACY_LISTS_ACTIVE_DEFAULT, False)
|
| ... | ... | @@ -160,7 +160,7 @@ def getPrivacyList(disp, listname): |
| 160 | 160 |
Request specific privacy list listname. Returns list of XML nodes (rules)
|
| 161 | 161 |
taken from the server responce.
|
| 162 | 162 |
"""
|
| 163 |
- def _on_response(resp):
|
|
| 163 |
+ def _on_response(_client, resp):
|
|
| 164 | 164 |
if not isResultNode(resp):
|
| 165 | 165 |
disp.Event(NS_PRIVACY, PRIVACY_LIST_RECEIVED, False)
|
| 166 | 166 |
return
|