Telegram bot settings page template updated. Linking status added. Notification about disabled linking when turning on subscribers notifications.

This commit is contained in:
Alexey Skobkin 2017-01-07 14:30:30 +03:00
parent 9a0d374baf
commit 3db25e9bdb
2 changed files with 7 additions and 0 deletions

View file

@ -1,9 +1,12 @@
{# @var account \Skobkin\Bundle\PointToolsBundle\Entity\Telegram\Account #} {# @var account \Skobkin\Bundle\PointToolsBundle\Entity\Telegram\Account #}
*Your current settings:* *Your current settings:*
Account /link status: {% if account.user %}Linked to {{ account.user.login }}{% else %}Not linked{% endif %}
User renaming notifications: {% if account.renameNotification %}enabled{% else %}disabled{% endif %} User renaming notifications: {% if account.renameNotification %}enabled{% else %}disabled{% endif %}
Subscribers notifications: {% if account.subscriberNotification %}enabled{% else %}disabled{% endif %} Subscribers notifications: {% if account.subscriberNotification %}enabled{% else %}disabled{% endif %}
{% if not account.user %}(Not active because account is not linked){% endif %}
Choose what to change. Choose what to change.

View file

@ -243,6 +243,10 @@ class PrivateMessageProcessor
$this->em->flush(); $this->em->flush();
$this->messenger->sendMessage($account, 'Subscribers notifications are turned '.($account->isSubscriberNotification() ? 'on' : 'off')); $this->messenger->sendMessage($account, 'Subscribers notifications are turned '.($account->isSubscriberNotification() ? 'on' : 'off'));
if ($account->isSubscriberNotification() && null === $account->getUser()) {
$this->messenger->sendMessage($account, 'You need to /link you account to receive these notifications.');
}
} else { } else {
$this->sendError($account, 'Notification type does not exist.'); $this->sendError($account, 'Notification type does not exist.');
} }