im.pidgin.pidgin: 8a96477df7545f48e81690f10a567c790af6ef81

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Jan 30 21:15:43 EST 2008


-----------------------------------------------------------------
Revision: 8a96477df7545f48e81690f10a567c790af6ef81
Ancestor: ae7f8e3acb446776f833c3b44514295ae56184b3
Author: markdoliner at pidgin.im
Date: 2008-01-31T02:13:30
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/yahoo/yahoo.c

ChangeLog: 

Revert bfc4df11256d088d75b0512bb0c4790967b68b19 because the code is
written such that it is not possible for this to happen, and
because PURPLE_CONNECTION_IS_VALID() is a hack

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/yahoo.c	a228d6e32bc131ceb6f315d5bb5b8d9c7d8551e1
+++ libpurple/protocols/yahoo/yahoo.c	e91a81571120665092540f1a8bef1effd1cb1622
@@ -975,56 +975,52 @@ static void
 };
 
 static void
-yahoo_buddy_add_authorize_cb(gpointer data) {
+yahoo_buddy_add_authorize_cb(gpointer data)
+{
 	struct yahoo_add_request *add_req = data;
+	struct yahoo_packet *pkt;
+	struct yahoo_data *yd = add_req->gc->proto_data;
 
-	if (PURPLE_CONNECTION_IS_VALID(add_req->gc)) {
-		struct yahoo_packet *pkt;
-		struct yahoo_data *yd = add_req->gc->proto_data;
+	pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, YAHOO_STATUS_AVAILABLE, 0);
+	yahoo_packet_hash(pkt, "ssiii",
+					  1, add_req->id,
+					  5, add_req->who,
+					  241, add_req->protocol,
+					  13, 1,
+					  334, 0);
+	yahoo_packet_send_and_free(pkt, yd);
 
-		pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15, YAHOO_STATUS_AVAILABLE, 0);
-		yahoo_packet_hash(pkt, "ssiii",
-						  1, add_req->id,
-						  5, add_req->who,
-						  241, add_req->protocol,
-						  13, 1,
-						  334, 0);
-		yahoo_packet_send_and_free(pkt, yd);
-	}
-
 	g_free(add_req->id);
 	g_free(add_req->who);
 	g_free(add_req);
 }
 
 static void
-yahoo_buddy_add_deny_cb(struct yahoo_add_request *add_req, const char *msg) {
+yahoo_buddy_add_deny_cb(struct yahoo_add_request *add_req, const char *msg)
+{
+	struct yahoo_data *yd = add_req->gc->proto_data;
+	struct yahoo_packet *pkt;
+	char *encoded_msg = NULL;
+	PurpleAccount *account = purple_connection_get_account(add_req->gc);
 
-	if (PURPLE_CONNECTION_IS_VALID(add_req->gc)) {
-		struct yahoo_data *yd = add_req->gc->proto_data;
-		struct yahoo_packet *pkt;
-		char *encoded_msg = NULL;
-		PurpleAccount *account = purple_connection_get_account(add_req->gc);
+	if (msg && *msg)
+		encoded_msg = yahoo_string_encode(add_req->gc, msg, NULL);
 
-		if (msg && *msg)
-			encoded_msg = yahoo_string_encode(add_req->gc, msg, NULL);
+	pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15,
+			YAHOO_STATUS_AVAILABLE, 0);
 
-		pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH_REQ_15,
-				YAHOO_STATUS_AVAILABLE, 0);
+	yahoo_packet_hash(pkt, "ssiiis",
+			1, purple_normalize(account, purple_account_get_username(account)),
+			5, add_req->who,
+			13, 2,
+			334, 0,
+			97, 1,
+			14, encoded_msg ? encoded_msg : "");
 
-		yahoo_packet_hash(pkt, "ssiiis",
-				1, purple_normalize(account, purple_account_get_username(account)),
-				5, add_req->who,
-				13, 2,
-				334, 0,
-				97, 1,
-				14, encoded_msg ? encoded_msg : "");
+	yahoo_packet_send_and_free(pkt, yd);
 
-		yahoo_packet_send_and_free(pkt, yd);
+	g_free(encoded_msg);
 
-		g_free(encoded_msg);
-	}
-
 	g_free(add_req->id);
 	g_free(add_req->who);
 	g_free(add_req);


More information about the Commits mailing list