mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-24 18:36:21 +03:00
Handle /nick
command (#12)
This commit is contained in:
parent
8a1a772ab7
commit
30774957ba
2 changed files with 9 additions and 3 deletions
|
@ -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…
Reference in a new issue