Telegram bot empty subscribers change notification fix.

This commit is contained in:
Alexey Skobkin 2017-01-07 21:56:09 +03:00
parent 1372b7e6d1
commit 2d47fb4f4d

View file

@ -84,9 +84,11 @@ class SubscriptionsManager
// Removing users from database
$this->em->getRepository('SkobkinPointToolsBundle:Subscription')->removeSubscribers($user, $unsubscribedList);
// Dispatching event
$subscribersUpdatedEvent = new UserSubscribersUpdatedEvent($user, $subscribedList, $unsubscribedList);
$this->eventDispatcher->dispatch(UserSubscribersUpdatedEvent::NAME, $subscribersUpdatedEvent);
if (0 !== count($subscribedList) || 0 !== count($unsubscribedList)) {
// Dispatching event
$subscribersUpdatedEvent = new UserSubscribersUpdatedEvent($user, $subscribedList, $unsubscribedList);
$this->eventDispatcher->dispatch(UserSubscribersUpdatedEvent::NAME, $subscribersUpdatedEvent);
}
}
/**