Restructure and inherit

This commit is contained in:
Tristan B. Kildaire 2021-01-28 11:41:19 +02:00
parent d4912089b1
commit 31611d6f94
4 changed files with 9 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import std.socket;
import gtk.ListBox; import gtk.ListBox;
import gtk.Label; import gtk.Label;
import Channel; import areas.Channel;
import std.string; import std.string;
import core.sync.mutex; import core.sync.mutex;
@ -184,7 +184,7 @@ public final class Connection : Thread
string channel = cast(string)data[2+usernameLength+1..2+usernameLength+1+channelLength]; string channel = cast(string)data[2+usernameLength+1..2+usernameLength+1+channelLength];
gprintln("NormalMessage: (Channel): "~channel); gprintln("NormalMessage: (Channel): "~channel);
findChannel(channel).receiveMessage(username, cast(string)data[2+usernameLength+1+channelLength..data.length]); findChannel(channel).receiveMessage(username, cast(string)data[2+usernameLength+1+channelLength..data.length]);
} }
/* Channel notification (ntype=1) */ /* Channel notification (ntype=1) */

View File

@ -7,6 +7,8 @@
* along with the input box state * along with the input box state
*/ */
module areas.Channel;
import gtk.Box; import gtk.Box;
import gtk.ListBox; import gtk.ListBox;
import gtk.Label; import gtk.Label;
@ -27,8 +29,9 @@ import pango.PgAttribute;
import Connection; import Connection;
import gogga; import gogga;
import areas.MessageArea;
public final class Channel public final class Channel : MessageArea
{ {
private DClient client; private DClient client;
private Connection connection; private Connection connection;

View File

@ -7,6 +7,8 @@
* The sub-classes are "Direct Message" and "Channel" * The sub-classes are "Direct Message" and "Channel"
*/ */
module areas.MessageArea;
public class MessageArea public class MessageArea
{ {
/* TODO: Implement me */ /* TODO: Implement me */

View File

@ -21,7 +21,7 @@ import gtk.SearchEntry;
import gtk.Image; import gtk.Image;
import Connection; import Connection;
import Channel; import areas.Channel;
import std.socket; import std.socket;
import std.conv; import std.conv;