Rework MUC reflected message filtering

Reflected messages can't be filtered by nick only otherwise you might
ignore messages comming from you on another devices.

Consequently we maintain a list of sent messages id in mucwin.
To be sure the id will be correctly reflected we use the origin-id
stanza.
This commit is contained in:
Paul Fariello
2019-04-01 20:39:39 +03:20
parent e7be3a605b
commit e69f947547
14 changed files with 64 additions and 25 deletions

View File

@@ -2417,6 +2417,21 @@ stanza_create_pubsub_configure_submit(xmpp_ctx_t *ctx, const char *const id, con
return iq;
}
xmpp_stanza_t*
stanza_attach_origin_id(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza, const char *const id)
{
xmpp_stanza_t *origin_id = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(origin_id, STANZA_NAME_ORIGIN_ID);
xmpp_stanza_set_ns(origin_id, STANZA_NS_STABLE_ID);
xmpp_stanza_set_attribute(origin_id, STANZA_ATTR_ID, id);
xmpp_stanza_add_child(stanza, origin_id);
xmpp_stanza_release(origin_id);
return stanza;
}
static void
_stanza_add_unique_id(xmpp_stanza_t *stanza, char *prefix)
{