Skip to content

Commit 40a0b99

Browse files
Disable muc history when joining an muc since we now have muc mam
Disable muc history when MAM is enabled see #660
1 parent 787124e commit 40a0b99

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/xmpp/stanza.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
*/
3535

3636
#include "config.h"
37+
#include "config/preferences.h"
3738

3839
#ifdef HAVE_GIT_VERSION
3940
#include "gitversion.h"
@@ -563,6 +564,15 @@ stanza_create_room_join_presence(xmpp_ctx_t* const ctx,
563564
xmpp_stanza_release(pass);
564565
}
565566

567+
// Disable muc history
568+
if (prefs_get_boolean(PREF_MAM)) {
569+
xmpp_stanza_t* history = xmpp_stanza_new(ctx);
570+
xmpp_stanza_set_name(history, STANZA_NAME_HISTORY);
571+
xmpp_stanza_set_attribute(history, "maxchars", "0");
572+
xmpp_stanza_add_child(x, history);
573+
xmpp_stanza_release(history);
574+
}
575+
566576
xmpp_stanza_add_child(presence, x);
567577
xmpp_stanza_release(x);
568578

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)