comparison src/protocols/irc/msgs.c @ 8504:534b479692d0

[gaim-migrate @ 9240] Patch to make IRC topics such as "Gaim > Oranges" display correctly in conversation windows. This is from A. C. Li, I think. Right? In any case, thanks to the author committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 25 Mar 2004 22:57:37 +0000
parents f24172f53650
children 2f505651ac03
comparison
equal deleted inserted replaced
8503:4c3ec649fd7d 8504:534b479692d0
253 } 253 }
254 } 254 }
255 255
256 void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args) 256 void irc_msg_topic(struct irc_conn *irc, const char *name, const char *from, char **args)
257 { 257 {
258 char *chan, *topic, *msg, *nick; 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 = args[1];
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);
272 } 272 }
273 gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), NULL, topic); 273 gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), NULL, topic);
274 /* If this is an interactive update, print it out */ 274 /* If this is an interactive update, print it out */
275 tmp = gaim_escape_html(topic);
275 if (!strcmp(name, "topic")) { 276 if (!strcmp(name, "topic")) {
276 nick = irc_mask_nick(from); 277 nick = irc_mask_nick(from);
277 msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick, topic); 278 msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick, tmp);
278 g_free(nick); 279 g_free(nick);
279 gaim_conv_chat_write(GAIM_CONV_CHAT(convo), from, msg, GAIM_MESSAGE_SYSTEM, time(NULL)); 280 gaim_conv_chat_write(GAIM_CONV_CHAT(convo), from, msg, GAIM_MESSAGE_SYSTEM, time(NULL));
280 g_free(msg); 281 g_free(msg);
281 } else { 282 } else {
282 msg = g_strdup_printf(_("The topic for %s is: %s"), chan, topic); 283 msg = g_strdup_printf(_("The topic for %s is: %s"), chan, tmp);
283 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));
284 g_free(msg); 285 g_free(msg);
285 } 286 }
287 g_free(tmp);
286 } 288 }
287 289
288 void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args) 290 void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args)
289 { 291 {
290 GaimConnection *gc = gaim_account_get_connection(irc->account); 292 GaimConnection *gc = gaim_account_get_connection(irc->account);