From: Bryan Worth <bryan@theworths.org>
Date: Fri, 25 Nov 2005 18:04:24 +0000 (+0000)
Subject: 2005-11-25  Bryan Worth <bryan@theworths.org>
X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=e26c0a51dea5e5ade3bdf081f29500a0fe3944d3;p=ttt

2005-11-25  Bryan Worth <bryan@theworths.org>
        * TODO: checked off NOTICE USER and NOTICE QUIT
        *src/ttt-client.c: (_ttt_client_execute_helo): implement NOTICE USER
        *(_ttt_client_execute_quit): implement NOTICE QUIT
---

diff --git a/ChangeLog b/ChangeLog
index e08c526..f99f646 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-11-25  Bryan Worth <bryan@theworths.org>
+	* TODO: checked off NOTICE USER and NOTICE QUIT
+	*src/ttt-client.c: (_ttt_client_execute_helo): implement NOTICE USER
+	*(_ttt_client_execute_quit): implement NOTICE QUIT
+
 2005-11-25  Bryan Worth <bryan@theworths.org>
 	* TODO: checked off MESSAGE
 
diff --git a/TODO b/TODO
index a795a03..da77894 100644
--- a/TODO
+++ b/TODO
@@ -18,8 +18,8 @@ S C
     1.4.3. MOVE
     2. Asynchronous notification.  
     2.1. Global notices
-    2.1.1. NOTICE USER <username>
-    2.1.2. NOTICE QUIT <username>
+✓   2.1.1. NOTICE USER <username>
+✓   2.1.2. NOTICE QUIT <username>
     2.1.3. NOTICE INVITE <username>
     2.1.4. NOTICE DISPOSE <game>
     2.1.5. NOTICE MESSAGE <username> <text>
diff --git a/src/ttt-client.c b/src/ttt-client.c
index 53cc4ff..7b37fad 100644
--- a/src/ttt-client.c
+++ b/src/ttt-client.c
@@ -109,6 +109,9 @@ _ttt_client_execute_helo (ttt_client_t *client,
 
     ttt_client_send (client, response);
 
+    xasprintf (&response, "NOTICE USER %s\n",client->name);
+    ttt_server_broadcast(client->server,response);
+
     free (response);
 
     return TTT_ERROR_NONE;
@@ -137,8 +140,12 @@ _ttt_client_execute_quit (ttt_client_t *client,
 			  char	       **args,
 			  int	       num_args)
 {
-    assert (num_args == 0);
+    char *notice;
 
+    assert (num_args == 0);
+    xasprintf (&notice,"NOTICE QUIT %s\n",client->name);
+    ttt_server_broadcast(client->server,notice);
+    free (notice);
     return TTT_ERROR_QUIT_REQUESTED;
 }