keybase-bot icon indicating copy to clipboard operation
keybase-bot copied to clipboard

ignore source local option

Open philaris opened this issue 5 years ago • 0 comments

Hi, keybase team and contributors and thank you for the nice code.

I have been trying to implement a bot with the following property: it receives commands from the same username as the one under which the bot runs. It can be the case that the sender of the messages is on the same device as the bot. Therefore, in order to read messages of the aforementioned type, showLocal has to be set to true in the ListenOptions argument to watchChannelForNewMessages (otherwise such messages are ignored). However, if showLocal is true, then messages from the same device are reported twice from watchChannelForNewMessages.

I investigated and it seems that each message from a same-device sender triggers two message notifications one with source: "local" and the other with source: "remote". Therefore, I added an optional field ignoreSourceLocal to the ListenOptions interface with which the source: "local" copy of the message is suppressed (when ignoreSourceLocal is set to true).

This pull request passes all tests except the one mentioned in #221 which also seems not to pass for the base branch.

philaris avatar Feb 22 '20 08:02 philaris