im.pidgin.pidgin: 276d5d2fcec397b769c6f4e7a6f037ae3398f125
evands at pidgin.im
evands at pidgin.im
Fri Oct 19 08:27:30 EDT 2007
-----------------------------------------------------------------
Revision: 276d5d2fcec397b769c6f4e7a6f037ae3398f125
Ancestor: f7291f1bd4e5b43f392db211f68193218e2aeba5
Author: evands at pidgin.im
Date: 2007-10-19T12:22:57
Branch: im.pidgin.pidgin
Modified files:
libpurple/protocols/msn/state.c
ChangeLog:
MSN personal status messages are plain text, not HTML. Previously, we were unescaping the message but not stripping it, which left any HTML tags intact.
-------------- next part --------------
============================================================
--- libpurple/protocols/msn/state.c 18d1238a4de446000f377de14b870dbe6b849166
+++ libpurple/protocols/msn/state.c 993bec301367b9ac460e399dc68c24bb4133d265
@@ -191,7 +191,7 @@ msn_get_psm(char *xml_str, gsize len)
return psm;
}
-/* set the MSN's PSM info,Currently Read from the status Line
+/* Set the MSN PSM based on the "message" attribute of the current status
* Thanks for Cris Code
*/
void
@@ -204,27 +204,27 @@ msn_set_psm(MsnSession *session)
MsnTransaction *trans;
char *payload;
const char *statusline;
- gchar *unescapedstatusline;
+ gchar *statusline_stripped;
g_return_if_fail(session != NULL);
g_return_if_fail(session->notification != NULL);
cmdproc = session->notification->cmdproc;
- /*prepare PSM info*/
- if(session->psm){
- g_free(session->psm);
- }
- /*Get the PSM string from Purple's Status Line*/
+
+ /* Get the PSM string from Purple's Status Line */
presence = purple_account_get_presence(account);
status = purple_presence_get_active_status(presence);
statusline = purple_status_get_attr_string(status, "message");
- unescapedstatusline = purple_unescape_html(statusline);
- session->psm = msn_build_psm(unescapedstatusline, NULL, NULL);
- g_free(unescapedstatusline);
- payload = session->psm;
+ /* MSN expects plain text, not HTML */
+ statusline_stripped = purple_markup_strip_html(statusline);
+ g_free(session->psm);
+ session->psm = msn_build_psm(statusline_stripped, NULL, NULL);
+ g_free(statusline_stripped);
+
+ payload = session->psm;
purple_debug_misc("MSNP14","Sending UUX command with payload: %s\n",payload);
- trans = msn_transaction_new(cmdproc, "UUX","%d",strlen(payload));
+ trans = msn_transaction_new(cmdproc, "UUX", "%d", strlen(payload));
msn_transaction_set_payload(trans, payload, strlen(payload));
msn_cmdproc_send_trans(cmdproc, trans);
}
More information about the Commits
mailing list