From bf647b36d49d75f59eaa6d57674a6f12d3b51b0f Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Mon, 28 Sep 2020 18:25:18 -0500 Subject: [PATCH] Fix a UUID variable holding an E164 --- ts/textsecure/SendMessage.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ts/textsecure/SendMessage.ts b/ts/textsecure/SendMessage.ts index d9fddf6b4..a25be7f07 100644 --- a/ts/textsecure/SendMessage.ts +++ b/ts/textsecure/SendMessage.ts @@ -1591,7 +1591,7 @@ export default class MessageSender { } const myE164 = window.textsecure.storage.user.getNumber(); - const myUuid = window.textsecure.storage.user.getNumber(); + const myUuid = window.textsecure.storage.user.getUuid(); // prettier-ignore const recipients = groupV2 ? groupV2.members @@ -1599,8 +1599,16 @@ export default class MessageSender { ? groupV1.members : []; + // We should always have a UUID but have this check just in case we don't. + let isNotMe: (recipient: string) => boolean; + if (myUuid) { + isNotMe = r => r !== myE164 && r !== myUuid; + } else { + isNotMe = r => r !== myE164; + } + const attrs = { - recipients: recipients.filter(r => r !== myE164 && r !== myUuid), + recipients: recipients.filter(isNotMe), body: messageText, timestamp, attachments,