diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2016-05-17 20:55:45 +0200 |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2016-05-17 20:55:45 +0200 |
commit | 4f009e64fc11ca352443e6a9df5fa4d7cb715f5c (patch) | |
tree | 824bdf4424e3ec80a6a66d82eef0e3fa18ceba82 /test/ejabberd_SUITE.erl | |
parent | Move CSI queue handling into mod_client_state (diff) |
mod_client_state: Queue chat state notifications
Queue standalone chat states instead of simply dropping them when the
client is inactive. Only the most recent chat state of a given client
is queued.
Diffstat (limited to 'test/ejabberd_SUITE.erl')
-rw-r--r-- | test/ejabberd_SUITE.erl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/ejabberd_SUITE.erl b/test/ejabberd_SUITE.erl index aa465fb6..f3f7ebde 100644 --- a/test/ejabberd_SUITE.erl +++ b/test/ejabberd_SUITE.erl @@ -2257,13 +2257,15 @@ client_state_master(Config) -> Message = ChatState#message{body = [#text{data = <<"body">>}]}, %% Wait for the slave to become inactive. wait_for_slave(Config), - %% Should be dropped: - send(Config, ChatState), %% Should be queued (but see below): send(Config, Presence), %% Should replace the previous presence in the queue: send(Config, Presence#presence{type = unavailable}), - %% Should be sent immediately, together with the previous presence: + %% Should be queued (but see below): + send(Config, ChatState), + %% Should replace the previous chat state in the queue: + send(Config, ChatState#message{sub_els = [#chatstate{type = composing}]}), + %% Should be sent immediately, together with the queued stanzas: send(Config, Message), %% Wait for the slave to become active. wait_for_slave(Config), @@ -2278,6 +2280,9 @@ client_state_slave(Config) -> ?recv1(#presence{from = Peer, type = unavailable, sub_els = [#delay{}]}), ?recv1(#message{from = Peer, thread = <<"1">>, + sub_els = [#chatstate{type = composing}, + #delay{}]}), + ?recv1(#message{from = Peer, thread = <<"1">>, body = [#text{data = <<"body">>}], sub_els = [#chatstate{type = active}]}), change_client_state(Config, active), |