From 428d5645451461b7afbd1de6a45d985449286b88 Mon Sep 17 00:00:00 2001 From: Daniel Carbonell Fraj Date: Thu, 5 Jun 2003 11:39:59 +0000 Subject: [PATCH] show the /msgs commands in the partyline --- ChangeLog | 4 ++++ src/partyline.c | 11 ++++++++--- src/partyline.h | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a75904..21728fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-06-05 Dani Carbonell + + * src/partyline.c (textentry): Show the /msgs commands in the partyline. + 2003-06-05 Abel Cheung * configure.in: Added "zh_TW" to ALL_LINGUAS. diff --git a/src/partyline.c b/src/partyline.c index 80793b4..7838f5d 100644 --- a/src/partyline.c +++ b/src/partyline.c @@ -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), ""); diff --git a/src/partyline.h b/src/partyline.h index 0d2e318..86e7406 100644 --- a/src/partyline.h +++ b/src/partyline.h @@ -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); -- 2.50.1