Check specifically for the Slack identity when working around its quirks

This commit is contained in:
JC Brand 2017-07-21 17:58:46 +02:00
parent 9084cdaa57
commit de7a1f7545

View File

@ -1971,6 +1971,8 @@
* 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;
@ -1979,9 +1981,11 @@
'sender': 'me',
'message': this.model.getMessageBody(message)
}).filter(
(msg) => Math.abs(moment(msg.get('time')).diff(moment.unix(ts))) < 2000
(msg) => Math.abs(moment(msg.get('time')).diff(moment.unix(ts))) < 5000
).length > 0;
}
}
return false;
},
isDuplicate (message) {