Pass in Connection instead

This commit is contained in:
Tristan B. Kildaire 2020-10-25 23:43:43 +02:00
parent 32deadfc83
commit 185e5efd5f
2 changed files with 10 additions and 3 deletions

View File

@ -23,10 +23,12 @@ import gtk.Entry;
import pango.PgAttributeList;
import pango.PgAttribute;
import Connection;
public final class Channel
{
private DClient client;
private Connection connection;
/**
* Channel details
@ -52,9 +54,10 @@ public final class Channel
/* TODO: No mutexes should be needed (same precaution) as the GTK lock provides safety */
private string[] usersString;
this(DClient client, string channelName)
this(Connection connection, string channelName)
{
this.client = client;
this.client = connection.getClient();
this.connection = connection;
this.channelName = channelName;
initializeBox();
@ -259,6 +262,10 @@ public final class Channel
Label bruh = getUserLabel(member);
users.add(bruh);
usersString~=member;
/* TODO: Testing code, remove */
// UserNode testNode = new UserNode(connectio)
}
}

View File

@ -260,7 +260,7 @@ public final class Connection : Thread
client.join(channelName);
/* Create the Channel object */
Channel newChannel = new Channel(client, channelName);
Channel newChannel = new Channel(this, channelName);
/* Add the channel */
addChannel(newChannel);