Commit Graph

485 Commits

Author SHA1 Message Date
mathieui
6c52843d71 XEP-0363: Add 0363 to the extension list 2020-12-04 18:55:55 +01:00
mathieui
70cf35e9bf XEP-0444: Fix session_bind()
wrong method called: remove_feature instead of del_feature
2020-12-04 18:34:27 +01:00
Emmanuel Gil Peyrot
203628d707 XEP-0353: Jingle Message Initiation 2020-12-04 12:38:59 +01:00
mathieui
4da1c8573e XEP-0045: Register the missing invite/decline element 2020-12-04 00:22:22 +01:00
mathieui
fa7e33110f XEP-0045: Misc small fixes. 2020-12-03 23:28:27 +01:00
mathieui
7033bc0061 XEP-0045: Better invitation handling 2020-12-03 23:28:27 +01:00
mathieui
98b9a6f9e3 XEP-0045: Remove "self" returns from stanza methods 2020-12-03 23:28:27 +01:00
mathieui
de548fbcce XEP-0045: Add status_codes interface to the MUC element 2020-12-03 23:28:27 +01:00
mathieui
4eb2bb7da8 ElementBase: serialize JID objects as strings automatically
This is a shortcut to avoid defining custom methods each time a
substanza containing a JID exists in a plugin.

Same thing with attributes, there is no place where we do not want this.
2020-12-02 19:17:33 +01:00
mathieui
350f85a8d1 XEP-0403: MIX-Presence 2020-12-02 19:17:33 +01:00
mathieui
b62ea49de3 XEP-0404: MIX-Anon: JID hidden channels
(not found)
2020-12-02 19:17:33 +01:00
mathieui
bdc12c00c6 XEP-0405: MIX-PAM 2020-12-02 19:17:33 +01:00
mathieui
51cc459bd0 XEP-0369: MIX-Core 2020-12-02 19:17:33 +01:00
mathieui
b27510f05b XEP-0047: Fix the max sequence number
The max seq allowed according to the XEP is 65535, therefore we must
modulo using 65536 to allow that value.
2020-12-01 20:13:34 +01:00
mathieui
c3a6352a6b Merge branch 'fix-xep_0115-disco-component' into 'master'
Fix 'from' attribute missing for ComponentXMPP Disco IQ

Closes #3455

See merge request poezio/slixmpp!60
2020-11-27 20:06:53 +01:00
mathieui
a245ba54bd Remove protoxep_occupantid
And fix some minor details in 0421 plugin.
2020-11-27 20:02:03 +01:00
mathieui
ddc3974d1b Update protoxep_reactions to XEP-0444 2020-11-27 19:44:13 +01:00
mathieui
a9a7bdc6c3 XEP-0045: update methods for asyncio & stanza, typing
- This rewrites most of the stuff in the plugin by using the newly added
  elements instead of raw ElementTree stuff with hardcoded namespaces.
- Adds methods for affiliation/roles
- Adds some type hints
- Fix many cases where the call would simply not work since slixmpp
  exists (and break the API but it was already broken ¯\_(ツ)_/¯)
2020-11-26 20:47:21 +01:00
mathieui
fe68d19f91 XEP-0045: register the new elements & reformat init 2020-11-22 18:11:18 +01:00
mathieui
fe46643f2f XEP-0045: add more stanza elements 2020-11-22 18:11:18 +01:00
Maxime Buquet
985505297c Merge branch 'master' into 'master'
Cancel run_filters task upon disconnect

See merge request poezio/slixmpp!57
2020-10-01 17:15:06 +02:00
Maxime Buquet
0b38eeaa4a Merge branch 'xep-0363-callback-fix' into 'master'
XEP-0363 fix: call callback when receiving the upload slot.

See merge request poezio/slixmpp!58
2020-10-01 13:52:28 +02:00
Maxime “pep” Buquet
57c8196d9c
StanzaBase.send: remove inexisting param in docstring -- thanks elghinn
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-10-01 13:06:37 +02:00
aearil
f90713cb9e Fix 'from' attribute missing for ComponentXMPP Disco IQ
Fixes #3455

This reuses the 'to' attribute of the received presence as a 'from' for
the Disco IQ. I don't know if this is the best way to do it, but in
testing with a simple component it fixed the error.

