diff libpurple/protocols/myspace/message.c @ 17333:b9c0a8bb94b9

Add msim_msg_get_binary() - retrieves binary data values from an MsimMessage.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Fri, 01 Jun 2007 05:28:46 +0000
parents 9accf6d6cd61
children af7083a8ada7
line wrap: on
line diff
--- a/libpurple/protocols/myspace/message.c	Fri Jun 01 05:10:01 2007 +0000
+++ b/libpurple/protocols/myspace/message.c	Fri Jun 01 05:28:46 2007 +0000
@@ -631,9 +631,26 @@
 			return GPOINTER_TO_UINT(elem->data);
 
 		case MSIM_TYPE_STRING:
+			/* TODO: find out if we need larger integers */
 			return (guint)atoi((gchar *)elem->data);
 
 		default:
 			return 0;
 	}
 }
+
+/** Return the data of an element of a given name, as a binary GString.
+ *
+ * @return GString * of binary data, or NULL.
+ */
+GString *msim_msg_get_binary(MsimMessage *msg, gchar *name)
+{
+	switch (elem->type)
+	{
+		case MSIM_TYPE_BINARY:
+			return (GString *)elem->data;
+
+		default:
+			return NULL;
+	}
+}