4use Bitrix\Im\V2\Message\CounterServiceLegacy;
5use Bitrix\Main\EventResult;
6use Bitrix\Main\Localization\Loc;
158 $cache = \Bitrix\Main\Data\Cache::createInstance();
161 $cache->clean(self::CACHE_NAME.
'_'.
$userId, self::CACHE_PATH);
165 $cache->cleanDir(self::CACHE_PATH);
173 $chatId = intval($chatId);
176 if ($chatId <= 0 ||
$userId <= 0)
183 return intval(
$counters[
'CHAT'][$chatId]);
189 $opponentUserId = intval($opponentUserId);
190 if (
$userId <= 0 || $opponentUserId <= 0)
197 return intval(
$counters[
'DIALOG'][$opponentUserId]);
210 return intval(
$counters[
'TYPE'][
'NOTIFY']);
310 EventResult::SUCCESS,
312 self::TYPE_MESSENGER => [
313 'NAME' => Loc::getMessage(
'IM_COUNTER_TYPE_MESSENGER'),
316 self::TYPE_NOTIFY => [
317 'NAME' => Loc::getMessage(
'IM_COUNTER_TYPE_NOTIFY'),
332 $notifyCounter = isset(
$counters[
'TYPE'][
'MESSENGER']) ?
$counters[
'TYPE'][
'NOTIFY'] : 0;
336 'TYPE' => self::TYPE_MESSENGER,
337 'COUNTER' => $messengerCounter,
340 'TYPE' => self::TYPE_NOTIFY,
341 'COUNTER' => $notifyCounter,
345 return new EventResult(EventResult::SUCCESS, $mobileCounters, self::MODULE_ID);
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static countingLostCountersAgent($notifyRelationId=0, $chatRelationId=0)
static clearCache($userId=null)
static onGetMobileCounterTypes(\Bitrix\Main\Event $event)
static getDialogCounter($opponentUserId, $userId=null)
static getNotifyCounter($userId=null)
static getChatCounter($chatId, $userId=null)
static onGetMobileCounter(\Bitrix\Main\Event $event)
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']