From 3f2e30826350be5df7f43de86751a9e4be9f819c Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Thu, 24 Sep 2020 14:36:32 +0200 Subject: [PATCH] Now 'part' and 'join' commands require connection type to be CLIENT --- source/dnetd/dconnection.d | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/dnetd/dconnection.d b/source/dnetd/dconnection.d index 906a756..6799ad1 100644 --- a/source/dnetd/dconnection.d +++ b/source/dnetd/dconnection.d @@ -197,8 +197,8 @@ public class DConnection : Thread { } - /* If `join` command (requires: authed) */ - else if(commandByte == 3 && hasAuthed) + /* If `join` command (requires: authed, client) */ + else if(commandByte == 3 && hasAuthed && connType == ConnectionType.CLIENT) { /* Get the channel names */ string channelList = cast(string)message.data[1..message.data.length]; @@ -232,8 +232,8 @@ public class DConnection : Thread /* TODO: Implement me, use return value */ writeSocket(tag, reply); } - /* If `part` command (requires: authed) */ - else if(commandByte == 4 && hasAuthed) + /* If `part` command (requires: authed, client) */ + else if(commandByte == 4 && hasAuthed && connType == ConnectionType.CLIENT) { /* Get the channel names */ string channelList = cast(string)message.data[1..message.data.length]; @@ -262,8 +262,8 @@ public class DConnection : Thread /* TODO: Implement me, use return value */ writeSocket(tag, reply); } - /* If `list` command (requires: authed) */ - else if(commandByte == 6 && hasAuthed) + /* If `list` command (requires: authed, client) */ + else if(commandByte == 6 && hasAuthed && connType == ConnectionType.CLIENT) { /* Get all channels */ DChannel[] channels = server.getChannels();