From 678806749d013b151afa2ac328cf7efb569ee1fc Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Fri, 1 Jul 2022 10:24:12 +0200 Subject: Add a /command to redact all visible messages sent by a user --- src/timeline/InputBar.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/timeline/InputBar.cpp') 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(); -- cgit 1.5.1