@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

indiefan and committed by
epriestley
eb942f3e edaff9e2

+19 -7
+19 -7
src/infrastructure/daemon/bot/adapter/PhabricatorCampfireProtocolAdapter.php
··· 129 129 130 130 public function writeMessage(PhabricatorBotMessage $message) { 131 131 switch ($message->getCommand()) { 132 - case 'MESSAGE': 133 - $this->speak( 134 - $message->getBody(), 135 - $message->getTarget()); 136 - break; 132 + case 'MESSAGE': 133 + $this->speak( 134 + $message->getBody(), 135 + $message->getTarget()); 136 + break; 137 + case 'SOUND': 138 + $this->speak( 139 + $message->getBody(), 140 + $message->getTarget(), 141 + 'SoundMessage'); 142 + break; 143 + case 'PASTE': 144 + $this->speak( 145 + $message->getBody(), 146 + $message->getTarget(), 147 + 'PasteMessage'); 148 + break; 137 149 } 138 150 } 139 151 ··· 147 159 unset($this->inRooms[$room_id]); 148 160 } 149 161 150 - private function speak($message, $room_id) { 162 + private function speak($message, $room_id, $type='TextMessage') { 151 163 $this->performPost( 152 164 "/room/{$room_id}/speak.json", 153 165 array( 154 166 'message' => array( 155 - 'type' => 'TextMessage', 167 + 'type' => $type, 156 168 'body' => $message))); 157 169 } 158 170