Handle /nick
command (#12)
This commit is contained in:
parent
8a1a772ab7
commit
30774957ba
@ -7,7 +7,7 @@ Features ✨:
|
||||
|
||||
Improvements 🙌:
|
||||
- "Add Matrix app" menu is now always visible (#1495)
|
||||
- Handle `/op` and `/deop` commands (#12)
|
||||
- Handle `/op`, `/deop`, and `/nick` commands (#12)
|
||||
|
||||
Bugfix 🐛:
|
||||
- Fix dark theme issue on login screen (#1097)
|
||||
|
@ -539,8 +539,8 @@ class RoomDetailViewModel @AssistedInject constructor(
|
||||
popDraft()
|
||||
}
|
||||
is ParsedCommand.ChangeDisplayName -> {
|
||||
// TODO
|
||||
_viewEvents.post(RoomDetailViewEvents.SlashCommandNotImplemented)
|
||||
handleChangeDisplayNameSlashCommand(slashCommandResult)
|
||||
popDraft()
|
||||
}
|
||||
is ParsedCommand.DiscardSession -> {
|
||||
if (room.isEncrypted()) {
|
||||
@ -685,6 +685,12 @@ class RoomDetailViewModel @AssistedInject constructor(
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleChangeDisplayNameSlashCommand(changeDisplayName: ParsedCommand.ChangeDisplayName) {
|
||||
launchSlashCommandFlow {
|
||||
session.setDisplayName(session.myUserId, changeDisplayName.displayName, it)
|
||||
}
|
||||
}
|
||||
|
||||
private fun handleKickSlashCommand(kick: ParsedCommand.KickUser) {
|
||||
launchSlashCommandFlow {
|
||||
room.kick(kick.userId, kick.reason, it)
|
||||
|
Loading…
x
Reference in New Issue
Block a user