diff libpurple/protocols/myspace/myspace.h @ 19244:b29788c6d269

Make msimprpl work without a libpurple attention API. Change PurpleAttentionType to MsimAttentionType and define it in myspace.h, so that msimprpl can use it while libpurple doesn't have it.
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Tue, 14 Aug 2007 03:03:52 +0000
parents a242e014ab8c
children d7eea5c20cf9
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.h	Tue Aug 14 02:54:31 2007 +0000
+++ b/libpurple/protocols/myspace/myspace.h	Tue Aug 14 03:03:52 2007 +0000
@@ -68,7 +68,8 @@
 /*#define MSIM_SELF_TEST            */
 
 /* Use the attention API for zaps? */
-#define MSIM_USE_ATTENTION_API
+/* Can't have until >=2.2.0, since is a new API. */
+/*#define MSIM_USE_ATTENTION_API 	*/
 
 /* Constants */
 
@@ -202,6 +203,9 @@
 	guint inbox_status;                 /**< Bit field of inbox notifications */
 } MsimSession;
 
+/* Check if an MsimSession is valid */
+#define MSIM_SESSION_VALID(s) (session != NULL && session->magic == MSIM_SESSION_STRUCT_MAGIC)
+
 /* Hold ephemeral information about buddies, for proto_data of PurpleBuddy. */
 /* GHashTable? */
 typedef struct _MsimUser
@@ -221,8 +225,19 @@
 	gchar *image_url;
 } MsimUser;
 
-/* Check if an MsimSession is valid */
-#define MSIM_SESSION_VALID(s) (session != NULL && session->magic == MSIM_SESSION_STRUCT_MAGIC)
+
+/* Different kinds of attention alerts. Not yet in libpurple, so define 
+ * our own structure here. */
+typedef struct _MsimAttentionType MsimAttentionType;
+
+/** A type of "attention" message (zap, nudge, buzz, etc. depending on the
+ * protocol) that can be sent and received. */
+struct _MsimAttentionType {
+	PurpleStoredImage *icon;
+	const gchar *description;		/**< Shown before sending. */
+	const gchar *incoming_description;	/**< Shown when sent. */
+	const gchar *outgoing_description;	/**< Shown when received. */
+};
 
 gchar *str_replace(const gchar *str, const gchar *old, const gchar *new);