From d4419bf71f64f1c38ba84cf67d87d52b2825cf07 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 6 Dec 2022 22:32:35 -0600 Subject: [PATCH] Chats: hide read receipts for unsupported servers --- app/soapbox/features/chats/components/chat-message-list.tsx | 2 +- app/soapbox/utils/features.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/soapbox/features/chats/components/chat-message-list.tsx b/app/soapbox/features/chats/components/chat-message-list.tsx index 9e023ed0b..5261a337a 100644 --- a/app/soapbox/features/chats/components/chat-message-list.tsx +++ b/app/soapbox/features/chats/components/chat-message-list.tsx @@ -348,7 +348,7 @@ const ChatMessageList: React.FC = ({ chat }) => { {intl.formatTime(chatMessage.created_at)} - {isMyMessage ? ( + {(isMyMessage && features.chatsReadReceipts) ? ( <> {isRead ? ( diff --git a/app/soapbox/utils/features.ts b/app/soapbox/utils/features.ts index 82770aa8d..184a3081e 100644 --- a/app/soapbox/utils/features.ts +++ b/app/soapbox/utils/features.ts @@ -238,6 +238,12 @@ const getInstanceFeatures = (instance: Instance) => { */ chatsMedia: v.software !== TRUTHSOCIAL, + /** + * Whether chat messages have read receipts. + * @see GET /api/v1/pleroma/chats/:id/messages + */ + chatsReadReceipts: v.software === TRUTHSOCIAL, + /** * Ability to search among chats. * @see GET /api/v1/pleroma/chats