Show read/viewed even after read receipts disabled

This commit is contained in:
Evan Hahn 2021-07-21 14:21:16 -05:00 committed by GitHub
parent 8bcf3addc7
commit 2c59c71872
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 70 deletions

View file

@ -35,7 +35,7 @@ import {
getUserNumber,
getUserUuid,
} from './user';
import { getPinnedConversationIds, getReadReceiptSetting } from './items';
import { getPinnedConversationIds } from './items';
import { getPropsForBubble } from './message';
import {
CallSelectorType,
@ -671,7 +671,6 @@ export const getMessageSelector = createSelector(
getSelectedMessage,
getConversationSelector,
getRegionCode,
getReadReceiptSetting,
getUserNumber,
getUserUuid,
getUserConversationId,
@ -684,7 +683,6 @@ export const getMessageSelector = createSelector(
selectedMessage: SelectedMessageType | undefined,
conversationSelector: GetConversationByIdType,
regionCode: string,
readReceiptSetting: boolean,
ourNumber: string,
ourUuid: string,
ourConversationId: string,
@ -705,7 +703,6 @@ export const getMessageSelector = createSelector(
ourNumber,
ourUuid,
regionCode,
readReceiptSetting,
selectedMessage ? selectedMessage.id : undefined,
selectedMessage ? selectedMessage.counter : undefined,
callSelector,

View file

@ -20,11 +20,6 @@ export const getUserAgent = createSelector(
(state: ItemsStateType): string => state.userAgent as string
);
export const getReadReceiptSetting = createSelector(
getItems,
(state: ItemsStateType): boolean => Boolean(state['read-receipt-setting'])
);
export const getPinnedConversationIds = createSelector(
getItems,
(state: ItemsStateType): Array<string> =>

View file

@ -83,7 +83,6 @@ export function getPropsForBubble(
ourNumber: string | undefined,
ourUuid: string | undefined,
regionCode: string,
readReceiptSetting: boolean,
selectedMessageId: string | undefined,
selectedMessageCounter: number | undefined,
callSelector: CallSelectorType,
@ -210,7 +209,6 @@ export function getPropsForBubble(
ourUuid,
selectedMessageId,
selectedMessageCounter,
readReceiptSetting,
regionCode,
accountSelector
),
@ -322,7 +320,6 @@ export function getPropsForMessage(
ourUuid: string | undefined,
selectedMessageId: string | undefined,
selectedMessageCounter: number | undefined,
readReceiptSetting: boolean,
regionCode: string,
accountSelector: (identifier?: string) => boolean
): Omit<PropsForMessage, 'renderingContext'> {
@ -393,11 +390,7 @@ export function getPropsForMessage(
quote: getPropsForQuote(message, conversationSelector, ourConversationId),
reactions,
selectedReaction,
status: getMessagePropStatus(
message,
ourConversationId,
readReceiptSetting
),
status: getMessagePropStatus(message, ourConversationId),
text: createNonBreakingLastSeparator(message.body),
textPending: message.bodyPending,
timestamp: message.sent_at,
@ -901,8 +894,7 @@ export function getMessagePropStatus(
MessageAttributesType,
'type' | 'errors' | 'sendStateByConversationId'
>,
ourConversationId: string,
readReceiptSetting: boolean
ourConversationId: string
): LastMessageStatus | undefined {
if (!isOutgoing(message)) {
return undefined;
@ -936,7 +928,7 @@ export function getMessagePropStatus(
if (hasErrors(message)) {
return isSent(highestSuccessfulStatus) ? 'partial-sent' : 'error';
}
if (readReceiptSetting && isRead(highestSuccessfulStatus)) {
if (isRead(highestSuccessfulStatus)) {
return 'read';
}
if (isDelivered(highestSuccessfulStatus)) {