Skip to content

Commit b591923

Browse files
Disable muc history when joining an muc since we now have muc mam
see #660
1 parent 787124e commit b591923

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/xmpp/stanza.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,11 @@ stanza_create_room_join_presence(xmpp_ctx_t* const ctx,
552552
xmpp_stanza_set_name(x, STANZA_NAME_X);
553553
xmpp_stanza_set_ns(x, STANZA_NS_MUC);
554554

555+
// Disable muc history
556+
xmpp_stanza_t* history = xmpp_stanza_new(ctx);
557+
xmpp_stanza_set_name(history, STANZA_NAME_HISTORY);
558+
xmpp_stanza_set_attribute(history, "maxchars", "0");
559+
555560
if (passwd) {
556561
xmpp_stanza_t* pass = xmpp_stanza_new(ctx);
557562
xmpp_stanza_set_name(pass, "password");
@@ -563,7 +568,9 @@ stanza_create_room_join_presence(xmpp_ctx_t* const ctx,
563568
xmpp_stanza_release(pass);
564569
}
565570

571+
xmpp_stanza_add_child(x, history);
566572
xmpp_stanza_add_child(presence, x);
573+
xmpp_stanza_release(history);
567574
xmpp_stanza_release(x);
568575

569576
return presence;

src/xmpp/stanza.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
#define STANZA_NAME_PRESENCE "presence"
5757
#define STANZA_NAME_PRIORITY "priority"
5858
#define STANZA_NAME_X "x"
59+
#define STANZA_NAME_HISTORY "history"
5960
// XEP-0373: OpenPGP for XMPP
6061
#define STANZA_NAME_OPENPGP "openpgp"
6162
#define STANZA_NAME_PUPKEY "pubkey"

0 commit comments

Comments
 (0)