* @property-read integer $isClosed
* @property-read integer $isDraft
* @property-read string $draftData
+ * @property-read integer|null $participantID
+ * @property-read integer|null $hideConversation
+ * @property-read integer|null $isInvisible
+ * @property-read integer|null $lastVisitTime
*/
class Conversation extends DatabaseObject implements IRouteController, ITitledLinkObject {
/**
if (!WCF::getSession()->getPermission('user.profile.cannotBeIgnored')) {
// check if user wants to receive any conversations
+ /** @noinspection PhpUndefinedFieldInspection */
if ($user->canSendConversation == 2) {
throw new UserInputException($field, 'doesNotAcceptConversation');
}
// check if user only wants to receive conversations by
// users they are following and if the active user is followed
// by the relevant user
+ /** @noinspection PhpUndefinedFieldInspection */
if ($user->canSendConversation == 1 && !$user->isFollowing(WCF::getUser()->userID)) {
throw new UserInputException($field, 'doesNotAcceptConversation');
}
* @package com.woltlab.wcf.conversation
* @subpackage data.conversation
* @category Community Framework
+ *
+ * @method Conversation getDecoratedObject()
+ * @mixin Conversation
*/
class FeedConversation extends DatabaseObjectDecorator implements IFeedEntry {
/**
*
* @method Conversation getDecoratedObject()
* @mixin Conversation
+ * @property-read integer|null $otherParticipantID
+ * @property-read string|null $otherParticipant
*/
class ViewableConversation extends DatabaseObjectDecorator {
use TLegacyUserPropertyAccess;
* @return integer
*/
public function getPages() {
+ /** @noinspection PhpUndefinedFieldInspection */
if (WCF::getUser()->conversationMessagesPerPage) {
+ /** @noinspection PhpUndefinedFieldInspection */
$messagesPerPage = WCF::getUser()->conversationMessagesPerPage;
}
else {
// update attachments
if (isset($this->parameters['attachmentHandler']) && $this->parameters['attachmentHandler'] !== null) {
+ /** @noinspection PhpUndefinedMethodInspection */
$this->parameters['attachmentHandler']->updateObjectID($message->messageID);
}
* @inheritDoc
*/
public function validateContainer(DatabaseObject $conversation) {
+ /** @var Conversation $conversation */
+
if (!$conversation->conversationID) {
throw new UserInputException('objectID');
}
* @inheritDoc
*/
public function getPageNo(DatabaseObject $conversation) {
+ /** @var Conversation $conversation */
+
$sql = "SELECT COUNT(*) AS count
FROM wcf".WCF_N."_conversation_message
WHERE conversationID = ?";
* @inheritDoc
*/
public function getRedirectUrl(DatabaseObject $conversation, DatabaseObject $message) {
+ /** @var ConversationMessage $message */
return LinkHandler::getInstance()->getLink('Conversation', [
'object' => $conversation,
'messageID' => $message->messageID
* @package com.woltlab.wcf.conversation
* @subpackage data.conversation.message
* @category Community Framework
+ *
+ * @property-read string|null $subject
*/
class SearchResultConversationMessage extends ViewableConversationMessage implements ISearchResultObject {
/**
/**
* message list
- * @var \wcf\data\conversation\message\ConversationMessageList
+ * @var ViewableConversationMessageList
*/
public $messageList = null;
'time' => TIME_NOW,
'userID' => WCF::getUser()->userID,
'username' => WCF::getUser()->username,
+ /* TODO:
'enableBBCodes' => $this->enableBBCodes,
'enableHtml' => $this->enableHtml,
'enableSmilies' => $this->enableSmilies,
'showSignature' => $this->showSignature
+ */
]);
$messageData = [
/**
* message list
- * @var \wcf\data\conversation\message\ConversationMessageList
+ * @var ViewableConversationMessageList
*/
public $messageList = null;
// save message
$data = array_merge($this->additionalFields, [
'message' => $this->text,
+ /* TODO:
'enableBBCodes' => $this->enableBBCodes,
'enableHtml' => $this->enableHtml,
'enableSmilies' => $this->enableSmilies,
'showSignature' => $this->showSignature
+ */
]);
if ($this->conversation->isDraft && !$this->draft) {
$data['time'] = TIME_NOW;
if (!in_array($this->filter, UserConversationList::$availableFilters)) $this->filter = '';
// user settings
- if (WCF::getUser()->conversationsPerPage) $this->itemsPerPage = WCF::getUser()->conversationsPerPage;
+ /** @noinspection PhpUndefinedFieldInspection */
+ if (WCF::getUser()->conversationsPerPage) {
+ /** @noinspection PhpUndefinedFieldInspection */
+ $this->itemsPerPage = WCF::getUser()->conversationsPerPage;
+ }
// labels
$this->labelList = ConversationLabel::getLabelsByUser();
$this->labelList = ConversationLabel::getLabelsByUser();
$this->conversation = ViewableConversation::getViewableConversation($this->conversation, $this->labelList);
- // posts per page
- if (WCF::getUser()->conversationMessagesPerPage) $this->itemsPerPage = WCF::getUser()->conversationMessagesPerPage;
+ // messages per page
+ /** @noinspection PhpUndefinedFieldInspection */
+ if (WCF::getUser()->conversationMessagesPerPage) {
+ /** @noinspection PhpUndefinedFieldInspection */
+ $this->itemsPerPage = WCF::getUser()->conversationMessagesPerPage;
+ }
$this->canonicalURL = LinkHandler::getInstance()->getLink('Conversation', [
'object' => $this->conversation
* @package com.woltlab.wcf.conversation
* @subpackage system.attachment
* @category Community Framework
+ *
+ * @method ConversationMessage getObject($objectID)
*/
class ConversationMessageAttachmentObjectType extends AbstractAttachmentObjectType {
/**
use wcf\data\conversation\message\SearchResultConversationMessageList;
use wcf\data\conversation\Conversation;
use wcf\form\IForm;
+use wcf\form\SearchForm;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\WCF;
* @inheritDoc
*/
public function show(IForm $form = null) {
+ /** @var SearchForm $form */
+
// get existing values
if ($form !== null && isset($form->searchData['additionalData']['com.woltlab.wcf.conversation.message']['conversationID'])) {
$this->conversationID = $form->searchData['additionalData']['com.woltlab.wcf.conversation.message']['conversationID'];
<?php
namespace wcf\system\user\notification\event;
use wcf\system\request\LinkHandler;
+use wcf\system\user\notification\object\ConversationMessageUserNotificationObject;
/**
* User notification event for conversation messages.
* @package com.woltlab.wcf.conversation
* @subpackage system.user.notification.event
* @category Community Framework
+ *
+ * @method ConversationMessageUserNotificationObject getUserNotificationObject()
*/
class ConversationMessageUserNotificationEvent extends AbstractUserNotificationEvent {
/**
*/
public function getLink() {
return LinkHandler::getInstance()->getLink('Conversation', [
- 'object' => $this->userNotificationObject->getConversation(),
- 'messageID' => $this->userNotificationObject->messageID
- ], '#message'.$this->userNotificationObject->messageID);
+ 'object' => $this->getUserNotificationObject()->getConversation(),
+ 'messageID' => $this->getUserNotificationObject()->messageID
+ ], '#message'.$this->getUserNotificationObject()->messageID);
}
/**
* @inheritDoc
*/
public function getEventHash() {
- return sha1($this->eventID . '-' . $this->userNotificationObject->conversationID);
+ return sha1($this->eventID . '-' . $this->getUserNotificationObject()->conversationID);
}
/**
* @inheritDoc
*/
public function checkAccess() {
- return $this->userNotificationObject->getConversation()->canRead();
+ return $this->getUserNotificationObject()->getConversation()->canRead();
}
}
<?php
namespace wcf\system\user\notification\event;
use wcf\system\request\LinkHandler;
+use wcf\system\user\notification\object\ConversationUserNotificationObject;
/**
* User notification event for conversations.
* @package com.woltlab.wcf.conversation
* @subpackage system.user.notification.event
* @category Community Framework
+ *
+ * @method ConversationUserNotificationObject getUserNotificationObject()
*/
class ConversationUserNotificationEvent extends AbstractUserNotificationEvent {
/**
* @inheritDoc
*/
public function checkAccess() {
- return $this->userNotificationObject->canRead();
+ return $this->getUserNotificationObject()->canRead();
}
}