- Модуль: im
- Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
- Класс: CIMRestService
- Вызов: CIMRestService::dialogUnread
static function dialogUnread($arParams, $n, CRestServer $server)
{
$arParams = array_change_key_case($arParams, CASE_UPPER);
$arParams['MESSAGE_ID'] = intval($arParams['MESSAGE_ID']);
if ($arParams['MESSAGE_ID'] <= 0)
{
throw new BitrixRestRestException("First unread message id can't be empty", "MESSAGE_ID_ERROR", CRestServer::STATUS_WRONG_REQUEST);
}
if (!BitrixImCommon::isDialogId($arParams['DIALOG_ID']))
{
throw new BitrixRestRestException("Dialog ID can't be empty", "DIALOG_ID_EMPTY", CRestServer::STATUS_WRONG_REQUEST);
}
BitrixImDialog::unread($arParams['DIALOG_ID'], $arParams['MESSAGE_ID']);
return true;
}