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

@ -23,6 +23,7 @@
#include "misc.h"
#include "channels-setup.h"
#include "settings.h"
#include "recode.h"
#include "irc-servers.h"
#include "irc-channels.h"
@ -136,13 +137,16 @@ static void channel_change_topic(IRC_SERVER_REC *server, const char *channel,
time_t settime)
{
CHANNEL_REC *chanrec;
char *recoded = NULL;
chanrec = channel_find(SERVER(server), channel);
if (chanrec == NULL) return;
/* the topic may be send out encoded, so we need to
recode it back or /topic <tab> will not work properly */
recoded = recode_in(topic, channel);
if (topic != NULL) {
g_free_not_null(chanrec->topic);
chanrec->topic = *topic == '\0' ? NULL : g_strdup(topic);
chanrec->topic = recoded == NULL ? NULL : g_strdup(recoded);
}
g_free_not_null(chanrec->topic_by);