This commit is contained in:
Valere 2020-01-06 09:31:03 +01:00 committed by Benoit Marty
parent c4ea2507f8
commit 3ac54c51f6
3 changed files with 8 additions and 5 deletions

View File

@ -41,8 +41,8 @@ enum class Command(val command: String, val parameters: String, @StringRes val d
RAINBOW_EMOTE("/rainbowme", "<message>", R.string.command_description_rainbow_emote),
CLEAR_SCALAR_TOKEN("/clear_scalar_token", "", R.string.command_description_clear_scalar_token),
SPOILER("/spoiler", "<message>", R.string.command_description_spoiler),
POLL("/poll", "Question | Option 1 | Option 2 ...", R.string.command_description_poll),
SHRUG("/shrug", "<message>", R.string.command_description_shrug),
SPOILER("/spoiler", "<message>", R.string.command_description_spoiler),
// TODO temporary command
VERIFY_USER("/verify", "<user-id>", R.string.command_description_verify);

View File

@ -80,12 +80,12 @@ object CommandParser {
ParsedCommand.SendEmote(message)
}
Command.RAINBOW.command -> {
Command.RAINBOW.command -> {
val message = textMessage.subSequence(Command.RAINBOW.command.length, textMessage.length).trim()
ParsedCommand.SendRainbow(message)
}
Command.RAINBOW_EMOTE.command -> {
Command.RAINBOW_EMOTE.command -> {
val message = textMessage.subSequence(Command.RAINBOW_EMOTE.command.length, textMessage.length).trim()
ParsedCommand.SendRainbowEmote(message)
@ -258,7 +258,6 @@ object CommandParser {
ParsedCommand.SendShrug(message)
}
Command.VERIFY_USER.command -> {
val message = textMessage.substring(Command.VERIFY_USER.command.length).trim()

View File

@ -145,7 +145,11 @@ class MessageItemFactory @Inject constructor(
}
}
private fun buildPollMessageItem(messageContent: MessageOptionsContent, informationData: MessageInformationData, highlight: Boolean, callback: TimelineEventController.Callback?, attributes: AbsMessageItem.Attributes): VectorEpoxyModel<*>? {
private fun buildPollMessageItem(messageContent: MessageOptionsContent,
informationData: MessageInformationData,
highlight: Boolean,
callback: TimelineEventController.Callback?,
attributes: AbsMessageItem.Attributes): VectorEpoxyModel<*>? {
return MessagePollItem_()
.attributes(attributes)
.callback(callback)