about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/xmpp/iq.c7
-rw-r--r--src/xmpp/xmpp.h1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index e6d34d9d..8152ec01 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -2503,8 +2503,11 @@ _iq_free_affiliation_list(ProfAffiliationList *affiliation_list)
 void
 iq_mam_request(ProfChatWin *win)
 {
-   //TODDO: check for mam feature
-   //if (connection_supports(XMPP_FEATURE_PING) == FALSE) {
+   if (connection_supports(XMPP_FEATURE_MAM2) == FALSE) {
+        log_warning("Server doesn't advertise %s feature.", XMPP_FEATURE_PING);
+        cons_show_error("Server doesn't support MAM.");
+        return;
+   }
 
     xmpp_ctx_t * const ctx = connection_get_ctx();
     char *id = connection_create_stanza_id();
diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h
index cb0004e3..fa26cfbf 100644
--- a/src/xmpp/xmpp.h
+++ b/src/xmpp/xmpp.h
@@ -69,6 +69,7 @@
 #define XMPP_FEATURE_PUBSUB_PUBLISH_OPTIONS "http://jabber.org/protocol/pubsub#publish-options"
 #define XMPP_FEATURE_USER_AVATAR_METADATA_NOTIFY "urn:xmpp:avatar:metadata+notify"
 #define XMPP_FEATURE_LAST_MESSAGE_CORRECTION "urn:xmpp:message-correct:0"
+#define XMPP_FEATURE_MAM2 "urn:xmpp:mam:2"
 
 typedef enum {
     JABBER_CONNECTING,