| 313 /* If this is an interactive update, print it out */ |
313 /* If this is an interactive update, print it out */ |
| 314 tmp = g_markup_escape_text(topic, -1); |
314 tmp = g_markup_escape_text(topic, -1); |
| 315 tmp2 = gaim_markup_linkify(tmp); |
315 tmp2 = gaim_markup_linkify(tmp); |
| 316 g_free(tmp); |
316 g_free(tmp); |
| 317 if (!strcmp(name, "topic")) { |
317 if (!strcmp(name, "topic")) { |
| 318 char *nick_esc; |
318 const char *current_topic = gaim_conv_chat_get_topic(GAIM_CONV_CHAT(convo)); |
| 319 nick = irc_mask_nick(from); |
319 if (!(current_topic != NULL && strcmp(tmp2, current_topic) == 0)) |
| 320 nick_esc = g_markup_escape_text(nick, -1); |
320 { |
| 321 gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), nick, topic); |
321 char *nick_esc; |
| 322 msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick_esc, tmp2); |
322 nick = irc_mask_nick(from); |
| 323 g_free(nick_esc); |
323 nick_esc = g_markup_escape_text(nick, -1); |
| 324 g_free(nick); |
324 gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), nick, topic); |
| 325 gaim_conv_chat_write(GAIM_CONV_CHAT(convo), from, msg, GAIM_MESSAGE_SYSTEM, time(NULL)); |
325 if (*tmp2) |
| 326 g_free(msg); |
326 msg = g_strdup_printf(_("%s has changed the topic to: %s"), nick_esc, tmp2); |
| |
327 else |
| |
328 msg = g_strdup_printf(_("%s has cleared the topic."), nick_esc); |
| |
329 g_free(nick_esc); |
| |
330 g_free(nick); |
| |
331 gaim_conv_chat_write(GAIM_CONV_CHAT(convo), from, msg, GAIM_MESSAGE_SYSTEM, time(NULL)); |
| |
332 g_free(msg); |
| |
333 } |
| 327 } else { |
334 } else { |
| 328 char *chan_esc = g_markup_escape_text(chan, -1); |
335 char *chan_esc = g_markup_escape_text(chan, -1); |
| 329 msg = g_strdup_printf(_("The topic for %s is: %s"), chan_esc, tmp2); |
336 msg = g_strdup_printf(_("The topic for %s is: %s"), chan_esc, tmp2); |
| 330 g_free(chan_esc); |
337 g_free(chan_esc); |
| 331 gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), NULL, topic); |
338 gaim_conv_chat_set_topic(GAIM_CONV_CHAT(convo), NULL, topic); |