Fix filtering of own messages

This commit is contained in:
Franck Royer 2021-07-02 10:56:23 +10:00
parent f020aa7a8c
commit 2f2f89cf65
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 2 additions and 1 deletions

View File

@ -144,7 +144,8 @@ async function handleDirectMessage(
console.log('Direct Message received:', wakuMsg); console.log('Direct Message received:', wakuMsg);
if (!wakuMsg.payload) return; if (!wakuMsg.payload) return;
const directMessage: DirectMessage = decode(wakuMsg.payload); const directMessage: DirectMessage = decode(wakuMsg.payload);
if (directMessage.toAddress !== address) return; // Do not return our own messages
if (directMessage.toAddress === address) return;
const text = await decryptMessage(privateKey, directMessage); const text = await decryptMessage(privateKey, directMessage);