From f8da92a8bed4fccff5e1999460b6ad3723d247f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Thu, 10 Oct 2019 21:15:09 +0200 Subject: =?UTF-8?q?Always=20send=20direct=20messages=20to=20the=20user?= =?UTF-8?q?=E2=80=99s=20bare=20JID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- tests/end_to_end/scenarios/multisessionnick.py | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'tests/end_to_end/scenarios/multisessionnick.py') 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("RELLO"), - # 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("first"), send_stanza("second"), - # 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']"] ), ) -- cgit v1.2.3