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( ...@@ -1190,13 +1190,12 @@ class ChatRoomPresenter @Inject constructor(
sendMessage(roomId, text, null) sendMessage(roomId, text, null)
} else { } else {
view.disableSendMessageButton() view.disableSendMessageButton()
val command = text.split(" ") val index = text.indexOf(" ")
val name = command[0].substring(1) var name = ""
var params = "" var params = ""
command.forEachIndexed { index, param -> if (index >= 1) {
if (index > 0) { name = text.substring(1, index)
params += "$param " params = text.substring(index + 1).trim()
}
} }
val result = retryIO("runCommand($name, $params, $roomId)") { val result = retryIO("runCommand($name, $params, $roomId)") {
client.runCommand(Command(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