comparison src/protocols/irc/msgs.c @ 10730:e84b1ef01905

[gaim-migrate @ 12331] Patch 2/4 committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 26 Mar 2005 01:18:47 +0000
parents b41c48d890d8
children c4cb90065e1d
comparison
equal deleted inserted replaced
10729:969f35b31a49 10730:e84b1ef01905
54 return g_strdup(strchr(mask, '!') + 1); 54 return g_strdup(strchr(mask, '!') + 1);
55 } 55 }
56 56
57 static void irc_chat_remove_buddy(GaimConversation *convo, char *data[2]) 57 static void irc_chat_remove_buddy(GaimConversation *convo, char *data[2])
58 { 58 {
59 char *message = g_strdup_printf("quit: %s", data[1]); 59 char *escaped, *message;
60
61 escaped = g_markup_escape_text(data[1], -1);
62 message = g_strdup_printf("quit: %s", escaped);
60 63
61 if (gaim_conv_chat_find_user(GAIM_CONV_CHAT(convo), data[0])) 64 if (gaim_conv_chat_find_user(GAIM_CONV_CHAT(convo), data[0]))
62 gaim_conv_chat_remove_user(GAIM_CONV_CHAT(convo), data[0], message); 65 gaim_conv_chat_remove_user(GAIM_CONV_CHAT(convo), data[0], message);
63 66
67 g_free(escaped);
64 g_free(message); 68 g_free(message);
65 } 69 }
66 70
67 void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args) 71 void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args)
68 { 72 {
816 820
817 void irc_msg_part(struct irc_conn *irc, const char *name, const char *from, char **args) 821 void irc_msg_part(struct irc_conn *irc, const char *name, const char *from, char **args)
818 { 822 {
819 GaimConnection *gc = gaim_account_get_connection(irc->account); 823 GaimConnection *gc = gaim_account_get_connection(irc->account);
820 GaimConversation *convo; 824 GaimConversation *convo;
821 char *nick, *msg; 825 char *nick, *msg, *escaped;
822 826
823 if (!args || !args[0] || !gc) 827 if (!args || !args[0] || !gc)
824 return; 828 return;
825 829
826 convo = gaim_find_conversation_with_account(GAIM_CONV_CHAT, args[0], irc->account); 830 convo = gaim_find_conversation_with_account(GAIM_CONV_CHAT, args[0], irc->account);
827 if (!convo) { 831 if (!convo) {
828 gaim_debug(GAIM_DEBUG_INFO, "irc", "Got a PART on %s, which doesn't exist -- probably closed\n", args[0]); 832 gaim_debug(GAIM_DEBUG_INFO, "irc", "Got a PART on %s, which doesn't exist -- probably closed\n", args[0]);
829 return; 833 return;
830 } 834 }
831 835
836 escaped = (args[1] && *args[1]) ? g_markup_escape_text(args[1], -1) : NULL;
832 nick = irc_mask_nick(from); 837 nick = irc_mask_nick(from);
833 if (!gaim_utf8_strcasecmp(nick, gaim_connection_get_display_name(gc))) { 838 if (!gaim_utf8_strcasecmp(nick, gaim_connection_get_display_name(gc))) {
834 msg = g_strdup_printf(_("You have parted the channel%s%s"), 839 msg = g_strdup_printf(_("You have parted the channel%s%s"),
835 (args[1] && *args[1]) ? ": " : "", 840 (args[1] && *args[1]) ? ": " : "",
836 (args[1] && *args[1]) ? args[1] : ""); 841 (escaped && *escaped) ? escaped : "");
837 gaim_conv_chat_write(GAIM_CONV_CHAT(convo), args[0], msg, GAIM_MESSAGE_SYSTEM, time(NULL)); 842 gaim_conv_chat_write(GAIM_CONV_CHAT(convo), args[0], msg, GAIM_MESSAGE_SYSTEM, time(NULL));
838 g_free(msg); 843 g_free(msg);
839 serv_got_chat_left(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(convo))); 844 serv_got_chat_left(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(convo)));
840 } else { 845 } else {
841 gaim_conv_chat_remove_user(GAIM_CONV_CHAT(convo), nick, args[1]); 846 gaim_conv_chat_remove_user(GAIM_CONV_CHAT(convo), nick, escaped);
842 } 847 }
848 g_free(escaped);
843 g_free(nick); 849 g_free(nick);
844 } 850 }
845 851
846 void irc_msg_ping(struct irc_conn *irc, const char *name, const char *from, char **args) 852 void irc_msg_ping(struct irc_conn *irc, const char *name, const char *from, char **args)
847 { 853 {