make sure reply is available to read messages

and do not handle read messages for non private convo1
This commit is contained in:
Audric Ackermann 2022-04-06 10:44:44 +10:00
parent 0ebc1d7e92
commit 1ebff6b3ae
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4
2 changed files with 15 additions and 1 deletions

View File

@ -72,7 +72,7 @@ export const MessageContextMenu = (props: Props) => {
const { messageId, contextMenuId } = props;
const isOutgoing = direction === 'outgoing';
const showRetry = status === 'error' && isOutgoing;
const isSent = status === 'sent';
const isSent = status === 'sent' || status === 'read'; // a read message should be replyable
const multipleAttachments = attachments && attachments.length > 1;
const onContextMenuShown = useCallback(() => {

View File

@ -27,6 +27,20 @@ async function onReadReceipt(receipt: { source: string; timestamp: number; readA
window.log.info('No message for read receipt', receipt.source, receipt.timestamp);
return;
}
const convoId = message.get('conversationId'); // this might be a group and we don't want to handle them
if (
!convoId ||
!getConversationController().get(convoId) ||
!getConversationController()
.get(convoId)
.isPrivate()
) {
window.log.info(
'Convo is undefined or not a private chat for read receipt in convo',
convoId
);
return;
}
const readBy = message.get('read_by') || [];
const expirationStartTimestamp = message.get('expirationStartTimestamp');