Mercurial > pidgin.yaz
comparison src/protocols/irc/msgs.c @ 8529:2f505651ac03
[gaim-migrate @ 9268]
This strips mIRC color and formatting codes from topics and provides
a generic function for stripping mirc color codes and returning plain
text (irc_mirc2txt()). This should fix Bug #923672.
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Tue, 30 Mar 2004 17:44:40 +0000 |
parents | 534b479692d0 |
children | 07404dc25af8 |
comparison
equal
deleted
inserted
replaced
8528:a48da599fd75 | 8529:2f505651ac03 |
---|---|
258 char *chan, *topic, *msg, *nick, *tmp; | 258 char *chan, *topic, *msg, *nick, *tmp; |
259 GaimConversation *convo; | 259 GaimConversation *convo; |
260 | 260 |
261 if (!strcmp(name, "topic")) { | 261 if (!strcmp(name, "topic")) { |
262 chan = args[0]; | 262 chan = args[0]; |
263 topic = args[1]; | 263 topic = irc_mirc2txt (args[1]); |
264 } else { | 264 } else { |
265 chan = args[1]; | 265 chan = args[1]; |
266 topic = args[2]; | 266 topic = irc_mirc2txt (args[2]); |
267 } | 267 } |
268 | 268 |
269 convo = gaim_find_conversation_with_account(chan, irc->account); | 269 convo = gaim_find_conversation_with_account(chan, irc->account); |
270 if (!convo) { | 270 if (!convo) { |
271 gaim_debug(GAIM_DEBUG_ERROR, "irc", "Got a topic for %s, which doesn't exist\n", chan); | 271 gaim_debug(GAIM_DEBUG_ERROR, "irc", "Got a topic for %s, which doesn't exist\n", chan); |
283 msg = g_strdup_printf(_("The topic for %s is: %s"), chan, tmp); | 283 msg = g_strdup_printf(_("The topic for %s is: %s"), chan, tmp); |
284 gaim_conv_chat_write(GAIM_CONV_CHAT(convo), "", msg, GAIM_MESSAGE_SYSTEM, time(NULL)); | 284 gaim_conv_chat_write(GAIM_CONV_CHAT(convo), "", msg, GAIM_MESSAGE_SYSTEM, time(NULL)); |
285 g_free(msg); | 285 g_free(msg); |
286 } | 286 } |
287 g_free(tmp); | 287 g_free(tmp); |
288 g_free(topic); | |
288 } | 289 } |
289 | 290 |
290 void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args) | 291 void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args) |
291 { | 292 { |
292 GaimConnection *gc = gaim_account_get_connection(irc->account); | 293 GaimConnection *gc = gaim_account_get_connection(irc->account); |