From cd5c2f274255e4a28b30ea6715bd507a64c9cbbc Mon Sep 17 00:00:00 2001 From: Panagiotis Cheilaris Date: Thu, 20 Feb 2020 08:29:41 +0100 Subject: [PATCH] ignore source local option --- lib/chat-client/index.d.ts | 1 + lib/chat-client/index.js | 9 +++++++-- lib/chat-client/index.js.map | 2 +- src/chat-client/index.ts | 9 +++++++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/chat-client/index.d.ts b/lib/chat-client/index.d.ts index 29a997e..b884b5b 100644 --- a/lib/chat-client/index.d.ts +++ b/lib/chat-client/index.d.ts @@ -66,6 +66,7 @@ export interface ChatDownloadOptions { export interface ListenOptions { hideExploding: boolean; showLocal: boolean; + ignoreSourceLocal?: boolean; } export interface Advertisement { alias?: string; diff --git a/lib/chat-client/index.js b/lib/chat-client/index.js index bfdbfbe..88046c0 100644 --- a/lib/chat-client/index.js +++ b/lib/chat-client/index.js @@ -875,15 +875,20 @@ var Chat = /** @class */ (function (_super) { return; } var msgNotification = messageObject; + var showLocal = (options && options.showLocal) || false; + var ignoreSourceLocal = (options && options.ignoreSourceLocal) || false; + var isSourceLocal = msgNotification.source === 'local'; if ( // fire onMessage if it was from a different sender or at least a different device // from this sender. Bots can filter out their own messages from other devices. - (options && options.showLocal) || + // With option ignoreSourceLocal, local source messages are ignored. + showLocal || (_this.username && _this.devicename && (msgNotification.msg.sender.username !== _this.username.toLowerCase() || msgNotification.msg.sender.deviceName !== _this.devicename))) { - onMessage(msgNotification.msg); + if (!ignoreSourceLocal || (ignoreSourceLocal && !isSourceLocal)) + onMessage(msgNotification.msg); } } catch (error) { diff --git a/lib/chat-client/index.js.map b/lib/chat-client/index.js.map index a923daa..5f9b486 100644 --- a/lib/chat-client/index.js.map +++ b/lib/chat-client/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chat-client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;gBACD,IAAI,aAAa,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE;oBAC7D,OAAM;iBACP;gBACD,IAAM,gBAAgB,GAA2B,aAAa,CAAA;gBAC9D,gBAAgB,CAAC,IAAI,IAAI,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAA;aACvD;YAAC,OAAO,KAAK,EAAE;gBACd,IAAI,OAAO,EAAE;oBACX,OAAO,CAAC,KAAK,CAAC,CAAA;iBACf;aACF;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;IACH,WAAC;AAAD,CAAC,AAnrBD,CAAmB,qBAAU,GAmrB5B;AAED,kBAAe,IAAI,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/chat-client/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAmC;AACnC,sDAA+B;AAC/B,+DAAuC;AACvC,kCAAoE;AA+FpE,uIAAuI;AACvI;IAAmB,wBAAU;IAA7B;;IAurBA,CAAC;IAtrBC;;;;;;;;OAQG;IACU,mBAAI,GAAjB,UAAkB,OAAyB;;;;;4BACzC,qBAAM,IAAI,CAAC,iBAAiB,EAAE,EAAA;;wBAA9B,SAA8B,CAAA;wBAClB,qBAAM,IAAI,CAAC,cAAc,CAAC,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,SAAA,EAAC,CAAC,EAAA;;wBAA3E,GAAG,GAAG,SAAqE;wBACjF,IAAI,CAAC,GAAG,EAAE;4BACR,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;yBACvD;wBACD,sBAAO,GAAG,CAAC,aAAa,IAAI,EAAE,EAAA;;;;KAC/B;IAED;;;;;;;;OAQG;IACU,2BAAY,GAAzB,UAA0B,IAAY,EAAE,OAAiC;;;;;4BACvE,qBAAM,IAAI,CAA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vrBD,CAAmB,qBAAU,GAurB5B;AAED,kBAAe,IAAI,CAAA"} \ No newline at end of file diff --git a/src/chat-client/index.ts b/src/chat-client/index.ts index 37a4e6a..0c8a309 100644 --- a/src/chat-client/index.ts +++ b/src/chat-client/index.ts @@ -78,6 +78,7 @@ export interface ChatDownloadOptions { export interface ListenOptions { hideExploding: boolean showLocal: boolean + ignoreSourceLocal?: boolean } export interface Advertisement { @@ -734,16 +735,20 @@ class Chat extends ClientBase { return } const msgNotification: chat1.MsgNotification = messageObject + const showLocal: boolean = (options && options.showLocal) || false + const ignoreSourceLocal: boolean = (options && options.ignoreSourceLocal) || false + const isSourceLocal: boolean = msgNotification.source === 'local' if ( // fire onMessage if it was from a different sender or at least a different device // from this sender. Bots can filter out their own messages from other devices. - (options && options.showLocal) || + // With option ignoreSourceLocal, local source messages are ignored. + showLocal || (this.username && this.devicename && (msgNotification.msg.sender.username !== this.username.toLowerCase() || msgNotification.msg.sender.deviceName !== this.devicename)) ) { - onMessage(msgNotification.msg) + if (!ignoreSourceLocal || (ignoreSourceLocal && !isSourceLocal)) onMessage(msgNotification.msg) } } catch (error) { if (onError) {