]> hydra-www.ietfng.org Git - gtetrinet/commitdiff
show the /msgs commands in the partyline
authorDaniel Carbonell Fraj <bocata@src.gnome.org>
Thu, 5 Jun 2003 11:39:59 +0000 (11:39 +0000)
committerDaniel Carbonell Fraj <bocata@src.gnome.org>
Thu, 5 Jun 2003 11:39:59 +0000 (11:39 +0000)
ChangeLog
src/partyline.c
src/partyline.h

index 1a75904214a909477f37cd2e4525ece4adfe034a..21728fec98be5f0648f757cae0561268e1b5380d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003-06-05  Dani Carbonell  <bocata@panete.net>
+
+       * src/partyline.c (textentry): Show the /msgs commands in the partyline.
+
 2003-06-05  Abel Cheung  <maddog@linux.org.hk>
 
        * configure.in: Added "zh_TW" to ALL_LINGUAS.
index 80793b47a6d16668e85e109f87c33afe816aa27a..7838f5d63829a7b6dde52047d76e66b3344720eb 100644 (file)
@@ -233,7 +233,7 @@ void partyline_status (char *status)
     gtk_label_set_text (GTK_LABEL(infolabel), status);
 }
 
-void partyline_text (char *text)
+void partyline_text (const gchar *text)
 {
     if (timestampsenable) {
         time_t now;
@@ -329,7 +329,7 @@ void textentry (GtkWidget *widget)
 
     if (strlen(text) == 0) return;
 
-    if (!strncmp("/list", text, strlen("/list")))
+    if (g_str_has_prefix(text, "/list"))
       stop_list(); /* Parsing can't be perfect,
                       so make sure they can do it by hand... */
     
@@ -337,8 +337,13 @@ void textentry (GtkWidget *widget)
     iso_text = g_locale_from_utf8 (text, -1, NULL, NULL, NULL);
 
        /* FIXME : if there is an error while converting from UTF8 to current locale, we ignore the message */
-       if (iso_text == NULL) return;
+    if (iso_text == NULL)
+      return;
 
+    // Show the command if it's a /msg
+    if (g_str_has_prefix (text, "/msg"))
+      partyline_text (text);
+    
     tetrinet_playerline (iso_text);
     GTET_O_STRCPY (plhistory[plh_end], iso_text);
     gtk_entry_set_text (GTK_ENTRY(widget), "");
index 0d2e318643d92d5679e582f098395fd2dcfb521a..86e7406941b1458bdf11e11d63e5ac0283130f58 100644 (file)
@@ -7,7 +7,7 @@ extern GtkWidget *partyline_page_new (void);
 extern void partyline_connectstatus (int status);
 extern void partyline_namelabel (char *nick, char *team);
 extern void partyline_status (char *status);
-extern void partyline_text (char *text);
+extern void partyline_text (const gchar *text);
 extern void partyline_fmt (const char *text, ...) G_GNUC_PRINTF (1, 2);
 extern void partyline_playerlist (int *numbers, char **names, char **teams, int n, char **specs, int sn);
 extern void partyline_entryfocus (void);