src/protocols/irc/irc.c

changeset 5299
a32031c0f781
parent 5298
b14e55964c97
child 5402
72ff435414e1
equal deleted inserted replaced
5298:b14e55964c97 5299:a32031c0f781
696 696
697 static void 697 static void
698 handle_topic(struct gaim_connection *gc, char *text) 698 handle_topic(struct gaim_connection *gc, char *text)
699 { 699 {
700 struct gaim_conversation *c; 700 struct gaim_conversation *c;
701 char *po = strchr(text, ' '); 701 char *po = strchr(text, ' '), *buf;
702 702
703 if (!po) 703 if (!po)
704 return; 704 return;
705 705
706 *po = 0; 706 *po = 0;
707 po += 2; 707 po += 2;
708 708
709 if ((c = irc_find_chat(gc, text))) { 709 if ((c = irc_find_chat(gc, text))) {
710 char buf[IRC_BUF_LEN]; 710 po = irc_recv_convert(gc, po);
711 gaim_chat_set_topic(GAIM_CHAT(c), NULL, po); 711 gaim_chat_set_topic(GAIM_CHAT(c), NULL, po);
712 g_snprintf(buf, sizeof(buf), _("<B>%s has changed the topic to: %s</B>"), 712 buf = g_strdup_printf(_("<B>%s has changed the topic to: %s</B>"), text, po);
713 text, po);
714
715 gaim_conversation_write(c, NULL, buf, -1, WFLAG_SYSTEM, time(NULL)); 713 gaim_conversation_write(c, NULL, buf, -1, WFLAG_SYSTEM, time(NULL));
714 g_free(buf);
715 g_free(po);
716 } 716 }
717 } 717 }
718 718
719 static gboolean 719 static gboolean
720 mode_has_arg(struct gaim_connection *gc, char sign, char mode) 720 mode_has_arg(struct gaim_connection *gc, char sign, char mode)

mercurial