--- a/src/protocols/irc/msgs.c Sat Apr 02 21:01:51 2005 -0500
+++ b/src/protocols/irc/msgs.c Sat Apr 02 21:04:36 2005 -0500
@@ -76,6 +76,7 @@
void irc_msg_away(struct irc_conn *irc, const char *name, const char *from, char **args)
@@ -87,8 +88,11 @@
gc = gaim_account_get_connection(irc->account);
- serv_got_im(gc, args[1], args[2], GAIM_CONV_IM_AUTO_RESP, time(NULL));
+ msg = g_markup_escape_text(args[2], -1); + serv_got_im(gc, args[1], msg, GAIM_CONV_IM_AUTO_RESP, time(NULL)); void irc_msg_badmode(struct irc_conn *irc, const char *name, const char *from, char **args)
@@ -138,7 +142,7 @@
void irc_msg_chanmode(struct irc_conn *irc, const char *name, const char *from, char **args)
if (!args || !args[1] || !args[2])
@@ -147,8 +151,10 @@
if (!convo) /* XXX punt on channels we are not in for now */
- buf = g_strdup_printf("mode for %s: %s %s", args[1], args[2], args[3] ? args[3] : "");
+ escaped = (args[3] != NULL) ? g_markup_escape_text(args[3], -1) : NULL; + buf = g_strdup_printf("mode for %s: %s %s", args[1], args[2], escaped ? escaped : ""); gaim_conv_chat_write(GAIM_CONV_CHAT(convo), "", buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
@@ -328,13 +334,15 @@
void irc_msg_unknown(struct irc_conn *irc, const char *name, const char *from, char **args)
GaimConnection *gc = gaim_account_get_connection(irc->account);
if (!args || !args[1] || !gc)
- buf = g_strdup_printf(_("Unknown message '%s'"), args[1]);
+ escaped = g_markup_escape_text(args[1], -1); + buf = g_strdup_printf(_("Unknown message '%s'"), escaped); gaim_notify_error(gc, _("Unknown message"), buf, _("Gaim has sent a message the IRC server did not understand."));
@@ -416,6 +424,7 @@
void irc_msg_motd(struct irc_conn *irc, const char *name, const char *from, char **args)
if (!strcmp(name, "375")) {
gc = gaim_account_get_connection(irc->account);
@@ -425,7 +434,9 @@
irc->motd = g_string_new("");
- g_string_append_printf(irc->motd, "%s<br>", args[1]);
+ escaped = g_markup_escape_text(args[1], -1); + g_string_append_printf(irc->motd, "%s<br>", escaped); void irc_msg_endmotd(struct irc_conn *irc, const char *name, const char *from, char **args)
@@ -447,24 +458,30 @@
void irc_msg_time(struct irc_conn *irc, const char *name, const char *from, char **args)
gc = gaim_account_get_connection(irc->account);
if (gc == NULL || args == NULL || args[2] == NULL)
+ time = g_markup_escape_text(args[2], -1); gaim_notify_message(gc, GAIM_NOTIFY_MSG_INFO, _("Time Response"),
_("The IRC server's local time is:"),
void irc_msg_nochan(struct irc_conn *irc, const char *name, const char *from, char **args)
GaimConnection *gc = gaim_account_get_connection(irc->account);
if (gc == NULL || args == NULL || args[1] == NULL)
- gaim_notify_error(gc, NULL, _("No such channel"), args[1]);
+ escaped = g_markup_escape_text(args[1], -1); + gaim_notify_error(gc, NULL, _("No such channel"), escaped); void irc_msg_nonick(struct irc_conn *irc, const char *name, const char *from, char **args)
@@ -652,7 +669,7 @@
GaimConnection *gc = gaim_account_get_connection(irc->account);
GaimConversation *convo = gaim_find_conversation_with_account(args[0], irc->account);
- char *nick = irc_mask_nick(from), *buf;
+ char *nick = irc_mask_nick(from), *buf, *reason; @@ -665,17 +682,19 @@
+ reason = g_markup_escape_text(args[2], -1); if (!gaim_utf8_strcasecmp(gaim_connection_get_display_name(gc), args[1])) {
- buf = g_strdup_printf(_("You have been kicked by %s: (%s)"), nick, args[2]);
+ buf = g_strdup_printf(_("You have been kicked by %s: (%s)"), nick, reason); gaim_conv_chat_write(GAIM_CONV_CHAT(convo), args[0], buf, GAIM_MESSAGE_SYSTEM, time(NULL));
serv_got_chat_left(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(convo)));
- buf = g_strdup_printf(_("Kicked by %s (%s)"), nick, args[2]);
+ buf = g_strdup_printf(_("Kicked by %s (%s)"), nick, reason); gaim_conv_chat_remove_user(GAIM_CONV_CHAT(convo), args[1], buf);
@@ -686,14 +705,17 @@
char *nick = irc_mask_nick(from), *buf;
if (*args[0] == '#' || *args[0] == '&') { /* Channel */
convo = gaim_find_conversation_with_account(args[0], irc->account);
gaim_debug(GAIM_DEBUG_ERROR, "irc", "MODE received for %s, which we are not in\n", args[0]);
- buf = g_strdup_printf(_("mode (%s %s) by %s"), args[1], args[2] ? args[2] : "", nick);
+ escaped = (args[2] != NULL) ? g_markup_escape_text(args[2], -1) : NULL; + buf = g_strdup_printf(_("mode (%s %s) by %s"), args[1], escaped ? escaped : "", nick); gaim_conv_chat_write(GAIM_CONV_CHAT(convo), args[0], buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
GaimConvChatBuddyFlags newflag, flags;
@@ -827,8 +849,8 @@
if (!args || !args[2] || !gc)
- msg = g_strdup_printf(_("Could not change nick"));
- gaim_notify_error(gc, _("Cannot change nick"), msg, args[2]);
+ msg = g_markup_escape_text(args[2], -1); + gaim_notify_error(gc, _("Cannot change nick"), _("Could not change nick"), msg); @@ -964,14 +986,16 @@
void irc_msg_regonly(struct irc_conn *irc, const char *name, const char *from, char **args)
GaimConnection *gc = gaim_account_get_connection(irc->account);
if (!args || !args[1] || !args[2] || !gc)
msg = g_strdup_printf(_("Cannot join %s:"), args[1]);
- gaim_notify_error(gc, _("Cannot join channel"), msg, args[2]);
+ reason = g_markup_escape_text(args[2], -1); + gaim_notify_error(gc, _("Cannot join channel"), msg, reason); void irc_msg_quit(struct irc_conn *irc, const char *name, const char *from, char **args)