Check for correct delay tag for muc timestamps

https://github.com/profanity-im/profanity/issues/1190 had another issue:
Sometimes servers send multiple </delay> and we just checked the first
one we got and only used it if the 'from' attribute was fitting.
However it could be that we actually wanted the second </delay> element
and there the 'from' would have been right.

So we need to loop through them until we get the one with the fitting
'from'.

Fix https://github.com/profanity-im/profanity/issues/1190
This commit is contained in:
Michael Vetter
2019-11-12 14:47:57 +01:00
parent ccb4d919b1
commit 61f66966dd
3 changed files with 42 additions and 19 deletions

View File

@@ -267,7 +267,7 @@ xmpp_stanza_t* stanza_create_mediated_invite(xmpp_ctx_t *ctx, const char *const
gboolean stanza_contains_chat_state(xmpp_stanza_t *stanza);
GDateTime* stanza_get_delay(xmpp_stanza_t *const stanza);
GDateTime* stanza_get_delay_from(xmpp_stanza_t *const stanza, gchar **from);
GDateTime* stanza_get_delay_from(xmpp_stanza_t *const stanza, gchar *from);
gboolean stanza_is_muc_presence(xmpp_stanza_t *const stanza);
gboolean stanza_is_muc_self_presence(xmpp_stanza_t *const stanza,