152 static $parser =
null;
156 && (int)
$params[
'AUTHOR_ID'] > 0
163 && (
string)
$params[
'MESSAGE'] !==
''
173 $module = (
$params[
'MODULE'] ??
'tasks');
183 if ($parser ===
null)
185 $parser = new \CTextParser();
188 $commentEventId =
false;
191 if (in_array($this->
getLogEventId(), $providerIntranetNewUser->getEventId(),
true))
193 $commentEventId =
'intranet_new_user_comment';
196 if (!$commentEventId)
199 if (in_array($this->
getLogEventId(), $providerBitrix24NewUser->getEventId(),
true))
201 $commentEventId =
'bitrix24_new_user_comment';
205 if (!$commentEventId)
208 if (in_array($this->
getLogEventId(), $providerPhotogalleryAlbum->getEventId(),
true))
210 $commentEventId =
'photoalbum_comment';
214 if (!$commentEventId)
216 $commentEventId =
'data_comment';
219 $sonetCommentFields =
array(
222 "EVENT_ID" => $commentEventId,
224 "TEXT_MESSAGE" => $parser->convert4mail(
$message),
225 "MODULE_ID" => $module,
227 "RATING_TYPE_ID" =>
"LOG_COMMENT",
228 "USER_ID" => $authorId,
229 "=LOG_DATE" => \CDatabase::currentTimeFunction(),
232 if (!empty(
$params[
'SHARE_DEST']))
234 $sonetCommentFields[
'SHARE_DEST'] =
$params[
'SHARE_DEST'];
237 if ($sonetCommentId = \CSocNetLogComments::add($sonetCommentFields,
false,
false))
239 \CSocNetLogComments::update($sonetCommentId,
array(
240 "RATING_ENTITY_ID" => $sonetCommentId
245 'sonetCommentId' => $sonetCommentId,
246 'sourceCommentId' => $sonetCommentId