*/
class ConversationAction extends AbstractDatabaseObjectAction implements IClipboardAction, IVisitableObjectAction {
/**
- * @see \wcf\data\AbstractDatabaseObjectAction::$className
+ * @inheritDoc
*/
- protected $className = 'wcf\data\conversation\ConversationEditor';
+ protected $className = ConversationEditor::class;
/**
* conversation object
- * @var \wcf\data\conversation\ConversationEditor
+ * @var ConversationEditor
*/
protected $conversation = null;
* list of conversation data modifications
* @var array<array>
*/
- protected $conversationData = array();
+ protected $conversationData = [];
/**
- * @see \wcf\data\AbstractDatabaseObjectAction::create()
+ * @inheritDoc
*/
public function create() {
// create conversation
if (isset($this->parameters['attachmentHandler']) && $this->parameters['attachmentHandler'] !== null) {
$data['attachments'] = count($this->parameters['attachmentHandler']);
}
- $conversation = call_user_func(array($this->className, 'create'), $data);
+ $conversation = call_user_func([$this->className, 'create'], $data);
$conversationEditor = new ConversationEditor($conversation);
if (!$conversation->isDraft) {
// save participants
- $conversationEditor->updateParticipants((!empty($this->parameters['participants']) ? $this->parameters['participants'] : array()), (!empty($this->parameters['invisibleParticipants']) ? $this->parameters['invisibleParticipants'] : array()));
+ $conversationEditor->updateParticipants((!empty($this->parameters['participants']) ? $this->parameters['participants'] : []), (!empty($this->parameters['invisibleParticipants']) ? $this->parameters['invisibleParticipants'] : []));
// add author
- $conversationEditor->updateParticipants(array($data['userID']));
+ $conversationEditor->updateParticipants([$data['userID']]);
// update conversation count
UserStorageHandler::getInstance()->reset($conversation->getParticipantIDs(), 'conversationCount');
WHERE participantID = ?
AND conversationID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute(array($data['time'], $data['userID'], $conversation->conversationID));
+ $statement->execute([$data['time'], $data['userID'], $conversation->conversationID]);
}
else {
// update conversation count
- UserStorageHandler::getInstance()->reset(array($data['userID']), 'conversationCount');
+ UserStorageHandler::getInstance()->reset([$data['userID']], 'conversationCount');
}
// update participant summary
$messageData['userID'] = $this->parameters['data']['userID'];
$messageData['username'] = $this->parameters['data']['username'];
- $messageAction = new ConversationMessageAction(array(), 'create', array(
+ $messageAction = new ConversationMessageAction([], 'create', [
'data' => $messageData,
'conversation' => $conversation,
'isFirstPost' => true,
- 'attachmentHandler' => (isset($this->parameters['attachmentHandler']) ? $this->parameters['attachmentHandler'] : null)
- ));
+ 'attachmentHandler' => (isset($this->parameters['attachmentHandler']) ? $this->parameters['attachmentHandler'] : null)
+ ]);
$resultValues = $messageAction->executeAction();
// update first message id
- $conversationEditor->update(array(
+ $conversationEditor->update([
'firstMessageID' => $resultValues['returnValues']->messageID
- ));
+ ]);
$conversation->setFirstMessage($resultValues['returnValues']);
if (!$conversation->isDraft) {
// fire notification event
- $notificationRecipients = array_merge((!empty($this->parameters['participants']) ? $this->parameters['participants'] : array()), (!empty($this->parameters['invisibleParticipants']) ? $this->parameters['invisibleParticipants'] : array()));
+ $notificationRecipients = array_merge((!empty($this->parameters['participants']) ? $this->parameters['participants'] : []), (!empty($this->parameters['invisibleParticipants']) ? $this->parameters['invisibleParticipants'] : []));
UserNotificationHandler::getInstance()->fireEvent('conversation', 'com.woltlab.wcf.conversation.notification', new ConversationUserNotificationObject($conversation), $notificationRecipients);
}
}
/**
- * @see \wcf\data\IDeleteAction::delete()
+ * @inheritDoc
*/
public function delete() {
// deletes messages
$messageList = new ConversationMessageList();
- $messageList->getConditionBuilder()->add('conversation_message.conversationID IN (?)', array($this->objectIDs));
+ $messageList->getConditionBuilder()->add('conversation_message.conversationID IN (?)', [$this->objectIDs]);
$messageList->readObjectIDs();
$action = new ConversationMessageAction($messageList->getObjectIDs(), 'delete');
$action->executeAction();
if (!empty($this->objectIDs)) {
// delete notifications
- UserNotificationHandler::getInstance()->deleteNotifications('conversation', 'com.woltlab.wcf.conversation.notification', array(), $this->objectIDs);
+ UserNotificationHandler::getInstance()->deleteNotifications('conversation', 'com.woltlab.wcf.conversation.notification', [], $this->objectIDs);
// remove modification logs
- ConversationModificationLogHandler::getInstance()->remove($this->objectIDs);
+ ConversationModificationLogHandler::getInstance()->deleteLogs($this->objectIDs);
}
}
/**
- * @see \wcf\data\AbstractDatabaseObjectAction::update()
+ * @inheritDoc
*/
public function update() {
- if (!isset($this->parameters['participants'])) $this->parameters['participants'] = array();
- if (!isset($this->parameters['invisibleParticipants'])) $this->parameters['invisibleParticipants'] = array();
+ if (!isset($this->parameters['participants'])) $this->parameters['participants'] = [];
+ if (!isset($this->parameters['invisibleParticipants'])) $this->parameters['invisibleParticipants'] = [];
// count participants
if (!empty($this->parameters['participants'])) {
// get current participants
$participantIDs = $conversation->getParticipantIDs();
- $conversation->updateParticipants((!empty($this->parameters['participants']) ? $this->parameters['participants'] : array()), (!empty($this->parameters['invisibleParticipants']) ? $this->parameters['invisibleParticipants'] : array()));
+ $conversation->updateParticipants((!empty($this->parameters['participants']) ? $this->parameters['participants'] : []), (!empty($this->parameters['invisibleParticipants']) ? $this->parameters['invisibleParticipants'] : []));
$conversation->updateParticipantSummary();
// check if new participants have been added
if (isset($this->parameters['data']['isDraft'])) {
if ($conversation->isDraft && !$this->parameters['data']['isDraft']) {
// add author
- $conversation->updateParticipants(array($conversation->userID));
+ $conversation->updateParticipants([$conversation->userID]);
// update conversation count
UserStorageHandler::getInstance()->reset($conversation->getParticipantIDs(), 'unreadConversationCount');
}
/**
- * @see \wcf\data\IVisitableObjectAction::markAsRead()
+ * @inheritDoc
*/
public function markAsRead() {
if (empty($this->parameters['visitTime'])) {
$this->readObjects();
}
- $conversationIDs = array();
+ $conversationIDs = [];
$sql = "UPDATE wcf".WCF_N."_conversation_to_user
SET lastVisitTime = ?
WHERE participantID = ?
$statement = WCF::getDB()->prepareStatement($sql);
WCF::getDB()->beginTransaction();
foreach ($this->objects as $conversation) {
- $statement->execute(array(
+ $statement->execute([
$this->parameters['visitTime'],
WCF::getUser()->userID,
$conversation->conversationID
- ));
+ ]);
$conversationIDs[] = $conversation->conversationID;
}
WCF::getDB()->commitTransaction();
// reset storage
- UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'unreadConversationCount');
+ UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'unreadConversationCount');
// mark notifications as confirmed
if (!empty($conversationIDs)) {
// conversation start notification
$conditionBuilder = new PreparedStatementConditionBuilder();
- $conditionBuilder->add('notification.eventID = ?', array(UserNotificationHandler::getInstance()->getEvent('com.woltlab.wcf.conversation.notification', 'conversation')->eventID));
+ $conditionBuilder->add('notification.eventID = ?', [UserNotificationHandler::getInstance()->getEvent('com.woltlab.wcf.conversation.notification', 'conversation')->eventID]);
$conditionBuilder->add('notification.objectID = conversation.conversationID');
- $conditionBuilder->add('notification.userID = ?', array(WCF::getUser()->userID));
- $conditionBuilder->add('conversation.conversationID IN (?)', array($conversationIDs));
- $conditionBuilder->add('conversation.time <= ?', array($this->parameters['visitTime']));
+ $conditionBuilder->add('notification.userID = ?', [WCF::getUser()->userID]);
+ $conditionBuilder->add('conversation.conversationID IN (?)', [$conversationIDs]);
+ $conditionBuilder->add('conversation.time <= ?', [$this->parameters['visitTime']]);
$sql = "SELECT conversation.conversationID
FROM wcf".WCF_N."_conversation conversation,
".$conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $notificationObjectIDs = array();
+ $notificationObjectIDs = [];
while ($row = $statement->fetchArray()) {
$notificationObjectIDs[] = $row['conversationID'];
}
if (!empty($notificationObjectIDs)) {
- UserNotificationHandler::getInstance()->markAsConfirmed('conversation', 'com.woltlab.wcf.conversation.notification', array(WCF::getUser()->userID), $notificationObjectIDs);
+ UserNotificationHandler::getInstance()->markAsConfirmed('conversation', 'com.woltlab.wcf.conversation.notification', [WCF::getUser()->userID], $notificationObjectIDs);
}
// conversation reply notification
$conditionBuilder = new PreparedStatementConditionBuilder();
- $conditionBuilder->add('notification.eventID = ?', array(UserNotificationHandler::getInstance()->getEvent('com.woltlab.wcf.conversation.message.notification', 'conversationMessage')->eventID));
+ $conditionBuilder->add('notification.eventID = ?', [UserNotificationHandler::getInstance()->getEvent('com.woltlab.wcf.conversation.message.notification', 'conversationMessage')->eventID]);
$conditionBuilder->add('notification.objectID = conversation_message.messageID');
- $conditionBuilder->add('notification.userID = ?', array(WCF::getUser()->userID));
- $conditionBuilder->add('conversation_message.conversationID IN (?)', array($conversationIDs));
- $conditionBuilder->add('conversation_message.time <= ?', array($this->parameters['visitTime']));
+ $conditionBuilder->add('notification.userID = ?', [WCF::getUser()->userID]);
+ $conditionBuilder->add('conversation_message.conversationID IN (?)', [$conversationIDs]);
+ $conditionBuilder->add('conversation_message.time <= ?', [$this->parameters['visitTime']]);
$sql = "SELECT conversation_message.messageID
FROM wcf".WCF_N."_conversation_message conversation_message,
".$conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $notificationObjectIDs = array();
+ $notificationObjectIDs = [];
while ($row = $statement->fetchArray()) {
$notificationObjectIDs[] = $row['messageID'];
}
if (!empty($notificationObjectIDs)) {
- UserNotificationHandler::getInstance()->markAsConfirmed('conversationMessage', 'com.woltlab.wcf.conversation.message.notification', array(WCF::getUser()->userID), $notificationObjectIDs);
+ UserNotificationHandler::getInstance()->markAsConfirmed('conversationMessage', 'com.woltlab.wcf.conversation.message.notification', [WCF::getUser()->userID], $notificationObjectIDs);
}
}
$this->unmarkItems($conversationIDs);
}
- $returnValues = array(
+ $returnValues = [
'totalCount' => ConversationHandler::getInstance()->getUnreadConversationCount(null, true)
- );
+ ];
if (count($conversationIDs) == 1) {
$returnValues['markAsRead'] = reset($conversationIDs);
}
/**
- * @see \wcf\data\IVisitableObjectAction::validateMarkAsRead()
+ * @inheritDoc
*/
public function validateMarkAsRead() {
// visitTime might not be in the future
}
// check participation
- $conversationIDs = array();
+ $conversationIDs = [];
foreach ($this->objects as $conversation) {
$conversationIDs[] = $conversation->conversationID;
}
SET lastVisitTime = ?
WHERE participantID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute(array(
+ $statement->execute([
TIME_NOW,
WCF::getUser()->userID
- ));
+ ]);
// reset storage
- UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'unreadConversationCount');
+ UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'unreadConversationCount');
// delete obsolete notifications
- UserNotificationHandler::getInstance()->deleteNotifications('conversation', 'com.woltlab.wcf.conversation.notification', array(WCF::getUser()->userID));
- UserNotificationHandler::getInstance()->deleteNotifications('conversationMessage', 'com.woltlab.wcf.conversation.message.notification', array(WCF::getUser()->userID));
+ UserNotificationHandler::getInstance()->deleteNotifications('conversation', 'com.woltlab.wcf.conversation.notification', [WCF::getUser()->userID]);
+ UserNotificationHandler::getInstance()->deleteNotifications('conversationMessage', 'com.woltlab.wcf.conversation.message.notification', [WCF::getUser()->userID]);
- return array(
+ return [
'markAllAsRead' => true
- );
+ ];
}
/**
* Validates the markAllAsRead action.
*/
- public function validateMarkAllAsRead() {}
+ public function validateMarkAllAsRead() {
+ // does nothing
+ }
/**
* Validates user access for label management.
* @return array
*/
public function getLabelManagement() {
- WCF::getTPL()->assign(array(
+ WCF::getTPL()->assign([
'cssClassNames' => ConversationLabel::getLabelCssClassNames(),
'labelList' => ConversationLabel::getLabelsByUser()
- ));
+ ]);
- return array(
+ return [
'actionName' => 'getLabelManagement',
'template' => WCF::getTPL()->fetch('conversationLabelManagement'),
'maxLabels' => WCF::getSession()->getPermission('user.conversation.maxLabels'),
'labelCount' => count(ConversationLabel::getLabelsByUser())
- );
+ ];
}
/**
*/
public function validateGetMessagePreview() {
$this->conversation = $this->getSingleObject();
- if (!Conversation::isParticipant(array($this->conversation->conversationID))) {
+ if (!Conversation::isParticipant([$this->conversation->conversationID])) {
throw new PermissionDeniedException();
}
}
/**
* Returns a preview of a message in a specific conversation.
*
- * @return array
+ * @return string[]
*/
public function getMessagePreview() {
$messageList = new SimplifiedViewableConversationMessageList();
- $messageList->getConditionBuilder()->add("conversation_message.messageID = ?", array($this->conversation->firstMessageID));
+ $messageList->getConditionBuilder()->add("conversation_message.messageID = ?", [$this->conversation->firstMessageID]);
$messageList->readObjects();
$messages = $messageList->getObjects();
- WCF::getTPL()->assign(array(
+ WCF::getTPL()->assign([
'message' => reset($messages)
- ));
- return array(
+ ]);
+ return [
'template' => WCF::getTPL()->fetch('conversationMessagePreview')
- );
+ ];
}
/**
*/
public function close() {
foreach ($this->objects as $conversation) {
- $conversation->update(array('isClosed' => 1));
+ $conversation->update(['isClosed' => 1]);
$this->addConversationData($conversation->getDecoratedObject(), 'isClosed', 1);
ConversationModificationLogHandler::getInstance()->close($conversation->getDecoratedObject());
*/
public function open() {
foreach ($this->objects as $conversation) {
- $conversation->update(array('isClosed' => 0));
+ $conversation->update(['isClosed' => 0]);
$this->addConversationData($conversation->getDecoratedObject(), 'isClosed', 0);
ConversationModificationLogHandler::getInstance()->open($conversation->getDecoratedObject());
WHERE conversationID = ?
AND participantID = ?";
$statement = WCF::getDB()->prepareStatement($sql);
- $statement->execute(array(
+ $statement->execute([
current($this->objectIDs),
WCF::getUser()->userID
- ));
+ ]);
$row = $statement->fetchArray();
WCF::getTPL()->assign('hideConversation', $row['hideConversation']);
- return array(
+ return [
'actionName' => 'getLeaveForm',
'template' => WCF::getTPL()->fetch('conversationLeave')
- );
+ ];
}
/**
*/
public function validateHideConversation() {
$this->parameters['hideConversation'] = (isset($this->parameters['hideConversation'])) ? intval($this->parameters['hideConversation']) : null;
- if ($this->parameters['hideConversation'] === null || !in_array($this->parameters['hideConversation'], array(Conversation::STATE_DEFAULT, Conversation::STATE_HIDDEN, Conversation::STATE_LEFT))) {
+ if ($this->parameters['hideConversation'] === null || !in_array($this->parameters['hideConversation'], [Conversation::STATE_DEFAULT, Conversation::STATE_HIDDEN, Conversation::STATE_LEFT])) {
throw new UserInputException('hideConversation');
}
/**
* Hides or restores conversations.
*
- * @return array
+ * @return string[]
*/
public function hideConversation() {
$sql = "UPDATE wcf".WCF_N."_conversation_to_user
WCF::getDB()->beginTransaction();
foreach ($this->objectIDs as $conversationID) {
- $statement->execute(array(
+ $statement->execute([
$this->parameters['hideConversation'],
$conversationID,
WCF::getUser()->userID
- ));
+ ]);
}
WCF::getDB()->commitTransaction();
// reset user's conversation counters if user leaves conversation
// permanently
if ($this->parameters['hideConversation'] == Conversation::STATE_LEFT) {
- UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'conversationCount');
- UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'unreadConversationCount');
+ UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'conversationCount');
+ UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'unreadConversationCount');
}
// add modification log entry
// delete conversation if all users have left it
$conditionBuilder = new PreparedStatementConditionBuilder();
- $conditionBuilder->add('conversation.conversationID IN (?)', array($this->objectIDs));
+ $conditionBuilder->add('conversation.conversationID IN (?)', [$this->objectIDs]);
$conditionBuilder->add('conversation_to_user.conversationID IS NULL');
- $conversationIDs = array();
+ $conversationIDs = [];
$sql = "SELECT DISTINCT conversation.conversationID
FROM wcf".WCF_N."_conversation conversation
LEFT JOIN wcf".WCF_N."_conversation_to_user conversation_to_user
}
}
- return array(
+ return [
'actionName' => 'hideConversation',
'redirectURL' => LinkHandler::getInstance()->getLink('ConversationList')
- );
+ ];
}
/**
$unreadConversationList->sqlOrderBy = 'conversation.lastPostTime DESC';
$unreadConversationList->readObjects();
- $conversations = array();
+ $conversations = [];
$count = 0;
foreach ($unreadConversationList as $conversation) {
$conversations[] = $conversation;
}
}
- WCF::getTPL()->assign(array(
+ WCF::getTPL()->assign([
'conversations' => $conversations
- ));
+ ]);
$totalCount = ConversationHandler::getInstance()->getUnreadConversationCount();
if ($count < 5 && $count < $totalCount) {
- UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'unreadConversationCount');
+ UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'unreadConversationCount');
}
- return array(
+ return [
'template' => WCF::getTPL()->fetch('conversationListUserPanel'),
'totalCount' => $totalCount
- );
+ ];
}
/**
*/
public function validateGetAddParticipantsForm() {
$this->conversation = $this->getSingleObject();
- if (!Conversation::isParticipant(array($this->conversation->conversationID)) || !$this->conversation->canAddParticipants()) {
+ if (!Conversation::isParticipant([$this->conversation->conversationID]) || !$this->conversation->canAddParticipants()) {
throw new PermissionDeniedException();
}
}
* @return array
*/
public function getAddParticipantsForm() {
- return array(
+ return [
'excludedSearchValues' => $this->conversation->getParticipantNames(),
'maxItems' => WCF::getSession()->getPermission('user.conversation.maxParticipants') - $this->conversation->participants,
'template' => WCF::getTPL()->fetch('conversationAddParticipants')
- );
+ ];
}
/**
$errorMessage = '';
foreach ($e->getType() as $type) {
if (!empty($errorMessage)) $errorMessage .= ' ';
- $errorMessage .= WCF::getLanguage()->getDynamicVariable('wcf.conversation.participants.error.'.$type['type'], array('errorData' => array('username' => $type['username'])));
+ $errorMessage .= WCF::getLanguage()->getDynamicVariable('wcf.conversation.participants.error.'.$type['type'], ['errorData' => ['username' => $type['username']]]);
}
- return array(
+ return [
'actionName' => 'addParticipants',
'errorMessage' => $errorMessage
- );
+ ];
}
// validate limit
$newCount = $this->conversation->participants + count($participantIDs);
if ($newCount > WCF::getSession()->getPermission('user.conversation.maxParticipants')) {
- return array(
+ return [
'actionName' => 'addParticipants',
'errorMessage' => WCF::getLanguage()->getDynamicVariable('wcf.conversation.participants.error.tooManyParticipants')
- );
+ ];
}
$count = 0;
$successMessage = '';
if (!empty($participantIDs)) {
// check for already added participants
- $data = array();
+ $data = [];
if ($this->conversation->isDraft) {
$draftData = unserialize($this->conversation->draftData);
$draftData['participants'] = array_merge($draftData['participants'], $participantIDs);
- $data = array('data' => array('draftData' => serialize($draftData)));
+ $data = ['data' => ['draftData' => serialize($draftData)]];
}
else {
- $data = array('participants' => $participantIDs);
+ $data = ['participants' => $participantIDs];
}
- $conversationAction = new ConversationAction(array($this->conversation), 'update', $data);
+ $conversationAction = new ConversationAction([$this->conversation], 'update', $data);
$conversationAction->executeAction();
$count = count($participantIDs);
- $successMessage = WCF::getLanguage()->getDynamicVariable('wcf.conversation.edit.addParticipants.success', array('count' => $count));
+ $successMessage = WCF::getLanguage()->getDynamicVariable('wcf.conversation.edit.addParticipants.success', ['count' => $count]);
ConversationModificationLogHandler::getInstance()->addParticipants($this->conversation->getDecoratedObject(), $participantIDs);
}
}
- return array(
+ return [
'count' => $count,
'successMessage' => $successMessage
- );
+ ];
}
/**
}
// validate participants
- if ($this->parameters['userID'] == WCF::getUser()->userID || !Conversation::isParticipant(array($this->conversation->conversationID)) || !Conversation::isParticipant(array($this->conversation->conversationID), $this->parameters['userID'])) {
+ if ($this->parameters['userID'] == WCF::getUser()->userID || !Conversation::isParticipant([$this->conversation->conversationID]) || !Conversation::isParticipant([$this->conversation->conversationID], $this->parameters['userID'])) {
throw new PermissionDeniedException();
}
ConversationModificationLogHandler::getInstance()->removeParticipant($this->conversation->getDecoratedObject(), $this->parameters['userID']);
// reset storage
- UserStorageHandler::getInstance()->reset(array($this->parameters['userID']), 'unreadConversationCount');
+ UserStorageHandler::getInstance()->reset([$this->parameters['userID']], 'unreadConversationCount');
- return array(
+ return [
'userID' => $this->parameters['userID']
- );
+ ];
}
/**
// collect number of messages for each conversation
$conditionBuilder = new PreparedStatementConditionBuilder();
- $conditionBuilder->add('conversation_message.conversationID IN (?)', array($this->objectIDs));
+ $conditionBuilder->add('conversation_message.conversationID IN (?)', [$this->objectIDs]);
$sql = "SELECT conversationID, COUNT(messageID) AS messages, SUM(attachments) AS attachments
FROM wcf".WCF_N."_conversation_message conversation_message
".$conditionBuilder."
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $objectIDs = array();
+ $objectIDs = [];
while ($row = $statement->fetchArray()) {
if (!$row['messages']) {
continue;
}
$objectIDs[] = $row['conversationID'];
- $conversationEditor = new ConversationEditor(new Conversation(null, array(
+ $conversationEditor = new ConversationEditor(new Conversation(null, [
'conversationID' => $row['conversationID']
- )));
- $conversationEditor->update(array(
+ ]));
+ $conversationEditor->update([
'attachments' => $row['attachments'],
'replies' => $row['messages'] - 1
- ));
+ ]);
$conversationEditor->updateFirstMessage();
$conversationEditor->updateLastMessage();
}
/**
* Adds conversation modification data.
*
- * @param \wcf\data\conversation\Conversation $conversation
- * @param string $key
- * @param mixed $value
+ * @param Conversation $conversation
+ * @param string $key
+ * @param mixed $value
*/
protected function addConversationData(Conversation $conversation, $key, $value) {
if (!isset($this->conversationData[$conversation->conversationID])) {
- $this->conversationData[$conversation->conversationID] = array();
+ $this->conversationData[$conversation->conversationID] = [];
}
$this->conversationData[$conversation->conversationID][$key] = $value;
* @return array<array>
*/
protected function getConversationData() {
- return array(
+ return [
'conversationData' => $this->conversationData
- );
+ ];
}
/**
* Unmarks conversations.
*
- * @param array<integer> $conversationIDs
+ * @param integer[] $conversationIDs
*/
- protected function unmarkItems(array $conversationIDs = array()) {
+ protected function unmarkItems(array $conversationIDs = []) {
if (empty($conversationIDs)) {
$conversationIDs = $this->objectIDs;
}