1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

fixed recoding of own messages.

recode after expand_emphasis
remove the redundant call to setlocale(LC_CTYPE, )


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4038 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Valentin Batz 2005-10-12 18:22:14 +00:00 committed by vb
parent fd476e8b31
commit d8d47ef37f
3 changed files with 16 additions and 14 deletions

View File

@ -259,8 +259,6 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg,
const char *nickmode; const char *nickmode;
char *freemsg = NULL, *recoded; char *freemsg = NULL, *recoded;
int print_channel; int print_channel;
/* ugly: recode the sent message back for printing */
recoded = recode_in(server, msg, target);
channel = channel_find(server, target); channel = channel_find(server, target);
if (channel != NULL) if (channel != NULL)
target = channel->visible_name; target = channel->visible_name;
@ -280,6 +278,9 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg,
if (settings_get_bool("emphasis")) if (settings_get_bool("emphasis"))
msg = freemsg = expand_emphasis((WI_ITEM_REC *) channel, msg); msg = freemsg = expand_emphasis((WI_ITEM_REC *) channel, msg);
/* ugly: recode the sent message back for printing */
recoded = recode_in(server, msg, target);
if (!print_channel) { if (!print_channel) {
printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT,
TXT_OWN_MSG, server->nick, recoded, nickmode); TXT_OWN_MSG, server->nick, recoded, nickmode);
@ -316,15 +317,16 @@ static void sig_message_own_private(SERVER_REC *server, const char *msg,
query = privmsg_get_query(server, target, TRUE, MSGLEVEL_MSGS); query = privmsg_get_query(server, target, TRUE, MSGLEVEL_MSGS);
if (settings_get_bool("emphasis"))
msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, msg);
/* ugly: recode the sent message back for printing */ /* ugly: recode the sent message back for printing */
recoded = recode_in(server, msg, target); recoded = recode_in(server, msg, target);
if (settings_get_bool("emphasis"))
msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, recoded);
printformat(server, target, printformat(server, target,
MSGLEVEL_MSGS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, MSGLEVEL_MSGS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT,
query == NULL ? TXT_OWN_MSG_PRIVATE : query == NULL ? TXT_OWN_MSG_PRIVATE :
TXT_OWN_MSG_PRIVATE_QUERY, target, msg, server->nick); TXT_OWN_MSG_PRIVATE_QUERY, target, recoded, server->nick);
g_free(recoded); g_free(recoded);
g_free_not_null(freemsg); g_free_not_null(freemsg);

View File

@ -111,7 +111,7 @@ static void sig_message_own_wall(SERVER_REC *server, const char *msg,
MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT |
MSGLEVEL_NO_ACT, MSGLEVEL_NO_ACT,
TXT_OWN_MSG_CHANNEL, TXT_OWN_MSG_CHANNEL,
server->nick, optarget, msg, nickmode); server->nick, optarget, recoded, nickmode);
g_free(recoded); g_free(recoded);
g_free(optarget); g_free(optarget);
} }
@ -127,16 +127,17 @@ static void sig_message_own_action(IRC_SERVER_REC *server, const char *msg,
else else
item = irc_query_find(server, target); item = irc_query_find(server, target);
if (settings_get_bool("emphasis"))
msg = freemsg = expand_emphasis(item, msg);
/* ugly: recode the sent message back for printing */ /* ugly: recode the sent message back for printing */
recoded = recode_in(SERVER(server), msg, target); recoded = recode_in(SERVER(server), msg, target);
if (settings_get_bool("emphasis"))
msg = freemsg = expand_emphasis(item, recoded);
printformat(server, target, printformat(server, target,
MSGLEVEL_ACTIONS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT | MSGLEVEL_ACTIONS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT |
(ischannel(*target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS), (ischannel(*target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS),
item != NULL ? IRCTXT_OWN_ACTION : IRCTXT_OWN_ACTION_TARGET, item != NULL ? IRCTXT_OWN_ACTION : IRCTXT_OWN_ACTION_TARGET,
server->nick, msg, target); server->nick, recoded, target);
g_free(recoded); g_free(recoded);
g_free_not_null(freemsg); g_free_not_null(freemsg);
} }

View File

@ -359,11 +359,10 @@ int main(int argc, char **argv)
before t his call. before t his call.
locales aren't actually used for anything else than autodetection locales aren't actually used for anything else than autodetection
of UTF-8 currently.. */ of UTF-8 currently..
setlocale(LC_CTYPE, "");
/* to get the users's charset with g_get_charset() properly you have furthermore to get the users's charset with g_get_charset() properly
to call setlocale(LC_ALL, "") aswell */ you have to call setlocale(LC_ALL, "") */
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
textui_init(); textui_init();