gobjectification: aedb69cf: And now oscar compiles.

qulogic at pidgin.im qulogic at pidgin.im
Wed Jun 9 01:30:49 EDT 2010


-----------------------------------------------------------------
Revision: aedb69cf86b7bf67e60413986545d3fe7d05e21f
Ancestor: b34d745fd5f8fb6a7ac67ac3aff3e00452652b23
Author: qulogic at pidgin.im
Date: 2010-06-09T01:31:56
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/aedb69cf86b7bf67e60413986545d3fe7d05e21f

Modified files:
        libpurple/protocols/oscar/family_icbm.c
        libpurple/protocols/oscar/oscar.c

ChangeLog: 

And now oscar compiles.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/family_icbm.c	52688bc864209fd4471193bfce81c4547ba8ae51
+++ libpurple/protocols/oscar/family_icbm.c	57b55d3f5c14e06ab019afac164e7b95983a9bf5
@@ -2926,6 +2926,7 @@ int icq_im_xstatus_request(OscarData *od
 	GSList *outer_tlvlist = NULL, *inner_tlvlist = NULL;
 	ByteStream bs, header, plugindata;
 	PurpleAccount *account;
+	const char *username;
 	const char *fmt;
 	char *statxml;
 	int xmllen;
@@ -2959,10 +2960,11 @@ int icq_im_xstatus_request(OscarData *od
 	fmt =  "<N><QUERY>&lt;Q&gt;&lt;PluginID&gt;srvMng&lt;/PluginID&gt;&lt;/Q&gt;</QUERY><NOTIFY>&lt;srv&gt;&lt;id&gt;cAwaySrv&lt;/id&gt;&lt;req&gt;&lt;id&gt;AwayStat&lt;/id&gt;&lt;trans&gt;2&lt;/trans&gt;&lt;senderId&gt;%s&lt;/senderId&gt;&lt;/req&gt;&lt;/srv&gt;</NOTIFY></N>\r\n";	
 
 	account = purple_connection_get_account(od->gc);
-	xmllen = strlen(fmt) - 2 + strlen(account->username);
+	username = purple_account_get_username(account);
+	xmllen = strlen(fmt) - 2 + strlen(username);
 
 	statxml = (char*) g_malloc(xmllen);
-	snprintf(statxml, xmllen, fmt, account->username);
+	snprintf(statxml, xmllen, fmt, username);
 
 	aim_icbm_makecookie(cookie);
 
@@ -3024,6 +3026,7 @@ int icq_relay_xstatus(OscarData *od, con
    char *statxml;
 	const char *title;
 	int len;
+	const char *username;
 	
 	static const guint8 plugindata[] = {
 	0x1B, 0x00,
@@ -3057,7 +3060,7 @@ int icq_relay_xstatus(OscarData *od, con
 /*	if (!strcmp(account->username, sn))
 		icq_im_xstatus_request(od, sn); */
 	
-	status  = purple_presence_get_active_status(account->presence);
+	status  = purple_presence_get_active_status(purple_account_get_presence(account));
 	if (!status) return -EINVAL;
    title = purple_status_get_name(status);
    if (!title) return -EINVAL;
@@ -3065,11 +3068,12 @@ int icq_relay_xstatus(OscarData *od, con
 	if (!formatted_msg) return -EINVAL;
    msg = purple_markup_strip_html(formatted_msg);
 	if (!msg) return -EINVAL;
-	len = strlen(fmt)-6+strlen(account->username)+strlen(title)+strlen(msg);
+	username = purple_account_get_username(account);
+	len = strlen(fmt)-6+strlen(username)+strlen(title)+strlen(msg);
 	statxml = (char*) g_malloc(len);
 
 	snprintf(statxml, len, fmt, 
-		account->username, title, msg);
+		username, title, msg);
 
 	purple_debug_misc("oscar", "X-Status AutoReply: %s, %s\n", formatted_msg, msg);
 
============================================================
--- libpurple/protocols/oscar/oscar.c	5dc1260c9dd09ff4ae7c422d7a5ef92c61581a21
+++ libpurple/protocols/oscar/oscar.c	c6d6a79a45f141a8c4c49588416f3fc339f64012
@@ -1526,14 +1526,12 @@ oscar_login(PurpleAccount *account)
 		return;
 	}
 
-		purple_connection_set_flags(gc,
-				purple_connection_get_flags(gc) | PURPLE_CONNECTION_FLAGS_HTML);
+	purple_connection_turn_on_flags(gc, PURPLE_CONNECTION_FLAGS_HTML);
 	if (oscar_util_valid_name_icq((purple_account_get_username(account)))) {
 		od->icq = TRUE;
-		gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS;
+		purple_connection_turn_on_flags(gc, PURPLE_CONNECTION_FLAGS_SUPPORT_MOODS);
 	} else {
-		purple_connection_set_flags(gc,
-				purple_connection_get_flags(gc) | PURPLE_CONNECTION_FLAGS_AUTO_RESP);
+		purple_connection_turn_on_flags(gc, PURPLE_CONNECTION_FLAGS_AUTO_RESP);
 	}
 
 	od->default_port = purple_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT);
@@ -4962,7 +4960,7 @@ oscar_set_status(PurpleAccount *account,
 		return;
 
 	pc = purple_account_get_connection(account);
-	od = purple_connection_get_protocol_data(pc);
+	od = purple_object_get_protocol_data(PURPLE_OBJECT(pc));
 
 	/* There's no need to do the stuff below for mood updates. */
 	if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) {
@@ -5391,7 +5389,7 @@ static int purple_ssi_parselist(OscarDat
 
 				if (gname_utf8 != NULL && purple_find_group(gname_utf8) == NULL) {
 					g = purple_group_new(gname_utf8);
-					purple_blist_add_group(g, NULL);
+					purple_blist_node_add_child(PURPLE_BLIST_NODE(g), purple_blist_get_root());
 				}
 				g_free(gname_utf8);
 			} break;
@@ -6183,7 +6181,7 @@ oscar_status_types(PurpleAccount *accoun
 									 OSCAR_STATUS_ID_FREE4CHAT,
 									 _("Free For Chat"), TRUE, is_icq, FALSE,
 									 "message", _("Message"),
-				purple_value_new(PURPLE_TYPE_STRING), NULL);
+				purple_g_value_slice_new(G_TYPE_STRING), NULL);
 
 	status_types = g_list_prepend(status_types, type);
 
@@ -6191,7 +6189,7 @@ oscar_status_types(PurpleAccount *accoun
 									 OSCAR_STATUS_ID_EVIL,
 									 _("Evil"), TRUE, is_icq, FALSE,
 				 "message", _("Message"),
-				purple_value_new(PURPLE_TYPE_STRING), NULL);
+				purple_g_value_slice_new(G_TYPE_STRING), NULL);
 	status_types = g_list_prepend(status_types, type);
 
 
@@ -6199,7 +6197,7 @@ oscar_status_types(PurpleAccount *accoun
 									 OSCAR_STATUS_ID_DEPRESSION,
 									 _("Depression"), TRUE, is_icq, FALSE,
 				 "message", _("Message"),
-				purple_value_new(PURPLE_TYPE_STRING), NULL);
+				purple_g_value_slice_new(G_TYPE_STRING), NULL);
 	status_types = g_list_prepend(status_types, type);
 
 
@@ -6207,7 +6205,7 @@ oscar_status_types(PurpleAccount *accoun
 									 OSCAR_STATUS_ID_ATHOME,
 									 _("At home"), TRUE, is_icq, FALSE,
 				"message", _("Message"),
-				purple_value_new(PURPLE_TYPE_STRING), NULL);
+				purple_g_value_slice_new(G_TYPE_STRING), NULL);
 	status_types = g_list_prepend(status_types, type);
 
 
