1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-27 01:02:42 +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:
indiefan 2013-02-12 11:30:14 -08:00 committed by epriestley
parent edaff9e2a3
commit eb942f3e1e

View file

@ -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)));
}