Also I'm not sure whether pres['to'] would also be valid when
is_component is False.
2020-08-05 20:35:30 -04:00
cnngimenez
9c7f3d59d8 XEP-363 fix: call callback when receiving the upload slot. 2020-06-28 21:01:40 -03:00
ehendrix23
145bb7a36e Cancel run_filters task upon disconnect 2020-06-12 19:03:58 +02:00
Maxime “pep” Buquet
67fb5fe4c3 XEP-0045: register_stanza_plgin(Message, MUCMessage)
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-29 23:35:31 +02:00
Maxime “pep” Buquet
605a58a864 XEP-0045: Split __init__
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-29 23:35:31 +02:00
Maxime “pep” Buquet
a3d343b253 XEP-0045: Add MUCMessage
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-29 23:35:31 +02:00
Maxime “pep” Buquet
d58f59980f XEP-0045: Remove unused MUCPresence attributes
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-29 23:35:31 +02:00
Maxime “pep” Buquet
9e8ac6b769 XEP-0045: Add some types in stanza
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-29 23:35:31 +02:00
Maxime “pep” Buquet
3b3eed544e
XEP-0045: Add stanza.NS* consts
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-29 17:27:51 +02:00
Maxime “pep” Buquet
03ee9bc4cc
XEP-0045: Split stanza into sub-module
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-29 17:25:18 +02:00
Maxime “pep” Buquet
4fad5c62ce
XEP-0045: Remove useless Python2-ness
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-29 14:15:28 +02:00
Maxime “pep” Buquet
5ccae3ce2a
XEP-0045: Change to a package module
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-29 14:15:04 +02:00
Maxime “pep” Buquet
a29ce4b547
XEP-0421: Add shorthand to namespace
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-27 23:45:41 +02:00
Maxime “pep” Buquet
07b1a4c1cd XEP-0421: add has_feature helper
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-27 22:39:52 +02:00
Maxime “pep” Buquet
cec34686fc New XEP: 0421 Occupant-id
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-27 22:39:52 +02:00
mathieui
28123083f7 Add stanza tests for 0377 2020-05-24 15:00:20 +02:00
mathieui
ef961392be Enforce <spam/> and <abuse/> quantity constraints 2020-05-24 13:46:47 +02:00
mathieui
2e31de3f45 Add a plugin for XEP-0377: spam reporting 2020-05-24 13:33:51 +02:00
mathieui
c7bd224182 Update version to 1.5.2 2020-05-23 23:43:27 +02:00
Maxime “pep” Buquet
b62f0e90c1
xep_0045: don't create empty item
Only create an item if an attribute is set. Don't create it when reading
if it wasn't already present.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-20 00:37:46 +02:00
Maxime “pep” Buquet
c7cd2fcf33
xep_0363: pass more information to FileTooBig exception
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-12 01:49:56 +02:00
Maxime “pep” Buquet
4aa35c11ab
xep_0363: Ensure every form in disco#info is read
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-05-12 01:03:50 +02:00
mathieui
0dd32be7f5 Update version to 1.5.1
1.5.0 changed what could be expected to be sent before calling
  disconnect(), this fixes it.
2020-05-02 19:39:21 +02:00
mathieui
f884b67b8b Fix a regression introduced in 1.5.0
Due to the send queue, messages sent immediatly before calling
"disconnect" would not be sent.
2020-05-02 17:17:08 +02:00
mathieui
3dcb96d9d8 Update version to 1.5.0 2020-05-01 15:26:24 +02:00
Maxime “pep” Buquet
c3fbc6cb80 xep_0196: Use correct tag local name (thanks ivucica)
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2020-04-06 12:57:12 +02:00
mathieui
9126bd8392 Merge branch 'fix-deprecations' into 'master'
Fix deprecation warning regarding invalid escape sequences.

See merge request poezio/slixmpp!40
2020-04-04 18:53:15 +02:00
jheling
2add94f5b0
Fix TypeError: 'NoneType' object is not an iterator
When deleting sub-elements in a stanza.
2020-04-04 18:42:48 +02:00
Karthikeyan Singaravelan
5fc757f200 Fix deprecation warning regarding invalid escape sequences. 2020-04-04 16:08:44 +00:00
mathieui
98108d0445 Merge branch 'fix-celementtree-import' into 'master'
cElementTree has been deprecated since Python 3.3 and removed in Python 3.9.

See merge request poezio/slixmpp!38
2020-04-04 17:55:11 +02:00
Georg Lukas
5be46a5e68 fire 'disconnected' callback from abort() 2020-04-04 13:16:33 +02:00
Georg Lukas
ab9040c30e expose is_connecting state based on connection attempt future 2020-04-04 13:16:31 +02:00
Maxime Buquet
a16e2a0f6c Merge branch 'fix-0198' into 'master'
XEP-0198: unset end_session_on_disconnect on resume/enable

