Added status message fetch

This commit is contained in:
Tristan B. Kildaire 2020-10-19 14:06:14 +02:00
parent ac9ea39a8f
commit 7ae11e120e
3 changed files with 17 additions and 2 deletions

View File

@ -208,11 +208,14 @@ public final class Channel
/* First one is prescence */
string prescence = statusMessage[0];
/* Netx is status message */
string status = statusMessage[1];
d.setIconFromIconName(statusToGtkIcon(prescence), GtkIconSize.DIALOG);
// d.setText();
d.setMarkup("<b>"~userHover~"</b>\n"~prescence);
d.setMarkup("<b>"~userHover~"</b>\n"~prescence~"\n<i>"~status~"</i>");
// /* The notification box */
// Box notificationBox = new Box(GtkOrientation.VERTICAL, 1);

View File

@ -28,6 +28,7 @@ public final class Connection : Thread
private DClient client;
private Address address;
private string[] auth;
private string statusText;
/* TODO: Check if we need to protect */
/* TODO: So far usage is in signal handlers (mutex safved) and within te-tl lock for notifications */
@ -42,6 +43,15 @@ public final class Connection : Thread
private Mutex chansLock;
private Channel focusedChan;
// public void setPrescence(string pres)
// {
// /* The new status */
// string newStatus =
// statusText = "";
// statusText =
// }
this(GUI gui, Address address, string[] auth)
{
super(&worker);
@ -52,6 +62,8 @@ public final class Connection : Thread
/* Initialize locks */
initializeLocks();
statusText = "Hey there, I'm using Dnet!";
/* Start the notification atcher */
start();
}

View File

@ -187,7 +187,7 @@ public class GUI : Thread
Connection currentConnection = connections[notebook.getCurrentPage()];
/* Set the status */
currentConnection.getClient().setStatus(x.getLabel());
currentConnection.getClient().setStatus(x.getLabel()~",Hey there");
}
private MenuBar initializeMenuBar()