Mercurial > pidgin.yaz
comparison libpurple/protocols/oscar/family_icbm.c @ 30707:2f96590b7b40
merged from im.pidgin.pidgin
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Thu, 22 Jul 2010 15:37:35 +0900 |
parents | 81ffeb069847 6829b27ee4c8 |
children | c5ba7dd399fa |
comparison
equal
deleted
inserted
replaced
30677:810a6be1920f | 30707:2f96590b7b40 |
---|---|
247 buf = g_strdup_printf(_("Unable to send message to %s: %s"), | 247 buf = g_strdup_printf(_("Unable to send message to %s: %s"), |
248 bn ? bn : "(unknown)", reason_str); | 248 bn ? bn : "(unknown)", reason_str); |
249 purple_notify_error(od->gc, NULL, buf, reason_str); | 249 purple_notify_error(od->gc, NULL, buf, reason_str); |
250 } | 250 } |
251 g_free(buf); | 251 g_free(buf); |
252 | |
253 | |
254 | |
255 | 252 |
256 g_free(snac2->data); | 253 g_free(snac2->data); |
257 g_free(snac2); | 254 g_free(snac2); |
258 | 255 |
259 return 1; | 256 return 1; |
2725 guint8 bnlen; | 2722 guint8 bnlen; |
2726 char *xml = NULL; | 2723 char *xml = NULL; |
2727 guint16 hdrlen; | 2724 guint16 hdrlen; |
2728 int curpos; | 2725 int curpos; |
2729 guint16 num1, num2; | 2726 guint16 num1, num2; |
2730 char *desc, *title, *temp; | |
2731 PurpleAccount *account; | 2727 PurpleAccount *account; |
2732 PurpleBuddy *buddy; | 2728 PurpleBuddy *buddy; |
2733 PurplePresence *presence; | 2729 PurplePresence *presence; |
2734 PurpleStatus *status; | 2730 PurpleStatus *status; |
2735 | 2731 |
2752 byte_stream_advance(bs, 86); | 2748 byte_stream_advance(bs, 86); |
2753 curpos = byte_stream_curpos(bs); | 2749 curpos = byte_stream_curpos(bs); |
2754 xml = byte_stream_getstr(bs, bs->len - curpos); | 2750 xml = byte_stream_getstr(bs, bs->len - curpos); |
2755 purple_debug_misc("oscar", "X-Status: Received XML reply\n"); | 2751 purple_debug_misc("oscar", "X-Status: Received XML reply\n"); |
2756 if (xml) { | 2752 if (xml) { |
2757 /* purple_debug_misc("oscar", "X-Status: XML reply: %s\n", xml); */ | 2753 GString *xstatus; |
2758 desc = strstr(xml, "<desc>"); | 2754 char *tmp1, *tmp2; |
2759 if (desc != NULL) { | 2755 |
2760 temp = strstr(xml, "</desc>"); | 2756 /* purple_debug_misc("oscar", "X-Status: XML reply: %s\n", xml); */ |
2761 temp[0] = 0; | 2757 |
2762 desc = desc + 12; | 2758 xstatus = g_string_new(NULL); |
2759 | |
2760 tmp1 = strstr(xml, "<title>"); | |
2761 if (tmp1 != NULL) { | |
2762 tmp1 += 13; | |
2763 tmp2 = strstr(tmp1, "</title>"); | |
2764 if (tmp2 != NULL) | |
2765 g_string_append_len(xstatus, tmp1, tmp2 - tmp1); | |
2763 } | 2766 } |
2764 title = strstr(xml, "<title>"); | 2767 tmp1 = strstr(xml, "<desc>"); |
2765 if (title != NULL) { | 2768 if (tmp1 != NULL) { |
2766 temp = strstr(xml, "</title>"); | 2769 tmp1 += 12; |
2767 temp[0] = 0; | 2770 tmp2 = strstr(tmp1, "</desc>"); |
2768 title = title + 13; | 2771 if (tmp2 != NULL) { |
2769 } else { | 2772 if (xstatus->len > 0) |
2770 title = ""; | 2773 g_string_append(xstatus, " - "); |
2774 g_string_append_len(xstatus, tmp1, tmp2 - tmp1); | |
2775 } | |
2771 } | 2776 } |
2772 strcpy(xml,title); | 2777 if (xstatus->len > 0) { |
2773 if (desc) { | 2778 purple_debug_misc("oscar", "X-Status reply: %s\n", xstatus->str); |
2774 strcat(xml, " - "); | 2779 account = purple_connection_get_account(od->gc); |
2775 strcat(xml, desc); | 2780 buddy = purple_find_buddy(account, bn); |
2781 presence = purple_buddy_get_presence(buddy); | |
2782 status = purple_presence_get_active_status(presence); | |
2783 purple_prpl_got_user_status(account, bn, | |
2784 purple_status_get_id(status), | |
2785 "message", xstatus->str, NULL); | |
2776 } | 2786 } |
2777 purple_debug_misc("oscar", "X-Status reply: %s\n", xml); | 2787 g_string_free(xstatus, TRUE); |
2778 account = purple_connection_get_account(od->gc); | |
2779 buddy = purple_find_buddy(account, bn); | |
2780 presence = purple_buddy_get_presence(buddy); | |
2781 status = purple_presence_get_active_status(presence); | |
2782 purple_prpl_got_user_status(account, bn, | |
2783 purple_status_get_id(status), "message", xml, NULL); | |
2784 } else { | 2788 } else { |
2785 purple_debug_misc("oscar", "X-Status: Can't get XML reply string\n"); | 2789 purple_debug_misc("oscar", "X-Status: Can't get XML reply string\n"); |
2786 } | 2790 } |
2787 } else { | 2791 } else { |
2788 purple_debug_misc("oscar", "X-Status: 0x0004, 0x000b not an xstatus reply\n"); | 2792 purple_debug_misc("oscar", "X-Status: 0x0004, 0x000b not an xstatus reply\n"); |