From 9236b54515937624cb8135bc1be64c7d96a9f840 Mon Sep 17 00:00:00 2001 From: "Tristan B. Kildaire" Date: Thu, 24 Sep 2020 15:01:23 +0200 Subject: [PATCH] Added code to send a message to a channel for the 'msg' command --- source/dnetd/dconnection.d | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/dnetd/dconnection.d b/source/dnetd/dconnection.d index 6799ad1..42eb685 100644 --- a/source/dnetd/dconnection.d +++ b/source/dnetd/dconnection.d @@ -319,10 +319,14 @@ public class DConnection : Thread /* If we are sending to a channel */ else if(messageType == cast(ubyte)1) { + /* The channel wanting to send to */ + DChannel channel = server.getChannelByName(destination); + /* If the channel exists */ - if(server.getChannelByName(destination)) + if(channel) { /* TODO Implemet me */ + channel.sendMessage(this, msg); } /* If the channel does not exist */ else