changeset 7076:9f1a6c97108d

[gaim-migrate @ 7641] this doesn't work yet...but it will committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Tue, 30 Sep 2003 18:08:15 +0000
parents 4e5654931401
children 6d10bf28be0e
files src/protocols/jabber/buddy.c
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/buddy.c	Tue Sep 30 17:14:14 2003 +0000
+++ b/src/protocols/jabber/buddy.c	Tue Sep 30 18:08:15 2003 +0000
@@ -20,6 +20,7 @@
  */
 #include "internal.h"
 #include "debug.h"
+#include "imgstore.h"
 #include "multi.h"
 #include "notify.h"
 #include "request.h"
@@ -714,6 +715,25 @@
 			} else if(text && !strcmp(child->name, "DESC")) {
 				g_string_append_printf(info_text, "<b>%s:</b> %s<br/>\n",
 						_("Description"), text);
+			} else if(!strcmp(child->name, "PHOTO") ||
+					!strcmp(child->name, "LOGO")) {
+				if((child2 = xmlnode_get_child(child, "BINVAL"))) {
+					char *data, *text2;
+					int size, imgid;
+					if((text2 = xmlnode_get_data(child2))) {
+						frombase64(text2, &data, &size);
+
+						imgid = gaim_imgstore_add(data, size, "logo.png");
+						g_string_append_printf(info_text,
+								"<b>%s:</b> <img id='%d' /><br/>",
+								strcmp(child->name, "PHOTO")  == 0 ?
+								_("Photo") : _("Logo"),
+								imgid);
+
+						g_free(data);
+						g_free(text2);
+					}
+				}
 			}
 			g_free(text);
 		}