Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/hooks.c @ 655:de6837908702
Use "(...)" when cutting a multi-line status message in the log window
Thanks to Salvador for suggesting...
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 07 Jan 2006 13:59:17 +0100 |
parents | 16cd6c858a5d |
children | 29a0637c176f |
comparison
equal
deleted
inserted
replaced
654:d7fe7b88e4fc | 655:de6837908702 |
---|---|
176 { | 176 { |
177 int buddy_format; | 177 int buddy_format; |
178 int st_in_buf; | 178 int st_in_buf; |
179 enum imstatus oldstat; | 179 enum imstatus oldstat; |
180 char *bn = NULL; | 180 char *bn = NULL; |
181 char *logsmsg, *p; | 181 char *logsmsg; |
182 const char *rn = (resname ? resname : ""); | 182 const char *rn = (resname ? resname : ""); |
183 | 183 |
184 st_in_buf = settings_opt_get_int("show_status_in_buffer"); | 184 st_in_buf = settings_opt_get_int("show_status_in_buffer"); |
185 buddy_format = settings_opt_get_int("buddy_format"); | 185 buddy_format = settings_opt_get_int("buddy_format"); |
186 if (buddy_format) { | 186 if (buddy_format) { |
198 if (!bn) { | 198 if (!bn) { |
199 bn = g_strdup_printf("<%s/%s>", jid, rn); | 199 bn = g_strdup_printf("<%s/%s>", jid, rn); |
200 } | 200 } |
201 | 201 |
202 logsmsg = g_strdup(status_msg ? status_msg : ""); | 202 logsmsg = g_strdup(status_msg ? status_msg : ""); |
203 if ((p = strchr(logsmsg, '\n')) != NULL) | 203 replace_nl_with_dots(logsmsg); |
204 *p = 0; | |
205 | 204 |
206 oldstat = roster_getstatus(jid, resname); | 205 oldstat = roster_getstatus(jid, resname); |
207 scr_LogPrint(LPRINT_LOGNORM, "Buddy status has changed: [%c>%c] %s %s", | 206 scr_LogPrint(LPRINT_LOGNORM, "Buddy status has changed: [%c>%c] %s %s", |
208 imstatus2char[oldstat], imstatus2char[status], bn, logsmsg); | 207 imstatus2char[oldstat], imstatus2char[status], bn, logsmsg); |
209 g_free(logsmsg); | 208 g_free(logsmsg); |