diff --git a/packages/rocketchat-i18n/i18n/en.i18n.json b/packages/rocketchat-i18n/i18n/en.i18n.json index 1b2888536b9a..62b4df3ac84b 100644 --- a/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/packages/rocketchat-i18n/i18n/en.i18n.json @@ -279,6 +279,7 @@ "Cancel": "Cancel", "Cancel_message_input": "Cancel", "Cannot_invite_users_to_direct_rooms": "Cannot invite users to direct rooms", + "Cannot_open_conversation_with_yourself": "Cannot open a conversation with yourself", "CAS_autoclose": "Autoclose login popup", "CAS_base_url": "SSO Base URL", "CAS_base_url_Description": "The base URL of your external SSO service e.g: https://sso.example.undef/sso/", diff --git a/packages/rocketchat-ui/client/views/404/roomNotFound.html b/packages/rocketchat-ui/client/views/404/roomNotFound.html index 9d653a0cce26..0fc3a73c8494 100644 --- a/packages/rocketchat-ui/client/views/404/roomNotFound.html +++ b/packages/rocketchat-ui/client/views/404/roomNotFound.html @@ -17,7 +17,11 @@ <h2> {{{_ 'No_group_with_name_%s_was_found' name}}} {{/if}} {{#if $eq type 'd'}} - {{{_ 'No_user_with_username_%s_was_found' name}}} + {{#if sameUser }} + {{{_ 'Cannot_open_conversation_with_yourself' }}} + {{else}} + {{{_ 'No_user_with_username_%s_was_found' name}}} + {{/if}} {{/if}} {{/with}} </div> diff --git a/packages/rocketchat-ui/client/views/404/roomNotFound.js b/packages/rocketchat-ui/client/views/404/roomNotFound.js index c09dc1f0190b..251389df7272 100644 --- a/packages/rocketchat-ui/client/views/404/roomNotFound.js +++ b/packages/rocketchat-ui/client/views/404/roomNotFound.js @@ -4,5 +4,9 @@ Template.roomNotFound.helpers({ }, name() { return Blaze._escape(this.name); + }, + sameUser() { + const user = Meteor.user(); + return user && user.username === this.name; } });