Commit dd4a4f3a authored by Hussein El Feky's avatar Hussein El Feky

Trimmed command params to fix /me command

parent c8963cdf
......@@ -1190,13 +1190,12 @@ class ChatRoomPresenter @Inject constructor(
sendMessage(roomId, text, null)
} else {
view.disableSendMessageButton()
val command = text.split(" ")
val name = command[0].substring(1)
val index = text.indexOf(" ")
var name = ""
var params = ""
command.forEachIndexed { index, param ->
if (index > 0) {
params += "$param "
}
if (index >= 1) {
name = text.substring(1, index)
params = text.substring(index + 1).trim()
}
val result = retryIO("runCommand($name, $params, $roomId)") {
client.runCommand(Command(name, params), roomId)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment