summaryrefslogtreecommitdiff
path: root/tests/end_to_end/scenarios/multisessionnick.py
diff options
context:
space:
mode:
authorJonas Schäfer <j.wielicki@sotecware.net>2019-10-10 21:15:09 +0200
committerlouiz’ <louiz@louiz.org>2020-09-23 23:20:47 +0200
commitf8da92a8bed4fccff5e1999460b6ad3723d247f3 (patch)
treecdd299593a800715dd396be428759a3e2c46d187 /tests/end_to_end/scenarios/multisessionnick.py
parent5900c19c22aad36c9dbb6f0ccecf66510def722b (diff)
downloadbiboumi-f8da92a8bed4fccff5e1999460b6ad3723d247f3.tar.gz
biboumi-f8da92a8bed4fccff5e1999460b6ad3723d247f3.tar.bz2
biboumi-f8da92a8bed4fccff5e1999460b6ad3723d247f3.tar.xz
biboumi-f8da92a8bed4fccff5e1999460b6ad3723d247f3.zip
Always send direct messages to the user’s bare JID
This has the following advantages: - Works while all resources are offline (persistent channels) - Helps with combating duplicate messages when sent to different resources, resources going offline, carbon-copying etc. etc. As a side effect, this also makes the MUC PMs not be MUC PMs and always be emitted from the server-wide JID of the sending user. Fixes #3313.
Diffstat (limited to 'tests/end_to_end/scenarios/multisessionnick.py')
-rw-r--r--tests/end_to_end/scenarios/multisessionnick.py24
1 files changed, 7 insertions, 17 deletions
diff --git a/tests/end_to_end/scenarios/multisessionnick.py b/tests/end_to_end/scenarios/multisessionnick.py
index 2fd84f9..1377a94 100644
--- a/tests/end_to_end/scenarios/multisessionnick.py
+++ b/tests/end_to_end/scenarios/multisessionnick.py
@@ -51,20 +51,10 @@ scenario = (
# That second user sends a private message to the first one
send_stanza("<message from='{jid_two}/{resource_one}' to='#foo%{irc_server_one}/{nick_one}' type='chat'><body>RELLO</body></message>"),
- # Message is received with a server-wide JID, by the two resources behind nick_one
- expect_unordered(
- [
- "/message[@from='{lower_nick_two}%{irc_server_one}'][@to='{jid_one}/{resource_one}'][@type='chat']/body[text()='RELLO']",
- "/message/hints:no-copy",
- "/message/carbon:private",
- "!/message/muc_user:x",
- ],
- [
- "/message[@from='{lower_nick_two}%{irc_server_one}'][@to='{jid_one}/{resource_two}'][@type='chat']/body[text()='RELLO']",
- "/message/hints:no-copy",
- "/message/carbon:private",
- "!/message/muc_user:x",
- ]
+ # Message is received with a server-wide JID to the bare JID as non-MUC-PM
+ expect_stanza(
+ "/message[@from='{lower_nick_two}%{irc_server_one}'][@to='{jid_one}'][@type='chat']/body[text()='RELLO']",
+ "!/message/muc_user:x",
),
# First occupant (with the two resources) changes her/his nick to a conflicting one
@@ -117,9 +107,9 @@ scenario = (
send_stanza("<message from='{jid_two}/{resource_one}' to='#foo%{irc_server_one}/{nick_three}' type='chat'><body>first</body></message>"),
send_stanza("<message from='{jid_two}/{resource_one}' to='#foo%{irc_server_one}/{nick_three}' type='chat'><body>second</body></message>"),
- # The first user receives the two messages, on the connected resource, once each
+ # The first user receives the two messages to the bare JID
expect_unordered(
- ["/message[@from='{lower_nick_two}%{irc_server_one}'][@to='{jid_one}/{resource_one}'][@type='chat']/body[text()='first']"],
- ["/message[@from='{lower_nick_two}%{irc_server_one}'][@to='{jid_one}/{resource_one}'][@type='chat']/body[text()='second']"]
+ ["/message[@from='{lower_nick_two}%{irc_server_one}'][@to='{jid_one}'][@type='chat']/body[text()='first']"],
+ ["/message[@from='{lower_nick_two}%{irc_server_one}'][@to='{jid_one}'][@type='chat']/body[text()='second']"]
),
)