diff --git a/src/i18n/en-US.json b/src/i18n/en-US.json index 7a11aa33dbe..244f45fee6f 100644 --- a/src/i18n/en-US.json +++ b/src/i18n/en-US.json @@ -959,11 +959,14 @@ "modalUserBlockHeadline": "Block {{user}}?", "modalUserBlockMessage": "{{user}} won’t be able to contact you or add you to group conversations.", "modalUserBlockedForLegalHold": "This user is blocked due to legal hold. [link]Learn more[/link]", + "modalUserCannotAcceptConnectionMessage": "Connection request could not be accepted", "modalUserCannotBeAddedHeadline": "Guests cannot be added", + "modalUserCannotCancelConnectionMessage": "Connection request could not be cancelled", "modalUserCannotConnectHeadline": "Connecting not possible", - "modalUserCannotConnectMessage": "Connection request could not be sent", - "modalUserCannotConnectLegalHoldMessage": "You cannot connect to this user due to legal hold. [link]Learn more[/link]", - "modalUserCannotConnectNotFederatingMessage": "You can’t send a connection request as your backend doesn’t federate with the one of {{username}}.", + "modalUserCannotIgnoreConnectionMessage": "Connection request could not be ignored", + "modalUserCannotSendConnectionMessage": "Connection request could not be sent", + "modalUserCannotSendConnectionLegalHoldMessage": "You cannot connect to this user due to legal hold. [link]Learn more[/link]", + "modalUserCannotSendConnectionNotFederatingMessage": "You can’t send a connection request as your backend doesn’t federate with the one of {{username}}.", "modalUserLearnMore": "Learn more", "modalUserUnblockAction": "Unblock", "modalUserUnblockHeadline": "Unblock?", diff --git a/src/script/connection/ConnectionRepository.ts b/src/script/connection/ConnectionRepository.ts index b5923bd60c9..6ee1a9b9e44 100644 --- a/src/script/connection/ConnectionRepository.ts +++ b/src/script/connection/ConnectionRepository.ts @@ -201,7 +201,7 @@ export class ConnectionRepository { ); PrimaryModal.show(PrimaryModal.type.ACKNOWLEDGE, { text: { - htmlMessage: t('modalUserCannotConnectLegalHoldMessage', {}, replaceLinkLegalHold), + htmlMessage: t('modalUserCannotSendConnectionLegalHoldMessage', {}, replaceLinkLegalHold), title: t('modalUserCannotConnectHeadline'), }, }); @@ -211,7 +211,7 @@ export class ConnectionRepository { case BackendErrorLabel.FEDERATION_NOT_ALLOWED: { PrimaryModal.show(PrimaryModal.type.ACKNOWLEDGE, { text: { - htmlMessage: t('modalUserCannotConnectNotFederatingMessage', userEntity.name()), + htmlMessage: t('modalUserCannotSendConnectionNotFederatingMessage', userEntity.name()), title: t('modalUserCannotConnectHeadline'), }, }); @@ -222,7 +222,7 @@ export class ConnectionRepository { this.logger.error(`Failed to send connection request to user '${userEntity.id}': ${error.message}`, error); PrimaryModal.show(PrimaryModal.type.ACKNOWLEDGE, { text: { - htmlMessage: t('modalUserCannotConnectMessage', userEntity.name()), + htmlMessage: t('modalUserCannotSendConnectionMessage'), title: t('modalUserCannotConnectHeadline'), }, }); @@ -318,6 +318,39 @@ export class ConnectionRepository { } catch (error) { const logMessage = `Connection change from '${currentStatus}' to '${newStatus}' failed`; this.logger.error(`${logMessage} for '${userEntity.id}' failed: ${error.message}`, error); + switch (newStatus) { + case ConnectionStatus.ACCEPTED: { + PrimaryModal.show(PrimaryModal.type.ACKNOWLEDGE, { + text: { + htmlMessage: t('modalUserCannotAcceptConnectionMessage'), + title: t('modalUserCannotConnectHeadline'), + }, + }); + } + case ConnectionStatus.CANCELLED: { + PrimaryModal.show(PrimaryModal.type.ACKNOWLEDGE, { + text: { + htmlMessage: t('modalUserCannotCancelConnectionMessage'), + title: t('modalUserCannotConnectHeadline'), + }, + }); + } + case ConnectionStatus.IGNORED: { + PrimaryModal.show(PrimaryModal.type.ACKNOWLEDGE, { + text: { + htmlMessage: t('modalUserCannotIgnoreConnectionMessage'), + title: t('modalUserCannotConnectHeadline'), + }, + }); + } + default: { + PrimaryModal.show(PrimaryModal.type.ACKNOWLEDGE, { + text: { + title: t('modalUserCannotConnectHeadline'), + }, + }); + } + } } }