See merge request poezio/slixmpp!36
2020-03-29 14:28:06 +02:00
Georg Lukas
6c28b49e7f XEP-0198: unset end_session_on_disconnect on resume/enable 2020-03-29 14:21:40 +02:00
Georg Lukas
621255027d Reset reconnect delay on manual reconnect, add delay event
This is just a hotfix workaround for an underlying problem. The
`_connect_routine` code is "blocking" (in an async way) for
`connect_loop_wait` seconds, so that a fresh-started manual reconnect
will be silenty delayed. This code does the following changes:

1. It moves the delay to before the DNS resolution (with the exponential
   back-off it might well be that the DNS records are changed while
   slixmpp is waiting).

2. It adds a new event `reconnect_delay` that gets passed the number of
   seconds it will delay before actually reconnecting

3. It resets the `connect_loop_wait` timer on a manual connect/reconnect
   call to fix the interactive experience.

A *proper fix* would replace the sleep in `_connect_routine` with a
properly timered re-invocation of it, but I don't understand enough of
asyncio for pulling off that magic, and this is actually a proper
improvement. Also I tested this and it works!
2020-03-29 14:21:05 +02:00
Maxime Buquet
efe316dc8c Merge branch 'fix-0198' into 'master'
XEP-0198: properly disable on disconnect, fix reconnect-loop

See merge request poezio/slixmpp!34
2020-03-28 22:11:52 +01:00
Georg Lukas
85c9967b9c XEP-0198: fix race conditions on enable/resume
This code splits out the `enabled` property into `enabled_in` and
`enabled_out` to reflect that client and server enable 0198
asynchronously.

This also moves the actual enabling code into the stanza processing
logic, because apparently, `enable.send()` was just added into the end
of the send queue, but `enable` got enabled immediately, so that poezio
requested ACKs for whatever happened to be in the queue before.

Async is hard, let's go get fishing.
2020-03-28 21:49:18 +01:00
Georg Lukas
deb6d4f176 XEP-0198: properly disable on disconnect, fix reconnect-loop
When the connection is disconnected (but the session didn't "end",
because 0198 resumption is enabled), poezio will reconnect and try to
send an <r/> element because the 0198 plugin doesn't realize that SM
wasn't re-enabled yet.
2020-03-28 20:50:55 +01:00
Karthikeyan Singaravelan
7218bb4499 cElementTree has been deprecated since Python 3.3 and removed in Python 3.9. 2020-03-28 04:42:23 +00:00
Georg Lukas
d85efec7a2 reconnect: fix callback when not currently connected
The 'disconnected' event is normally fired from connection_lost(), which
is called by the connection code when the connection is lost after being
established. However, if the connection wasn't successfully established,
a manual /reconnect no-ops because it waits for the 'disconnected'
callback which never fires. This patch does two things:

1. Immediately fire a 'disconnected' event in disconnect() if there is
   no transport.

2. Register the 'disconnected' event handler in reconnect() *before* it
   can be fired.
2020-03-23 18:59:29 +01:00
mathieui
a0f5cb6e09
Put the queue exception at toplevel 2019-12-27 15:27:29 +01:00
mathieui
110bbf8afc
Improve the send queue code a bit 2019-12-27 15:27:29 +01:00
mathieui
d97efa0bd8
add a separate place for slow ass filters 2019-12-27 15:27:29 +01:00
mathieui
672f1b28f6
raise Exception 2019-12-27 15:27:29 +01:00
mathieui
27d3ae958b
Try/except around outbound stanza processing
to avoid killing the send loop when a filter has an error
2019-12-27 15:27:29 +01:00
mathieui
a32794ec35
Remove trailing whitespace 2019-12-27 15:27:28 +01:00
mathieui
a83c00e933
Update test framework to work with new filters
(eewww)
2019-12-27 15:27:28 +01:00
mathieui
31f6ef6814
Run the send queue in a separate coroutine
To be able to run async stream filters
2019-12-27 15:27:25 +01:00
Maxime “pep” Buquet
9b3874b5df
xep_0048: Ensure Conference jid is of type str when given a JID
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-11-11 14:00:19 +01:00
mathieui
0139fb291e
Fix a bug in the 0202 plugin where a time result would send back a result
poezio bug #3499
2019-09-19 22:54:53 +02:00
mathieui
e58988484a
Match the sender JID as well as the queryid in MAM results 2019-09-10 23:13:04 +02:00
mathieui
5d5e5cda19
Add typing/docstring in the MAM plugin 2019-09-10 22:44:46 +02:00
root
11f707987d Added amount parameter, so that limit on the msgs received per query can be changed. 2019-09-08 14:22:48 +02:00
Maxime “pep” Buquet
db13794e0f Revert "Remove a block of compatibility code"
This reverts commit 37bc1bb9b3.

