cpw.ivan: b4b01e01: X-Status messages are basically mood com...
ivan.komarov at soc.pidgin.im
ivan.komarov at soc.pidgin.im
Sun Sep 26 11:51:23 EDT 2010
----------------------------------------------------------------------
Revision: b4b01e015e5c9e5ce422640df7149d766e7e16fb
Parent: 28df58e33e7d8d23e766f0e95629ecfb374776b2
Author: ivan.komarov at soc.pidgin.im
Date: 09/26/10 10:23:04
Branch: im.pidgin.cpw.ivan
URL: http://d.pidgin.im/viewmtn/revision/info/b4b01e015e5c9e5ce422640df7149d766e7e16fb
Changelog:
X-Status messages are basically mood comments, and are now treated
as such (and not as status messages).
Also, a couple of minor tweaks to oscar.c.
Changes against parent 28df58e33e7d8d23e766f0e95629ecfb374776b2
patched libpurple/protocols/oscar/family_icbm.c
patched libpurple/protocols/oscar/oscar.c
patched libpurple/protocols/oscar/userinfo.c
-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c 7f3f9725ad923ea66d341217a0ef4a7de1b15432
+++ libpurple/protocols/oscar/oscar.c 67d2ea8a5cc0bdc34f063dfc1914e6994b81c832
@@ -1400,13 +1400,13 @@ static int purple_parse_oncoming(OscarDa
if (strcmp(status_id, OSCAR_STATUS_ID_AVAILABLE) == 0) {
if (info->itmsurl != NULL) {
itmsurl = (info->itmsurl_len > 0) ? oscar_encoding_to_utf8(info->itmsurl_encoding, info->itmsurl, info->itmsurl_len) : NULL;
- } else if (previous_status != NULL) {
+ } else if (previous_status != NULL && purple_status_is_available(previous_status)) {
itmsurl = g_strdup(purple_status_get_attr_string(previous_status, "itmsurl"));
}
- purple_debug_info("oscar", "Activating status '%s' for buddy %s, message = '%s'\n", status_id, info->bn, message);
+ purple_debug_info("oscar", "Activating status '%s' for buddy %s, message = '%s', itmsurl = '%s'\n", status_id, info->bn, message, itmsurl);
purple_prpl_got_user_status(account, info->bn, status_id, "message", message, "itmsurl", itmsurl, NULL);
} else {
- purple_debug_info("oscar", "Activating status '%s' for buddy %s, message = '%s', itmsurl = '%s'\n", status_id, info->bn, message, itmsurl);
+ purple_debug_info("oscar", "Activating status '%s' for buddy %s, message = '%s'\n", status_id, info->bn, message);
purple_prpl_got_user_status(account, info->bn, status_id, "message", message, NULL);
}
============================================================
--- libpurple/protocols/oscar/family_icbm.c fc14f7b0d74cabc7a6a499dd2fd5ac90dc481826
+++ libpurple/protocols/oscar/family_icbm.c 8c85ff771e981aa2863ec01d659c7b137617c672
@@ -1719,10 +1719,13 @@ static int clientautoresp(OscarData *od,
account = purple_connection_get_account(od->gc);
buddy = purple_find_buddy(account, bn);
presence = purple_buddy_get_presence(buddy);
- status = purple_presence_get_active_status(presence);
- /* purple_prpl_got_user_status(account, bn,
- purple_status_get_id(status),
- "message", xstatus->str, NULL); */
+ status = purple_presence_get_status(presence, "mood");
+ if (status) {
+ purple_prpl_got_user_status(account, bn,
+ "mood",
+ PURPLE_MOOD_NAME, purple_status_get_attr_string(status, PURPLE_MOOD_NAME),
+ PURPLE_MOOD_COMMENT, xstatus->str, NULL);
+ }
}
g_string_free(xstatus, TRUE);
} else {
============================================================
--- libpurple/protocols/oscar/userinfo.c 1fb9c439c7f6140aade72c0df698e741df26a59f
+++ libpurple/protocols/oscar/userinfo.c ea93e169098591e773909e0b8f066b13523628ac
@@ -282,12 +282,23 @@ oscar_user_info_append_status(PurpleConn
if (presence) {
const char *mood;
- const char *description;
+ const char *comment;
+ char *description;
status = purple_presence_get_status(presence, "mood");
- mood = purple_status_get_attr_string(status, PURPLE_MOOD_NAME);
- description = icq_get_custom_icon_description(mood);
- if (description && *description)
- purple_notify_user_info_add_pair(user_info, _("Mood"), _(description));
+ mood = icq_get_custom_icon_description(purple_status_get_attr_string(status, PURPLE_MOOD_NAME));
+ if (mood) {
+ comment = purple_status_get_attr_string(status, PURPLE_MOOD_COMMENT);
+ if (comment) {
+ char *escaped_comment = purple_markup_escape_text(comment, -1);
+ description = g_strdup_printf("%s (%s)", _(mood), escaped_comment);
+ g_free(escaped_comment);
+ } else {
+ description = g_strdup(_(mood));
+ }
+ purple_notify_user_info_add_pair(user_info, _("Mood"), description);
+ g_free(comment);
+ g_free(description);
+ }
}
purple_notify_user_info_add_pair(user_info, _("Status"), message);
More information about the Commits
mailing list