libpurple/connection.c

branch
soc.2013.gobjectification.plugins
changeset 36710
16a60fe59d22
parent 36709
6e915db4db35
child 36719
0d7682bdf828
--- a/libpurple/connection.c	Fri Sep 13 19:02:07 2013 +0530
+++ b/libpurple/connection.c	Fri Sep 13 19:07:59 2013 +0530
@@ -63,6 +63,9 @@
 
 	GSList *active_chats;         /**< A list of active chats
 	                                  (#PurpleChatConversation structs). */
+	void *proto_data;             /**< Protocol-specific data.            
+	                                  TODO Remove this, and use
+	                                       protocol-specific subclasses  */
 
 	char *display_name;           /**< How you appear to other people.   */
 	guint keepalive;              /**< Keep-alive.                       */
@@ -272,6 +275,16 @@
 	priv->display_name = g_strdup(name);
 }
 
+void
+purple_connection_set_protocol_data(PurpleConnection *gc, void *proto_data)
+{
+	PurpleConnectionPrivate *priv = PURPLE_CONNECTION_GET_PRIVATE(gc);
+
+	g_return_if_fail(priv != NULL);
+
+	priv->proto_data = proto_data;
+}
+
 PurpleConnectionState
 purple_connection_get_state(const PurpleConnection *gc)
 {
@@ -342,6 +355,16 @@
 	return priv->display_name;
 }
 
+void *
+purple_connection_get_protocol_data(const PurpleConnection *gc)
+{
+	PurpleConnectionPrivate *priv = PURPLE_CONNECTION_GET_PRIVATE(gc);
+
+	g_return_val_if_fail(priv != NULL, NULL);
+
+	return priv->proto_data;
+}
+
 void
 _purple_connection_add_active_chat(PurpleConnection *gc, PurpleChatConversation *chat)
 {

mercurial