Mercurial > pidgin
comparison src/server.c @ 10774:d83f745c997b
[gaim-migrate @ 12383]
Some escaping stuff, all over the place.
Various escaping fixes in the IRC prpl.
The core and plugins only need to escape text if it's going to be shown in
a gtkimhtml or equivalent - such as writing to a conversation window, or
gaim_notify_{formatted,userinfo}
The primary and secondary text for all notify and request API functions
do NOT need to be escaped by the core or plugins, because whether html-like
markup is required for these is UI dependent. Now we always escape these
in the Gtk UI request & notify ops.
Should I backport any of the above to oldstatus?
I also removed gaim_chat_get_display_name() - it was almost a duplicate of
gaim_chat_get_name(), and it leaked.
committer: Tailor Script <tailor@pidgin.im>
| author | Stu Tomlinson <stu@nosnilmot.com> |
|---|---|
| date | Sat, 02 Apr 2005 17:18:43 +0000 |
| parents | bf5e48215158 |
| children | 53e7884c549a |
comparison
equal
deleted
inserted
replaced
| 10773:888d4c328be5 | 10774:d83f745c997b |
|---|---|
| 1048 const char *who, const char *message, GHashTable *data) | 1048 const char *who, const char *message, GHashTable *data) |
| 1049 { | 1049 { |
| 1050 GaimAccount *account; | 1050 GaimAccount *account; |
| 1051 char buf2[BUF_LONG]; | 1051 char buf2[BUF_LONG]; |
| 1052 struct chat_invite_data *cid = g_new0(struct chat_invite_data, 1); | 1052 struct chat_invite_data *cid = g_new0(struct chat_invite_data, 1); |
| 1053 char *name_escaped = g_markup_escape_text(name, -1); | |
| 1054 char *who_escaped = g_markup_escape_text(who, -1); | |
| 1055 | 1053 |
| 1056 account = gaim_connection_get_account(gc); | 1054 account = gaim_connection_get_account(gc); |
| 1057 | 1055 |
| 1058 gaim_signal_emit(gaim_conversations_get_handle(), | 1056 gaim_signal_emit(gaim_conversations_get_handle(), |
| 1059 "chat-invited", account, who, name, message, data); | 1057 "chat-invited", account, who, name, message, data); |
| 1060 | 1058 |
| 1061 if (message != NULL) | 1059 if (message != NULL) |
| 1062 { | 1060 { |
| 1063 char *message_escaped = g_markup_escape_text(message, -1); | |
| 1064 g_snprintf(buf2, sizeof(buf2), | 1061 g_snprintf(buf2, sizeof(buf2), |
| 1065 _("%s has invited %s to the chat room %s:\n<b>%s</b>"), | 1062 _("%s has invited %s to the chat room %s:\n%s"), |
| 1066 who_escaped, gaim_account_get_username(account), name_escaped, message_escaped); | 1063 who, gaim_account_get_username(account), name, message); |
| 1067 g_free(message_escaped); | |
| 1068 } | 1064 } |
| 1069 else | 1065 else |
| 1070 g_snprintf(buf2, sizeof(buf2), | 1066 g_snprintf(buf2, sizeof(buf2), |
| 1071 _("%s has invited %s to the chat room %s\n"), | 1067 _("%s has invited %s to the chat room %s\n"), |
| 1072 who_escaped, gaim_account_get_username(account), name_escaped); | 1068 who, gaim_account_get_username(account), name); |
| 1073 | |
| 1074 g_free(name_escaped); | |
| 1075 g_free(who_escaped); | |
| 1076 | 1069 |
| 1077 cid->gc = gc; | 1070 cid->gc = gc; |
| 1078 cid->components = data; | 1071 cid->components = data; |
| 1079 | 1072 |
| 1080 gaim_request_accept_cancel(gc, NULL, _("Accept chat invitation?"), buf2, | 1073 gaim_request_accept_cancel(gc, NULL, _("Accept chat invitation?"), buf2, |
