Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlovetox <philipp@hoerist.com>2020-02-23 17:34:39 +0300
committerlovetox <philipp@hoerist.com>2020-03-07 22:21:45 +0300
commit78a8dd4c8abc61521ec1d8791ea071e0059f6cfe (patch)
tree582ffa3eb0bc7ddfdc48f59901411d891d00ae3f /nbxmpp/modules
parentaca509f45842dc801bc0f74c89a9abb2bd36f229 (diff)
Add new modules and example client
Diffstat (limited to 'nbxmpp/modules')
-rw-r--r--nbxmpp/modules/activity.py2
-rw-r--r--nbxmpp/modules/attention.py2
-rw-r--r--nbxmpp/modules/bookmarks.py6
-rw-r--r--nbxmpp/modules/captcha.py2
-rw-r--r--nbxmpp/modules/chat_markers.py2
-rw-r--r--nbxmpp/modules/chatstates.py2
-rw-r--r--nbxmpp/modules/correction.py2
-rw-r--r--nbxmpp/modules/delay.py4
-rw-r--r--nbxmpp/modules/eme.py2
-rw-r--r--nbxmpp/modules/entity_caps.py2
-rw-r--r--nbxmpp/modules/http_auth.py2
-rw-r--r--nbxmpp/modules/ibb.py21
-rw-r--r--nbxmpp/modules/idle.py2
-rw-r--r--nbxmpp/modules/iq.py4
-rw-r--r--nbxmpp/modules/location.py2
-rw-r--r--nbxmpp/modules/message.py4
-rw-r--r--nbxmpp/modules/mood.py2
-rw-r--r--nbxmpp/modules/muc.py26
-rw-r--r--nbxmpp/modules/muclumbus.py26
-rw-r--r--nbxmpp/modules/nickname.py4
-rw-r--r--nbxmpp/modules/omemo.py4
-rw-r--r--nbxmpp/modules/oob.py2
-rw-r--r--nbxmpp/modules/openpgp.py4
-rw-r--r--nbxmpp/modules/pgplegacy.py4
-rw-r--r--nbxmpp/modules/presence.py4
-rw-r--r--nbxmpp/modules/pubsub.py2
-rw-r--r--nbxmpp/modules/receipts.py2
-rw-r--r--nbxmpp/modules/security_labels.py2
-rw-r--r--nbxmpp/modules/software_version.py2
-rw-r--r--nbxmpp/modules/tune.py2
-rw-r--r--nbxmpp/modules/user_avatar.py2
-rw-r--r--nbxmpp/modules/vcard_avatar.py2
32 files changed, 75 insertions, 76 deletions
diff --git a/nbxmpp/modules/activity.py b/nbxmpp/modules/activity.py
index 7f48ba1..9e1f0b3 100644
--- a/nbxmpp/modules/activity.py
+++ b/nbxmpp/modules/activity.py
@@ -38,7 +38,7 @@ class Activity:
priority=16),
]
- def _process_pubsub_activity(self, _con, stanza, properties):
+ def _process_pubsub_activity(self, _client, stanza, properties):
if not properties.is_pubsub_event:
return
diff --git a/nbxmpp/modules/attention.py b/nbxmpp/modules/attention.py
index a0d2269..109bfde 100644
--- a/nbxmpp/modules/attention.py
+++ b/nbxmpp/modules/attention.py
@@ -34,7 +34,7 @@ class Attention:
priority=15),
]
- def _process_message_attention(self, _con, stanza, properties):
+ def _process_message_attention(self, _client, stanza, properties):
attention = stanza.getTag('attention', namespace=NS_ATTENTION)
if attention is None:
return
diff --git a/nbxmpp/modules/bookmarks.py b/nbxmpp/modules/bookmarks.py
index 85ca237..5b6d8c3 100644
--- a/nbxmpp/modules/bookmarks.py
+++ b/nbxmpp/modules/bookmarks.py
@@ -78,7 +78,7 @@ class Bookmarks:
self._node_configuration_in_progress = False
self._node_configuration_not_possible = False
- def _process_pubsub_bookmarks(self, _con, stanza, properties):
+ def _process_pubsub_bookmarks(self, _client, stanza, properties):
if not properties.is_pubsub_event:
return
@@ -108,7 +108,7 @@ class Bookmarks:
properties.pubsub_event = pubsub_event
- def _process_pubsub_bookmarks2(self, _con, _stanza, properties):
+ def _process_pubsub_bookmarks2(self, _client, _stanza, properties):
if not properties.is_pubsub_event:
return
@@ -415,6 +415,6 @@ class Bookmarks:
return Iq('set', NS_PRIVATE, payload=storage_node)
@staticmethod
- def _on_private_store_result(_con, stanza):
+ def _on_private_store_result(_client, stanza):
if not isResultNode(stanza):
return raise_error(log.info, stanza)
diff --git a/nbxmpp/modules/captcha.py b/nbxmpp/modules/captcha.py
index 52bfc77..8e4f90a 100644
--- a/nbxmpp/modules/captcha.py
+++ b/nbxmpp/modules/captcha.py
@@ -38,7 +38,7 @@ class Captcha:
]
@staticmethod
- def _process_captcha(_con, stanza, properties):
+ def _process_captcha(_client, stanza, properties):
captcha = stanza.getTag('captcha', namespace=NS_CAPTCHA)
if captcha is None:
return
diff --git a/nbxmpp/modules/chat_markers.py b/nbxmpp/modules/chat_markers.py
index 7d33dd6..eec8fa6 100644
--- a/nbxmpp/modules/chat_markers.py
+++ b/nbxmpp/modules/chat_markers.py
@@ -35,7 +35,7 @@ class ChatMarkers:
]
@staticmethod
- def _process_message_marker(_con, stanza, properties):
+ def _process_message_marker(_client, stanza, properties):
type_ = stanza.getTag('received', namespace=NS_CHATMARKERS)
if type_ is None:
type_ = stanza.getTag('displayed', namespace=NS_CHATMARKERS)
diff --git a/nbxmpp/modules/chatstates.py b/nbxmpp/modules/chatstates.py
index 8304310..8f9869f 100644
--- a/nbxmpp/modules/chatstates.py
+++ b/nbxmpp/modules/chatstates.py
@@ -35,7 +35,7 @@ class Chatstates:
priority=15),
]
- def _process_message_chatstate(self, _con, stanza, properties):
+ def _process_message_chatstate(self, _client, stanza, properties):
chatstate = parse_chatstate(stanza)
if chatstate is None:
return
diff --git a/nbxmpp/modules/correction.py b/nbxmpp/modules/correction.py
index d56bd29..68d6376 100644
--- a/nbxmpp/modules/correction.py
+++ b/nbxmpp/modules/correction.py
@@ -34,7 +34,7 @@ class Correction:
priority=15),
]
- def _process_message_correction(self, _con, stanza, properties):
+ def _process_message_correction(self, _client, stanza, properties):
replace = stanza.getTag('replace', namespace=NS_CORRECT)
if replace is None:
return
diff --git a/nbxmpp/modules/delay.py b/nbxmpp/modules/delay.py
index cf440d6..859ad1a 100644
--- a/nbxmpp/modules/delay.py
+++ b/nbxmpp/modules/delay.py
@@ -38,7 +38,7 @@ class Delay:
priority=15)
]
- def _process_message_delay(self, _con, stanza, properties):
+ def _process_message_delay(self, _client, stanza, properties):
if properties.is_muc_subject:
# MUC Subjects can have a delay timestamp
# to indicate when the user has set the subject,
@@ -65,7 +65,7 @@ class Delay:
properties.user_timestamp = parse_delay(stanza, not_from=jids)
@staticmethod
- def _process_presence_delay(_con, stanza, properties):
+ def _process_presence_delay(_client, stanza, properties):
properties.user_timestamp = parse_delay(stanza)
diff --git a/nbxmpp/modules/eme.py b/nbxmpp/modules/eme.py
index c585a2a..84b1d3e 100644
--- a/nbxmpp/modules/eme.py
+++ b/nbxmpp/modules/eme.py
@@ -35,7 +35,7 @@ class EME:
]
@staticmethod
- def _process_eme(_con, stanza, properties):
+ def _process_eme(_client, stanza, properties):
encryption = stanza.getTag('encryption', namespace=NS_EME)
if encryption is None:
return
diff --git a/nbxmpp/modules/entity_caps.py b/nbxmpp/modules/entity_caps.py
index 4eee6ab..dd04ee2 100644
--- a/nbxmpp/modules/entity_caps.py
+++ b/nbxmpp/modules/entity_caps.py
@@ -35,7 +35,7 @@ class EntityCaps:
]
@staticmethod
- def _process_entity_caps(_con, stanza, properties):
+ def _process_entity_caps(_client, stanza, properties):
caps = stanza.getTag('c', namespace=NS_CAPS)
if caps is None:
properties.entity_caps = EntityCapsData()
diff --git a/nbxmpp/modules/http_auth.py b/nbxmpp/modules/http_auth.py
index fb78c46..5488f77 100644
--- a/nbxmpp/modules/http_auth.py
+++ b/nbxmpp/modules/http_auth.py
@@ -40,7 +40,7 @@ class HTTPAuth:
]
@staticmethod
- def _process_http_auth(_con, stanza, properties):
+ def _process_http_auth(_client, stanza, properties):
confirm = stanza.getTag('confirm', namespace=NS_HTTP_AUTH)
if confirm is None:
return
diff --git a/nbxmpp/modules/ibb.py b/nbxmpp/modules/ibb.py
index e70721c..402f5eb 100644
--- a/nbxmpp/modules/ibb.py
+++ b/nbxmpp/modules/ibb.py
@@ -46,7 +46,7 @@ class IBB:
priority=20),
]
- def _process_ibb(self, _con, stanza, properties):
+ def _process_ibb(self, _client, stanza, properties):
if properties.type.is_set:
open_ = stanza.getTag('open', namespace=NS_IBB)
if open_ is not None:
@@ -70,23 +70,24 @@ class IBB:
except Exception as error:
log.warning(error)
log.warning(stanza)
- self._client.send(ErrorStanza(stanza, ERR_BAD_REQUEST))
+ self._client.send_stanza(ErrorStanza(stanza, ERR_BAD_REQUEST))
raise NodeProcessed
if block_size > 65535:
log.warning('Invalid block-size')
- self._client.send(ErrorStanza(stanza, ERR_BAD_REQUEST))
+ self._client.send_stanza(ErrorStanza(stanza, ERR_BAD_REQUEST))
raise NodeProcessed
sid = attrs.get('sid')
if not sid:
log.warning('Invalid sid')
- self._client.send(ErrorStanza(stanza, ERR_BAD_REQUEST))
+ self._client.send_stanza(ErrorStanza(stanza, ERR_BAD_REQUEST))
raise NodeProcessed
type_ = attrs.get('stanza')
if type_ == 'message':
- self._client.send(ErrorStanza(stanza, ERR_FEATURE_NOT_IMPLEMENTED))
+ self._client.send_stanza(ErrorStanza(stanza,
+ ERR_FEATURE_NOT_IMPLEMENTED))
raise NodeProcessed
return IBBData(type='open', block_size=block_size, sid=sid)
@@ -95,7 +96,7 @@ class IBB:
sid = close.getAttrs().get('sid')
if sid is None:
log.warning('Invalid sid')
- self._client.send(ErrorStanza(stanza, ERR_BAD_REQUEST))
+ self._client.send_stanza(ErrorStanza(stanza, ERR_BAD_REQUEST))
raise NodeProcessed
return IBBData(type='close', sid=sid)
@@ -105,21 +106,21 @@ class IBB:
sid = attrs.get('sid')
if sid is None:
log.warning('Invalid sid')
- self._client.send(ErrorStanza(stanza, ERR_BAD_REQUEST))
+ self._client.send_stanza(ErrorStanza(stanza, ERR_BAD_REQUEST))
raise NodeProcessed
try:
seq = int(attrs.get('seq'))
except Exception:
log.exception('Invalid seq')
- self._client.send(ErrorStanza(stanza, ERR_BAD_REQUEST))
+ self._client.send_stanza(ErrorStanza(stanza, ERR_BAD_REQUEST))
raise NodeProcessed
try:
decoded_data = b64decode(data.getData(), return_type=bytes)
except Exception:
log.exception('Failed to decode IBB data')
- self._client.send(ErrorStanza(stanza, ERR_BAD_REQUEST))
+ self._client.send_stanza(ErrorStanza(stanza, ERR_BAD_REQUEST))
raise NodeProcessed
return IBBData(type='data', sid=sid, seq=seq, data=decoded_data)
@@ -130,7 +131,7 @@ class IBB:
reply.getChildren().clear()
else:
reply = ErrorStanza(stanza, error)
- self._client.send(reply)
+ self._client.send_stanza(reply)
@call_on_response('_default_response')
def send_open(self, jid, sid, block_size):
diff --git a/nbxmpp/modules/idle.py b/nbxmpp/modules/idle.py
index 5f5d6db..81870f2 100644
--- a/nbxmpp/modules/idle.py
+++ b/nbxmpp/modules/idle.py
@@ -35,7 +35,7 @@ class Idle:
]
@staticmethod
- def _process_idle(_con, stanza, properties):
+ def _process_idle(_client, stanza, properties):
idle_tag = stanza.getTag('idle', namespace=NS_IDLE)
if idle_tag is None:
return
diff --git a/nbxmpp/modules/iq.py b/nbxmpp/modules/iq.py
index e699c75..35b92ea 100644
--- a/nbxmpp/modules/iq.py
+++ b/nbxmpp/modules/iq.py
@@ -36,13 +36,13 @@ class BaseIq:
priority=10),
]
- def _process_iq_base(self, _con, stanza, properties):
+ def _process_iq_base(self, _client, stanza, properties):
try:
properties.type = IqType(stanza.getType())
except ValueError:
log.warning('Message with invalid type: %s', stanza.getType())
log.warning(stanza)
- self._client.send(ErrorStanza(stanza, ERR_BAD_REQUEST))
+ self._client.send_stanza(ErrorStanza(stanza, ERR_BAD_REQUEST))
raise NodeProcessed
properties.jid = stanza.getFrom()
diff --git a/nbxmpp/modules/location.py b/nbxmpp/modules/location.py
index 5fe2252..88ac35d 100644
--- a/nbxmpp/modules/location.py
+++ b/nbxmpp/modules/location.py
@@ -37,7 +37,7 @@ class Location:
priority=16),
]
- def _process_pubsub_location(self, _con, _stanza, properties):
+ def _process_pubsub_location(self, _client, _stanza, properties):
if not properties.is_pubsub_event:
return
diff --git a/nbxmpp/modules/message.py b/nbxmpp/modules/message.py
index 8a708eb..23c4022 100644
--- a/nbxmpp/modules/message.py
+++ b/nbxmpp/modules/message.py
@@ -41,7 +41,7 @@ class BaseMessage:
priority=10),
]
- def _process_message_base(self, _con, stanza, properties):
+ def _process_message_base(self, _client, stanza, properties):
properties.type = self._parse_type(stanza)
# Determine remote JID
@@ -72,7 +72,7 @@ class BaseMessage:
properties.error = error_factory(stanza)
@staticmethod
- def _process_message_after_base(_con, stanza, properties):
+ def _process_message_after_base(_client, stanza, properties):
# This handler runs after decryption handlers had the chance
# to decrypt the body
properties.body = stanza.getBody()
diff --git a/nbxmpp/modules/mood.py b/nbxmpp/modules/mood.py
index 00cd755..7f02025 100644
--- a/nbxmpp/modules/mood.py
+++ b/nbxmpp/modules/mood.py
@@ -38,7 +38,7 @@ class Mood:
priority=16),
]
- def _process_pubsub_mood(self, _con, stanza, properties):
+ def _process_pubsub_mood(self, _client, stanza, properties):
if not properties.is_pubsub_event:
return
diff --git a/nbxmpp/modules/muc.py b/nbxmpp/modules/muc.py
index 6df191d..28c96e1 100644
--- a/nbxmpp/modules/muc.py
+++ b/nbxmpp/modules/muc.py
@@ -94,7 +94,7 @@ class MUC:
]
@staticmethod
- def _process_muc_presence(_con, stanza, properties):
+ def _process_muc_presence(_client, stanza, properties):
muc = stanza.getTag('x', namespace=NS_MUC)
if muc is None:
return
@@ -103,7 +103,7 @@ class MUC:
properties.muc_jid.setBare()
properties.muc_nickname = properties.jid.getResource()
- def _process_muc_user_presence(self, _con, stanza, properties):
+ def _process_muc_user_presence(self, _client, stanza, properties):
muc_user = stanza.getTag('x', namespace=NS_MUC_USER)
if muc_user is None:
return
@@ -162,7 +162,7 @@ class MUC:
properties.muc_user = self._parse_muc_user(muc_user)
- def _process_groupchat_message(self, _con, stanza, properties):
+ def _process_groupchat_message(self, _client, stanza, properties):
properties.from_muc = True
properties.muc_jid = properties.jid.copy()
properties.muc_jid.setBare()
@@ -179,7 +179,7 @@ class MUC:
properties.muc_ofrom = JID(address.getAttr('jid'))
@staticmethod
- def _process_message(_con, stanza, properties):
+ def _process_message(_client, stanza, properties):
muc_user = stanza.getTag('x', namespace=NS_MUC_USER)
if muc_user is None:
return
@@ -230,7 +230,7 @@ class MUC:
properties.muc_status_codes = codes
@staticmethod
- def _process_direct_invite(_con, stanza, properties):
+ def _process_direct_invite(_client, stanza, properties):
direct = stanza.getTag('x', namespace=NS_CONFERENCE)
if direct is None:
return
@@ -252,7 +252,7 @@ class MUC:
properties.muc_invite = InviteData(**data)
@staticmethod
- def _process_mediated_invite(_con, stanza, properties):
+ def _process_mediated_invite(_client, stanza, properties):
muc_user = stanza.getTag('x', namespace=NS_MUC_USER)
if muc_user is None:
return
@@ -292,7 +292,7 @@ class MUC:
return
@staticmethod
- def _process_voice_request(_con, stanza, properties):
+ def _process_voice_request(_client, stanza, properties):
data_form = stanza.getTag('x', namespace=NS_DATA)
if data_form is None:
return
@@ -324,7 +324,7 @@ class MUC:
form = voice_request.form
form.type_ = 'submit'
form['muc#request_allow'].value = True
- self._client.send(Message(to=muc_jid, payload=form))
+ self._client.send_stanza(Message(to=muc_jid, payload=form))
@call_on_response('_affiliation_received')
def get_affiliation(self, jid, affiliation):
@@ -451,7 +451,7 @@ class MUC:
def set_subject(self, room_jid, subject):
message = Message(room_jid, typ='groupchat', subject=subject)
log.info('Set subject for %s', room_jid)
- self._client.send(message)
+ self._client.send_stanza(message)
def decline(self, room, to, reason=None):
message = Message(to=room)
@@ -459,7 +459,7 @@ class MUC:
decline = muc_user.addChild('decline', attrs={'to': to})
if reason:
decline.setTagData('reason', reason)
- self._client.send(message)
+ self._client.send_stanza(message)
def request_voice(self, room):
message = Message(to=room)
@@ -470,7 +470,7 @@ class MUC:
value='participant',
typ='text-single'))
message.addChild(node=xdata)
- self._client.send(message)
+ self._client.send_stanza(message)
def invite(self, room, to, password, reason=None, continue_=False,
type_=InviteType.MEDIATED):
@@ -480,7 +480,7 @@ class MUC:
else:
invite = self._build_mediated_invite(
room, to, reason, password, continue_)
- self._client.send(invite)
+ self._client.send_stanza(invite)
@staticmethod
def _build_direct_invite(room, to, reason, password, continue_):
@@ -520,7 +520,7 @@ class MUC:
message = Message(typ='error', to=room_jid)
message.setID(message_id)
message.setError(ERR_NOT_ACCEPTABLE)
- self._client.send(message)
+ self._client.send_stanza(message)
@callback
def _default_response(self, stanza):
diff --git a/nbxmpp/modules/muclumbus.py b/nbxmpp/modules/muclumbus.py
index e68bfcf..e6a71eb 100644
--- a/nbxmpp/modules/muclumbus.py
+++ b/nbxmpp/modules/muclumbus.py
@@ -18,6 +18,10 @@
import logging
import json
+import gi
+gi.require_version('Soup', '2.4')
+from gi.repository import Soup
+
from nbxmpp.protocol import NS_MUCLUMBUS
from nbxmpp.protocol import NS_DATA
from nbxmpp.protocol import NS_RSM
@@ -32,14 +36,6 @@ from nbxmpp.util import call_on_response
from nbxmpp.util import callback
from nbxmpp.util import raise_error
-try:
- import gi
- gi.require_version('Soup', '2.4')
- from gi.repository import Soup
- SOUP_AVAILABLE = True
-except (ValueError, ImportError):
- SOUP_AVAILABLE = False
-
log = logging.getLogger('nbxmpp.m.muclumbus')
# API Documentation
@@ -50,9 +46,14 @@ class Muclumbus:
self._client = client
self.handlers = []
- self._soup_session = None
- if SOUP_AVAILABLE:
- self._soup_session = Soup.Session()
+ self._proxy_resolver = None
+ self._soup_session = Soup.Session()
+
+ def set_proxy(self, proxy):
+ if proxy is None:
+ return
+ self._proxy_resolver = proxy.get_resolver()
+ self._soup_session.props.proxy_resolver = self._proxy_resolver
@call_on_response('_parameters_received')
def request_parameters(self, jid):
@@ -90,9 +91,6 @@ class Muclumbus:
def set_http_search(self, uri, keywords, after=None,
callback=None, user_data=None):
- if not SOUP_AVAILABLE:
- raise ImportError('Module Soup not found')
-
search = {'keywords': keywords}
if after is not None:
search['after'] = after
diff --git a/nbxmpp/modules/nickname.py b/nbxmpp/modules/nickname.py
index 0262a64..1da02cb 100644
--- a/nbxmpp/modules/nickname.py
+++ b/nbxmpp/modules/nickname.py
@@ -44,7 +44,7 @@ class Nickname:
priority=40),
]
- def _process_nickname(self, _con, stanza, properties):
+ def _process_nickname(self, _client, stanza, properties):
if stanza.getName() == 'message':
properties.nickname = self._parse_nickname(stanza)
@@ -57,7 +57,7 @@ class Nickname:
return
properties.nickname = self._parse_nickname(stanza)
- def _process_pubsub_nickname(self, _con, _stanza, properties):
+ def _process_pubsub_nickname(self, _client, _stanza, properties):
if not properties.is_pubsub_event:
return
diff --git a/nbxmpp/modules/omemo.py b/nbxmpp/modules/omemo.py
index 859e37e..ba24d42 100644
--- a/nbxmpp/modules/omemo.py
+++ b/nbxmpp/modules/omemo.py
@@ -55,7 +55,7 @@ class OMEMO:
priority=7),
]
- def _process_omemo_message(self, _con, stanza, properties):
+ def _process_omemo_message(self, _client, stanza, properties):
try:
properties.omemo = self._parse_omemo_message(stanza)
log.info('Received message')
@@ -126,7 +126,7 @@ class OMEMO:
return OMEMOMessage(sid=sid, iv=iv, keys=keys, payload=payload)
- def _process_omemo_devicelist(self, _con, stanza, properties):
+ def _process_omemo_devicelist(self, _client, stanza, properties):
if not properties.is_pubsub_event:
return
diff --git a/nbxmpp/modules/oob.py b/nbxmpp/modules/oob.py
index c0de07f..0b1f210 100644
--- a/nbxmpp/modules/oob.py
+++ b/nbxmpp/modules/oob.py
@@ -34,7 +34,7 @@ class OOB:
priority=15),
]
- def _process_message_oob(self, _con, stanza, properties):
+ def _process_message_oob(self, _client, stanza, properties):
oob = stanza.getTag('x', namespace=NS_X_OOB)
if oob is None:
return
diff --git a/nbxmpp/modules/openpgp.py b/nbxmpp/modules/openpgp.py
index 8079098..0b2978d 100644
--- a/nbxmpp/modules/openpgp.py
+++ b/nbxmpp/modules/openpgp.py
@@ -59,7 +59,7 @@ class OpenPGP:
priority=7),
]
- def _process_openpgp_message(self, _con, stanza, properties):
+ def _process_openpgp_message(self, _client, stanza, properties):
openpgp = stanza.getTag('openpgp', namespace=NS_OPENPGP)
if openpgp is None:
log.warning('No openpgp node found')
@@ -80,7 +80,7 @@ class OpenPGP:
log.warning(stanza)
return
- def _process_pubsub_openpgp(self, _con, stanza, properties):
+ def _process_pubsub_openpgp(self, _client, stanza, properties):
if not properties.is_pubsub_event:
return
diff --git a/nbxmpp/modules/pgplegacy.py b/nbxmpp/modules/pgplegacy.py
index 256b89f..0f6f458 100644
--- a/nbxmpp/modules/pgplegacy.py
+++ b/nbxmpp/modules/pgplegacy.py
@@ -39,7 +39,7 @@ class PGPLegacy:
]
@staticmethod
- def _process_signed(_con, stanza, properties):
+ def _process_signed(_client, stanza, properties):
signed = stanza.getTag('x', namespace=NS_SIGNED)
if signed is None:
return
@@ -47,7 +47,7 @@ class PGPLegacy:
properties.signed = signed.getData()
@staticmethod
- def _process_pgplegacy_message(_con, stanza, properties):
+ def _process_pgplegacy_message(_client, stanza, properties):
pgplegacy = stanza.getTag('x', namespace=NS_ENCRYPTED)
if pgplegacy is None:
log.warning('No x node found')
diff --git a/nbxmpp/modules/presence.py b/nbxmpp/modules/presence.py
index f9e3bc2..bebb2fa 100644
--- a/nbxmpp/modules/presence.py
+++ b/nbxmpp/modules/presence.py
@@ -37,7 +37,7 @@ class BasePresence:
priority=10),
]
- def _process_presence_base(self, _con, stanza, properties):
+ def _process_presence_base(self, _client, stanza, properties):
properties.type = self._parse_type(stanza)
properties.priority = self._parse_priority(stanza)
properties.show = self._parse_show(stanza)
@@ -79,7 +79,7 @@ class BasePresence:
except ValueError:
log.warning('Presence with invalid type received')
log.warning(stanza)
- self._client.send(ErrorStanza(stanza, ERR_BAD_REQUEST))
+ self._client.send_stanza(ErrorStanza(stanza, ERR_BAD_REQUEST))
raise NodeProcessed
@staticmethod
diff --git a/nbxmpp/modules/pubsub.py b/nbxmpp/modules/pubsub.py
index 2f8d1a2..3967568 100644
--- a/nbxmpp/modules/pubsub.py
+++ b/nbxmpp/modules/pubsub.py
@@ -50,7 +50,7 @@ class PubSub:
priority=15),
]
- def _process_pubsub_base(self, _con, stanza, properties):
+ def _process_pubsub_base(self, _client, stanza, properties):
properties.pubsub = True
event = stanza.getTag('event', namespace=NS_PUBSUB_EVENT)
diff --git a/nbxmpp/modules/receipts.py b/nbxmpp/modules/receipts.py
index 329e88a..2056efe 100644
--- a/nbxmpp/modules/receipts.py
+++ b/nbxmpp/modules/receipts.py
@@ -38,7 +38,7 @@ class Receipts:
priority=15),
]
- def _process_message_receipt(self, _con, stanza, properties):
+ def _process_message_receipt(self, _client, stanza, properties):
request = stanza.getTag('request', namespace=NS_RECEIPTS)
if request is not None:
properties.receipt = ReceiptData(request.getName())
diff --git a/nbxmpp/modules/security_labels.py b/nbxmpp/modules/security_labels.py
index 04e119d..ac29d11 100644
--- a/nbxmpp/modules/security_labels.py
+++ b/nbxmpp/modules/security_labels.py
@@ -35,7 +35,7 @@ class SecurityLabels:
priority=15),
]
- def _process_message_security_label(self, _con, stanza, properties):
+ def _process_message_security_label(self, _client, stanza, properties):
security = stanza.getTag('securitylabel', namespace=NS_SECLABEL)
if security is None:
return
diff --git a/nbxmpp/modules/software_version.py b/nbxmpp/modules/software_version.py
index c23188c..23d06b5 100644
--- a/nbxmpp/modules/software_version.py
+++ b/nbxmpp/modules/software_version.py
@@ -101,5 +101,5 @@ class SoftwareVersion:
log.info('Send software version: %s %s %s',
self._name, self._version, self._os)
- self._client.send(iq)
+ self._client.send_stanza(iq)
raise NodeProcessed
diff --git a/nbxmpp/modules/tune.py b/nbxmpp/modules/tune.py
index 6ce4b0f..15bc610 100644
--- a/nbxmpp/modules/tune.py
+++ b/nbxmpp/modules/tune.py
@@ -37,7 +37,7 @@ class Tune:
priority=16),
]
- def _process_pubsub_tune(self, _con, _stanza, properties):
+ def _process_pubsub_tune(self, _client, _stanza, properties):
if not properties.is_pubsub_event:
return
diff --git a/nbxmpp/modules/user_avatar.py b/nbxmpp/modules/user_avatar.py
index fb79c96..b7a33ee 100644
--- a/nbxmpp/modules/user_avatar.py
+++ b/nbxmpp/modules/user_avatar.py
@@ -45,7 +45,7 @@ class UserAvatar:
priority=16),
]
- def _process_pubsub_avatar(self, _con, stanza, properties):
+ def _process_pubsub_avatar(self, _client, stanza, properties):
if not properties.is_pubsub_event:
return
diff --git a/nbxmpp/modules/vcard_avatar.py b/nbxmpp/modules/vcard_avatar.py
index c47d5ed..6e929be 100644
--- a/nbxmpp/modules/vcard_avatar.py
+++ b/nbxmpp/modules/vcard_avatar.py
@@ -36,7 +36,7 @@ class VCardAvatar:
]
@staticmethod
- def _process_avatar(_con, stanza, properties):
+ def _process_avatar(_client, stanza, properties):
if properties.type != PresenceType.AVAILABLE:
return