uawdijnntqw1x1x1
IP : 18.189.188.228
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
.
/
b24.axolotl.ru
/
public_html
/
bitrix
/
modules
/
imbot
/
lib
/
event.php
/
/
<?php namespace Bitrix\ImBot; /** * Bot event dispatcher. * @package \Bitrix\ImBot */ class Event { /** * Handler for "im:OnAfterUserRead" event. * @see \CIMMessage::SetReadMessage * * @param array $params * @return bool */ public static function onUserRead($params) { $botData = \Bitrix\Im\Bot::getCache($params['DIALOG_ID']); if (!$botData) { return true; } if (class_exists($botData['CLASS']) && method_exists($botData['CLASS'], 'onUserRead')) { return call_user_func_array(array($botData['CLASS'], 'onUserRead'), Array($params)); } return true; } /** * Handler for "im:OnAfterChatRead" event. * @see \CIMChat::SetReadMessage * * @param array $params * @return bool */ public static function onChatRead($params) { $botList = []; $relations = \CIMChat::GetRelationById($params['CHAT_ID']); foreach ($relations as $relation) { if ($relation['EXTERNAL_AUTH_ID'] === \Bitrix\Im\Bot::EXTERNAL_AUTH_ID) { $botList[(int)$relation['USER_ID']] = (int)$relation['USER_ID']; } } $result = true; foreach ($botList as $botId) { $botData = \Bitrix\Im\Bot::getCache($botId); if (!$botData) { continue; } if (class_exists($botData['CLASS']) && method_exists($botData['CLASS'], 'onChatRead')) { $result = call_user_func_array([$botData['CLASS'], 'onChatRead'], [$params]); } } return $result; } /** * Handler for "im:OnAfterMessagesLike" event. * @see \CIMMessenger::Like * * @param array $params * @return bool */ public static function onMessageLike($params) { if ($params['CHAT']['TYPE'] == \IM_MESSAGE_PRIVATE) { $botId = $params['DIALOG_ID']; } else { $botId = $params['MESSAGE']['AUTHOR_ID']; } $botData = \Bitrix\Im\Bot::getCache($botId); if (!$botData) { return true; } Log::write($params, 'MESSAGE LIKE'); if (class_exists($botData['CLASS']) && method_exists($botData['CLASS'], 'onMessageLike')) { return call_user_func_array(array($botData['CLASS'], 'onMessageLike'), Array($params)); } return true; } /** * Handler for "im:OnStartWriting" event. * @see \CIMMessenger::StartWriting * * @param array $params * @return bool */ public static function onStartWriting($params) { $botList = []; if (empty($params['CHAT'])) { $botList[] = (int)$params['DIALOG_ID']; } elseif (!empty($params['RELATION'])) { foreach ($params['RELATION'] as $relation) { if ($relation['EXTERNAL_AUTH_ID'] === \Bitrix\Im\Bot::EXTERNAL_AUTH_ID) { $botList[(int)$relation['USER_ID']] = (int)$relation['USER_ID']; } } } $result = true; foreach ($botList as $botId) { $botData = \Bitrix\Im\Bot::getCache($botId); if (!$botData) { continue; } if ( class_exists($botData['CLASS'], true) && method_exists($botData['CLASS'], 'onStartWriting') ) { $params['BOT_ID'] = $botId; Log::write($params, 'START WRITING'); $result = call_user_func([$botData['CLASS'], 'onStartWriting'], $params); } } return $result; } /** * Handler for "im:OnSessionVote" event. * @see \CIMMessenger::LinesSessionVote * @see \Bitrix\Imbot\Bot\NetworkBot::onSessionVote * * @param array $params * @return bool */ public static function onSessionVote($params) { $botList = []; if (empty($params['CHAT'])) { $botList[] = (int)$params['DIALOG_ID']; } elseif (!empty($params['RELATION'])) { foreach ($params['RELATION'] as $relation) { if ($relation['EXTERNAL_AUTH_ID'] === \Bitrix\Im\Bot::EXTERNAL_AUTH_ID) { $botList[(int)$relation['USER_ID']] = (int)$relation['USER_ID']; } } } $result = true; foreach ($botList as $botId) { $botData = \Bitrix\Im\Bot::getCache($botId); if (!$botData) { continue; } if ( class_exists($botData['CLASS']) && method_exists($botData['CLASS'], 'onSessionVote') ) { $params['BOT_ID'] = $botId; Log::write($params, 'SESSION VOTE'); $result = call_user_func([$botData['CLASS'], 'onSessionVote'], $params); } } return $result; } }
/var/www/axolotl/data/www/./b24.axolotl.ru/public_html/bitrix/modules/imbot/lib/event.php