_handle_groupchat(): get correct origin-id stanza

The problem is that in _handle_groupchat() we look for
STANZA_NS_STABLE_ID which will result in origin-id or stanza-id.
It seems like prosody servers send origin-id first, so this worked in
all my tests. But actually we cannot be sure of the order.
So far we stopped after the first element was found.

I only found xmpp_stanza_get_child_by_ns() and
xmpp_stanza_get_child_by_name() in libstrophe. But we need a combination
of both.

So I created stanza_get_child_by_name_and_ns() for Profanity. I need to
remember to upstream this to libstrophe later (if they really don't have
such a function).

Fix https://github.com/profanity-im/profanity/issues/1223
This commit is contained in:
Michael Vetter
2019-11-08 15:05:49 +01:00
parent cbd85ffd1a
commit 68af0aad65
3 changed files with 22 additions and 2 deletions

View File

@@ -349,4 +349,6 @@ char* stanza_text_strdup(xmpp_stanza_t *stanza);
XMPPCaps* stanza_parse_caps(xmpp_stanza_t *const stanza);
void stanza_free_caps(XMPPCaps *caps);
xmpp_stanza_t* stanza_get_child_by_name_and_ns(xmpp_stanza_t * const stanza, const char * const name, const char * const ns);
#endif