24 $result =
new EventResult(EventResult::UNDEFINED, [],
'socialnetwork');
29 if ($taskId <= 0 || $userId <= 0)
36 $liveFeedEntity = Provider::init([
37 'ENTITY_TYPE' => Provider::DATA_ENTITY_TYPE_TASKS_TASK,
38 'ENTITY_ID' => $taskId,
42 $liveFeedEntity->setContentView([
'user_id' => $userId]);
43 self::updateUserCounter([
45 'logId' => $liveFeedEntity->getLogId(),
50 return new EventResult(EventResult::SUCCESS, [],
'socialnetwork');
114 EventResult::UNDEFINED,
127 || $option !== \
Bitrix\Tasks\Internals\UserOption\Option::MUTED
128 || !Loader::includeModule(
'tasks')
135 $provider = new \Bitrix\Socialnetwork\Livefeed\TasksTask();
138 '@EVENT_ID' => $provider->getEventId(),
139 '=SOURCE_ID' => $taskId
143 if ($logFields = $res->fetch())
145 $logId = (int)$logFields[
'ID'];
155 \CSocNetLogFollow::delete($userId,
'L'.$logId);
156 $followDate = ConvertTimeStamp(time() + \CTimeZone::getOffset(),
'FULL', SITE_ID);
159 \CSocNetLogFollow::set($userId,
'L'.$logId, ($added ?
'N' :
'Y'), $followDate);
162 EventResult::SUCCESS,