diff --git a/ts/state/selectors/stories.ts b/ts/state/selectors/stories.ts index 523374062..5cdbf5136 100644 --- a/ts/state/selectors/stories.ts +++ b/ts/state/selectors/stories.ts @@ -282,7 +282,9 @@ export const getStories = createSelector( const list = story.storyDistributionListId === MY_STORIES_ID ? { id: MY_STORIES_ID, name: MY_STORIES_ID } - : distributionListSelector(story.storyDistributionListId); + : distributionListSelector( + story.storyDistributionListId.toLowerCase() + ); if (!list) { return; diff --git a/ts/textsecure/MessageReceiver.ts b/ts/textsecure/MessageReceiver.ts index 366f78c23..0abd5f90f 100644 --- a/ts/textsecure/MessageReceiver.ts +++ b/ts/textsecure/MessageReceiver.ts @@ -1946,15 +1946,20 @@ export default class MessageReceiver return; } + const normalizedDestinationUuid = normalizeUuid( + destinationUuid, + 'handleStoryMessage.destinationUuid' + ); + recipient.distributionListIds?.forEach(listId => { const sentUuids: Set = distributionListToSentUuid.get(listId) || new Set(); - sentUuids.add(destinationUuid); + sentUuids.add(normalizedDestinationUuid); distributionListToSentUuid.set(listId, sentUuids); }); isAllowedToReply.set( - destinationUuid, + normalizedDestinationUuid, recipient.isAllowedToReply !== false ); }); @@ -1975,7 +1980,10 @@ export default class MessageReceiver isRecipientUpdate: Boolean(sentMessage.isRecipientUpdate), receivedAtCounter: envelope.receivedAtCounter, receivedAtDate: envelope.receivedAtDate, - storyDistributionListId: listId, + storyDistributionListId: normalizeUuid( + listId, + 'storyDistributionListId' + ), }, this.removeFromCache.bind(this, envelope) ); diff --git a/ts/util/onStoryRecipientUpdate.ts b/ts/util/onStoryRecipientUpdate.ts index 0bf75f3a2..6df2eb28a 100644 --- a/ts/util/onStoryRecipientUpdate.ts +++ b/ts/util/onStoryRecipientUpdate.ts @@ -13,6 +13,7 @@ import { getMessageIdForLogging, } from './idForLogging'; import { isStory } from '../state/selectors/message'; +import { normalizeUuid } from './normalizeUuid'; import { queueUpdateMessage } from './messageBatcher'; export async function onStoryRecipientUpdate( @@ -58,7 +59,11 @@ export async function onStoryRecipientUpdate( conversationIdToDistributionListIds.set( convo.id, - new Set(item.distributionListIds) + new Set( + item.distributionListIds.map(uuid => + normalizeUuid(uuid, 'onStoryRecipientUpdate.distributionListId') + ) + ) ); isAllowedToReply.set(convo.id, item.isAllowedToReply !== false); });