uawdijnntqw1x1x1
IP : 3.128.29.244
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
/
yar.axolotls.ru
/
bitrix
/
modules
/
imconnector
/
lib
/
chat.php
/
/
<?php /** * Created by PhpStorm. * User: varfolomeev * Date: 22.01.2019 * Time: 12:18 */ namespace Bitrix\ImConnector; use \Bitrix\ImConnector\Model\ChatLastMessageTable; class Chat { /** * @param $fields * * @return \Bitrix\Main\ORM\Data\AddResult|\Bitrix\Main\ORM\Data\UpdateResult * @throws \Bitrix\Main\ArgumentException * @throws \Bitrix\Main\ObjectPropertyException * @throws \Bitrix\Main\SystemException */ public static function setLastMessage($fields) { $lastMessage = self::getLastMessage($fields['EXTERNAL_CHAT_ID'], $fields['CONNECTOR']); if (!empty($lastMessage['ID'])) { $result = ChatLastMessageTable::update( $lastMessage['ID'], array( 'EXTERNAL_MESSAGE_ID' => $fields['EXTERNAL_MESSAGE_ID'] ) ); } else { $result = ChatLastMessageTable::add( array( 'EXTERNAL_CHAT_ID' => $fields['EXTERNAL_CHAT_ID'], 'CONNECTOR' => $fields['CONNECTOR'], 'EXTERNAL_MESSAGE_ID' => $fields['EXTERNAL_MESSAGE_ID'] ) ); } return $result; } /** * @param $externalChatId * @param $connector * * @return mixed * @throws \Bitrix\Main\ArgumentException * @throws \Bitrix\Main\ObjectPropertyException * @throws \Bitrix\Main\SystemException */ public static function getChatLastMessageId($externalChatId, $connector) { $message = self::getLastMessage($externalChatId, $connector); return $message['EXTERNAL_MESSAGE_ID']; } /** * @param $externalChatId * @param $connector * * @return array|false * @throws \Bitrix\Main\ArgumentException * @throws \Bitrix\Main\ObjectPropertyException * @throws \Bitrix\Main\SystemException */ public static function getLastMessage($externalChatId, $connector) { $message = ChatLastMessageTable::getList( [ 'filter' => [ '=EXTERNAL_CHAT_ID' => $externalChatId, '=CONNECTOR' => $connector ], 'limit' => '1', 'order' => [ 'ID' => 'DESC' ] ] )->fetch(); return $message; } /** * @param $externalChatId * @param $connector * * @throws \Bitrix\Main\ArgumentException * @throws \Bitrix\Main\ObjectPropertyException * @throws \Bitrix\Main\SystemException */ public static function deleteLastMessage($externalChatId, $connector) { $lastMessage = self::getLastMessage($externalChatId, $connector); if (!empty($lastMessage['ID'])) { ChatLastMessageTable::delete($lastMessage['ID']); } } }
/var/www/axolotl/data/www/yar.axolotls.ru/bitrix/modules/imconnector/lib/chat.php