{
parent::validateUpdate();
- if (\count($this->objects) != 1) {
- throw new UserInputException('objectID');
- }
-
- $label = \current($this->objects);
+ $label = $this->getSingleObject();
if ($label->userID != WCF::getUser()->userID) {
throw new PermissionDeniedException();
}
{
parent::validateDelete();
- if (\count($this->objects) != 1) {
- throw new UserInputException('objectID');
- }
-
- $label = \current($this->objects);
+ $label = $this->getSingleObject();
if ($label->userID != WCF::getUser()->userID) {
throw new PermissionDeniedException();
}
$invisibleParticipantIDs = [];
if (WCF::getUser()->userID != $this->conversation->userID) {
foreach ($this->participantList as $participant) {
+ /** @noinspection PhpUndefinedFieldInspection */
if ($participant->isInvisible) {
$invisibleParticipantIDs[] = $participant->userID;
}
'variables' => [
'author' => $this->author,
'message' => $this->userNotificationObject,
- 'conversation' => $this->userNotificationObject->getConversation(),
+ 'conversation' => $this->getUserNotificationObject()->getConversation(),
],
];
}
return $this->getLanguage()->getDynamicVariable('wcf.user.notification.conversation.message.mail.title', [
'author' => $this->author,
'message' => $this->userNotificationObject,
- 'conversation' => $this->userNotificationObject->getConversation(),
+ 'conversation' => $this->getUserNotificationObject()->getConversation(),
]);
}
// retrieve permissions
$userIDs = [];
- foreach ($this->objectList as $object) {
+ foreach ($this->getObjectList() as $object) {
// passing `0` is actually valid, because it won't yield any results when querying the group membership
$userIDs[] = ($object->userID ?: 0);
}
$userPermissions = $this->getBulkUserPermissions($userIDs, ['user.message.disallowedBBCodes']);
$updateData = [];
- /** @var ConversationMessage $message */
- foreach ($this->objectList as $message) {
+ foreach ($this->getObjectList() as $message) {
SearchIndexManager::getInstance()->set(
'com.woltlab.wcf.conversation.message',
$message->messageID,