summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-07-01 10:24:12 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-07-01 10:24:12 +0200
commit678806749d013b151afa2ac328cf7efb569ee1fc (patch)
tree55f6cd4d6d02049040a2369b815ca93100c667de /src/timeline/InputBar.cpp
parentFix crash on empty user cache stored (diff)
downloadnheko-678806749d013b151afa2ac328cf7efb569ee1fc.tar.xz
Add a /command to redact all visible messages sent by a user
Diffstat (limited to 'src/timeline/InputBar.cpp')
-rw-r--r--src/timeline/InputBar.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp

index fe171deb..91654f40 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp
@@ -692,6 +692,12 @@ InputBar::command(const QString &command, QString args) } else if (command == QLatin1String("unban")) { ChatPage::instance()->unbanUser( room->roomId(), args.section(' ', 0, 0), args.section(' ', 1, -1)); + } else if (command == QLatin1String("redact")) { + if (args.startsWith('@')) { + room->redactAllFromUser(args.section(' ', 0, 0), args.section(' ', 1, -1)); + } else if (args.startsWith('$')) { + room->redactEvent(args.section(' ', 0, 0), args.section(' ', 1, -1)); + } } else if (command == QLatin1String("roomnick")) { mtx::events::state::Member member; member.display_name = args.toStdString();