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 🙌:
|
Improvements 🙌:
|
||||||
- "Add Matrix app" menu is now always visible (#1495)
|
- "Add Matrix app" menu is now always visible (#1495)
|
||||||
- Handle `/op` and `/deop` commands (#12)
|
- Handle `/op`, `/deop`, and `/nick` commands (#12)
|
||||||
|
|
||||||
Bugfix 🐛:
|
Bugfix 🐛:
|
||||||
- Fix dark theme issue on login screen (#1097)
|
- Fix dark theme issue on login screen (#1097)
|
||||||
|
|
|
@ -539,8 +539,8 @@ class RoomDetailViewModel @AssistedInject constructor(
|
||||||
popDraft()
|
popDraft()
|
||||||
}
|
}
|
||||||
is ParsedCommand.ChangeDisplayName -> {
|
is ParsedCommand.ChangeDisplayName -> {
|
||||||
// TODO
|
handleChangeDisplayNameSlashCommand(slashCommandResult)
|
||||||
_viewEvents.post(RoomDetailViewEvents.SlashCommandNotImplemented)
|
popDraft()
|
||||||
}
|
}
|
||||||
is ParsedCommand.DiscardSession -> {
|
is ParsedCommand.DiscardSession -> {
|
||||||
if (room.isEncrypted()) {
|
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) {
|
private fun handleKickSlashCommand(kick: ParsedCommand.KickUser) {
|
||||||
launchSlashCommandFlow {
|
launchSlashCommandFlow {
|
||||||
room.kick(kick.userId, kick.reason, it)
|
room.kick(kick.userId, kick.reason, it)
|
||||||
|
|
Loading…
Reference in a new issue