feat: dont save interaction error messages in communities

pull/2789/head
William Grant 2 years ago
parent 7579ec98e8
commit d782a0214e

@ -108,7 +108,7 @@
"hideConversationFailedPleaseTryAgain": "Unable to hide the conversation, please try again",
"deleteConversation": "Delete Conversation",
"deleteConversationConfirmation": "Are you sure you want to delete your conversation with <b>$name$</b>?",
"deleteConversationFailed": "Failed to leave the Conversation!",
"deleteConversationFailed": "Failed to delete the Conversation!",
"deleteConversationFailedPleaseTryAgain": "Unable to delete the conversation, please try again",
"hiding": "Hiding...",
"leaving": "Leaving...",

@ -120,6 +120,7 @@ export const SessionMessagesList = (props: {
) : null;
const componentToMerge = [dateBreak, unreadIndicator];
if (messageProps.message?.messageType === 'group-notification') {
const msgProps = messageProps.message.props as PropsForGroupUpdate;
return [<GroupUpdateMessage key={messageId} {...msgProps} />, ...componentToMerge];

@ -24,8 +24,13 @@ export const InteractionNotification = (props: PropsForInteractionNotification)
const isGroup = !useIsPrivate(convoId);
const isCommunity = useIsPublic(convoId);
// NOTE For now we only show interaction errors in the message history
// NOTE at this time we don't show visible control messages in communities, that might change in future...
if (isCommunity) {
return null;
}
if (interactionStatus !== ConversationInteractionStatus.Error) {
// NOTE For now we only show interaction errors in the message history
return null;
}

@ -751,6 +751,11 @@ async function saveConversationInteractionErrorAsMessage({
status: interactionStatus,
});
// NOTE at this time we don't have visible control messages in communities
if (conversation.isPublic()) {
return;
}
// Add an error message to the database so we can view it in the message history
await conversation?.addSingleIncomingMessage({
source: UserUtils.getOurPubKeyStrFromCache(),

Loading…
Cancel
Save