From 3d0435a75563a56f030274f41ccc73f63fa27469 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Tue, 10 Apr 2018 20:56:40 +0200 Subject: [PATCH] Remove hack specific to the soon to be retired Slack XMPP gateway --- src/converse-muc.js | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/converse-muc.js b/src/converse-muc.js index 96a9788bc..77695d1bf 100644 --- a/src/converse-muc.js +++ b/src/converse-muc.js @@ -785,32 +785,6 @@ return data; }, - isDuplicateBasedOnTime (message) { - /* Checks whether a received messages is actually a - * duplicate based on whether it has a "ts" attribute - * with a unix timestamp. - * - * This is used for better integration with Slack's XMPP - * gateway, which doesn't use message IDs but instead the - * aforementioned "ts" attributes. - */ - const entity = _converse.disco_entities.get(_converse.domain); - if (entity.identities.where({'name': "Slack-XMPP"})) { - const ts = message.getAttribute('ts'); - if (_.isNull(ts)) { - return false; - } else { - return this.messages.where({ - 'sender': 'me', - 'message': this.getMessageBody(message) - }).filter( - (msg) => Math.abs(moment(msg.get('time')).diff(moment.unix(ts))) < 5000 - ).length > 0; - } - } - return false; - }, - isDuplicate (message, original_stanza) { const msgid = message.getAttribute('id'), jid = message.getAttribute('from'), @@ -824,7 +798,7 @@ (msg) => msg.get('msgid') === msgid && msg.get('fullname') === sender ).length > 0; } - return this.isDuplicateBasedOnTime(message); + return false; }, fetchFeaturesIfConfigurationChanged (stanza) {