gobjectification: 599cdc21: compile silc. I don't have enough silc f...

sadrul at pidgin.im sadrul at pidgin.im
Thu Mar 13 04:38:06 EDT 2008


-----------------------------------------------------------------
Revision: 599cdc21a89571e3d4bd0ba8a6cf4772d0163081
Ancestor: 2f208136794e66cef8e8101256844b6dd93de22a
Author: sadrul at pidgin.im
Date: 2008-03-13T08:00:25
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/599cdc21a89571e3d4bd0ba8a6cf4772d0163081

Modified files:
        libpurple/protocols/silc/buddy.c
        libpurple/protocols/silc/chat.c
        libpurple/protocols/silc/ft.c libpurple/protocols/silc/ops.c
        libpurple/protocols/silc/pk.c
        libpurple/protocols/silc/silc.c
        libpurple/protocols/silc/util.c
        libpurple/protocols/silc/wb.c

ChangeLog: 

compile silc. I don't have enough silc foo to compile silc10. someone should fix that ;)

-------------- next part --------------
============================================================
--- libpurple/protocols/silc/buddy.c	d752e276e3463444bd0882665bf2a43fe1ae004f
+++ libpurple/protocols/silc/buddy.c	eeb4c9b4387e378fc19f0610b7e9dadbd48f09f9
@@ -71,7 +71,7 @@ silcpurple_buddy_keyagr_cb(SilcClient cl
 			   void *context)
 {
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (!sg->conn)
 		return;
@@ -145,7 +145,7 @@ silcpurple_buddy_keyagr_do(PurpleConnect
 silcpurple_buddy_keyagr_do(PurpleConnection *gc, const char *name,
 			   gboolean force_local)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcDList clients;
 	SilcClientEntry client_entry;
 	SilcClientConnectionParams params;
@@ -165,7 +165,7 @@ silcpurple_buddy_keyagr_do(PurpleConnect
 		if (!r)
 			return;
 		r->nick = g_strdup(name);
-		purple_account_get_connection(r) = gc;
+		r->gc = gc;
 		silc_client_get_clients(sg->client, sg->conn, name, NULL,
 					silcpurple_buddy_keyagr_resolved, r);
 		return;
@@ -342,7 +342,7 @@ silcpurple_buddy_resetkey(PurpleBlistNod
 
 	b = (PurpleBuddy *) node;
 	gc = purple_account_get_connection(b->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	/* Find client entry */
 	clients = silc_client_get_clients_local(sg->client, sg->conn,
@@ -422,7 +422,7 @@ silcpurple_buddy_privkey(PurpleConnectio
 static void
 silcpurple_buddy_privkey(PurpleConnection *gc, const char *name)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcPurplePrivkey p;
 	SilcDList clients;
 	SilcClientEntry client_entry;
@@ -550,7 +550,7 @@ silcpurple_buddy_getkey(PurpleConnection
 static void
 silcpurple_buddy_getkey(PurpleConnection *gc, const char *name)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcClientEntry client_entry;
@@ -614,7 +614,7 @@ silcpurple_buddy_showkey(PurpleBlistNode
 
 	b = (PurpleBuddy *) node;
 	gc = purple_account_get_connection(b->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	pkfile = purple_blist_node_get_string(node, "public-key");
 	if (!silc_pkcs_load_public_key(pkfile, &public_key)) {
@@ -665,7 +665,7 @@ void silcpurple_get_info(PurpleConnectio
 
 void silcpurple_get_info(PurpleConnection *gc, const char *who)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcClientEntry client_entry;
@@ -695,7 +695,7 @@ void silcpurple_get_info(PurpleConnectio
 			return;
 		}
 
-		if (!b->proto_data) {
+		if (!purple_object_get_protocol_data(PURPLE_OBJECT(b))) {
 			g_snprintf(tmp, sizeof(tmp),
 				   _("User %s is not present in the network"), b->name);
 			purple_notify_error(gc, _("User Information"),
@@ -703,7 +703,7 @@ void silcpurple_get_info(PurpleConnectio
 			return;
 		}
 
-		client_entry = silc_client_get_client_by_id(client, conn, b->proto_data);
+		client_entry = silc_client_get_client_by_id(client, conn, purple_object_get_protocol_data(PURPLE_OBJECT(b)));
 		if (client_entry) {
 			/* Call WHOIS.  The user info is displayed in the WHOIS
 			   command reply. */
@@ -1175,7 +1175,7 @@ silcpurple_add_buddy_select(SilcPurpleBu
 		}
 		g_snprintf(tmp, sizeof(tmp), "%s - %s (%s@%s)%s",
 			   client_entry->realname, client_entry->nickname,
-			   client_purple_account_get_username(entry), *client_entry->hostname ?
+			   client_entry->username, *client_entry->hostname ?
 			   client_entry->hostname : "",
 			   fingerprint ? tmp2 : "");
 		purple_request_field_list_add(f, tmp, client_entry);
@@ -1271,7 +1271,7 @@ silcpurple_add_buddy_resolved(SilcClient
 	/* The client was found.  Now get its public key and verify
 	   that before adding the buddy. */
 	memset(&userpk, 0, sizeof(userpk));
-	b->proto_data = silc_memdup(&client_entry->id, sizeof(client_entry->id));
+	purple_object_set_protocol_data(PURPLE_OBJECT(b),silc_memdup(&client_entry->id, sizeof(client_entry->id)));
 	r->client_id = client_entry->id;
 
 	/* Get the public key from attributes, if not present then
@@ -1330,7 +1330,7 @@ silcpurple_add_buddy_i(PurpleConnection 
 static void
 silcpurple_add_buddy_i(PurpleConnection *gc, PurpleBuddy *b, gboolean init)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcPurpleBuddyRes r;
@@ -1428,13 +1428,13 @@ void silcpurple_remove_buddy(PurpleConne
 void silcpurple_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy,
 			   PurpleGroup *group)
 {
-	silc_free(buddy->proto_data);
+	silc_free(purple_object_get_protocol_data(PURPLE_OBJECT(buddy)));
 }
 
 void silcpurple_idle_set(PurpleConnection *gc, int idle)
 
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcAttributeObjService service;
@@ -1457,10 +1457,10 @@ char *silcpurple_status_text(PurpleBuddy
 
 char *silcpurple_status_text(PurpleBuddy *b)
 {
-	SilcPurple sg = purple_account_get_connection(b->account)->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(purple_account_get_connection(b->account)));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
-	SilcClientID *client_id = b->proto_data;
+	SilcClientID *client_id = purple_object_get_protocol_data(PURPLE_OBJECT(b));
 	SilcClientEntry client_entry;
 	SilcAttributePayload attr;
 	SilcAttributeMood mood = 0;
@@ -1521,10 +1521,10 @@ void silcpurple_tooltip_text(PurpleBuddy
 
 void silcpurple_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full)
 {
-	SilcPurple sg = purple_account_get_connection(b->account)->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(purple_account_get_connection(b->account)));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
-	SilcClientID *client_id = b->proto_data;
+	SilcClientID *client_id = purple_object_get_protocol_data(PURPLE_OBJECT(b));
 	SilcClientEntry client_entry;
 	char *moodstr, *statusstr, *contactstr, *langstr, *devicestr, *tzstr, *geostr;
 	char tmp[256];
@@ -1537,8 +1537,8 @@ void silcpurple_tooltip_text(PurpleBuddy
 	if (client_entry->nickname)
 		purple_notify_user_info_add_pair(user_info, _("Nickname"),
 					       client_entry->nickname);
-	if (client_purple_account_get_username(entry) && client_entry->hostname) {
-		g_snprintf(tmp, sizeof(tmp), "%s@%s", client_purple_account_get_username(entry), client_entry->hostname);
+	if (client_entry->username && client_entry->hostname) {
+		g_snprintf(tmp, sizeof(tmp), "%s@%s", client_entry->username, client_entry->hostname);
 		purple_notify_user_info_add_pair(user_info, _("Username"), tmp);
 	}
 	if (client_entry->mode) {
@@ -1599,7 +1599,7 @@ silcpurple_buddy_kill(PurpleBlistNode *n
 
 	b = (PurpleBuddy *) node;
 	gc = purple_account_get_connection(b->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	/* Call KILL */
 	silc_client_command_call(sg->client, sg->conn, NULL, "KILL",
@@ -1622,7 +1622,7 @@ GList *silcpurple_buddy_menu(PurpleBuddy
 GList *silcpurple_buddy_menu(PurpleBuddy *buddy)
 {
 	PurpleConnection *gc = purple_account_get_connection(buddy->account);
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClientConnection conn = sg->conn;
 	const char *pkfile = NULL;
 	SilcClientEntry client_entry = NULL;
@@ -1633,7 +1633,7 @@ GList *silcpurple_buddy_menu(PurpleBuddy
 	pkfile = purple_blist_node_get_string((PurpleBlistNode *) buddy, "public-key");
 	client_entry = silc_client_get_client_by_id(sg->client,
 						    sg->conn,
-						    buddy->proto_data);
+						    purple_object_get_protocol_data(PURPLE_OBJECT(buddy)));
 
 	if (client_entry &&
 	    silc_client_private_message_key_is_set(sg->client,
@@ -1688,7 +1688,7 @@ void silcpurple_buddy_set_icon(PurpleCon
 
 void silcpurple_buddy_set_icon(PurpleConnection *gc, PurpleStoredImage *img)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcMime mime;
============================================================
--- libpurple/protocols/silc/chat.c	29f23eb2374c1d779ab525853311fe84aa662234
+++ libpurple/protocols/silc/chat.c	8b461117d95ba83533ab6a0c37a2d9c9bfcb463b
@@ -90,7 +90,7 @@ silcpurple_chat_getinfo(PurpleConnection
 static void
 silcpurple_chat_getinfo(PurpleConnection *gc, GHashTable *components)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	const char *chname;
 	char *buf, tmp[256], *tmp2;
 	GString *s;
@@ -303,10 +303,10 @@ silcpurple_chat_chpk_cb(SilcPurpleChauth
 	f = purple_request_fields_get_field(fields, "list");
 	if (!purple_request_field_list_get_selected(f)) {
 		/* Add new public key */
-		purple_request_file(purple_account_get_connection(sg), _("Open Public Key..."), NULL, FALSE,
+		purple_request_file(sg->gc, _("Open Public Key..."), NULL, FALSE,
 				    G_CALLBACK(silcpurple_chat_chpk_add),
 				    G_CALLBACK(silcpurple_chat_chpk_cancel),
-				    purple_connection_get_account(purple_account_get_connection(sg)), NULL, NULL, sgc);
+				    purple_connection_get_account(sg->gc), NULL, NULL, sgc);
 		return;
 	}
 
@@ -443,11 +443,11 @@ void silcpurple_chat_chauth_show(SilcPur
 	if (!channel_pubkeys || !silc_dlist_count(channel_pubkeys)) {
 		f = purple_request_field_list_new("list", NULL);
 		purple_request_field_group_add_field(g, f);
-		purple_request_fields(purple_account_get_connection(sg), _("Channel Authentication"),
+		purple_request_fields(sg->gc, _("Channel Authentication"),
 				      _("Channel Authentication"), t, fields,
 				      _("Add / Remove"), G_CALLBACK(silcpurple_chat_chpk_cb),
 				      _("OK"), G_CALLBACK(silcpurple_chat_chauth_ok),
-				      purple_connection_get_account(purple_account_get_connection(sg)), NULL, NULL, sgc);
+				      purple_connection_get_account(sg->gc), NULL, NULL, sgc);
 		if (channel_pubkeys)
 		  silc_dlist_uninit(channel_pubkeys);
 		return;
@@ -471,8 +471,8 @@ void silcpurple_chat_chauth_show(SilcPur
 		ident = &silc_pubkey->identifier;
 
 		g_snprintf(tmp2, sizeof(tmp2), "%s\n  %s\n  %s",
-			   ident->realname ? ident->realname : purple_account_get_username(ident) ?
-			   purple_account_get_username(ident) : "", fingerprint, babbleprint);
+			   ident->realname ? ident->realname : ident->username ?
+			   ident->username : "", fingerprint, babbleprint);
 		purple_request_field_list_add(f, tmp2, public_key);
 
 		silc_free(fingerprint);
@@ -480,11 +480,11 @@ void silcpurple_chat_chauth_show(SilcPur
 	}
 
 	purple_request_field_list_set_multi_select(f, FALSE);
-	purple_request_fields(purple_account_get_connection(sg), _("Channel Authentication"),
+	purple_request_fields(sg->gc, _("Channel Authentication"),
 			      _("Channel Authentication"), t, fields,
 			      _("Add / Remove"), G_CALLBACK(silcpurple_chat_chpk_cb),
 			      _("OK"), G_CALLBACK(silcpurple_chat_chauth_ok),
-			      purple_connection_get_account(purple_account_get_connection(sg)), NULL, NULL, sgc);
+			      purple_connection_get_account(sg->gc), NULL, NULL, sgc);
 }
 
 static void
@@ -498,7 +498,7 @@ silcpurple_chat_chauth(PurpleBlistNode *
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
 				 g_hash_table_lookup(chat->components, "channel"),
@@ -557,7 +557,7 @@ silcpurple_chat_prv_add(SilcPurpleCharPr
 	purple_blist_node_set_string((PurpleBlistNode *)cn, "parentch", p->channel);
 
 	/* Join the group */
-	silcpurple_chat_join(purple_account_get_connection(sg), comp);
+	silcpurple_chat_join(sg->gc, comp);
 
 	silc_free(p);
 }
@@ -585,7 +585,7 @@ silcpurple_chat_prv(PurpleBlistNode *nod
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	p = silc_calloc(1, sizeof(*p));
 	if (!p)
@@ -635,7 +635,7 @@ silcpurple_chat_permanent_reset(PurpleBl
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
 				 g_hash_table_lookup(chat->components, "channel"),
@@ -654,7 +654,7 @@ silcpurple_chat_permanent(PurpleBlistNod
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (!sg->conn)
 		return;
@@ -727,7 +727,7 @@ silcpurple_chat_ulimit(PurpleBlistNode *
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (!sg->conn)
 		return;
@@ -762,7 +762,7 @@ silcpurple_chat_resettopic(PurpleBlistNo
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
 				 g_hash_table_lookup(chat->components, "channel"),
@@ -780,7 +780,7 @@ silcpurple_chat_settopic(PurpleBlistNode
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
 				 g_hash_table_lookup(chat->components, "channel"),
@@ -798,7 +798,7 @@ silcpurple_chat_resetprivate(PurpleBlist
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
 				 g_hash_table_lookup(chat->components, "channel"),
@@ -816,7 +816,7 @@ silcpurple_chat_setprivate(PurpleBlistNo
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
 				 g_hash_table_lookup(chat->components, "channel"),
@@ -834,7 +834,7 @@ silcpurple_chat_resetsecret(PurpleBlistN
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
 				 g_hash_table_lookup(chat->components, "channel"),
@@ -852,7 +852,7 @@ silcpurple_chat_setsecret(PurpleBlistNod
 
 	chat = (PurpleChat *) node;
 	gc = purple_account_get_connection(chat->account);
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	silc_client_command_call(sg->client, sg->conn, NULL, "CMODE",
 				 g_hash_table_lookup(chat->components, "channel"),
@@ -876,7 +876,7 @@ GList *silcpurple_chat_menu(PurpleChat *
 {
 	GHashTable *components = chat->components;
 	PurpleConnection *gc = purple_account_get_connection(chat->account);
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClientConnection conn = sg->conn;
 	const char *chname = NULL;
 	SilcChannelEntry channel = NULL;
@@ -1013,7 +1013,7 @@ void silcpurple_chat_join(PurpleConnecti
 
 void silcpurple_chat_join(PurpleConnection *gc, GHashTable *data)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	const char *channel, *passphrase, *parentch;
@@ -1096,7 +1096,7 @@ void silcpurple_chat_invite(PurpleConnec
 void silcpurple_chat_invite(PurpleConnection *gc, int id, const char *msg,
 			    const char *name)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcHashTableList htl;
@@ -1141,7 +1141,7 @@ void silcpurple_chat_leave(PurpleConnect
 
 void silcpurple_chat_leave(PurpleConnection *gc, int id)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcHashTableList htl;
@@ -1211,7 +1211,7 @@ int silcpurple_chat_send(PurpleConnectio
 int silcpurple_chat_send(PurpleConnection *gc, int id, const char *msg,
 			 PurpleMessageFlags msgflags)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcHashTableList htl;
@@ -1333,7 +1333,7 @@ void silcpurple_chat_set_topic(PurpleCon
 
 void silcpurple_chat_set_topic(PurpleConnection *gc, int id, const char *topic)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcHashTableList htl;
@@ -1377,7 +1377,7 @@ PurpleRoomlist *silcpurple_roomlist_get_
 
 PurpleRoomlist *silcpurple_roomlist_get_list(PurpleConnection *gc)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	GList *fields = NULL;
@@ -1417,7 +1417,7 @@ void silcpurple_roomlist_cancel(PurpleRo
 
 	if (!gc)
 		return;
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	purple_roomlist_set_in_progress(list, FALSE);
 	if (sg->roomlist == list) {
============================================================
--- libpurple/protocols/silc/ft.c	6e8ef4bc6b7e061720808b53fd66e9b19c86de4f
+++ libpurple/protocols/silc/ft.c	7317554e637dc77c2da3208ba29ab7c48877bac7
@@ -70,7 +70,7 @@ silcpurple_ftp_monitor(SilcClient client
 		     void *context)
 {
 	SilcPurpleXfer xfer = context;
-	PurpleConnection *gc = purple_account_get_connection(xfer->sg);
+	PurpleConnection *gc = xfer->sg->gc;
 	char tmp[256];
 
 	if (status == SILC_CLIENT_FILE_MONITOR_CLOSED) {
@@ -213,7 +213,7 @@ silcpurple_ftp_request_result(PurpleXfer
 {
 	SilcPurpleXfer xfer = x->data;
 	SilcClientFileError status;
-	PurpleConnection *gc = purple_account_get_connection(xfer->sg);
+	PurpleConnection *gc = xfer->sg->gc;
 	SilcClientConnectionParams params;
 	gboolean local = xfer->hostname ? FALSE : TRUE;
 	char *local_ip = NULL, *remote_ip = NULL;
@@ -309,7 +309,7 @@ void silcpurple_ftp_request(SilcClient c
 			    const char *hostname, SilcUInt16 port)
 {
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcPurpleXfer xfer;
 
 	xfer = silc_calloc(1, sizeof(*xfer));
@@ -434,7 +434,7 @@ PurpleXfer *silcpurple_ftp_new_xfer(Purp
 
 PurpleXfer *silcpurple_ftp_new_xfer(PurpleConnection *gc, const char *name)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcDList clients;
============================================================
--- libpurple/protocols/silc/ops.c	cf8123ad6eb20c5c9e22a60c8405b8a2012edadf
+++ libpurple/protocols/silc/ops.c	bed31023b986401915f08a62537caa4195050c6a
@@ -72,7 +72,7 @@ silcpurple_mime_message(SilcClient clien
 			gboolean recursive)
 {
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	const char *type;
 	const unsigned char *data;
 	SilcUInt32 data_len;
@@ -248,7 +248,7 @@ silc_channel_message(SilcClient client, 
 		     SilcUInt32 message_len)
 {
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	PurpleConversation *convo = NULL;
 	char *msg, *tmp;
 
@@ -338,7 +338,7 @@ silc_private_message(SilcClient client, 
 		     SilcUInt32 message_len)
 {
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	PurpleConversation *convo = NULL;
 	char *msg, *tmp;
 
@@ -415,7 +415,7 @@ silc_notify(SilcClient client, SilcClien
 {
 	va_list va;
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	PurpleConversation *convo;
 	SilcClientEntry client_entry, client_entry2;
 	SilcChannelEntry channel;
@@ -467,7 +467,7 @@ silc_notify(SilcClient client, SilcClien
 
 		/* Join user to channel */
 		g_snprintf(buf, sizeof(buf), "%s@%s",
-			   client_purple_account_get_username(entry), client_entry->hostname);
+			   client_entry->username, client_entry->hostname);
 		purple_conv_chat_add_user(PURPLE_CONV_CHAT(convo),
 					  g_strdup(client_entry->nickname), buf, PURPLE_CBFLAGS_NONE, TRUE);
 
@@ -874,7 +874,7 @@ silc_notify(SilcClient client, SilcClien
 				}
 			}
 
-			silc_free(b->proto_data);
+			silc_free(purple_object_get_protocol_data(PURPLE_OBJECT(b)));
 			b->proto_data = silc_memdup(&client_entry->id,
 						    sizeof(client_entry->id));
 			if (notify == SILC_NOTIFY_TYPE_NICK_CHANGE) {
@@ -937,7 +937,7 @@ silc_command(SilcClient client, SilcClie
 	     SilcUInt32 argc, unsigned char **argv)
 {
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	switch (command) {
 
@@ -1076,7 +1076,7 @@ silc_command_reply(SilcClient client, Si
 		   SilcStatus error, va_list ap)
 {
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	PurpleConversation *convo;
 
 	switch (command) {
@@ -1190,7 +1190,7 @@ silc_command_reply(SilcClient client, Si
 				purple_notify_user_info_add_pair(user_info, _("Real Name"), tmp2);
 				g_free(tmp2);
 			}
-			tmp2 = g_markup_escape_text(client_purple_account_get_username(entry), -1);
+			tmp2 = g_markup_escape_text(client_entry->username, -1);
 			if (*client_entry->hostname) {
 				gchar *tmp3;
 				tmp3 = g_strdup_printf("%s@%s", tmp2, client_entry->hostname);
@@ -1719,7 +1719,7 @@ silc_get_auth_method(SilcClient client, 
 		     SilcGetAuthMeth completion, void *context)
 {
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcPurpleAskPassphrase internal;
 	const char *password;
 
@@ -1770,7 +1770,7 @@ silc_verify_public_key(SilcClient client
 		       SilcVerifyPublicKey completion, void *context)
 {
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (!sg->conn && (conn_type == SILC_CONN_SERVER ||
 			  conn_type == SILC_CONN_ROUTER)) {
============================================================
--- libpurple/protocols/silc/pk.c	d51e1c49b31e88f5a0d34afb6f4cc4b0170c9eb2
+++ libpurple/protocols/silc/pk.c	dab7dbcbdcb3c030a4c96953e802a3c30cb1d2b0
@@ -78,7 +78,7 @@ static void silcpurple_verify_details(Pu
 static void silcpurple_verify_details(PublicKeyVerify verify, gint id)
 {
 	PurpleConnection *gc = verify->client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	silcpurple_show_public_key(sg, verify->entity_name, verify->public_key,
 				   G_CALLBACK(silcpurple_verify_details_cb),
============================================================
--- libpurple/protocols/silc/silc.c	355db4c285596589295f6cc872721f8baff2be89
+++ libpurple/protocols/silc/silc.c	aeec269ce6758fd210a94c8d44dc7a36a0ac612f
@@ -76,7 +76,7 @@ silcpurple_set_status(PurpleAccount *acc
 	const char *state;
 
 	if (gc != NULL)
-		sg = gc->proto_data;
+		sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (status == NULL)
 		return;
@@ -123,7 +123,7 @@ silcpurple_keepalive(PurpleConnection *g
 static void
 silcpurple_keepalive(PurpleConnection *gc)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	silc_packet_send(sg->conn->stream, SILC_PACKET_HEARTBEAT, 0,
 			 NULL, 0);
 }
@@ -178,7 +178,7 @@ silcpurple_scheduler(SilcSchedule schedu
 {
 	SilcClient client = (SilcClient)context;
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcPurpleTask ptask = NULL;
 
 	if (added) {
@@ -250,7 +250,7 @@ silcpurple_connect_cb(SilcClient client,
 	struct utsname u;
 #endif
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	switch (status) {
 	case SILC_CLIENT_CONN_SUCCESS:
@@ -365,7 +365,7 @@ silcpurple_stream_created(SilcSocketStre
 	SilcClientConnectionParams params;
 	const char *dfile;
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (status != SILC_SOCKET_OK) {
 		purple_connection_error_reason(gc,
@@ -374,7 +374,7 @@ silcpurple_stream_created(SilcSocketStre
 		silc_pkcs_public_key_free(sg->public_key);
 		silc_pkcs_private_key_free(sg->private_key);
 		silc_free(sg);
-		gc->proto_data = NULL;
+		purple_object_set_protocol_data(PURPLE_OBJECT(gc),NULL);
 		return;
 	}
 
@@ -413,7 +413,7 @@ silcpurple_login_connected(gpointer data
 
 	g_return_if_fail(gc != NULL);
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (source < 0) {
 		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
@@ -421,7 +421,7 @@ silcpurple_login_connected(gpointer data
 		silc_pkcs_public_key_free(sg->public_key);
 		silc_pkcs_private_key_free(sg->private_key);
 		silc_free(sg);
-		gc->proto_data = NULL;
+		purple_object_set_protocol_data(PURPLE_OBJECT(gc),NULL);
 		return;
 	}
 
@@ -436,7 +436,7 @@ static void silcpurple_running(SilcClien
 static void silcpurple_running(SilcClient client, void *context)
 {
 	SilcPurple sg = context;
-	PurpleConnection *gc = purple_account_get_connection(sg);
+	PurpleConnection *gc = sg->gc;
 	PurpleAccount *account = purple_connection_get_account(gc);
 	char pkd[256], prd[256];
 
@@ -453,7 +453,7 @@ static void silcpurple_running(SilcClien
 				&sg->public_key, &sg->private_key)) {
 		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 		                             _("Could not load SILC key pair"));
-		gc->proto_data = NULL;
+		purple_object_set_protocol_data(PURPLE_OBJECT(gc),NULL);
 		silc_free(sg);
 		return;
 	}
@@ -467,7 +467,7 @@ static void silcpurple_running(SilcClien
 	{
 		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 		                             _("Unable to create connection"));
-		gc->proto_data = NULL;
+		purple_object_set_protocol_data(PURPLE_OBJECT(gc),NULL);
 		silc_free(sg);
 		return;
 	}
@@ -487,7 +487,7 @@ silcpurple_login(PurpleAccount *account)
 	gc = purple_account_get_connection(account);
 	if (!gc)
 		return;
-	gc->proto_data = NULL;
+	purple_object_set_protocol_data(PURPLE_OBJECT(gc),NULL);
 
 	memset(&params, 0, sizeof(params));
 	strcat(params.nickname_format, "%n#a");
@@ -539,16 +539,16 @@ silcpurple_login(PurpleAccount *account)
 	if (!sg)
 		return;
 	sg->client = client;
-	purple_account_get_connection(sg) = gc;
+	sg->gc = gc;
 	sg->account = account;
-	gc->proto_data = sg;
+	purple_object_set_protocol_data(PURPLE_OBJECT(gc),sg);
 
 	/* Init SILC client */
 	if (!silc_client_init(client, username, hostname, realname,
 			      silcpurple_running, sg)) {
 		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 		                             _("Cannot initialize SILC protocol"));
-		gc->proto_data = NULL;
+		purple_object_set_protocol_data(PURPLE_OBJECT(gc),NULL);
 		silc_free(sg);
 		return;
 	}
@@ -557,7 +557,7 @@ silcpurple_login(PurpleAccount *account)
 	if (!silcpurple_check_silc_dir(gc)) {
 		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 		                             _("Error loading SILC key pair"));
-		gc->proto_data = NULL;
+		purple_object_set_protocol_data(PURPLE_OBJECT(gc),NULL);
 		silc_free(sg);
 		return;
 	}
@@ -592,7 +592,7 @@ silcpurple_close(PurpleConnection *gc)
 static void
 silcpurple_close(PurpleConnection *gc)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 #if __SILC_TOOLKIT_VERSION >= SILC_VERSION(1,1,1)
 	SilcPurpleTask task;
 #endif /* __SILC_TOOLKIT_VERSION */
@@ -636,7 +636,7 @@ silcpurple_attrs_cb(PurpleConnection *gc
 static void
 silcpurple_attrs_cb(PurpleConnection *gc, PurpleRequestFields *fields)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	PurpleRequestField *f;
@@ -647,7 +647,7 @@ silcpurple_attrs_cb(PurpleConnection *gc
 	SilcVCardStruct vcard;
 	const char *val;
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	if (!sg)
 		return;
 
@@ -808,7 +808,7 @@ silcpurple_attrs(PurplePluginAction *act
 silcpurple_attrs(PurplePluginAction *action)
 {
 	PurpleConnection *gc = (PurpleConnection *) action->context;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	PurpleRequestFields *fields;
@@ -825,7 +825,7 @@ silcpurple_attrs(PurplePluginAction *act
 	gboolean device = TRUE;
 	char status[1024], tz[16];
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	if (!sg)
 		return;
 
@@ -975,7 +975,7 @@ silcpurple_detach(PurplePluginAction *ac
 
 	if (!gc)
 		return;
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	if (!sg)
 		return;
 
@@ -993,7 +993,7 @@ silcpurple_view_motd(PurplePluginAction 
 
 	if (!gc)
 		return;
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	if (!sg)
 		return;
 
@@ -1019,7 +1019,7 @@ silcpurple_create_keypair_cb(PurpleConne
 static void
 silcpurple_create_keypair_cb(PurpleConnection *gc, PurpleRequestFields *fields)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	PurpleRequestField *f;
 	const char *val, *pkfile = NULL, *prfile = NULL;
 	const char *pass1 = NULL, *pass2 = NULL, *un = NULL, *hn = NULL;
@@ -1028,7 +1028,7 @@ silcpurple_create_keypair_cb(PurpleConne
 	int keylen = SILCPURPLE_DEF_PKCS_LEN;
 	SilcPublicKey public_key;
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	if (!sg)
 		return;
 
@@ -1111,7 +1111,7 @@ silcpurple_create_keypair(PurplePluginAc
 silcpurple_create_keypair(PurplePluginAction *action)
 {
 	PurpleConnection *gc = (PurpleConnection *) action->context;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	PurpleRequestFields *fields;
 	PurpleRequestFieldGroup *g;
 	PurpleRequestField *f;
@@ -1259,7 +1259,7 @@ silcpurple_send_im_resolved(SilcClient c
 			    void *context)
 {
 	PurpleConnection *gc = client->application;
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcPurpleIM im = context;
 	PurpleConversation *convo;
 	char tmp[256];
@@ -1330,7 +1330,7 @@ silcpurple_send_im(PurpleConnection *gc,
 silcpurple_send_im(PurpleConnection *gc, const char *who, const char *message,
 		   PurpleMessageFlags flags)
 {
-	SilcPurple sg = gc->proto_data;
+	SilcPurple sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	SilcClient client = sg->client;
 	SilcClientConnection conn = sg->conn;
 	SilcDList clients;
@@ -1490,7 +1490,7 @@ static PurpleCmdRet silcpurple_cmd_chat_
 			g_free(tmp2);
 		} else
 			buf = g_strdup(_("No topic is set"));
-		purple_conv_chat_write(PURPLE_CONV_CHAT(conv), purple_account_get_username(purple_connection_get_account(gc)), buf,
+		purple_conv_chat_write(PURPLE_CONV_CHAT(conv), purple_connection_get_account(gc)->username, buf,
 							 PURPLE_MESSAGE_SYSTEM|PURPLE_MESSAGE_NO_LOG, time(NULL));
 		g_free(buf);
 
@@ -1615,7 +1615,7 @@ static PurpleCmdRet silcpurple_cmd_motd(
 	if (gc == NULL)
 		return PURPLE_CMD_RET_FAILED;
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (sg == NULL)
 		return PURPLE_CMD_RET_FAILED;
@@ -1644,7 +1644,7 @@ static PurpleCmdRet silcpurple_cmd_detac
 	if (gc == NULL)
 		return PURPLE_CMD_RET_FAILED;
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (sg == NULL)
 		return PURPLE_CMD_RET_FAILED;
@@ -1665,12 +1665,11 @@ static PurpleCmdRet silcpurple_cmd_cmode
 	const char *chname;
 
 	gc = purple_conversation_get_gc(conv);
+	sg = gc ? purple_object_get_protocol_data(PURPLE_OBJECT(gc)) : NULL;
 
-	if (gc == NULL || !args || gc->proto_data == NULL)
+	if (gc == NULL || !args || sg == NULL)
 		return PURPLE_CMD_RET_FAILED;
 
-	sg = gc->proto_data;
-
 	if (args[0])
 		chname = args[0];
 	else
@@ -1720,7 +1719,7 @@ static PurpleCmdRet silcpurple_cmd_gener
 	if (gc == NULL)
 		return PURPLE_CMD_RET_FAILED;
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (sg == NULL)
 		return PURPLE_CMD_RET_FAILED;
@@ -1749,7 +1748,7 @@ static PurpleCmdRet silcpurple_cmd_quit(
 	if (gc == NULL)
 		return PURPLE_CMD_RET_FAILED;
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (sg == NULL)
 		return PURPLE_CMD_RET_FAILED;
@@ -1771,7 +1770,7 @@ static PurpleCmdRet silcpurple_cmd_call(
 	if (gc == NULL)
 		return PURPLE_CMD_RET_FAILED;
 
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	if (sg == NULL)
 		return PURPLE_CMD_RET_FAILED;
============================================================
--- libpurple/protocols/silc/util.c	43a790736e6e800bd3aefbaa4415a83bac35293c
+++ libpurple/protocols/silc/util.c	6d5af699f2321553b6e97c943d690d78985f38e9
@@ -362,8 +362,8 @@ void silcpurple_show_public_key(SilcPurp
 		   the next strings (short strings: 2 tabs, longer strings 1 tab,
 		   sum: 3 tabs or 24 characters) */
 		g_string_append_printf(s, _("Real Name: \t%s\n"), ident->realname);
-	if (purple_account_get_username(ident))
-		g_string_append_printf(s, _("User Name: \t%s\n"), purple_account_get_username(ident));
+	if (ident->username)
+		g_string_append_printf(s, _("User Name: \t%s\n"), ident->username);
 	if (ident->email)
 		g_string_append_printf(s, _("E-Mail: \t\t%s\n"), ident->email);
 	if (ident->host)
@@ -382,9 +382,9 @@ void silcpurple_show_public_key(SilcPurp
 
 	buf = g_string_free(s, FALSE);
 
-	purple_request_action(purple_account_get_connection(sg), _("Public Key Information"),
+	purple_request_action(sg->gc, _("Public Key Information"),
 			      _("Public Key Information"),
-			      buf, 0, purple_connection_get_account(purple_account_get_connection(sg)),
+			      buf, 0, purple_connection_get_account(sg->gc),
 			      NULL, NULL, context, 1, _("Close"), callback);
 
 	g_free(buf);
============================================================
--- libpurple/protocols/silc/wb.c	64ff9cef2bcb14c5d2c602cc051c1c698492f319
+++ libpurple/protocols/silc/wb.c	1bcfe5acc10459c3f4d3d8dccfce53710118f508
@@ -115,7 +115,7 @@ PurpleWhiteboard *silcpurple_wb_init(Sil
 	if (!wb)
 		return NULL;
 
-	if (!wb->proto_data) {
+	if (!purple_object_get_protocol_data(PURPLE_OBJECT(wb))) {
 		wbs = silc_calloc(1, sizeof(*wbs));
 		if (!wbs)
 			return NULL;
@@ -125,7 +125,7 @@ PurpleWhiteboard *silcpurple_wb_init(Sil
 		wbs->height = SILCPURPLE_WB_HEIGHT;
 		wbs->brush_size = SILCPURPLE_WB_BRUSH_SMALL;
 		wbs->brush_color = SILCPURPLE_WB_COLOR_BLACK;
-		wb->proto_data = wbs;
+		purple_object_set_protocol_data(PURPLE_OBJECT(wb),wbs);
 
 		/* Start the whiteboard */
 		purple_whiteboard_start(wb);
@@ -146,7 +146,7 @@ PurpleWhiteboard *silcpurple_wb_init_ch(
 	if (!wb)
 		return NULL;
 
-	if (!wb->proto_data) {
+	if (!purple_object_get_protocol_data(PURPLE_OBJECT(wb))) {
 		wbs = silc_calloc(1, sizeof(*wbs));
 		if (!wbs)
 			return NULL;
@@ -156,7 +156,7 @@ PurpleWhiteboard *silcpurple_wb_init_ch(
 		wbs->height = SILCPURPLE_WB_HEIGHT;
 		wbs->brush_size = SILCPURPLE_WB_BRUSH_SMALL;
 		wbs->brush_color = SILCPURPLE_WB_COLOR_BLACK;
-		wb->proto_data = wbs;
+		purple_object_set_protocol_data(PURPLE_OBJECT(wb),wbs);
 
 		/* Start the whiteboard */
 		purple_whiteboard_start(wb);
@@ -245,7 +245,7 @@ silcpurple_wb_request_cb(SilcPurpleWbReq
 	else
 		wb = silcpurple_wb_init_ch(req->sg, req->channel);
 
-	silcpurple_wb_parse(wb->proto_data, wb, req->message, req->message_len);
+	silcpurple_wb_parse(purple_object_get_protocol_data(PURPLE_OBJECT(wb)), wb, req->message, req->message_len);
 
   out:
 	silc_free(req->message);
@@ -263,7 +263,7 @@ silcpurple_wb_request(SilcClient client,
 	SilcPurple sg;
 
 	gc = client->application;
-	sg = gc->proto_data;
+	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	/* Open whiteboard automatically if requested */
 	if (purple_account_get_bool(sg->account, "open-wb", FALSE)) {
@@ -274,7 +274,7 @@ silcpurple_wb_request(SilcClient client,
 		else
 			wb = silcpurple_wb_init_ch(sg, channel);
 
-		silcpurple_wb_parse(wb->proto_data, wb,
+		silcpurple_wb_parse(purple_object_get_protocol_data(PURPLE_OBJECT(wb)), wb,
 				    (unsigned char *)message,
 				    message_len);
 		return;
@@ -322,7 +322,7 @@ void silcpurple_wb_receive(SilcClient cl
 	SilcPurpleWb wbs;
 
 	gc = client->application;
-        sg = gc->proto_data;
+        sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	wb = purple_whiteboard_get_session(sg->account, sender->nickname);
 	if (!wb) {
@@ -332,7 +332,7 @@ void silcpurple_wb_receive(SilcClient cl
 		return;
 	}
 
-	wbs = wb->proto_data;
+	wbs = purple_object_get_protocol_data(PURPLE_OBJECT(wb));
 	silcpurple_wb_parse(wbs, wb, (unsigned char *)message, message_len);
 }
 
@@ -351,7 +351,7 @@ void silcpurple_wb_receive_ch(SilcClient
 	SilcPurpleWb wbs;
 
 	gc = client->application;
-        sg = gc->proto_data;
+        sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 
 	wb = purple_whiteboard_get_session(sg->account, channel->channel_name);
 	if (!wb) {
@@ -361,7 +361,7 @@ void silcpurple_wb_receive_ch(SilcClient
 		return;
 	}
 
-	wbs = wb->proto_data;
+	wbs = purple_object_get_protocol_data(PURPLE_OBJECT(wb));
 	silcpurple_wb_parse(wbs, wb, (unsigned char *)message, message_len);
 }
 
@@ -369,7 +369,7 @@ void silcpurple_wb_send(PurpleWhiteboard
 
 void silcpurple_wb_send(PurpleWhiteboard *wb, GList *draw_list)
 {
-	SilcPurpleWb wbs = wb->proto_data;
+	SilcPurpleWb wbs = purple_object_get_protocol_data(PURPLE_OBJECT(wb));
 	SilcBuffer packet;
 	GList *list;
 	int len;
@@ -379,7 +379,7 @@ void silcpurple_wb_send(PurpleWhiteboard
 	g_return_if_fail(draw_list);
 	gc = purple_account_get_connection(wb->account);
 	g_return_if_fail(gc);
- 	sg = gc->proto_data;
+ 	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	g_return_if_fail(sg);
 
 	len = SILCPURPLE_WB_HEADER;
@@ -434,20 +434,20 @@ void silcpurple_wb_end(PurpleWhiteboard 
 
 void silcpurple_wb_end(PurpleWhiteboard *wb)
 {
-	silc_free(wb->proto_data);
-	wb->proto_data = NULL;
+	silc_free(purple_object_get_protocol_data(PURPLE_OBJECT(wb)));
+	purple_object_set_protocol_data(PURPLE_OBJECT(wb),NULL);
 }
 
 void silcpurple_wb_get_dimensions(const PurpleWhiteboard *wb, int *width, int *height)
 {
-	SilcPurpleWb wbs = wb->proto_data;
+	SilcPurpleWb wbs = purple_object_get_protocol_data(PURPLE_OBJECT(wb));
 	*width = wbs->width;
 	*height = wbs->height;
 }
 
 void silcpurple_wb_set_dimensions(PurpleWhiteboard *wb, int width, int height)
 {
-	SilcPurpleWb wbs = wb->proto_data;
+	SilcPurpleWb wbs = purple_object_get_protocol_data(PURPLE_OBJECT(wb));
 	wbs->width = width > SILCPURPLE_WB_WIDTH_MAX ? SILCPURPLE_WB_WIDTH_MAX :
 			width;
 	wbs->height = height > SILCPURPLE_WB_HEIGHT_MAX ? SILCPURPLE_WB_HEIGHT_MAX :
@@ -459,14 +459,14 @@ void silcpurple_wb_get_brush(const Purpl
 
 void silcpurple_wb_get_brush(const PurpleWhiteboard *wb, int *size, int *color)
 {
-	SilcPurpleWb wbs = wb->proto_data;
+	SilcPurpleWb wbs = purple_object_get_protocol_data(PURPLE_OBJECT(wb));
 	*size = wbs->brush_size;
 	*color = wbs->brush_color;
 }
 
 void silcpurple_wb_set_brush(PurpleWhiteboard *wb, int size, int color)
 {
-	SilcPurpleWb wbs = wb->proto_data;
+	SilcPurpleWb wbs = purple_object_get_protocol_data(PURPLE_OBJECT(wb));
 	wbs->brush_size = size;
 	wbs->brush_color = color;
 
@@ -476,7 +476,7 @@ void silcpurple_wb_clear(PurpleWhiteboar
 
 void silcpurple_wb_clear(PurpleWhiteboard *wb)
 {
-	SilcPurpleWb wbs = wb->proto_data;
+	SilcPurpleWb wbs = purple_object_get_protocol_data(PURPLE_OBJECT(wb));
 	SilcBuffer packet;
 	int len;
         PurpleConnection *gc;
@@ -484,7 +484,7 @@ void silcpurple_wb_clear(PurpleWhiteboar
 
 	gc = purple_account_get_connection(wb->account);
 	g_return_if_fail(gc);
- 	sg = gc->proto_data;
+ 	sg = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	g_return_if_fail(sg);
 
 	len = SILCPURPLE_WB_HEADER;


More information about the Commits mailing list