From b5091dbf3d73b8bb193940a1d3eecfd3d9187479 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Wed, 30 Sep 2020 10:16:11 +0200 Subject: [PATCH] Added 'names' command --- dub.json | 2 +- dub.selections.json | 2 +- source/app.d | 6 ++++++ source/notifications.d | 8 ++++---- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/dub.json b/dub.json index 9139f71..56845b4 100644 --- a/dub.json +++ b/dub.json @@ -4,7 +4,7 @@ ], "copyright": "Copyright © 2020, Tristan B. Kildaire", "dependencies": { - "libdnet": "~>0.0.4", + "libdnet": "~>0.0.5", "tristanable": "~>0.0.33" }, "description": "dnet client", diff --git a/dub.selections.json b/dub.selections.json index b1e0128..b43ace7 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -2,7 +2,7 @@ "fileVersion": 1, "versions": { "bformat": "1.0.8", - "libdnet": "0.0.4", + "libdnet": "0.0.5", "tristanable": "0.0.33" } } diff --git a/source/app.d b/source/app.d index 6ca8b2a..42aa33e 100644 --- a/source/app.d +++ b/source/app.d @@ -166,6 +166,12 @@ void commandLine() writeln(to!(string)(memberCount)~")"); } } + /* If the command is `names` */ + else if(cmp(command, "names") == 0) + { + string[] members = dclient.getMembers(currentChannel); + writeln(members); + } /* If the command is `join` */ else if(cmp(command, "join") == 0) { diff --git a/source/notifications.d b/source/notifications.d index 2c8a7b7..81f52c0 100644 --- a/source/notifications.d +++ b/source/notifications.d @@ -28,12 +28,12 @@ public class NotificationWatcher : Thread if(notifications.length) { - writeln(notifications); + //writeln(notifications); foreach(NotificationReply notificationReply; notifications) { - writeln(notificationReply.getData()); + //writeln(notificationReply.getData()); string msg = cast(string)notificationReply.getData(); - writeln("!> "~msg); + //writeln("!> "~msg); process(notificationReply.getData()); } } @@ -64,7 +64,7 @@ public class NotificationWatcher : Thread { /* TODO: Decode using tristanable */ /* TODO: Get the username of the user that left */ - writeln("user left/join message"); + //writeln("user left/join message"); /* Get the sub-type */ byte subType = data[1];