Mercurial > ~mikael > mcabber > hg
diff mcabber/src/hooks.c @ 591:5a685e9012b4
Show only the 1st line of the status message, in the log window
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 10 Dec 2005 23:52:04 +0100 |
parents | fed6d1e4d7a9 |
children | 9516db839e08 |
line wrap: on
line diff
--- a/mcabber/src/hooks.c Sat Dec 10 23:18:26 2005 +0100 +++ b/mcabber/src/hooks.c Sat Dec 10 23:52:04 2005 +0100 @@ -175,6 +175,7 @@ int st_in_buf; enum imstatus oldstat; char *bn = NULL; + char *logsmsg, *p; const char *rn = (resname ? resname : "default"); st_in_buf = settings_opt_get_int("show_status_in_buffer"); @@ -195,10 +196,14 @@ bn = g_strdup_printf("<%s/%s>", jid, rn); } + logsmsg = g_strdup(status_msg ? status_msg : ""); + if ((p = strchr(logsmsg, '\n')) != NULL) + *p = 0; + oldstat = roster_getstatus(jid, resname); scr_LogPrint(LPRINT_LOGNORM, "Buddy status has changed: [%c>%c] %s %s", - imstatus2char[oldstat], imstatus2char[status], bn, - ((status_msg) ? status_msg : "")); + imstatus2char[oldstat], imstatus2char[status], bn, logsmsg); + g_free(logsmsg); g_free(bn); if (st_in_buf == 2 ||