fix: don't allow users to start chats with themselves

This commit is contained in:
Pascal Precht 2020-10-14 09:41:09 +02:00 committed by Iuri Matias
parent 6f138f2d44
commit 85f18057ae
1 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,8 @@ ModalPopup {
if (!Utils.isChatKey(chatKey.text) && !Utils.isValidETHNamePrefix(chatKey.text)) { if (!Utils.isChatKey(chatKey.text) && !Utils.isValidETHNamePrefix(chatKey.text)) {
validationError = "This needs to be a valid chat key or ENS username"; validationError = "This needs to be a valid chat key or ENS username";
ensUsername.text = ""; ensUsername.text = "";
} else if (profileModel.profile.pubKey === chatKey.text) {
validationError = qsTr("Can't chat with yourself");
} else { } else {
validationError = "" validationError = ""
} }