Confusion confusion. Mathieui thought this was a sleekxmpp thing when
it's actually been added not so long ago.
2019-08-28 00:12:10 +02:00
mathieui
37bc1bb9b3
Remove a block of compatibility code
even if the user makes that mistake, it does not cause problems down the
line.
2019-08-26 12:00:38 +02:00
mathieui
9be30e5291
fix a typo in the invalidjid exception name case 2019-08-25 01:42:00 +02:00
Maxime “pep” Buquet
3253d34c0a basexmpp: Make origin-id opt-out
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-08-23 17:09:21 +02:00
Maxime “pep” Buquet
fef575ee1a Implement origin-id (XEP-0359)
This XEP is not implemented as a plugin but directly into Message.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-08-23 17:09:21 +02:00
root
dd8ac8fc87 Assign True to the 'before' tag if it's value is None (eg:at the start no msg is there in the group, so no stanza-id) 2019-08-23 04:39:20 +05:30
root
89fa9dc1dd Removed before tag. (Code for setting it is already there) 2019-08-23 00:21:42 +05:30
root
d7729e8683 Removed assigning 'reverse' value to the 'before' tag (It's value is set in xep_0313 (mam.py file) and if not then by default it is takes as 'None'). 2019-08-23 00:15:56 +05:30
Madhur Garg
b0e688eb35 Added <before> tag for querying messages before a stanza-id. 2019-08-12 23:39:01 +05:30
Maxime “pep” Buquet
0e7176483b
xep_0030: add docstring to get_info_from_domain
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-08-03 16:05:09 +02:00
Emmanuel Gil Peyrot
f35569a2c1 Remove the last instances of a block argument to iq.send().
Thanks Madhur Garg for spotting this in
027ce2434d7fd3cf4a286dd373cb761c0d114c66!
2019-08-01 22:36:59 +02:00
Link Mauve
bec6f7c8f3 Merge branch 'mam' into 'master'
Removed 'block' from set_preferences as it was giving a TypeError while sending the staza.

See merge request poezio/slixmpp!20
2019-08-01 22:30:58 +02:00
Madhur Garg
027ce2434d Removed 'block' from set_preferences as it was giving a TypeError while sending the staza. 2019-08-02 01:57:36 +05:30
Maxime Buquet
d57fbb57a2 Merge branch 'mam' into 'master'
Added a function in xep313 plugin to get current MAM preferences.

See merge request poezio/slixmpp!19
2019-07-22 22:05:05 +02:00
Madhur Garg
85cd7a9166 Added a function to get current MAM preferences. 2019-07-18 16:55:11 +05:30
Maxime “pep” Buquet
d50d996c68
xmlstream/stanzabase: remove unused interfaces and types attributes
These are already on each stanza, and were not applicable to all stanzas
anyway.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-07-16 11:26:54 +02:00
mathieui
371ad20ca7
Do not add disco#info for occupantid, it’s a server thing 2019-07-14 13:25:22 +02:00
mathieui
5f49df6b56
Add the occupant id stanza elements 2019-07-14 13:13:59 +02:00
mathieui
b50bfb2f34
Initial commit for reactions protoxep 2019-07-13 19:44:32 +02:00
Maxime “pep” Buquet
b29bb30eb7
Make generated stanza id truly random
Fix long-standing security issues where stanza @id be predictable.

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-07-13 14:07:31 +02:00
Maxime “pep” Buquet
4435c81d77 xmlstream.disconnect: add compat behaviour, set wait to default 2.0 when True is passed. Update documentation
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-07-03 21:36:17 +02:00
Madhur Garg
2638ba2744 Added 'reverse' argument. 2019-07-03 14:18:33 +05:30
Madhur Garg
dbc9758311 Added 'reverse' parameter in mam and rsm plugins 2019-07-03 10:31:18 +05:30
Maxime “pep” Buquet
47968963b1
Revert part of previous commit. Return NotImplemented when object is not a valid JID
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-05-07 11:56:39 +01:00