mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-31 00:48:21 +01:00
d5995d574d
Summary: Make users/channels/rooms into objects, so we can later sort out stuff like Campfire user IDs, Phabricator vs chat accounts, etc. The only change here is that I removed output buffering from the macro handler. We should move throttling/buffering to adapters instead and have it apply globally. Test Plan: Ran IRC and Campfire bots and interacted with them. Reviewers: indiefan Reviewed By: indiefan CC: aran Differential Revision: https://secure.phabricator.com/D4924
52 lines
910 B
PHP
52 lines
910 B
PHP
<?php
|
|
|
|
final class PhabricatorBotMessage {
|
|
|
|
private $sender;
|
|
private $command;
|
|
private $body;
|
|
private $target;
|
|
private $public;
|
|
|
|
public function __construct() {
|
|
// By default messages are public
|
|
$this->public = true;
|
|
}
|
|
|
|
public function setSender(PhabricatorBotTarget $sender = null) {
|
|
$this->sender = $sender;
|
|
return $this;
|
|
}
|
|
|
|
public function getSender() {
|
|
return $this->sender;
|
|
}
|
|
|
|
public function setCommand($command) {
|
|
$this->command = $command;
|
|
return $this;
|
|
}
|
|
|
|
public function getCommand() {
|
|
return $this->command;
|
|
}
|
|
|
|
public function setBody($body) {
|
|
$this->body = $body;
|
|
return $this;
|
|
}
|
|
|
|
public function getBody() {
|
|
return $this->body;
|
|
}
|
|
|
|
public function setTarget(PhabricatorBotTarget $target = null) {
|
|
$this->target = $target;
|
|
return $this;
|
|
}
|
|
|
|
public function getTarget() {
|
|
return $this->target;
|
|
}
|
|
|
|
}
|