mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
Move input recoding in irc_server_event.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4483 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
2a915b21de
commit
bfc0b362e8
6 changed files with 58 additions and 89 deletions
|
|
@ -150,7 +150,7 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg,
|
|||
const char *target)
|
||||
{
|
||||
void *item;
|
||||
char *freemsg = NULL, *recoded;
|
||||
char *freemsg = NULL;
|
||||
int level;
|
||||
|
||||
level = MSGLEVEL_ACTIONS |
|
||||
|
|
@ -167,28 +167,26 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg,
|
|||
if (settings_get_bool("emphasis"))
|
||||
msg = freemsg = expand_emphasis(item, msg);
|
||||
|
||||
recoded = recode_in(SERVER(server), msg, target);
|
||||
if (ischannel(*target)) {
|
||||
/* channel action */
|
||||
if (window_item_is_active(item)) {
|
||||
/* message to active channel in window */
|
||||
printformat(server, target, level,
|
||||
IRCTXT_ACTION_PUBLIC, nick, recoded);
|
||||
IRCTXT_ACTION_PUBLIC, nick, msg);
|
||||
} else {
|
||||
/* message to not existing/active channel */
|
||||
printformat(server, target, level,
|
||||
IRCTXT_ACTION_PUBLIC_CHANNEL,
|
||||
nick, target, recoded);
|
||||
nick, target, msg);
|
||||
}
|
||||
} else {
|
||||
/* private action */
|
||||
printformat(server, nick, MSGLEVEL_ACTIONS | MSGLEVEL_MSGS,
|
||||
item == NULL ? IRCTXT_ACTION_PRIVATE :
|
||||
IRCTXT_ACTION_PRIVATE_QUERY,
|
||||
nick, address == NULL ? "" : address, recoded);
|
||||
nick, address == NULL ? "" : address, msg);
|
||||
}
|
||||
|
||||
g_free(recoded);
|
||||
g_free_not_null(freemsg);
|
||||
}
|
||||
|
||||
|
|
@ -208,20 +206,17 @@ static void sig_message_irc_notice(SERVER_REC *server, const char *msg,
|
|||
const char *target)
|
||||
{
|
||||
const char *oldtarget;
|
||||
char *recoded;
|
||||
|
||||
oldtarget = target;
|
||||
target = skip_target(target);
|
||||
|
||||
if (address == NULL || *address == '\0') {
|
||||
/* notice from server */
|
||||
recoded = recode_in(SERVER(server), msg, NULL);
|
||||
if (!ignore_check(server, nick, "",
|
||||
target, msg, MSGLEVEL_SNOTES)) {
|
||||
printformat(server, target, MSGLEVEL_SNOTES,
|
||||
IRCTXT_NOTICE_SERVER, nick, recoded);
|
||||
IRCTXT_NOTICE_SERVER, nick, msg);
|
||||
}
|
||||
g_free(recoded);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -230,19 +225,17 @@ static void sig_message_irc_notice(SERVER_REC *server, const char *msg,
|
|||
msg, MSGLEVEL_NOTICES))
|
||||
return;
|
||||
|
||||
recoded = recode_in(SERVER(server), msg, target);
|
||||
if (ischannel(*target)) {
|
||||
/* notice in some channel */
|
||||
printformat(server, target, MSGLEVEL_NOTICES,
|
||||
IRCTXT_NOTICE_PUBLIC, nick, oldtarget, recoded);
|
||||
IRCTXT_NOTICE_PUBLIC, nick, oldtarget, msg);
|
||||
} else {
|
||||
/* private notice */
|
||||
privmsg_get_query(SERVER(server), nick, FALSE,
|
||||
MSGLEVEL_NOTICES);
|
||||
printformat(server, nick, MSGLEVEL_NOTICES,
|
||||
IRCTXT_NOTICE_PRIVATE, nick, address, recoded);
|
||||
IRCTXT_NOTICE_PRIVATE, nick, address, msg);
|
||||
}
|
||||
g_free(recoded);
|
||||
}
|
||||
|
||||
static void sig_message_own_ctcp(IRC_SERVER_REC *server, const char *cmd,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue