1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
DeleteService.php
См. документацию.
1<?php
2
4
5use Bitrix\Disk\SystemUser;
16use Bitrix\Im\V2\Permission\Action;
26use ReflectionNamedType;
27
29{
30 use ContextCustomer
31 {
32 setContext as private defaultSetContext;
33 }
34
35 public const EVENT_AFTER_MESSAGE_DELETE = 'OnAfterMessagesDelete';
36 public const OPTION_KEY_DELETE_AFTER = 'complete_delete_message_start_date';
37 private MessageCollection $messages;
38 private array $messagesForEvent = [];
39 private array $messagesDeletionModes = [];
40 private bool $byEvent = false;
41 private Chat $chat;
42 private bool $isModeSpecified = false;
43 private bool $needUpdateRecent = false;
44 private array $counters;
45 private array $lastMessageViewers;
46 private bool $isPermissionFilled = false;
47 private \WeakMap $deletionTypeMap;
48 private \WeakMap $sortedMessagesByMode;
49
50 public function __construct(MessageCollection $messages)
51 {
52 $this->setMessages($messages);
54 }
55
56 protected function initializeDefaultValues(): self
57 {
58 $this->deletionTypeMap = new \WeakMap();
59 foreach (MessageType::cases() as $type)
60 {
61 $this->deletionTypeMap[$type] = DeletionMode::None;
62 }
63
64 $this->sortedMessagesByMode = new \WeakMap();
65 foreach (DeletionMode::cases() as $case)
66 {
67 $this->sortedMessagesByMode[$case] = [];
68 }
69
70 return $this;
71 }
72
73 public static function getInstanceByMessage(Message $message): self
74 {
75 $collection = new MessageCollection();
76 $collection->add($message);
77
78 return (new self($collection));
79 }
80
81 protected function setMessages(MessageCollection $messages): self
82 {
83 $this->messages = $messages;
84 $chatId = $this->messages->getCommonChatId() ?? 0;
85 Chat::cleanCache($chatId);
86 $this->chat = Chat::getInstance($chatId);
87
88 return $this;
89 }
90
95 public function setMode(?DeletionMode $mode = null): self
96 {
97 if (!isset($mode) || ($mode === DeletionMode::None))
98 {
99 $this->isModeSpecified = false;
100 return $this;
101 }
102
103 $this->isModeSpecified = true;
104 $this->setDeletionMode(MessageType::OwnMessageRead, $mode)
105 ->setDeletionMode(MessageType::OwnMessageUnread, $mode)
106 ->setDeletionMode(MessageType::OtherMessage, $mode)
107 ;
108
109 return $this;
110 }
111
112 public function canDelete(int $messageId): DeletionMode
113 {
114 if (!isset($this->messages[$messageId]))
115 {
116 return DeletionMode::None;
117 }
118
119 if (!$this->isModeSpecified && !$this->isPermissionFilled)
120 {
121 $this->fillPermissions();
122 }
123
124 $messageType = $this->defineMessageType($this->messages[$messageId]);
125 return $this->getDeletionMode($messageType);
126 }
127
128 public function setByEvent(bool $byEvent): self
129 {
130 $this->byEvent = $byEvent;
131
132 return $this;
133 }
134
138 public function delete(): Result
139 {
140 if ($this->chat instanceof Chat\NullChat)
141 {
142 return new Result();
143 }
144
145 if (!$this->isModeSpecified)
146 {
147 if (!$this->chat->checkAccess($this->getContext()->getUserId())->isSuccess())
148 {
149 return (new Result())->addError(new Message\MessageError(Message\MessageError::ACCESS_DENIED));
150 }
151
152 $this->fillPermissions();
153 }
154
155 $chatLastMessageId = $this->chat->getLastMessageId();
156 $this->messages->fillFiles();
157 $this->assignToGroups();
158 $this->fillMessagesForEvent();
159
160 foreach (DeletionMode::cases() as $deletionMode)
161 {
163 $this->getMessageCollectionByMode($deletionMode),
164 $deletionMode
165 )
166 ->setContext($this->getContext())
167 ->delete()
168 ;
169 }
170
171 $this->needUpdateRecent = $this->chat->getLastMessageId() !== $chatLastMessageId;
172 $this->onAfterDelete();
173
174 return new Result();
175 }
176
177 private function onAfterDelete(): void
178 {
179 $ids = $this->sortedMessagesByMode[DeletionMode::None] ?? [];
180 $this->clearMessagesByIds($ids);
181
182 $this->fireEventAfterMessagesDelete();
183
184 $this->sendPullMessage();
185
186 if (Option::get('im', 'message_history_index'))
187 {
188 MessageIndexTable::deleteByFilter(['=MESSAGE_ID' => $this->messages->getPrimaryIds()]);
189 }
190
191 (new UrlService())->deleteUrlsByMessages($this->messages);
192
193 $this->deleteAnchors();
194
195 $this->sendAnalyticsData();
196 }
197
198 private function clearMessagesByIds(array $ids): void
199 {
200 $this->messages->unsetByKeys($ids);
201 foreach ($ids as $id)
202 {
203 if (isset($this->messagesForEvent[$id]))
204 {
205 unset($this->messagesForEvent[$id]);
206 }
207 }
208 }
209
210 private function isCompleteDelete(int $messageId): bool
211 {
215 $mode = $this->messagesDeletionModes[$messageId];
216
217 return $mode === DeletionMode::Complete;
218 }
219
226 protected function setDeletionMode(MessageType $messageType, DeletionMode $mode): self
227 {
228 $this->deletionTypeMap[$messageType] = $mode;
229 return $this;
230 }
231
237 protected function getDeletionMode(MessageType $messageType): DeletionMode
238 {
239 return $this->deletionTypeMap[$messageType] ?? DeletionMode::None;
240 }
241
242 protected function assignToGroups(): void
243 {
244 foreach ($this->messages as $message)
245 {
246 if ($message->getId() === null)
247 {
248 continue;
249 }
250
251 $messageType = $this->defineMessageType($message);
252 $mode = $this->getDeletionMode($messageType);
253 $this->sortedMessagesByMode[$mode][] = $message->getId();
254 $this->messagesDeletionModes[$message->getId()] = $mode;
255 }
256 }
257
262 protected function getMessageCollectionByMode(DeletionMode $mode = DeletionMode::None): MessageCollection
263 {
264 $ids = $this->sortedMessagesByMode[$mode] ?? [];
265 $collection = $this->messages->filter(
266 fn (Message $message) => in_array($message->getId(), $ids, true)
267 );
268
269 return $collection;
270 }
271
273 {
274 if ($this->isOwnMessage($message))
275 {
276 return $message->isViewedByOthers() ? MessageType::OwnMessageRead : MessageType::OwnMessageUnread;
277 }
278
280 }
281
282 private function fillPermissions(): void
283 {
284 if ($this->isPermissionFilled)
285 {
286 return;
287 }
288 $this->isPermissionFilled = true;
289
290 // case of deletion, if user is SuperAdmin
291 if ($this->getContext()->getUser()->isSuperAdmin())
292 {
293 $this->setDeletionMode(MessageType::OwnMessageUnread, DeletionMode::Complete)
294 ->setDeletionMode(MessageType::OwnMessageRead, DeletionMode::Complete)
296 ;
297
298 return;
299 }
300
301 // case of deletion in OpenLineChat
302 if ($this->chat instanceof Chat\OpenLineChat && Loader::includeModule('imopenlines'))
303 {
305
306 return;
307 }
308
309 // case of deletion other users messages
310 if ($this->chat->canDo(Action::DeleteOthersMessage))
311 {
312 $deletionModeOtherMessage = $this->chat instanceof Chat\CommentChat ? DeletionMode::Soft : DeletionMode::Complete;
313 $this->setDeletionMode(MessageType::OtherMessage, $deletionModeOtherMessage);
314 }
315
316 // case of deletion own messages(read/unread) in ChannelChat and GeneralChat
317 if ($this->chat instanceof Chat\ChannelChat || $this->chat instanceof Chat\GeneralChat)
318 {
319 if ($this->chat->canDo(Action::Send))
320 {
321 $this->setDeletionMode(MessageType::OwnMessageUnread, DeletionMode::Complete)
322 ->setDeletionMode(MessageType::OwnMessageRead, DeletionMode::Complete)
323 ;
324 }
325
326 return;
327 }
328
329 // if viewed by others -> "complete"(CommentChat - "soft")
330 // if not viewed by others -> "soft"
331 $deletionModeSelfMessage = $this->chat instanceof Chat\CommentChat ? DeletionMode::Soft : DeletionMode::Complete;
332 $this->setDeletionMode(MessageType::OwnMessageRead, DeletionMode::Soft)
333 ->setDeletionMode(MessageType::OwnMessageUnread, $deletionModeSelfMessage)
334 ;
335 }
336
337 protected function fillPermissionsForOpenLine(): void
338 {
339 if (!($this->chat instanceof Chat\OpenLineChat))
340 {
341 return;
342 }
343
344 if ($this->getContext()->getUser()->isBot())
345 {
346 $this->setDeletionMode(MessageType::OwnMessageUnread, DeletionMode::Complete)
347 ->setDeletionMode(MessageType::OwnMessageRead, DeletionMode::Complete)
349 ;
350
351 return;
352 }
353
354 if ($this->chat->canDeleteOwnMessage())
355 {
356 $this->setDeletionMode(MessageType::OwnMessageUnread, DeletionMode::Soft)
357 ->setDeletionMode(MessageType::OwnMessageRead, DeletionMode::Soft)
358 ;
359 }
360
361 if (
362 $this->chat->canDeleteMessage()
363 && $this->chat->canDo(Action::DeleteOthersMessage)
364 )
365 {
366 $this->setDeletionMode(MessageType::OtherMessage, DeletionMode::Soft);
367 }
368 }
369
370 protected function isOwnMessage(Message $message): bool
371 {
372 return
373 $this->getContext()->getUserId() === $message->getAuthorId()
374 && !$message->isSystem()
375 ;
376 }
377
378 private function getMessageOut(Message $message): string
379 {
380 $date = $message->getDateCreate()?->toString();
381
382 return Loc::getMessage('IM_MESSAGE_DELETED_OUT', ['#DATE#' => $date]) ?? '';
383 }
384
385 protected function sendPullOpenLineMessages(): Result
386 {
387 if (!($this->chat instanceof Chat\OpenLineChat || $this->chat instanceof Chat\OpenLineLiveChat))
388 {
389 return new Result;
390 }
391
392 $relations = $this->chat->getRelations()->getUserIds();
393
394 foreach ($this->messages as $message)
395 {
396 $pullMessage = $this->getFormatOpenLinePullMessage($message);
397 \Bitrix\Pull\Event::add($relations, $pullMessage);
398
399 $pullMessage['extra']['is_shared_event'] = true;
400 if ($this->chat->needToSendPublicPull())
401 {
402 \CPullWatch::AddToStack('IM_PUBLIC_' . $this->chat->getChatId(), $pullMessage);
403 }
404 }
405
406 return new Result;
407 }
408
409 private function sendPullMessage(): Result
410 {
411 if ($this->chat instanceof Chat\OpenLineChat || $this->chat instanceof Chat\OpenLineLiveChat)
412 {
413 return $this->sendPullOpenLineMessages();
414 }
415
416 $pullMessage = $this->getFormatPullMessage();
417
418 if ($this->chat instanceof Chat\PrivateChat)
419 {
420 $userId = $this->chat->getAuthorId();
421 $companionUserId = $this->chat->getCompanion($userId)->getId();
422 $this->sendPullMessagePrivate($userId, $companionUserId, $pullMessage);
423 $this->sendPullMessagePrivate($companionUserId, $userId, $pullMessage);
424 }
425 else
426 {
427 $groupedPullMessage = $this->groupPullByCounter($pullMessage);
428 foreach ($groupedPullMessage as $pullForGroup)
429 {
430 Event::add($pullForGroup['users'], $pullForGroup['event']);
431 }
432
433 $pullMessage['extra']['is_shared_event'] = true;
434 $pullMessage['params']['recentConfig']['sections'] = $this->chat->getRecentSectionsForGuest();
435
436 if ($this->chat->getType() === Chat::IM_TYPE_COMMENT)
437 {
438 \CPullWatch::AddToStack('IM_PUBLIC_COMMENT_' . $this->chat->getParentChatId(), $pullMessage);
439 }
440
441 if ($this->chat->needToSendPublicPull())
442 {
443 \CPullWatch::AddToStack('IM_PUBLIC_' . $this->chat->getChatId(), $pullMessage);
444 }
445 if ($this->chat->getType() === Chat::IM_TYPE_OPEN_CHANNEL && $this->needUpdateRecent)
446 {
447 Chat\OpenChannelChat::sendSharedPull($pullMessage);
448 }
449 }
450
451 return new Result;
452 }
453
454 private function sendPullMessagePrivate(int $fromUser, int $toUser, array $pullMessage): void
455 {
456 $isMuted = false;
457 $relation = $this->chat->getRelations()->getByUserId($toUser, $this->chat->getChatId());
458 if ($relation !== null)
459 {
460 $isMuted = $relation->getNotifyBlock() ?? false;
461 }
462 $pullMessage['params']['dialogId'] = $fromUser;
463 $pullMessage['params']['fromUserId'] = $fromUser;
464 $pullMessage['params']['toUserId'] = $toUser;
465 $pullMessage['params']['counter'] = $this->getCounter($toUser);
466 $pullMessage['params']['unread'] = Recent::isUnread($toUser, $this->chat->getType(), $fromUser);
467 $pullMessage['params']['muted'] = $isMuted;
468 if ($this->needUpdateRecent)
469 {
470 $pullMessage['params']['lastMessageViews'] = $this->getLastViewers($toUser);
471 }
472 Event::add($toUser, $pullMessage);
473 }
474
475 private function getFormatMessageForPull(Message $message, bool $completeDelete): array
476 {
477 return [
478 'id' => (int)$message->getId(),
479 'text' => Loc::getMessage('IM_MESSAGE_DELETED'),
480 'senderId' => $message->getAuthorId(),
481 'params' => ['IS_DELETED' => 'Y', 'URL_ID' => [], 'FILE_ID' => [], 'KEYBOARD' => 'N', 'ATTACH' => []],
482 'completelyDeleted' => $completeDelete,
483 ];
484 }
485
486 private function getFormatOpenLinePullMessage(Message $message): array
487 {
488 $params = [
489 'id' => (int)$message->getId(),
490 'type' => 'chat',
491 'text' => Loc::getMessage('IM_MESSAGE_DELETED'),
492 'senderId' => $message->getAuthorId(),
493 'params' => ['IS_DELETED' => 'Y', 'URL_ID' => [], 'FILE_ID' => [], 'KEYBOARD' => 'N', 'ATTACH' => []],
494 'chatId' => $this->chat->getChatId(),
495 'dialogId' => $this->chat->getDialogId(),
496 ];
497 $isComplete = $this->isCompleteDelete((int)$message->getId());
498
499 return [
500 'module_id' => 'im',
501 'command' => $isComplete ? 'messageDeleteComplete' : 'messageDelete',
502 'params' => $params,
503 'push' => $isComplete ? ['badge' => 'Y'] : [],
504 'extra' => Common::getPullExtra()
505 ];
506 }
507
508 public function getFormatPullMessage(): array
509 {
510 $params = [
511 'messages' => [],
512 'chatId' => $this->chat->getChatId(),
513 'type' => $this->chat->getType() === Chat::IM_TYPE_PRIVATE ? 'private' : 'chat',
514 'unread' => false,
515 'muted' => false,
516 'counter' => 0,
517 'counterType' => $this->chat->getCounterType()->value,
518 'recentConfig' => $this->chat->getRecentConfig()->toPullFormat(),
519 ];
520
521 foreach ($this->messages as $message)
522 {
523 $isCompleteDelete = $this->isCompleteDelete($message->getId());
524 $params['messages'][] = $this->getFormatMessageForPull($message, $isCompleteDelete);
525 }
526
527 if (!$this->chat instanceof Chat\PrivateChat)
528 {
529 $params['dialogId'] = $this->chat->getDialogId();
530 }
531
532 $chatLastMessageId = $this->chat->getLastMessageId();
533 if ($this->needUpdateRecent && isset($chatLastMessageId))
534 {
535 if ($chatLastMessageId !== 0)
536 {
537 $newLastMessage = new Message($chatLastMessageId);
538 if ($newLastMessage->getId())
539 {
540 $params['newLastMessage'] = $this->formatNewLastMessage($newLastMessage);
541 }
542 }
543 else
544 {
545 $params['newLastMessage'] = ['id' => 0];
546 }
547 }
548
549 return [
550 'module_id' => 'im',
551 'command' => 'messageDeleteV2',
552 'params' => $params,
553 'push' => ['badge' => 'Y'],
554 'extra' => Common::getPullExtra(),
555 ];
556 }
557
558 private function groupPullByCounter(array $pullMessage): array
559 {
560 $events = [];
562 $relations = $this->chat->getRelations();
563 $unreadList = Recent::getUnread($this->chat->getType(), $this->chat->getDialogId());
564 $messageId = $this->messages->getAny()?->getId() ?? 0;
565
566 foreach ($relations as $relation)
567 {
568 $user = $relation->getUser();
569 if (
570 (!$user->isActive() && $user->getExternalAuthId() !== \Bitrix\Im\Bot::EXTERNAL_AUTH_ID)
571 || ($this->chat->getEntityType() === Chat::ENTITY_TYPE_LINE && $user->getExternalAuthId() === 'imconnector')
572 )
573 {
574 continue;
575 }
576
577 $userId = $relation->getUserId();
578
579 $pullMessage['params']['unread'] = $unreadList[$userId] ?? false;
580 $pullMessage['params']['muted'] = $relation->getNotifyBlock() ?? false;
581
582 $events[$userId] = $pullMessage;
583
584 $count = 0;
585 if ($this->needUpdateRecent)
586 {
587 $lastMessageViews = $this->getLastViewers($userId);
588 $events[$userId]['params']['lastMessageViews'] = $lastMessageViews;
589 $count = $lastMessageViews['countOfViewers'] ?? 0;
590 }
591
592 $unreadGroupFlag = $pullMessage['params']['unread'] ? 1 : 0;
593 $mutedGroupFlag = $pullMessage['params']['muted'] ? 1 : 0;
594
595 $events[$userId]['params']['counter'] = $this->getCounter($userId);
596 $events[$userId]['groupId'] =
597 'im_chat_'
598 . $this->chat->getChatId()
599 . '_'. $messageId
600 . '_'. $events[$userId]['params']['counter']
601 . '_'. $count
602 . '_'. $unreadGroupFlag
603 . '_'. $mutedGroupFlag
604 ;
605 }
606
607 return Message\Send\PushService::getEventByCounterGroup($events);
608 }
609
610 private function fireEventAfterMessagesDelete(): Result
611 {
612 $result = new Result;
613 foreach ($this->messages as $message)
614 {
615 $id = $message->getMessageId();
616 if (!isset($id, $this->messagesForEvent[$id]))
617 {
618 continue;
619 }
620
621 $messageForEvent = $this->messagesForEvent[$id];
622
623 \Bitrix\Im\Bot::onMessageDelete(
624 $id,
625 $messageForEvent
626 );
627
628 $deleteFlags = [
629 'ID' => $id,
630 'USER_ID' => $this->getContext()->getUserId(),
631 'COMPLETE_DELETE' => $this->isCompleteDelete($id),
632 'BY_EVENT' => $this->byEvent,
633 ];
634
635 foreach(GetModuleEvents('im', self::EVENT_AFTER_MESSAGE_DELETE, true) as $event)
636 {
637 ExecuteModuleEventEx($event, [$id, $messageForEvent, $deleteFlags]);
638 }
639 }
640
641 return $result;
642 }
643
644 private function getCounter(int $userId): int
645 {
646 $this->counters ??= (new Message\CounterService())
647 ->getByChatForEachUsers($this->chat->getChatId(), $this->chat->getRelations()->getUserIds())
648 ;
649
650 return $this->counters[$userId] ?? 0;
651 }
652
653 private function formatNewLastMessage(Message $message): array
654 {
656 ->setViewed(false) // todo: refactor this
657 ->toRestFormat()
658 ;
659
660 if ($message->getFiles()->count() <= 0)
661 {
662 return $result;
663 }
664
665 $file = $message->getFiles()->getAny();
666
667 if ($file === null)
668 {
669 return $result;
670 }
671
672 $result['file'] = ['type' => $file->getContentType(), 'name' => $file->getDiskFile()?->getName()];
673
674 return $result;
675 }
676
677 private function fillMessagesForEvent(): void
678 {
679 foreach ($this->messages as $message)
680 {
681 $id = $message->getId();
682 if (isset($id))
683 {
684 $this->messagesForEvent[$id] = $this->getMessageForEvent($message);
685 }
686 }
687 }
688
689 private function getMessageForEvent(Message $message): array
690 {
691 $messageForEvent = [
692 'ID' => $message->getId(),
693 'CHAT_ID' => $message->getChatId(),
694 'AUTHOR_ID' => $message->getAuthorId(),
695 'MESSAGE' => $this->getMessageOut($message),
696 'MESSAGE_OUT' => $message->getMessageOut(),
697 'DATE_CREATE' => $message->getDateCreate()?->toUserTime()->getTimestamp(),
698 'EMAIL_TEMPLATE' => $message->getEmailTemplate(),
699 'NOTIFY_TYPE' => $message->getNotifyType(),
700 'NOTIFY_MODULE' => $message->getNotifyModule(),
701 'NOTIFY_EVENT' => $message->getNotifyEvent(),
702 'NOTIFY_TAG' => $message->getNotifyTag(),
703 'NOTIFY_SUB_TAG' => $message->getNotifySubTag(),
704 'NOTIFY_TITLE' => $message->getNotifyTitle(),
705 'NOTIFY_BUTTONS' => $message->getNotifyButtons(),
706 'NOTIFY_READ' => $message->isNotifyRead(),
707 'IMPORT_ID' => $message->getImportId(),
708 'PARAMS' => $message->getParams()->toRestFormat(),
709 'MESSAGE_TYPE' => $this->chat->getType(),
710 'CHAT_AUTHOR_ID'=> $this->chat->getAuthorId(),
711 'CHAT_ENTITY_TYPE' => $this->chat->getEntityType(),
712 'CHAT_ENTITY_ID' => $this->chat->getEntityId(),
713 'CHAT_PARENT_ID' => $this->chat->getParentChatId(),
714 'CHAT_PARENT_MID' => $this->chat->getParentMessageId(),
715 'CHAT_ENTITY_DATA_1' => $this->chat->getEntityData1(),
716 'CHAT_ENTITY_DATA_2' => $this->chat->getEntityData2(),
717 'CHAT_ENTITY_DATA_3' => $this->chat->getEntityData3(),
718 'DATE_MODIFY' => new DateTime(),
719 ];
720
721 if ($this->chat instanceof Chat\PrivateChat)
722 {
723 $authorId = $message->getAuthorId();
724 $messageForEvent['FROM_USER_ID'] = $authorId;
725 $messageForEvent['TO_USER_ID'] = $this->chat->getCompanion($authorId)->getId() ?: $authorId;
726 }
727 else
728 {
729 $messageForEvent['BOT_IN_CHAT'] = $this->chat->getBotInChat();
730 }
731
732 return $messageForEvent;
733 }
734
735 private function getLastViewers(int $userId): array
736 {
737 $this->lastMessageViewers ??= $this->chat->getLastMessageViewsByGroups();
738
739 if (isset($this->lastMessageViewers['USERS'][$userId]))
740 {
741 return Common::toJson($this->lastMessageViewers['FOR_VIEWERS'] ?? []);
742 }
743
744 return Common::toJson($this->lastMessageViewers['FOR_NOT_VIEWERS'] ?? []);
745 }
746
747 public function setContext(?Context $context): self
748 {
749 $this->messages->setContext($context);
750 $this->chat->setContext($context);
751
752 return $this->defaultSetContext($context);
753 }
754
755 private function sendAnalyticsData(): void
756 {
757 foreach ($this->messages as $message)
758 {
759 $messageType = $this->getMessageComponentName($message->getId());
760 (new MessageAnalytics($message))->addDeleteMessage($messageType);
761 }
762 }
763 private function getMessageComponentName(int $id): string
764 {
765 if (!isset($this->messages[$id]))
766 {
767 return '';
768 }
769 $this->messages->fillParams();
770
771 return (new MessageContent($this->messages[$id]))->getComponentName();
772 }
773
774 private function deleteAnchors(): void
775 {
776 $readService = AnchorContainer::getInstance()->getReadService()->setContext($this->getContext());
777
778 $readService->readByMessageIds($this->messages->getIds());
779 }
780}
$count
Определения admin_tab.php:4
$type
Определения options.php:106
if(! $messageFields||!isset($messageFields['message_id'])||!isset($messageFields['status'])||!CModule::IncludeModule("messageservice")) $messageId
Определения callback_ismscenter.php:26
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
Определения common.php:7
static toJson($array, $camelCase=true)
Определения common.php:89
static getPullExtra()
Определения common.php:127
static isUnread(int $userId, string $itemType, string $dialogId)
Определения recent.php:1819
static getUnread(string $itemType, string $dialogId)
Определения recent.php:1838
setDeletionMode(MessageType $messageType, DeletionMode $mode)
Определения DeleteService.php:226
setMessages(MessageCollection $messages)
Определения DeleteService.php:81
defineMessageType(Message $message)
Определения DeleteService.php:272
getMessageCollectionByMode(DeletionMode $mode=DeletionMode::None)
Определения DeleteService.php:262
getDeletionMode(MessageType $messageType)
Определения DeleteService.php:237
__construct(MessageCollection $messages)
Определения DeleteService.php:50
setMode(?DeletionMode $mode=null)
Определения DeleteService.php:95
isOwnMessage(Message $message)
Определения DeleteService.php:370
static getInstanceByMessage(Message $message)
Определения DeleteService.php:73
setContext(?Context $context)
Определения DeleteService.php:747
canDelete(int $messageId)
Определения DeleteService.php:112
static getInstance(MessageCollection $messages, DeletionMode $deletionMode)
Определения DeletionStrategy.php:30
static getInstance()
Определения application.php:98
Определения result.php:20
Определения event.php:5
Определения loader.php:13
static cleanCache()
Определения datamanager.php:1983
static add($recipient, array $parameters, $channelType=\CPullChannel::TYPE_PRIVATE)
Определения event.php:22
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$context
Определения csv_new_setup.php:223
ExecuteModuleEventEx($arEvent, $arParams=[])
Определения tools.php:5214
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
Определения tools.php:5177
Определения Uuid.php:3
trait ContextCustomer
Определения ContextCustomer.php:12
Определения culture.php:9
$user
Определения mysql_to_pgsql.php:33
$message
Определения payment.php:8
$event
Определения prolog_after.php:141
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799