git » sdk » commit a7a69a4

Set MAM archive to always after login

author Stephen Paul Weber
2026-09-28 15:26:59 UTC
committer Stephen Paul Weber
2026-09-28 15:29:56 UTC
parent 2e4f56f866df0c47132955ea77fe1f174833ff41

Set MAM archive to always after login

XEP-0441 offered misguided options for settings partial archiving on an
account, which some server operators default to bad defaults. This does
nothing but confuse users in practise and the whole protocol we expect
to get phased out and replaced with eg ad-hoc commands for settings
retention time. For now, unconditionally set to always as a
compatibility setting for servers supporting the legacy protocol.

borogove/Client.hx +6 -0

diff --git a/borogove/Client.hx b/borogove/Client.hx
index 26c7362..f347ef2 100644
--- a/borogove/Client.hx
+++ b/borogove/Client.hx
@@ -1162,6 +1162,12 @@ class Client extends EventEmitter {
 								.tag("enable", { xmlns: "urn:xmpp:carbons:2" })
 								.up()
 						);
+						// Enable MAM archiving
+						sendStanza(
+							new Stanza("iq", { type: "set", id: ID.unique() })
+								.tag("prefs", { xmlns: "urn:xmpp:mam:2", "default": "always" })
+								.up()
+						);
 						sendPresence();
 						joinAllChannels();
 					}