Open pdorofiejczyk opened 5 years ago
Sorry for such a late response. Usually, regular XMPP clients sends initial presence to the server just after establishing the session and waits for the presence reply. This is what escalus_story
tries to simulate in https://github.com/esl/escalus/blob/master/src/escalus_story.erl#L133-L134. You can set your own initial_activity
if you don't want to send the initial presence.
It is ok that client sends initial presence. The wrong thing is that escalus waits ONLY for presence reply. It means that server should not send offline messages to client until it send presence reply first. I 'm using ejabberd server version 18.04 and default mod_offline, sends offline messages before presence reply. What's more this behaviour of escalus is not consistent with XEP-0160 (https://xmpp.org/extensions/xep-0160.html).
I see your point. You can change the way escalus_story
behaves by providing other function to initial_activity
by setting is in escalus_overrides
. Sth like the following should work
[{escalus_overrides,
[{initial_activity, [{your_module, your_function}]}]} | Config]
In your function you can stop sending the initial presence, or send it but consume all the offline messages.
Please consult the escalus_overridables
module for more details.
I'm trying to test offline messages using escalus. When I'm trying to start escalus story for user who have offline messages, I'm getting following error:
Short investigation shows that escalus story aways wait for presences after starting client (https://github.com/esl/escalus/blob/master/src/escalus_story.erl#L136) but this behaviour is not fully correct in my case.