mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-12-21 21:30:08 +00:00
Make Broadcast/Team message types not inherit from PlainMessageType
This commit is contained in:
parent
5b4d97fbc8
commit
e836009dbb
@ -19,23 +19,21 @@
|
||||
use chat\data\room\Room;
|
||||
use wcf\data\user\UserProfile;
|
||||
use wcf\system\event\EventHandler;
|
||||
use wcf\system\html\output\HtmlOutputProcessor;
|
||||
use wcf\system\WCF;
|
||||
|
||||
/**
|
||||
* BroadcastMessageType represents a broadcasted message.
|
||||
*/
|
||||
class BroadcastMessageType extends PlainMessageType
|
||||
class BroadcastMessageType implements IMessageType, IDeletableMessageType
|
||||
{
|
||||
/**
|
||||
* HtmlOutputProcessor to use.
|
||||
* @var \wcf\system\html\output\HtmlOutputProcessor
|
||||
* @var PlainMessageType
|
||||
*/
|
||||
protected $processor;
|
||||
protected $plainMessageType;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->processor = new HtmlOutputProcessor();
|
||||
$this->plainMessageType = new PlainMessageType();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,6 +44,14 @@ public function getJavaScriptModuleName()
|
||||
return 'Bastelstu.be/Chat/MessageType/Broadcast';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPayload(Message $message, ?UserProfile $user = null)
|
||||
{
|
||||
return $this->plainMessageType->getPayload($message, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
@ -19,23 +19,21 @@
|
||||
use chat\data\room\Room;
|
||||
use wcf\data\user\UserProfile;
|
||||
use wcf\system\event\EventHandler;
|
||||
use wcf\system\html\output\HtmlOutputProcessor;
|
||||
use wcf\system\WCF;
|
||||
|
||||
/**
|
||||
* TeamMessageType represents a team internal message.
|
||||
*/
|
||||
class TeamMessageType extends PlainMessageType
|
||||
class TeamMessageType implements IMessageType, IDeletableMessageType
|
||||
{
|
||||
/**
|
||||
* HtmlOutputProcessor to use.
|
||||
* @var \wcf\system\html\output\HtmlOutputProcessor
|
||||
* @var PlainMessageType
|
||||
*/
|
||||
protected $processor;
|
||||
protected $plainMessageType;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->processor = new HtmlOutputProcessor();
|
||||
$this->plainMessageType = new PlainMessageType();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,6 +44,14 @@ public function getJavaScriptModuleName()
|
||||
return 'Bastelstu.be/Chat/MessageType/Team';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getPayload(Message $message, ?UserProfile $user = null)
|
||||
{
|
||||
return $this->plainMessageType->getPayload($message, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user