- Модуль: im
- Путь к файлу: ~/bitrix/modules/im/lib/V2/Message/Send/SendingService.php
- Класс: BitrixImV2MessageSendSendingService
- Вызов: SendingService::detectReasonSendError
private function detectReasonSendError($type, $reason = ''): string
{
if (!empty($reason))
{
$sanitizer = new CBXSanitizer;
$sanitizer->addTags([
'a' => ['href','style', 'target'],
'b' => [],
'u' => [],
'i' => [],
'br' => [],
'span' => ['style'],
]);
$reason = $sanitizer->sanitizeHtml($reason);
}
else
{
if ($type == Chat::IM_TYPE_PRIVATE)
{
$reason = Loc::getMessage('IM_ERROR_MESSAGE_CANCELED');
}
else if ($type == Chat::IM_TYPE_SYSTEM)
{
$reason = Loc::getMessage('IM_ERROR_NOTIFY_CANCELED');
}
else
{
$reason = Loc::getMessage('IM_ERROR_GROUP_CANCELED');
}
}
return $reason;
}