summary refs log tree commit diff
path: root/src/timeline/InputBar.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-11-21 05:23:38 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-11-21 06:13:45 +0100
commit3d92e8ae606024f5054795281ccd488abee1795a (patch)
tree79d81d414251a4d090458eff72c16551f029091a /src/timeline/InputBar.cpp
parentPretty error printing (diff)
downloadnheko-3d92e8ae606024f5054795281ccd488abee1795a.tar.xz
Mark rooms as direct chats
Either by accepting an invite or manually using /converttodm and revert
with /converttoroom.
Diffstat (limited to 'src/timeline/InputBar.cpp')
-rw-r--r--src/timeline/InputBar.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp
index 44df3411..bd4f59d8 100644
--- a/src/timeline/InputBar.cpp
+++ b/src/timeline/InputBar.cpp
@@ -645,6 +645,11 @@ InputBar::command(QString command, QString args)
             return;
         }
         nhlog::net()->error("Could not resolve goto: {}", args.toStdString());
+    } else if (command == "converttodm") {
+        utils::markRoomAsDirect(this->room->roomId(),
+                                cache::getMembers(this->room->roomId().toStdString(), 0, -1));
+    } else if (command == "converttoroom") {
+        utils::removeDirectFromRoom(this->room->roomId());
     }
 }