comparison mcabber/mcabber/hooks.c @ 1847:2e133fc0e3d9

Display the sender in the log window before processing hooks When 'log_display_sender' is set, display the sender before runnin the hook-post-message-in hooks.
author Mikael Berthe <mikael@lilotux.net>
date Sun, 28 Mar 2010 23:40:10 +0200
parents f0a07658e009
children b210c3d0de1f
comparison
equal deleted inserted replaced
1846:048bcde98fc6 1847:2e133fc0e3d9
370 } 370 }
371 371
372 if (settings_opt_get_int("eventcmd_use_nickname")) 372 if (settings_opt_get_int("eventcmd_use_nickname"))
373 ename = roster_getname(bjid); 373 ename = roster_getname(bjid);
374 374
375 // Display the sender in the log window
376 if ((!is_groupchat) && !(message_flags & HBB_PREFIX_ERR) &&
377 settings_opt_get_int("log_display_sender")) {
378 const char *name = roster_getname(bjid);
379 if (!name) name = "";
380 scr_LogPrint(LPRINT_NORMAL, "Message received from %s <%s/%s>",
381 name, bjid, (resname ? resname : ""));
382 }
383
375 #ifdef MODULES_ENABLE 384 #ifdef MODULES_ENABLE
376 { 385 {
377 hk_arg_t args[] = { 386 hk_arg_t args[] = {
378 { "jid", bjid }, 387 { "jid", bjid },
379 { "resource", resname }, 388 { "resource", resname },
390 // - We do not call hk_ext_cmd() for history lines in MUC 399 // - We do not call hk_ext_cmd() for history lines in MUC
391 // - We do call hk_ext_cmd() for private messages in a room 400 // - We do call hk_ext_cmd() for private messages in a room
392 // - We do call hk_ext_cmd() for messages to the current window 401 // - We do call hk_ext_cmd() for messages to the current window
393 if (!active_window && ((is_groupchat && !timestamp) || !is_groupchat)) 402 if (!active_window && ((is_groupchat && !timestamp) || !is_groupchat))
394 hk_ext_cmd(ename ? ename : bjid, (is_groupchat ? 'G' : 'M'), 'R', wmsg); 403 hk_ext_cmd(ename ? ename : bjid, (is_groupchat ? 'G' : 'M'), 'R', wmsg);
395
396 // Display the sender in the log window
397 if ((!is_groupchat) && !(message_flags & HBB_PREFIX_ERR) &&
398 settings_opt_get_int("log_display_sender")) {
399 const char *name = roster_getname(bjid);
400 if (!name) name = "";
401 scr_LogPrint(LPRINT_NORMAL, "Message received from %s <%s/%s>",
402 name, bjid, (resname ? resname : ""));
403 }
404 404
405 // Beep, if enabled: 405 // Beep, if enabled:
406 // - if it's a private message 406 // - if it's a private message
407 // - if it's a public message and it's highlighted 407 // - if it's a public message and it's highlighted
408 if (settings_opt_get_int("beep_on_message")) { 408 if (settings_opt_get_int("beep_on_message")) {