diff --git a/packages/state-manager/src/sagas/publicChannels/publicChannels.selectors.ts b/packages/state-manager/src/sagas/publicChannels/publicChannels.selectors.ts index 95649cf71e..580d4f1ed1 100644 --- a/packages/state-manager/src/sagas/publicChannels/publicChannels.selectors.ts +++ b/packages/state-manager/src/sagas/publicChannels/publicChannels.selectors.ts @@ -213,7 +213,7 @@ export const currentChannelMessagesMergedBySender = createSelector(dailyGroupedC const last = merged[index][0] if ( - last.nickname === message.nickname && + last?.pubKey === message?.pubKey && message.createdAt - last.createdAt < 300 && message.type !== MessageType.Info && last.type !== MessageType.Info diff --git a/packages/state-manager/src/sagas/users/users.selectors.ts b/packages/state-manager/src/sagas/users/users.selectors.ts index ee57a9b256..5c19903bf7 100644 --- a/packages/state-manager/src/sagas/users/users.selectors.ts +++ b/packages/state-manager/src/sagas/users/users.selectors.ts @@ -87,7 +87,8 @@ export const allUsers = createSelector(csrsMapping, certificatesMapping, (csrs, users[pubKey] = { ...csrs[pubKey], isRegistered, - isDuplicated + isDuplicated, + pubKey } }) return users diff --git a/packages/state-manager/src/utils/functions/dates/formatDisplayableMessage.ts b/packages/state-manager/src/utils/functions/dates/formatDisplayableMessage.ts index 61b14a93b0..2d4db56955 100644 --- a/packages/state-manager/src/utils/functions/dates/formatDisplayableMessage.ts +++ b/packages/state-manager/src/utils/functions/dates/formatDisplayableMessage.ts @@ -12,6 +12,7 @@ export const displayableMessage = (message: ChannelMessage, user: User): Display nickname: user.username, isRegistered: user.isRegistered, isDuplicated: user.isDuplicated, + pubKey: user.pubKey, media: message.media, } } diff --git a/packages/types/src/channel.ts b/packages/types/src/channel.ts index 72425ff63b..ddd5404f76 100644 --- a/packages/types/src/channel.ts +++ b/packages/types/src/channel.ts @@ -52,6 +52,7 @@ export interface DisplayableMessage { media?: FileMetadata isRegistered?: boolean isDuplicated?: boolean + pubKey?: string } export type MessagesGroupsType = Record diff --git a/packages/types/src/user.ts b/packages/types/src/user.ts index 1a0662c386..11e2955e39 100644 --- a/packages/types/src/user.ts +++ b/packages/types/src/user.ts @@ -5,6 +5,7 @@ export interface User { dmPublicKey: string isRegistered?: boolean isDuplicated?: boolean + pubKey?: string } export interface SendCertificatesResponse {