Mercurial > ~mikael > mcabber > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
590:a5707d61e469 | 591:5a685e9012b4 |
---|---|
173 { | 173 { |
174 int buddy_format; | 174 int buddy_format; |
175 int st_in_buf; | 175 int st_in_buf; |
176 enum imstatus oldstat; | 176 enum imstatus oldstat; |
177 char *bn = NULL; | 177 char *bn = NULL; |
178 char *logsmsg, *p; | |
178 const char *rn = (resname ? resname : "default"); | 179 const char *rn = (resname ? resname : "default"); |
179 | 180 |
180 st_in_buf = settings_opt_get_int("show_status_in_buffer"); | 181 st_in_buf = settings_opt_get_int("show_status_in_buffer"); |
181 buddy_format = settings_opt_get_int("buddy_format"); | 182 buddy_format = settings_opt_get_int("buddy_format"); |
182 if (buddy_format) { | 183 if (buddy_format) { |
193 | 194 |
194 if (!bn) { | 195 if (!bn) { |
195 bn = g_strdup_printf("<%s/%s>", jid, rn); | 196 bn = g_strdup_printf("<%s/%s>", jid, rn); |
196 } | 197 } |
197 | 198 |
199 logsmsg = g_strdup(status_msg ? status_msg : ""); | |
200 if ((p = strchr(logsmsg, '\n')) != NULL) | |
201 *p = 0; | |
202 | |
198 oldstat = roster_getstatus(jid, resname); | 203 oldstat = roster_getstatus(jid, resname); |
199 scr_LogPrint(LPRINT_LOGNORM, "Buddy status has changed: [%c>%c] %s %s", | 204 scr_LogPrint(LPRINT_LOGNORM, "Buddy status has changed: [%c>%c] %s %s", |
200 imstatus2char[oldstat], imstatus2char[status], bn, | 205 imstatus2char[oldstat], imstatus2char[status], bn, logsmsg); |
201 ((status_msg) ? status_msg : "")); | 206 g_free(logsmsg); |
202 g_free(bn); | 207 g_free(bn); |
203 | 208 |
204 if (st_in_buf == 2 || | 209 if (st_in_buf == 2 || |
205 (st_in_buf == 1 && (status == offline || oldstat == offline))) { | 210 (st_in_buf == 1 && (status == offline || oldstat == offline))) { |
206 // Write the status change in the buddy's buffer, only if it already exists | 211 // Write the status change in the buddy's buffer, only if it already exists |