changeset 22232:cbf64b6f5d4a

merge of '04e7d54475c3ddf91ad523e3e58521bc4fa59c85' and '8a96477df7545f48e81690f10a567c790af6ef81'
author Richard Nelson <wabz@pidgin.im>
date Thu, 31 Jan 2008 04:37:40 +0000
parents 4af9179e33df (current diff) 0f654f866de0 (diff)
children 782df0fd9e5e
files
diffstat 1 files changed, 37 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Thu Jan 31 02:23:55 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Thu Jan 31 04:37:40 2008 +0000
@@ -975,22 +975,20 @@
 };
 
 static void
-yahoo_buddy_add_authorize_cb(gpointer data) {
+yahoo_buddy_add_authorize_cb(gpointer data)
+{
 	struct yahoo_add_request *add_req = 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);
-	}
+	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);
 
 	g_free(add_req->id);
 	g_free(add_req->who);
@@ -998,32 +996,30 @@
 }
 
 static void
-yahoo_buddy_add_deny_cb(struct yahoo_add_request *add_req, const char *msg) {
-
-	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);
-
-		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_send_and_free(pkt, yd);
-
-		g_free(encoded_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 (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);
+
+	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);
+
+	g_free(encoded_msg);
 
 	g_free(add_req->id);
 	g_free(add_req->who);