From 5e628b9cddc979bdd7cdab8aa6913f91793b0248 Mon Sep 17 00:00:00 2001 From: Debashis Chowdhury Date: Mon, 27 May 2019 11:26:37 +0400 Subject: [PATCH] Adding error call back function with sendIQ() this will help to get the error message response by server. If MAM service is not active in XMPP server, we will get the bellow kind of error message from server: urn:xmpp:mam:2 user2@my.xmpp-server.com 2017-05-23T00:00:00Z 2017-05-26T00:00:00Z --- src/strophe.mam.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/strophe.mam.js b/src/strophe.mam.js index 86248b7..9ce37db 100644 --- a/src/strophe.mam.js +++ b/src/strophe.mam.js @@ -55,6 +55,10 @@ Strophe.addConnectionPlugin('mam', { return this._c.sendIQ(iq, function(){ _c.deleteHandler(handler); onComplete.apply(this, arguments); - }); + }, + function(err){ + //error callBack function + console.log("Error Response from server:", err); + }); } });