13 if (!in_array(
$params[
'MODULE_ID'], [
'im',
'imopenlines']))
18 $result = IM\Model\ChatTable::getList([
19 'select' => [
'ID',
'AUTHOR_ID'],
20 'filter' => [
'=AVATAR' =>
$params[
'ID']]
24 IM\Model\ChatTable::update($row[
'ID'], [
'AVATAR' =>
null]);
30 $bots = IM\Bot::getListCache();
36 if (mb_substr(
$params[
'LOGIN'], 0, mb_strlen(IM\Bot::LOGIN_START)) == IM\Bot::LOGIN_START)
41 '=EXTERNAL_AUTH_ID' => IM\Bot::EXTERNAL_AUTH_ID
46 $GLOBALS[
"APPLICATION"]->ThrowException(
GetMessage(
"IM_EVENT_ERROR_CHANGE_PASSWORD_FOR_BOT"),
"ERROR_CHANGE_PASSWORD_FOR_BOT");
57 '=EXTERNAL_AUTH_ID' => IM\Bot::EXTERNAL_AUTH_ID
62 $GLOBALS[
"APPLICATION"]->ThrowException(
GetMessage(
"IM_EVENT_ERROR_CHANGE_PASSWORD_FOR_BOT"),
"ERROR_CHANGE_PASSWORD_FOR_BOT");
70 public static function OnAddRatingVote($id,
$arParams)
72 if (!Loader::includeModule(
"socialnetwork"))
77 $ratingNotifyTag =
"RATING|".($arParams[
'VALUE'] >= 0 ?
"" :
"DL|").
$arParams[
'ENTITY_TYPE_ID'].
"|".
$arParams[
'ENTITY_ID'];
80 $ratingNotifyTag .=
"|".$arParams[
'REACTION'];
82 $ratingMentionNotifyTag =
'RATING_MENTION|' . (
$arParams[
'VALUE'] >= 0 ?
'' :
'DL|') .
$arParams[
'ENTITY_TYPE_ID'] .
'|' .
$arParams[
'ENTITY_ID'];
85 "RATING_TYPE_ID" =>
$arParams[
'ENTITY_TYPE_ID'],
86 "RATING_ENTITY_ID" =>
$arParams[
'ENTITY_ID']
91 $liveFeedEntity = Livefeed\Provider::init([
103 $originalText = $liveFeedEntity->getSourceOriginalText();
104 $auxData = $liveFeedEntity->getSourceAuxData();
111 $handlerManager =
new Bitrix\Socialnetwork\CommentAux\HandlerManager();
113 if($handler = $handlerManager->getHandlerByPostText($originalText))
121 $handler->setOptions([
125 $handler->sendRatingNotification($auxData,
$arParams);
131 $title = $liveFeedEntity->getSourceTitle();
133 $url = $liveFeedEntity->getLiveFeedUrl();
135 $arMentionedUserID = [];
138 preg_match_all(
"/\[user\s*=\s*([^\]]*)\](.+?)\[\/user\]/isu",
$description, $mention);
139 if (!empty($mention))
141 $arMentionedUserID = array_merge($arMentionedUserID, $mention[1]);
144 $arMentionedUserID = array_unique($arMentionedUserID);
151 || !empty($arMentionedUserID)
158 in_array(
'photo_photo', $liveFeedEntity->getEventId())
159 || in_array(
'photo', $liveFeedEntity->getEventId())
164 elseif (in_array(
'wiki', $liveFeedEntity->getEventId()))
169 $arParams[
"ENTITY_TITLE"] = trim(strip_tags(str_replace([
"\r\n",
"\n",
"\r"],
' ',
$title)));
181 $originalLink =
$arParams[
"ENTITY_LINK"];
184 if ($bExtranetInstalled)
187 $extranet_site_id = CExtranet::GetExtranetSiteID();
190 while($arSite = $dbSite->Fetch())
193 "DIR" => (trim($arSite[
"DIR"]) <>
'' ? $arSite[
"DIR"] :
"/"),
194 "SERVER_NAME" => (trim($arSite[
"SERVER_NAME"]) <>
'' ? $arSite[
"SERVER_NAME"] : COption::GetOptionString(
"main",
"server_name",
$_SERVER[
"HTTP_HOST"]))
198 $bSentToOwner =
false;
207 if ($followValue !=
"N")
219 "TO_USER_ID" => intval(
$arParams[
'OWNER_ID']),
220 "FROM_USER_ID" => intval(
$arParams[
'USER_ID']),
222 "NOTIFY_MODULE" =>
"main",
223 "NOTIFY_EVENT" =>
"rating_vote",
224 "NOTIFY_TAG" => $ratingNotifyTag,
225 "NOTIFY_SUB_TAG" => $ratingNotifyTag.
'|'.intval(
$arParams[
'OWNER_ID']),
233 if (is_array($arMentionedUserID))
235 if (in_array(
$arParams[
'ENTITY_TYPE_ID'], [
"BLOG_COMMENT",
"FORUM_POST"]))
240 "RATING_TYPE_ID" =>
$arParams[
'ENTITY_TYPE_ID'],
241 "RATING_ENTITY_ID" =>
$arParams[
'ENTITY_ID']
247 if ($arLogComment = $rsLogComment->Fetch())
249 $logId = $arLogComment[
"LOG_ID"];
257 "RATING_TYPE_ID" =>
$arParams[
'ENTITY_TYPE_ID'],
258 "RATING_ENTITY_ID" =>
$arParams[
'ENTITY_ID']
264 if ($arLog = $rsLog->Fetch())
266 $logId = $arLog[
"ID"];
270 if (intval($logId) > 0)
274 foreach ($arMentionedUserID as $mentioned_user_id)
277 $mentioned_user_id !=
$arParams[
'USER_ID']
278 && ($mentioned_user_id !=
$arParams[
'OWNER_ID'] || !$bSentToOwner)
283 intval($mentioned_user_id),
288 if ($followValue !=
"N")
292 intval($mentioned_user_id),
300 "TO_USER_ID" => intval($mentioned_user_id),
301 "FROM_USER_ID" => intval(
$arParams[
'USER_ID']),
303 "NOTIFY_MODULE" =>
"main",
304 "NOTIFY_EVENT" =>
"rating_vote_mentioned",
305 "NOTIFY_TAG" => $ratingMentionNotifyTag,
306 "NOTIFY_SUB_TAG" => $ratingMentionNotifyTag.
'|'.intval($mentioned_user_id),
331 static $intranetInstalled =
null;
333 if ($intranetInstalled ===
null)
340 ? ($intranetInstalled ?
'_REACT' :
'_LIKE')
365 'select' => [
'PERSONAL_GENDER']
367 if ($userFields =
$res->fetch())
369 switch ($userFields[
'PERSONAL_GENDER'])
373 $genderSuffix =
'_'.$userFields[
'PERSONAL_GENDER'];
379 $like .= $genderSuffix;
388 $arParams[
'ENTITY_TYPE_ID'] ==
'FORUM_POST'
389 ||
$arParams[
'ENTITY_TYPE_ID'] ==
'BLOG_COMMENT'
392 $stripped = $CCTP->strip_words(
$arParams[
"ENTITY_MESSAGE"], 199);
393 $arParams[
"ENTITY_MESSAGE"] = $stripped.(mb_strlen($stripped) != mb_strlen(
$arParams[
"ENTITY_MESSAGE"]) ?
'...' :
'');
397 $stripped = $CCTP->strip_words(
$arParams[
"ENTITY_TITLE"], 199);
398 $arParams[
"ENTITY_TITLE"] = $stripped.(mb_strlen($stripped) != mb_strlen(
$arParams[
"ENTITY_TITLE"]) ?
'...' :
'');
403 if (
$arParams[
'ENTITY_TYPE_ID'] ==
'BLOG_POST')
405 $message = str_replace(
'#LINK#',
$arParams[
"ENTITY_TITLE"], Loc::getMessage(
'IM_EVENT_RATING_BLOG_POST'.(
$arParams[
'MENTION'] ?
'_MENTION' :
'').$like,
null, $languageId));
409 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_MESSAGE"],
'',
''], Loc::getMessage(
'IM_EVENT_RATING_COMMENT'.(
$arParams[
'MENTION'] ?
'_MENTION' :
'').$like,
null, $languageId));
413 $message = str_replace(
'#LINK#',
$arParams[
"ENTITY_TITLE"], Loc::getMessage(
'IM_EVENT_RATING_FORUM_TOPIC'.$like,
null, $languageId));
417 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_MESSAGE"],
'',
''], Loc::getMessage(
'IM_EVENT_RATING_COMMENT'.(
$arParams[
'MENTION'] ?
'_MENTION' :
'').$like,
null, $languageId));
420 $arParams[
'ENTITY_TYPE_ID'] ==
'IBLOCK_SECTION'
426 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_BODY"],
'',
''], Loc::getMessage(
'IM_EVENT_RATING_PHOTO_ALBUM'.$like,
null, $languageId));
430 $message = str_replace([
'#A_START#',
'#A_END#'], [
'',
''], Loc::getMessage(
'IM_EVENT_RATING_PHOTO_ALBUM1'.$like,
null, $languageId));
434 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_TITLE"],
'',
''], Loc::getMessage(
'IM_EVENT_RATING_PHOTO_ALBUM'.$like,
null, $languageId));
438 $arParams[
'ENTITY_TYPE_ID'] ==
'IBLOCK_ELEMENT'
439 &&
$arParams[
'ENTITY_PARAM'] ==
'library'
442 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_TITLE"],
'',
''], Loc::getMessage(
'IM_EVENT_RATING_FILE'.$like,
null, $languageId));
445 $arParams[
'ENTITY_TYPE_ID'] ==
'IBLOCK_ELEMENT'
449 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_TITLE"],
'',
''], Loc::getMessage(
'IM_EVENT_RATING_WIKI'.$like,
null, $languageId));
452 $arParams[
'ENTITY_TYPE_ID'] ==
'IBLOCK_ELEMENT'
458 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_BODY"],
'',
''], Loc::getMessage(
'IM_EVENT_RATING_PHOTO'.$like,
null, $languageId));
462 $message = str_replace([
'#A_START#',
'#A_END#'], [
'',
''], Loc::getMessage(
'IM_EVENT_RATING_PHOTO1'.$like,
null, $languageId));
466 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_TITLE"],
'',
''], Loc::getMessage(
'IM_EVENT_RATING_PHOTO'.$like,
null, $languageId));
471 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_TITLE"],
'',
''], Loc::getMessage(
'IM_EVENT_RATING_COMMENT'.(
$arParams[
'MENTION'] ?
'_MENTION' :
'').$like,
null, $languageId));
486 Loc::getMessage(
'IM_EVENT_RATING_LISTS_NEW_ELEMENT_LIKE'.$like,
null, $languageId)
491 $message = str_replace(
'#LINK#',
$arParams[
"ENTITY_TITLE"], Loc::getMessage(
'IM_EVENT_RATING_ELSE'.$like,
null, $languageId));
496 $message .=
' ('.$arParams[
'ENTITY_LINK'].
')';
501 if (
$arParams[
'ENTITY_TYPE_ID'] ==
'BLOG_POST')
503 $message = str_replace(
'#LINK#',
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">'.
$arParams[
"ENTITY_TITLE"].
'</a>', Loc::getMessage(
'IM_EVENT_RATING_BLOG_POST'.(
$arParams[
'MENTION'] ?
'_MENTION' :
'').$like,
null, $languageId));
507 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_MESSAGE"],
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_COMMENT'.(
$arParams[
'MENTION'] ?
'_MENTION' :
'').$like,
null, $languageId));
511 $message = str_replace(
'#LINK#',
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">'.
$arParams[
"ENTITY_TITLE"].
'</a>', Loc::getMessage(
'IM_EVENT_RATING_FORUM_TOPIC'.$like,
null, $languageId));
515 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_MESSAGE"],
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_COMMENT'.(
$arParams[
'MENTION'] ?
'_MENTION' :
'').$like,
null, $languageId));
518 $arParams[
'ENTITY_TYPE_ID'] ==
'IBLOCK_ELEMENT'
519 &&
$arParams[
'ENTITY_PARAM'] ==
'library'
522 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_TITLE"],
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_FILE'.$like,
null, $languageId));
525 $arParams[
'ENTITY_TYPE_ID'] ==
'IBLOCK_ELEMENT'
529 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_TITLE"],
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_WIKI'.$like,
null, $languageId));
532 $arParams[
'ENTITY_TYPE_ID'] ==
'IBLOCK_SECTION'
538 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_BODY"],
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_PHOTO_ALBUM'.$like,
null, $languageId));
542 $message = str_replace([
'#A_START#',
'#A_END#'], [
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_PHOTO_ALBUM1'.$like,
null, $languageId));
546 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_TITLE"],
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_PHOTO_ALBUM'.$like,
null, $languageId));
550 $arParams[
'ENTITY_TYPE_ID'] ==
'IBLOCK_ELEMENT'
556 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_BODY"],
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_PHOTO'.$like,
null, $languageId));
560 $message = str_replace([
'#A_START#',
'#A_END#'], [
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_PHOTO1'.$like));
564 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_TITLE"],
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_PHOTO'.$like,
null, $languageId));
569 $message = str_replace([
'#TITLE#',
'#A_START#',
'#A_END#'], [
$arParams[
"ENTITY_TITLE"],
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
'</a>'], Loc::getMessage(
'IM_EVENT_RATING_COMMENT'.(
$arParams[
'MENTION'] ?
'_MENTION' :
'').$like,
null, $languageId));
581 '<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">',
584 Loc::getMessage(
'IM_EVENT_RATING_LISTS_NEW_ELEMENT'.$like,
null, $languageId)
589 $message = str_replace(
'#LINK#',
$arParams[
'ENTITY_LINK'] <>
''?
'<a href="'.
$arParams[
'ENTITY_LINK'].
'" class="bx-notifier-item-action">'.
$arParams[
"ENTITY_TITLE"].
'</a>':
'<i>'.
$arParams[
"ENTITY_TITLE"].
'</i>', Loc::getMessage(
'IM_EVENT_RATING_ELSE'.$like,
null, $languageId));
592 if ($intranetInstalled)
603 static $arSiteData =
false;
608 && CModule::IncludeModule(
'socialnetwork')
616 &&
count($arSiteData) > 1
619 foreach($arSiteData as
$siteId => $arUrl)
621 $url = str_replace($arUrl[
"USER_PATH"],
"#USER_PATH#",
$url);
633 mb_strpos(
$url,
"http://") === 0
634 || mb_strpos(
$url,
"https://") === 0
637 isset(
$arTmp[
"SERVER_NAME"])
638 && !empty(
$arTmp[
"SERVER_NAME"])
642 ).$arTmp[
"URLS"][
"URL"];
648 && intval($user_id) > 0
649 && $extranet_site_id <>
''
650 && $intranet_site_id <>
''
653 $bExtranetUser =
false;
656 $bExtranetUser =
true;
657 $rsUser = CUser::GetByID(intval($user_id));
658 if ($arUser = $rsUser->Fetch())
660 if (intval($arUser[
"UF_DEPARTMENT"][0]) > 0)
662 $bExtranetUser =
false;
670 if (mb_substr($link, 0, mb_strlen(
$arSites[$extranet_site_id][
'DIR'])) ==
$arSites[$extranet_site_id][
'DIR'])
672 $link = mb_substr($link, mb_strlen(
$arSites[$extranet_site_id][
'DIR']));
675 $SiteServerName =
$arSites[$extranet_site_id][
'SERVER_NAME'].$arSites[$extranet_site_id][
'DIR'].ltrim($link,
"/");
680 if (mb_substr($link, 0, mb_strlen(
$arSites[$intranet_site_id][
'DIR'])) ==
$arSites[$intranet_site_id][
'DIR'])
682 $link = mb_substr($link, mb_strlen(
$arSites[$intranet_site_id][
'DIR']));
685 $SiteServerName =
$arSites[$intranet_site_id][
'SERVER_NAME'].$arSites[$intranet_site_id][
'DIR'].ltrim($link,
"/");
688 $url = (CMain::IsHTTPS() ?
"https" :
"http").
"://".$SiteServerName;
692 $SiteServerName = (defined(
'SITE_SERVER_NAME') && SITE_SERVER_NAME <>
'' ? SITE_SERVER_NAME : COption::GetOptionString(
"main",
"server_name",
$_SERVER[
'SERVER_NAME']));
693 if ($SiteServerName <>
'')
695 $url = (CMain::IsHTTPS() ?
"https" :
"http").
"://".$SiteServerName.$url;
703 private static function GetMessageRatingLogCommentURL($arComment, $user_id =
false,
$arSites =
false, $intranet_site_id =
false, $extranet_site_id =
false)
708 !is_array($arComment)
709 || !isset($arComment[
"ENTITY_TYPE"]) || $arComment[
"ENTITY_TYPE"] ==
''
710 || !isset($arComment[
"ID"]) || intval($arComment[
"ID"]) <= 0
711 || !isset($arComment[
"LOG_ID"]) || intval($arComment[
"LOG_ID"]) <= 0
719 && intval($user_id) > 0
720 && $extranet_site_id <>
''
721 && $intranet_site_id <>
''
724 $bExtranetUser =
false;
727 $bExtranetUser =
true;
729 if ($arUser = $rsUser->Fetch())
731 if (intval($arUser[
"UF_DEPARTMENT"][0]) > 0)
733 $bExtranetUser =
false;
738 $user_site_id = ($bExtranetUser ? $extranet_site_id : $intranet_site_id);
740 $url = (in_array($arComment[
"ENTITY_TYPE"], [
"CRMLEAD",
"CRMCONTACT",
"CRMCOMPANY",
"CRMDEAL",
"CRMACTIVITY"]) ?
$arSites[$user_site_id][
"DIR"].
"crm/stream?log_id=#log_id#" :
COption::GetOptionString(
"socialnetwork",
"log_entry_page",
$arSites[$user_site_id][
"DIR"].
"company/personal/log/#log_id#/", $user_site_id));
741 $url = str_replace(
"#log_id#", $arComment[
"LOG_ID"],
$url);
742 $url .= (mb_strpos(
$url,
"?") !==
false ?
"&" :
"?").
"commentId=".$arComment[
"ID"].
"#com".$arComment[
"ID"];
747 $url = (in_array($arComment[
"ENTITY_TYPE"], [
"CRMLEAD",
"CRMCONTACT",
"CRMCOMPANY",
"CRMDEAL",
"CRMACTIVITY"]) ?
SITE_DIR.
"crm/stream?log_id=#log_id#" :
COption::GetOptionString(
"socialnetwork",
"log_entry_page",
SITE_DIR.
"company/personal/log/#log_id#/",
SITE_ID));
748 $url = str_replace(
"#log_id#", $arComment[
"LOG_ID"],
$url);
749 $url .= (mb_strpos(
$url,
"?") !==
false ?
"&" :
"?").
"commentId=".$arComment[
"ID"].
"#com".$arComment[
"ID"];
751 $SiteServerName = (defined(
'SITE_SERVER_NAME') && SITE_SERVER_NAME <>
'' ? SITE_SERVER_NAME :
COption::GetOptionString(
"main",
"server_name",
$_SERVER[
'SERVER_NAME']));
752 if ($SiteServerName <>
'')
769 $user = IM\V2\Entity\User\User::getInstance((
int)
$arParams[
"ID"]);
770 IM\V2\Entity\User\UserFactory::getInstance()->clearCache((
int)
$arParams[
"ID"]);
772 IM\V2\Message\CounterService::onAfterUserUpdate(
$arParams);
773 IM\V2\Chat\User\OwnerService::onAfterUserUpdate(
$arParams);
775 $commonChatId = CIMChat::GetGeneralChatId();
776 if ($commonChatId > 0 && (isset(
$arParams[
'ACTIVE']) || isset(
$arParams[
'UF_DEPARTMENT'])))
782 if ($commonChatId && CIMChat::GetRelationById($commonChatId,
$arParams[
"ID"],
true,
false))
784 $chat->DeleteUser($commonChatId,
$arParams[
"ID"],
false);
789 $commonChatId = CIMChat::GetGeneralChatId();
802 $userInChat = CIMChat::GetRelationById($commonChatId,
$arParams[
"ID"],
true,
false);
803 $userCanJoin = CIMChat::CanJoinGeneralChatId(
$arParams[
"ID"]);
805 if ($userInChat && !$userCanJoin)
807 $chat->DeleteUser($commonChatId,
$arParams[
"ID"],
false);
809 else if (!$userInChat && $userCanJoin)
811 $chat->AddUser($commonChatId, [
$arParams[
"ID"]],
false,
true,
true);
819 self::updateChatUserCounter(
$arParams[
"ID"]);
823 private static function updateChatUserCounter(
$userId): void
828 INNER JOIN b_im_relation R ON C.ID = R.CHAT_ID
831 FROM b_im_relation R1
832 INNER JOIN b_user U ON R1.USER_ID = U.ID
833 WHERE R1.CHAT_ID = C.ID AND U.ACTIVE = 'Y'
838 $DB->Query($sql,
true);
851 $isRecentExists = \Bitrix\Im\Model\RecentTable::getList([
861 FROM b_im_chat C, b_im_relation R
870 $accessProvider = new \Bitrix\Im\Access\ChatAuthProvider;
871 $accessProvider->deleteByUser(
$ID);
873 if (
count($arChat) > 0)
875 $strSQL =
"DELETE FROM b_im_chat WHERE ID IN (".implode(
',', $arChat).
")";
876 $DB->Query($strSQL,
true);
878 $strSQL =
"DELETE FROM b_im_message WHERE CHAT_ID IN (".implode(
',', $arChat).
")";
879 $DB->Query($strSQL,
true);
881 $strSQL =
"DELETE FROM b_im_relation WHERE CHAT_ID IN (".implode(
',', $arChat).
")";
882 $DB->Query($strSQL,
true);
884 IM\V2\Link\Url\UrlCollection::deleteByChatsIds($arChat);
885 foreach ($arChat as $id)
887 IM\V2\Chat::cleanCache((
int)$id);
892 $strSQL =
"DELETE FROM b_im_message WHERE AUTHOR_ID = ".$ID;
893 $DB->Query($strSQL,
true);
895 $strSQL =
"DELETE FROM b_im_relation WHERE USER_ID =".$ID;
896 $DB->Query($strSQL,
true);
898 IM\V2\Link\Url\UrlCollection::deleteByAuthorsIds([
$ID]);
901 \Bitrix\Im\Bot::unRegister([
'BOT_ID' =>
$ID]);
903 $strSQL =
"DELETE FROM b_im_recent WHERE USER_ID = ".$ID;
904 $DB->Query($strSQL,
true);
906 $strSQL =
"DELETE FROM b_im_recent WHERE ITEM_TYPE = '".IM_MESSAGE_PRIVATE.
"' AND ITEM_ID = ".
$ID;
907 $DB->Query($strSQL,
true);
909 $strSQL =
"DELETE FROM b_im_status WHERE USER_ID = ".$ID;
910 $DB->Query($strSQL,
true);
912 $strSQL =
"DELETE FROM b_im_recent WHERE ITEM_TYPE = '".IM_MESSAGE_PRIVATE.
"' and ITEM_ID = ".
$ID;
913 $DB->Query($strSQL,
true);
915 if ($isRecentExists && CModule::IncludeModule(
'pull'))
921 'command' =>
'chatHide',
928 'extra' => \
Bitrix\Im\Common::getPullExtra()
939 'USE' => [
"PUBLIC_SECTION"]
954 "NAME" =>
GetMessage(
'DESKTOP_APPLICATION_NAME'),
955 "DESCRIPTION" =>
GetMessage(
"DESKTOP_APPLICATION_DESC"),
957 "CLASS" =>
"DesktopApplication",
if(!Loader::includeModule('messageservice')) $provider
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static getOnlineIntranetUsers()
static isModuleInstalled($moduleName)
static getList(array $parameters=array())
static add($recipient, array $parameters, $channelType=\CPullChannel::TYPE_PRIVATE)
static GetOptionString($module_id, $name, $def="", $site=false, $bExactSite=false)
static GetDefSite($LID=false)
static GetList($by="sort", $order="asc", $arFilter=[])
static OnBeforeUserSendPassword($params)
static GetMessageRatingEntityURL($url, $user_id=false, $arSites=false, $intranet_site_id=false, $extranet_site_id=false)
static OnGetDependentModule()
static OnFileDelete($params)
static GetMessageRatingVote($arParams, $bForMail=false, ?string $languageId=null)
static OnCancelRatingVote($id, $arParams)
static OnAfterUserAdd($arParams)
static OnAfterUserUpdate($arParams)
static IncludeModule($module_name)
static getRatingLikeMessage($emotion, $safe=true)
static GetExactValueByRating($user_id, $rating_type_id, $rating_entity_id)
static GetList($arOrder=Array("ID"=> "DESC"), $arFilter=Array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array(), $arParams=array())
static CheckForUserOnly($logID, $userID)
static clearAllTags($text)
static OnApplicationsBuildList()
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
$_SERVER["DOCUMENT_ROOT"]
const SITE_DIR(!defined('LANG'))
ExecuteModuleEventEx($arEvent, $arParams=[])
IsModuleInstalled($module_id)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
$GLOBALS['____1690880296']
if(intval($iTestTransaction) > 0) $arTmp
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']