mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-30 03:26:22 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user