@@ -6215,7 +6213,7 @@ oscar_status_types(PurpleAccount *accoun
 									 OSCAR_STATUS_ID_ATWORK,
 									 _("At work"), TRUE, is_icq, FALSE,
 				"message", _("Message"),
-				purple_value_new(PURPLE_TYPE_STRING), NULL);
+				purple_g_value_slice_new(G_TYPE_STRING), NULL);
 
 	status_types = g_list_prepend(status_types, type);
 
@@ -6224,7 +6222,7 @@ oscar_status_types(PurpleAccount *accoun
 									 OSCAR_STATUS_ID_LUNCH,
 									 _("Lunch"), TRUE, is_icq, FALSE,
 				"message", _("Message"),
-				purple_value_new(PURPLE_TYPE_STRING), NULL);
+				purple_g_value_slice_new(G_TYPE_STRING), NULL);
 
 	status_types = g_list_prepend(status_types, type);
 
@@ -6239,7 +6237,7 @@ oscar_status_types(PurpleAccount *accoun
 									 OSCAR_STATUS_ID_INVISIBLE,
 									 NULL, TRUE, TRUE, FALSE,
 									 "message", _("Message"),
-									  purple_value_new(PURPLE_TYPE_STRING), NULL);
+									  purple_g_value_slice_new(G_TYPE_STRING), NULL);
 
 	status_types = g_list_prepend(status_types, type);
 
