Recode patch by decadix/senneth

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3283 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2004-08-20 00:03:40 +00:00 committed by cras
commit 226a567562
20 changed files with 289 additions and 63 deletions

View file

@ -22,6 +22,7 @@
#include "network.h"
#include "settings.h"
#include "irssi-version.h"
#include "recode.h"
#include "irc-servers.h"
#include "irc-channels.h"
@ -195,10 +196,11 @@ static void dump_join(IRC_CHANNEL_REC *channel, CLIENT_REC *client)
proxy_outdata(client, ":%s 366 %s %s :End of /NAMES list.\n",
client->proxy_address, client->nick, channel->name);
/* this is needed because the topic may be encoded into other charsets internaly */
if (channel->topic != NULL) {
proxy_outdata(client, ":%s 332 %s %s :%s\n",
client->proxy_address, client->nick,
channel->name, channel->topic);
channel->name, recode_out(channel->topic, channel->name));
}
}

View file

@ -257,7 +257,8 @@ static void handle_client_cmd(CLIENT_REC *client, char *cmd, char *args,
ignore_next = TRUE;
if (*msg != '\001' || msg[strlen(msg)-1] != '\001') {
signal_emit("message own_public", 4,
signal_emit(ischannel(*target) ?
"message own_public" : "message own_private", 4,
client->server, msg, target, target);
} else if (strncmp(msg+1, "ACTION ", 7) == 0) {
/* action */
@ -528,6 +529,16 @@ static void sig_message_own_public(IRC_SERVER_REC *server, const char *msg,
proxy_outserver_all(server, "PRIVMSG %s :%s", target, msg);
}
static void sig_message_own_private(IRC_SERVER_REC *server, const char *msg,
const char *target, const char *origtarget)
{
if (!IS_IRC_SERVER(server))
return;
if (!ignore_next)
proxy_outserver_all(server, "PRIVMSG %s :%s", target, msg);
}
static void sig_message_own_action(IRC_SERVER_REC *server, const char *msg,
const char *target)
{
@ -659,6 +670,7 @@ void proxy_listen_init(void)
signal_add("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
signal_add("event nick", (SIGNAL_FUNC) event_nick);
signal_add("message own_public", (SIGNAL_FUNC) sig_message_own_public);
signal_add("message own_private", (SIGNAL_FUNC) sig_message_own_private);
signal_add("message irc own_action", (SIGNAL_FUNC) sig_message_own_action);
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
}
@ -675,6 +687,7 @@ void proxy_listen_deinit(void)
signal_remove("server disconnected", (SIGNAL_FUNC) sig_server_disconnected);
signal_remove("event nick", (SIGNAL_FUNC) event_nick);
signal_remove("message own_public", (SIGNAL_FUNC) sig_message_own_public);
signal_remove("message own_private", (SIGNAL_FUNC) sig_message_own_private);
signal_remove("message irc own_action", (SIGNAL_FUNC) sig_message_own_action);
signal_remove("setup changed", (SIGNAL_FUNC) read_settings);
}