from scenarios import *
scenario = (
scenarios.simple_channel_join.scenario,
# Second user joins, from two resources
send_stanza(""),
sequences.connection("irc.localhost", '{jid_two}/{resource_one}'),
expect_unordered(
["/presence/muc_user:x/muc_user:item[@affiliation='none'][@role='participant']"],
["/presence/muc_user:x/muc_user:item[@affiliation='admin'][@role='moderator']"],
["/presence/muc_user:x/muc_user:status[@code='110']"],
["/message/subject"]
),
# Second resource
send_stanza(""),
expect_stanza("/presence[@to='{jid_two}/{resource_two}'][@from='#foo%{irc_server_one}/{nick_one}']"),
expect_stanza("/presence[@to='{jid_two}/{resource_two}'][@from='#foo%{irc_server_one}/{nick_two}']",
"/presence/muc_user:x/muc_user:status[@code='110']"
),
expect_stanza("/message[@from='#foo%{irc_server_one}'][@type='groupchat'][@to='{jid_two}/{resource_two}']/subject[not(text())]"),
# Moderator kicks participant
send_stanza("- reported
"),
expect_unordered(
[
"/presence[@type='unavailable'][@to='{jid_two}/{resource_one}']/muc_user:x/muc_user:item[@role='none']/muc_user:actor[@nick='{nick_one}']",
"/presence/muc_user:x/muc_user:item/muc_user:reason[text()='reported']",
"/presence/muc_user:x/muc_user:status[@code='307']",
"/presence/muc_user:x/muc_user:status[@code='110']"
],
[
"/presence[@type='unavailable'][@to='{jid_two}/{resource_two}']/muc_user:x/muc_user:item[@role='none']/muc_user:actor[@nick='{nick_one}']",
"/presence/muc_user:x/muc_user:item/muc_user:reason[text()='reported']",
"/presence/muc_user:x/muc_user:status[@code='307']",
"/presence/muc_user:x/muc_user:status[@code='110']"
],
["/presence[@type='unavailable']/muc_user:x/muc_user:item[@role='none']/muc_user:actor[@nick='{nick_one}']",
"/presence/muc_user:x/muc_user:item/muc_user:reason[text()='reported']",
"/presence/muc_user:x/muc_user:status[@code='307']",
],
[
"/iq[@id='kick1'][@type='result']"
]
),
)