mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Updated Campfire adapter to be able to post sound messages and paste messages.
Test Plan: Ran the bot with a handler that sends sound commands. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4922
This commit is contained in:
parent
edaff9e2a3
commit
eb942f3e1e
1 changed files with 19 additions and 7 deletions
|
@ -134,6 +134,18 @@ extends PhabricatorBaseProtocolAdapter {
|
|||
$message->getBody(),
|
||||
$message->getTarget());
|
||||
break;
|
||||
case 'SOUND':
|
||||
$this->speak(
|
||||
$message->getBody(),
|
||||
$message->getTarget(),
|
||||
'SoundMessage');
|
||||
break;
|
||||
case 'PASTE':
|
||||
$this->speak(
|
||||
$message->getBody(),
|
||||
$message->getTarget(),
|
||||
'PasteMessage');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,12 +159,12 @@ extends PhabricatorBaseProtocolAdapter {
|
|||
unset($this->inRooms[$room_id]);
|
||||
}
|
||||
|
||||
private function speak($message, $room_id) {
|
||||
private function speak($message, $room_id, $type='TextMessage') {
|
||||
$this->performPost(
|
||||
"/room/{$room_id}/speak.json",
|
||||
array(
|
||||
'message' => array(
|
||||
'type' => 'TextMessage',
|
||||
'type' => $type,
|
||||
'body' => $message)));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue