From 866d6a8c4577b798c2b60e3fc23cbaefb45e679c Mon Sep 17 00:00:00 2001 From: veselcraft Date: Fri, 3 Mar 2023 21:30:36 +0300 Subject: [PATCH] Messenger: Add a warning about privacy settings if user to whom he sends a message cannot reply (it annoys me a lot) --- Web/Presenters/MessengerPresenter.php | 5 +++++ locales/en.strings | 1 + locales/ru.strings | 1 + 3 files changed, 7 insertions(+) diff --git a/Web/Presenters/MessengerPresenter.php b/Web/Presenters/MessengerPresenter.php index 46094c43..438d9ccd 100644 --- a/Web/Presenters/MessengerPresenter.php +++ b/Web/Presenters/MessengerPresenter.php @@ -57,6 +57,11 @@ final class MessengerPresenter extends OpenVKPresenter $correspondent = $this->getCorrespondent($sel); if(!$correspondent) $this->notFound(); + + if(!$this->user->identity->getPrivacyPermission('messages.write', $correspondent)) + { + $this->flash("err", tr("warning"), "Этот пользователь, возможно, вам не сможет ответить из-за ваших настроек приватности."); + } $this->template->selId = $sel; $this->template->correspondent = $correspondent; diff --git a/locales/en.strings b/locales/en.strings index 5079d1a8..669bfc8b 100644 --- a/locales/en.strings +++ b/locales/en.strings @@ -1197,6 +1197,7 @@ /* User alerts */ "user_alert_scam" = "This account has been reported a lot for scam. Please be careful, especially if he asked for money."; +"user_may_not_reply" = "This user may not reply to you because of your privacy settings. Open privacy settings"; /* Cookies pop-up */ diff --git a/locales/ru.strings b/locales/ru.strings index 361d6db7..ac7a537d 100644 --- a/locales/ru.strings +++ b/locales/ru.strings @@ -1085,6 +1085,7 @@ /* User alerts */ "user_alert_scam" = "На этот аккаунт много жаловались в связи с мошенничеством. Пожалуйста, будьте осторожны, особенно если у вас попросят денег."; +"user_may_not_reply" = "Этот пользователь, возможно, вам не сможет ответить из-за ваших настроек приватности. Открыть настройки приватности"; /* Cookies pop-up */