@@ -6275,8 +6273,8 @@ oscar_status_types(PurpleAccount *accoun
 
 	type = purple_status_type_new_with_attrs(PURPLE_STATUS_MOOD,
 			"mood", NULL, TRUE, is_icq, TRUE,
-			PURPLE_MOOD_NAME, _("Mood Name"), purple_value_new(PURPLE_TYPE_STRING),
-			PURPLE_MOOD_COMMENT, _("Mood Comment"), purple_value_new(PURPLE_TYPE_STRING),
+			PURPLE_MOOD_NAME, _("Mood Name"), purple_g_value_slice_new(G_TYPE_STRING),
+			PURPLE_MOOD_COMMENT, _("Mood Comment"), purple_g_value_slice_new(G_TYPE_STRING),
 			NULL);
 	status_types = g_list_prepend(status_types, type);
 
@@ -6428,13 +6426,13 @@ oscar_close_directim(gpointer object, gp
 
 	node = object;
 
-	g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
+	g_return_if_fail(PURPLE_IS_BUDDY(node));
 
-	buddy = (PurpleBuddy*)node;
+	buddy = PURPLE_BUDDY(node);
 	name = purple_buddy_get_name(buddy);
 	account = purple_buddy_get_account(buddy);
 	gc = purple_account_get_connection(account);
-	od = gc->proto_data;
+	od = purple_object_get_protocol_data(PURPLE_OBJECT(gc));
 	conn = peer_connection_find_by_type(od, name, OSCAR_CAPABILITY_DIRECTIM);
 
 	if (conn != NULL)
@@ -6458,14 +6456,14 @@ static void oscar_get_icqxstatusmsg(Purp
 	PurpleConnection *gc;
 	PurpleAccount *account;
 
-	g_return_if_fail(PURPLE_BLIST_NODE_IS_BUDDY(node));
+	g_return_if_fail(PURPLE_IS_BUDDY(node));
 
-	buddy = (PurpleBuddy *)node;
-	gc = purple_account_get_connection(buddy->account);
-	account = purple_connection_get_account(gc);
-	purple_debug_info("oscar", "Manual X-Status Get From %s to %s:\n", purple_buddy_get_name(buddy), account->username);
+	buddy = PURPLE_BUDDY(node);
+	account = purple_buddy_get_account(buddy);
+	gc = purple_account_get_connection(account);
+	purple_debug_info("oscar", "Manual X-Status Get From %s to %s:\n", purple_buddy_get_name(buddy), purple_account_get_username(account));
 
-	icq_im_xstatus_request(gc->proto_data, purple_buddy_get_name(buddy));
+	icq_im_xstatus_request(purple_object_get_protocol_data(PURPLE_OBJECT(gc)), purple_buddy_get_name(buddy));
 }
 
 static void
@@ -6476,7 +6474,7 @@ oscar_get_aim_info_cb(PurpleBlistNode *n
 
 	g_return_if_fail(PURPLE_IS_BUDDY(node));
 
-	buddy = (PurpleBuddy *)node;
+	buddy = PURPLE_BUDDY(node);
 	gc = purple_account_get_connection(purple_buddy_get_account(buddy));
 
 	aim_locate_getinfoshort(purple_object_get_protocol_data(PURPLE_OBJECT(gc)),


More information about the Commits mailing list