Index: protocols/yahoo/libyahoo2.c
===================================================================
--- protocols/yahoo/libyahoo2.c	(revision 25c4c78e2ddad482dfc9d5a104f76325fcc2f8e5)
+++ protocols/yahoo/libyahoo2.c	(revision 9216eff1a59e9d4a24b63c16ba4c2cacd051332c)
@@ -3,11 +3,11 @@
  *
  * Some code copyright (C) 2002-2004, Philip S Tellis <philip.tellis AT gmx.net>
- * YMSG16 code copyright (C) 2009, 
- * 		Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
+ * YMSG16 code copyright (C) 2009,
+ *              Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
  *
  * Yahoo Search copyright (C) 2003, Konstantin Klyagin <konst AT konst.org.ua>
  *
  * Much of this code was taken and adapted from the yahoo module for
- * gaim released under the GNU GPL.  This code is also released under the 
+ * gaim released under the GNU GPL.  This code is also released under the
  * GNU GPL.
  *
@@ -30,5 +30,5 @@
  *
  * YMSG16 authentication code based mostly on write-up at:
- * 	http://www.carbonize.co.uk/ymsg16.html
+ *      http://www.carbonize.co.uk/ymsg16.html
  *
  * This program is free software; you can redistribute it and/or modify
@@ -60,8 +60,8 @@
 #  define strrchr rindex
 # endif
-char *strchr (), *strrchr ();
+char *strchr(), *strrchr();
 # if !HAVE_MEMCPY
-#  define memcpy(d, s, n) bcopy ((s), (d), (n))
-#  define memmove(d, s, n) bcopy ((s), (d), (n))
+#  define memcpy(d, s, n) bcopy((s), (d), (n))
+#  define memmove(d, s, n) bcopy((s), (d), (n))
 # endif
 #endif
@@ -100,7 +100,7 @@
 }
 
-#define YAHOO_CALLBACK(x)	yc->x
+#define YAHOO_CALLBACK(x)       yc->x
 #else
-#define YAHOO_CALLBACK(x)	x
+#define YAHOO_CALLBACK(x)       x
 #endif
 
@@ -113,8 +113,9 @@
 	char out[1024];
 	va_list ap;
+
 	va_start(ap, fmt);
 	vsnprintf(out, sizeof(out), fmt, ap);
 	va_end(ap);
-	return YAHOO_CALLBACK(ext_yahoo_log) ("%s", out);
+	return YAHOO_CALLBACK (ext_yahoo_log) ("%s", out);
 }
 
@@ -129,4 +130,5 @@
 {
 	enum yahoo_log_level l = log_level;
+
 	log_level = level;
 	return l;
@@ -134,9 +136,9 @@
 
 /* default values for servers */
-static char *default_pager_hosts[] = {	"scs.msg.yahoo.com",
-					"scsa.msg.yahoo.com",
-					"scsb.msg.yahoo.com",
-					"scsc.msg.yahoo.com",
-					NULL};
+static char *default_pager_hosts[] = {  "scs.msg.yahoo.com",
+	                                "scsa.msg.yahoo.com",
+	                                "scsb.msg.yahoo.com",
+	                                "scsc.msg.yahoo.com",
+	                                NULL };
 
 static int pager_port = 5050;
@@ -222,9 +224,9 @@
 
 static void yahoo_process_filetransfer(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt);
+                                       struct yahoo_packet *pkt);
 static void yahoo_process_filetransferinfo(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt);
+                                           struct yahoo_packet *pkt);
 static void yahoo_process_filetransferaccept(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt);
+                                             struct yahoo_packet *pkt);
 
 static void yahoo_https_auth(struct yahoo_input_data *yid, const char *seed, const char *sn);
@@ -233,8 +235,8 @@
 {
 	struct yahoo_server_settings *yss =
-		y_new0(struct yahoo_server_settings, 1);
+	        y_new0(struct yahoo_server_settings, 1);
 
 	/* Give preference to the default host list
-	 * Make sure that only one of the two is set at any time 
+	 * Make sure that only one of the two is set at any time
 	 */
 	yss->pager_host = NULL;
@@ -263,6 +265,7 @@
 	while (1) {
 		key = va_arg(ap, char *);
-		if (key == NULL)
-			break;
+		if (key == NULL) {
+			break;
+		}
 
 		if (!strcmp(key, "pager_host")) {
@@ -306,6 +309,6 @@
 		} else {
 			WARNING(("Unknown key passed to yahoo_init, "
-					"perhaps you didn't terminate the list "
-					"with NULL"));
+			         "perhaps you didn't terminate the list "
+			         "with NULL"));
 		}
 	}
@@ -316,6 +319,7 @@
 static void yahoo_free_server_settings(struct yahoo_server_settings *yss)
 {
-	if (!yss)
-		return;
+	if (!yss) {
+		return;
+	}
 
 	free(yss->pager_host);
@@ -340,8 +344,10 @@
 {
 	YList *l;
+
 	for (l = conns; l; l = y_list_next(l)) {
 		struct yahoo_data *yd = l->data;
-		if (yd->client_id == id)
+		if (yd->client_id == id) {
 			return yd;
+		}
 	}
 	return NULL;
@@ -357,11 +363,11 @@
 static struct yahoo_input_data * find_input_by_id(int id)
 {
-	YList *l;
-	for(l = inputs; l; l = y_list_next(l)) {
-		struct yahoo_input_data *yid = l->data;
-		if(yid->yd->client_id == id)
-			return yid;
-	}
-	return NULL;
+        YList *l;
+        for(l = inputs; l; l = y_list_next(l)) {
+                struct yahoo_input_data *yid = l->data;
+                if(yid->yd->client_id == id)
+                        return yid;
+        }
+        return NULL;
 }
 */
@@ -369,16 +375,18 @@
 #if 0
 static struct yahoo_input_data *find_input_by_id_and_webcam_user(int id,
-	const char *who)
+                                                                 const char *who)
 {
 	YList *l;
+
 	LOG(("find_input_by_id_and_webcam_user"));
 	for (l = inputs; l; l = y_list_next(l)) {
 		struct yahoo_input_data *yid = l->data;
 		if (yid->type == YAHOO_CONNECTION_WEBCAM
-			&& yid->yd->client_id == id && yid->wcm && ((who
-					&& yid->wcm->user
-					&& !strcmp(who, yid->wcm->user))
-				|| !(yid->wcm->user && !who)))
+		    && yid->yd->client_id == id && yid->wcm && ((who
+		                                                 && yid->wcm->user
+		                                                 && !strcmp(who, yid->wcm->user))
+		                                                || !(yid->wcm->user && !who))) {
 			return yid;
+		}
 	}
 	return NULL;
@@ -387,12 +395,14 @@
 
 static struct yahoo_input_data *find_input_by_id_and_type(int id,
-	enum yahoo_connection_type type)
+                                                          enum yahoo_connection_type type)
 {
 	YList *l;
+
 	LOG(("find_input_by_id_and_type"));
 	for (l = inputs; l; l = y_list_next(l)) {
 		struct yahoo_input_data *yid = l->data;
-		if (yid->type == type && yid->yd->client_id == id)
+		if (yid->type == type && yid->yd->client_id == id) {
 			return yid;
+		}
 	}
 	return NULL;
@@ -402,9 +412,11 @@
 {
 	YList *l;
+
 	LOG(("find_input_by_id_and_fd"));
 	for (l = inputs; l; l = y_list_next(l)) {
 		struct yahoo_input_data *yid = l->data;
-		if (yid->fd == fd && yid->yd->client_id == id)
+		if (yid->fd == fd && yid->yd->client_id == id) {
 			return yid;
+		}
 	}
 	return NULL;
@@ -415,9 +427,11 @@
 	int c = 0;
 	YList *l;
+
 	LOG(("counting %d", id));
 	for (l = inputs; l; l = y_list_next(l)) {
 		struct yahoo_input_data *yid = l->data;
-		if (yid->yd->client_id == id)
+		if (yid->yd->client_id == id) {
 			c++;
+		}
 	}
 	LOG(("%d", c));
@@ -432,6 +446,7 @@
 	for (l = list; l; l = l->next) {
 		struct yahoo_buddy *bud = l->data;
-		if (!bud)
+		if (!bud) {
 			continue;
+		}
 
 		FREE(bud->group);
@@ -503,5 +518,5 @@
 
 static struct yahoo_packet *yahoo_packet_new(enum yahoo_service service,
-	enum ypacket_status status, int id)
+                                             enum ypacket_status status, int id)
 {
 	struct yahoo_packet *pkt = y_new0(struct yahoo_packet, 1);
@@ -515,7 +530,8 @@
 
 static void yahoo_packet_hash(struct yahoo_packet *pkt, int key,
-	const char *value)
+                              const char *value)
 {
 	struct yahoo_pair *pair = y_new0(struct yahoo_pair, 1);
+
 	pair->key = key;
 	pair->value = strdup(value);
@@ -545,21 +561,21 @@
 
 #define yahoo_put16(buf, data) ( \
-		(*(buf) = (unsigned char)((data)>>8)&0xff), \
-		(*((buf)+1) = (unsigned char)(data)&0xff),  \
-		2)
-#define yahoo_get16(buf) ((((*(buf))&0xff)<<8) + ((*((buf)+1)) & 0xff))
+	        (*(buf) = (unsigned char) ((data) >> 8) & 0xff), \
+	        (*((buf) + 1) = (unsigned char) (data) & 0xff),  \
+	        2)
+#define yahoo_get16(buf) ((((*(buf)) & 0xff) << 8) + ((*((buf) + 1)) & 0xff))
 #define yahoo_put32(buf, data) ( \
-		(*((buf)) = (unsigned char)((data)>>24)&0xff), \
-		(*((buf)+1) = (unsigned char)((data)>>16)&0xff), \
-		(*((buf)+2) = (unsigned char)((data)>>8)&0xff), \
-		(*((buf)+3) = (unsigned char)(data)&0xff), \
-		4)
-#define yahoo_get32(buf) ((((*(buf)   )&0xff)<<24) + \
-			 (((*((buf)+1))&0xff)<<16) + \
-			 (((*((buf)+2))&0xff)<< 8) + \
-			 (((*((buf)+3))&0xff)))
+	        (*((buf)) = (unsigned char) ((data) >> 24) & 0xff), \
+	        (*((buf) + 1) = (unsigned char) ((data) >> 16) & 0xff), \
+	        (*((buf) + 2) = (unsigned char) ((data) >> 8) & 0xff), \
+	        (*((buf) + 3) = (unsigned char) (data) & 0xff), \
+	        4)
+#define yahoo_get32(buf) ((((*(buf)) & 0xff) << 24) + \
+	                  (((*((buf) + 1)) & 0xff) << 16) + \
+	                  (((*((buf) + 2)) & 0xff) << 8) + \
+	                  (((*((buf) + 3)) & 0xff)))
 
 static void yahoo_packet_read(struct yahoo_packet *pkt, unsigned char *data,
-	int len)
+                              int len)
 {
 	int pos = 0;
@@ -575,6 +591,7 @@
 		x = 0;
 		while (pos + 1 < len) {
-			if (data[pos] == 0xc0 && data[pos + 1] == 0x80)
+			if (data[pos] == 0xc0 && data[pos + 1] == 0x80) {
 				break;
+			}
 			key[x++] = data[pos++];
 		}
@@ -583,31 +600,35 @@
 		pair->key = strtol(key, NULL, 10);
 		free(key);
-		
+
 		/* Libyahoo2 developer(s) don't seem to have the time to fix
 		   this problem, so for now try to work around it:
-		   
+
 		   Sometimes we receive an invalid packet with not any more
 		   data at this point. I don't know how to handle this in a
 		   clean way, but let's hope this is clean enough: */
-		
+
 		if (pos + 1 < len) {
-			accept = x; 
+			accept = x;
 			/* if x is 0 there was no key, so don't accept it */
-			if (accept)
+			if (accept) {
 				value = malloc(len - pos + 1);
+			}
 			x = 0;
 			while (pos + 1 < len) {
-				if (data[pos] == 0xc0 && data[pos + 1] == 0x80)
+				if (data[pos] == 0xc0 && data[pos + 1] == 0x80) {
 					break;
-				if (accept)
+				}
+				if (accept) {
 					value[x++] = data[pos++];
+				}
 			}
-			if (accept)
+			if (accept) {
 				value[x] = 0;
+			}
 			pos += 2;
 		} else {
 			accept = 0;
 		}
-		
+
 		if (accept) {
 			pair->value = strdup(value);
@@ -615,5 +636,5 @@
 			pkt->hash = y_list_append(pkt->hash, pair);
 			DEBUG_MSG(("Key: %d  \tValue: %s", pair->key,
-					pair->value));
+			           pair->value));
 		} else {
 			FREE(pair);
@@ -631,11 +652,11 @@
 		unsigned char buf[100];
 
-		snprintf((char *)buf, sizeof(buf), "%d", pair->key);
-		strcpy((char *)data + pos, (char *)buf);
-		pos += strlen((char *)buf);
+		snprintf((char *) buf, sizeof(buf), "%d", pair->key);
+		strcpy((char *) data + pos, (char *) buf);
+		pos += strlen((char *) buf);
 		data[pos++] = 0xc0;
 		data[pos++] = 0x80;
 
-		strcpy((char *)data + pos, pair->value);
+		strcpy((char *) data + pos, pair->value);
 		pos += strlen(pair->value);
 		data[pos++] = 0xc0;
@@ -660,22 +681,27 @@
 		int i;
 		for (i = 0; i < len; i++) {
-			if ((i % 8 == 0) && i)
-				YAHOO_CALLBACK(ext_yahoo_log) (" ");
-			if ((i % 16 == 0) && i)
-				YAHOO_CALLBACK(ext_yahoo_log) ("\n");
-			YAHOO_CALLBACK(ext_yahoo_log) ("%02x ", data[i]);
-		}
-		YAHOO_CALLBACK(ext_yahoo_log) ("\n");
+			if ((i % 8 == 0) && i) {
+				YAHOO_CALLBACK (ext_yahoo_log) (" ");
+			}
+			if ((i % 16 == 0) && i) {
+				YAHOO_CALLBACK (ext_yahoo_log) ("\n");
+			}
+			YAHOO_CALLBACK (ext_yahoo_log) ("%02x ", data[i]);
+		}
+		YAHOO_CALLBACK (ext_yahoo_log) ("\n");
 		for (i = 0; i < len; i++) {
-			if ((i % 8 == 0) && i)
-				YAHOO_CALLBACK(ext_yahoo_log) (" ");
-			if ((i % 16 == 0) && i)
-				YAHOO_CALLBACK(ext_yahoo_log) ("\n");
-			if (isprint(data[i]))
-				YAHOO_CALLBACK(ext_yahoo_log) (" %c ", data[i]);
-			else
-				YAHOO_CALLBACK(ext_yahoo_log) (" . ");
-		}
-		YAHOO_CALLBACK(ext_yahoo_log) ("\n");
+			if ((i % 8 == 0) && i) {
+				YAHOO_CALLBACK (ext_yahoo_log) (" ");
+			}
+			if ((i % 16 == 0) && i) {
+				YAHOO_CALLBACK (ext_yahoo_log) ("\n");
+			}
+			if (isprint(data[i])) {
+				YAHOO_CALLBACK (ext_yahoo_log) (" %c ", data[i]);
+			} else {
+				YAHOO_CALLBACK (ext_yahoo_log) (" . ");
+			}
+		}
+		YAHOO_CALLBACK (ext_yahoo_log) ("\n");
 	}
 }
@@ -703,7 +729,8 @@
 
 static void yahoo_add_to_send_queue(struct yahoo_input_data *yid, void *data,
-	int length)
+                                    int length)
 {
 	struct data_queue *tx = y_new0(struct data_queue, 1);
+
 	tx->queue = y_new0(unsigned char, length);
 	tx->len = length;
@@ -712,12 +739,13 @@
 	yid->txqueues = y_list_append(yid->txqueues, tx);
 
-	if (!yid->write_tag)
+	if (!yid->write_tag) {
 		yid->write_tag =
-			YAHOO_CALLBACK(ext_yahoo_add_handler) (yid->yd->
-			client_id, yid->fd, YAHOO_INPUT_WRITE, yid);
+		        YAHOO_CALLBACK (ext_yahoo_add_handler) (yid->yd->
+		                                                client_id, yid->fd, YAHOO_INPUT_WRITE, yid);
+	}
 }
 
 static void yahoo_send_packet(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt, int extra_pad)
+                              struct yahoo_packet *pkt, int extra_pad)
 {
 	int pktlen = yahoo_packet_length(pkt);
@@ -726,6 +754,7 @@
 	int pos = 0;
 
-	if (yid->fd < 0)
-		return;
+	if (yid->fd < 0) {
+		return;
+	}
 
 	data = y_new0(unsigned char, len + 1);
@@ -733,10 +762,10 @@
 	memcpy(data + pos, "YMSG", 4);
 	pos += 4;
-	pos += yahoo_put16(data + pos, YAHOO_PROTO_VER);	/* version [latest 12 0x000c] */
-	pos += yahoo_put16(data + pos, 0x0000);	/* HIWORD pkt length??? */
-	pos += yahoo_put16(data + pos, pktlen + extra_pad);	/* LOWORD pkt length? */
-	pos += yahoo_put16(data + pos, pkt->service);	/* service */
-	pos += yahoo_put32(data + pos, pkt->status);	/* status [4bytes] */
-	pos += yahoo_put32(data + pos, pkt->id);	/* session [4bytes] */
+	pos += yahoo_put16(data + pos, YAHOO_PROTO_VER);        /* version [latest 12 0x000c] */
+	pos += yahoo_put16(data + pos, 0x0000); /* HIWORD pkt length??? */
+	pos += yahoo_put16(data + pos, pktlen + extra_pad);     /* LOWORD pkt length? */
+	pos += yahoo_put16(data + pos, pkt->service);   /* service */
+	pos += yahoo_put32(data + pos, pkt->status);    /* status [4bytes] */
+	pos += yahoo_put32(data + pos, pkt->id);        /* session [4bytes] */
 
 	yahoo_packet_write(pkt, data + pos);
@@ -744,8 +773,9 @@
 	yahoo_packet_dump(data, len);
 
-	if (yid->type == YAHOO_CONNECTION_FT)
+	if (yid->type == YAHOO_CONNECTION_FT) {
 		yahoo_send_data(yid->fd, data, len);
-	else
+	} else {
 		yahoo_add_to_send_queue(yid, data, len);
+	}
 	FREE(data);
 }
@@ -770,11 +800,12 @@
 	int e;
 
-	if (fd == NULL)
+	if (fd == NULL) {
 		return -1;
+	}
 
 	yahoo_packet_dump(data, len);
 
 	do {
-		ret = YAHOO_CALLBACK(ext_yahoo_write) (fd, data, len);
+		ret = YAHOO_CALLBACK (ext_yahoo_write) (fd, data, len);
 	} while (ret == -1 && errno == EINTR);
 	e = errno;
@@ -793,12 +824,15 @@
 {
 	struct yahoo_data *yd = find_conn_by_id(id);
-	if (!yd)
-		return;
+
+	if (!yd) {
+		return;
+	}
 
 	del_from_list(yd);
 
 	yahoo_free_data(yd);
-	if (id == last_id)
+	if (id == last_id) {
 		last_id--;
+	}
 }
 
@@ -808,12 +842,13 @@
 
 	LOG(("yahoo_input_close(read)"));
-	YAHOO_CALLBACK(ext_yahoo_remove_handler) (yid->yd->client_id,
-		yid->read_tag);
+	YAHOO_CALLBACK (ext_yahoo_remove_handler) (yid->yd->client_id,
+	                                           yid->read_tag);
 	LOG(("yahoo_input_close(write)"));
-	YAHOO_CALLBACK(ext_yahoo_remove_handler) (yid->yd->client_id,
-		yid->write_tag);
+	YAHOO_CALLBACK (ext_yahoo_remove_handler) (yid->yd->client_id,
+	                                           yid->write_tag);
 	yid->read_tag = yid->write_tag = 0;
-	if (yid->fd)
-		YAHOO_CALLBACK(ext_yahoo_close) (yid->fd);
+	if (yid->fd) {
+		YAHOO_CALLBACK (ext_yahoo_close) (yid->fd);
+	}
 	yid->fd = 0;
 	FREE(yid->rxqueue);
@@ -823,6 +858,7 @@
 	}
 	yahoo_free_webcam(yid->wcm);
-	if (yid->wcd)
+	if (yid->wcd) {
 		FREE(yid->wcd);
+	}
 	if (yid->ys) {
 		FREE(yid->ys->lsearch_text);
@@ -846,12 +882,14 @@
 	char *cookieend;
 
-	if (strlen(rawcookie) < 2)
+	if (strlen(rawcookie) < 2) {
 		return NULL;
+	}
 
 	tmpcookie = strdup(rawcookie + 2);
 	cookieend = strchr(tmpcookie, ';');
 
-	if (cookieend)
+	if (cookieend) {
 		*cookieend = '\0';
+	}
 
 	cookie = strdup(tmpcookie);
@@ -872,6 +910,7 @@
 		tmp = strdup(tmpend + 2);
 		tmpend = strchr(tmp, '&');
-		if (tmpend)
+		if (tmpend) {
 			*tmpend = '\0';
+		}
 		login_cookie = strdup(tmp);
 		FREE(tmp);
@@ -882,5 +921,5 @@
 
 static void yahoo_process_notify(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                 struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -892,17 +931,23 @@
 	char *ind = NULL;
 	YList *l;
+
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 4)
+		if (pair->key == 4) {
 			from = pair->value;
-		if (pair->key == 5)
+		}
+		if (pair->key == 5) {
 			to = pair->value;
-		if (pair->key == 49)
+		}
+		if (pair->key == 49) {
 			msg = pair->value;
-		if (pair->key == 13)
+		}
+		if (pair->key == 13) {
 			stat = atoi(pair->value);
-		if (pair->key == 14)
+		}
+		if (pair->key == 14) {
 			ind = pair->value;
-		if (pair->key == 16) {	/* status == -1 */
+		}
+		if (pair->key == 16) {  /* status == -1 */
 			NOTICE((pair->value));
 			return;
@@ -911,31 +956,34 @@
 	}
 
-	if (!msg)
-		return;
-
-	if (!strncasecmp(msg, "TYPING", strlen("TYPING")))
-		YAHOO_CALLBACK(ext_yahoo_typing_notify) (yd->client_id, to,
-			from, stat);
-	else if (!strncasecmp(msg, "GAME", strlen("GAME")))
-		YAHOO_CALLBACK(ext_yahoo_game_notify) (yd->client_id, to, from,
-			stat, ind);
-	else if (!strncasecmp(msg, "WEBCAMINVITE", strlen("WEBCAMINVITE"))) {
+	if (!msg) {
+		return;
+	}
+
+	if (!strncasecmp(msg, "TYPING", strlen("TYPING"))) {
+		YAHOO_CALLBACK (ext_yahoo_typing_notify) (yd->client_id, to,
+		                                          from, stat);
+	} else if (!strncasecmp(msg, "GAME", strlen("GAME"))) {
+		YAHOO_CALLBACK (ext_yahoo_game_notify) (yd->client_id, to, from,
+		                                        stat, ind);
+	} else if (!strncasecmp(msg, "WEBCAMINVITE", strlen("WEBCAMINVITE"))) {
 		if (!strcmp(ind, " ")) {
-			YAHOO_CALLBACK(ext_yahoo_webcam_invite) (yd->client_id,
-				to, from);
+			YAHOO_CALLBACK (ext_yahoo_webcam_invite) (yd->client_id,
+			                                          to, from);
 		} else {
 			accept = atoi(ind);
 			/* accept the invitation (-1 = deny 1 = accept) */
-			if (accept < 0)
+			if (accept < 0) {
 				accept = 0;
-			YAHOO_CALLBACK(ext_yahoo_webcam_invite_reply) (yd->
-				client_id, to, from, accept);
-		}
-	} else
+			}
+			YAHOO_CALLBACK (ext_yahoo_webcam_invite_reply) (yd->
+			                                                client_id, to, from, accept);
+		}
+	} else {
 		LOG(("Got unknown notification: %s", msg));
+	}
 }
 
 static void yahoo_process_conference(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                     struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -951,52 +999,68 @@
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 50)
+		if (pair->key == 50) {
 			host = pair->value;
-
-		if (pair->key == 52) {	/* invite */
+		}
+
+		if (pair->key == 52) {  /* invite */
 			members = y_list_append(members, strdup(pair->value));
 		}
-		if (pair->key == 53)	/* logon */
+		if (pair->key == 53) {  /* logon */
 			who = pair->value;
-		if (pair->key == 54)	/* decline */
+		}
+		if (pair->key == 54) {  /* decline */
 			who = pair->value;
-		if (pair->key == 55)	/* unavailable (status == 2) */
+		}
+		if (pair->key == 55) {  /* unavailable (status == 2) */
 			who = pair->value;
-		if (pair->key == 56)	/* logoff */
+		}
+		if (pair->key == 56) {  /* logoff */
 			who = pair->value;
-
-		if (pair->key == 57)
+		}
+
+		if (pair->key == 57) {
 			room = pair->value;
-
-		if (pair->key == 58)	/* join message */
+		}
+
+		if (pair->key == 58) {  /* join message */
 			msg = pair->value;
-		if (pair->key == 14)	/* decline/conf message */
+		}
+		if (pair->key == 14) {  /* decline/conf message */
 			msg = pair->value;
-
-		if (pair->key == 13) 
+		}
+
+		if (pair->key == 13) {
 			;
-		if (pair->key == 16)	/* error */
+		}
+		if (pair->key == 16) {  /* error */
 			msg = pair->value;
-
-		if (pair->key == 1)	/* my id */
+		}
+
+		if (pair->key == 1) {   /* my id */
 			id = pair->value;
-		if (pair->key == 3)	/* message sender */
+		}
+		if (pair->key == 3) {   /* message sender */
 			who = pair->value;
-
-		if (pair->key == 97)
+		}
+
+		if (pair->key == 97) {
 			utf8 = atoi(pair->value);
-	}
-
-	if (!room)
-		return;
+		}
+	}
+
+	if (!room) {
+		return;
+	}
 
 	if (host) {
 		for (l = members; l; l = l->next) {
 			char *w = l->data;
-			if (!strcmp(w, host))
+			if (!strcmp(w, host)) {
 				break;
-		}
-		if (!l)
+			}
+		}
+		if (!l) {
 			members = y_list_append(members, strdup(host));
+		}
 	}
 	/* invite, decline, join, left, message -> status == 1 */
@@ -1004,36 +1068,43 @@
 	switch (pkt->service) {
 	case YAHOO_SERVICE_CONFINVITE:
-		if (pkt->status == 2) ;
-		else if (members)
-			YAHOO_CALLBACK(ext_yahoo_got_conf_invite) (yd->
-				client_id, id, host, room, msg, members);
-		else if (msg)
-			YAHOO_CALLBACK(ext_yahoo_error) (yd->client_id, msg, 0,
-				E_CONFNOTAVAIL);
+		if (pkt->status == 2) {
+			;
+		} else if (members) {
+			YAHOO_CALLBACK (ext_yahoo_got_conf_invite) (yd->
+			                                            client_id, id, host, room, msg, members);
+		} else if (msg) {
+			YAHOO_CALLBACK (ext_yahoo_error) (yd->client_id, msg, 0,
+			                                  E_CONFNOTAVAIL);
+		}
 		break;
 	case YAHOO_SERVICE_CONFADDINVITE:
-		if (pkt->status == 1)
-			YAHOO_CALLBACK(ext_yahoo_got_conf_invite) (yd->
-				client_id, id, host, room, msg, members);
+		if (pkt->status == 1) {
+			YAHOO_CALLBACK (ext_yahoo_got_conf_invite) (yd->
+			                                            client_id, id, host, room, msg, members);
+		}
 		break;
 	case YAHOO_SERVICE_CONFDECLINE:
-		if (who)
-			YAHOO_CALLBACK(ext_yahoo_conf_userdecline) (yd->
-				client_id, id, who, room, msg);
+		if (who) {
+			YAHOO_CALLBACK (ext_yahoo_conf_userdecline) (yd->
+			                                             client_id, id, who, room, msg);
+		}
 		break;
 	case YAHOO_SERVICE_CONFLOGON:
-		if (who)
-			YAHOO_CALLBACK(ext_yahoo_conf_userjoin) (yd->client_id,
-				id, who, room);
+		if (who) {
+			YAHOO_CALLBACK (ext_yahoo_conf_userjoin) (yd->client_id,
+			                                          id, who, room);
+		}
 		break;
 	case YAHOO_SERVICE_CONFLOGOFF:
-		if (who)
-			YAHOO_CALLBACK(ext_yahoo_conf_userleave) (yd->client_id,
-				id, who, room);
+		if (who) {
+			YAHOO_CALLBACK (ext_yahoo_conf_userleave) (yd->client_id,
+			                                           id, who, room);
+		}
 		break;
 	case YAHOO_SERVICE_CONFMSG:
-		if (who)
-			YAHOO_CALLBACK(ext_yahoo_conf_message) (yd->client_id,
-				id, who, room, msg, utf8);
+		if (who) {
+			YAHOO_CALLBACK (ext_yahoo_conf_message) (yd->client_id,
+			                                         id, who, room, msg, utf8);
+		}
 		break;
 	}
@@ -1041,5 +1112,5 @@
 
 static void yahoo_process_chat(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                               struct yahoo_packet *pkt)
 {
 	char *msg = NULL;
@@ -1087,5 +1158,5 @@
 			if (pkt->service == YAHOO_SERVICE_CHATJOIN) {
 				currentmember =
-					y_new0(struct yahoo_chat_member, 1);
+				        y_new0(struct yahoo_chat_member, 1);
 				currentmember->id = strdup(pair->value);
 				members = y_list_append(members, currentmember);
@@ -1095,24 +1166,28 @@
 		if (pair->key == 110) {
 			/* age */
-			if (pkt->service == YAHOO_SERVICE_CHATJOIN)
+			if (pkt->service == YAHOO_SERVICE_CHATJOIN) {
 				currentmember->age = atoi(pair->value);
+			}
 		}
 
 		if (pair->key == 113) {
 			/* attribs */
-			if (pkt->service == YAHOO_SERVICE_CHATJOIN)
+			if (pkt->service == YAHOO_SERVICE_CHATJOIN) {
 				currentmember->attribs = atoi(pair->value);
+			}
 		}
 
 		if (pair->key == 141) {
 			/* alias */
-			if (pkt->service == YAHOO_SERVICE_CHATJOIN)
+			if (pkt->service == YAHOO_SERVICE_CHATJOIN) {
 				currentmember->alias = strdup(pair->value);
+			}
 		}
 
 		if (pair->key == 142) {
 			/* location */
-			if (pkt->service == YAHOO_SERVICE_CHATJOIN)
+			if (pkt->service == YAHOO_SERVICE_CHATJOIN) {
 				currentmember->location = strdup(pair->value);
+			}
 		}
 
@@ -1139,12 +1214,12 @@
 
 	if (!room) {
-		if (pkt->service == YAHOO_SERVICE_CHATLOGOUT) {	/* yahoo originated chat logout */
-			YAHOO_CALLBACK(ext_yahoo_chat_yahoologout) (yid->yd->
-				client_id, id);
+		if (pkt->service == YAHOO_SERVICE_CHATLOGOUT) { /* yahoo originated chat logout */
+			YAHOO_CALLBACK (ext_yahoo_chat_yahoologout) (yid->yd->
+			                                             client_id, id);
 			return;
 		}
 		if (pkt->service == YAHOO_SERVICE_COMMENT && chaterr) {
-			YAHOO_CALLBACK(ext_yahoo_chat_yahooerror) (yid->yd->
-				client_id, id);
+			YAHOO_CALLBACK (ext_yahoo_chat_yahooerror) (yid->yd->
+			                                            client_id, id);
 			return;
 		}
@@ -1160,6 +1235,6 @@
 		}
 		if (firstjoin && members) {
-			YAHOO_CALLBACK(ext_yahoo_chat_join) (yid->yd->client_id,
-				id, room, topic, members, yid->fd);
+			YAHOO_CALLBACK (ext_yahoo_chat_join) (yid->yd->client_id,
+			                                      id, room, topic, members, yid->fd);
 		} else if (who) {
 			if (y_list_length(members) != 1) {
@@ -1170,6 +1245,6 @@
 				YList *n = members->next;
 				currentmember = members->data;
-				YAHOO_CALLBACK(ext_yahoo_chat_userjoin) (yid->
-					yd->client_id, id, room, currentmember);
+				YAHOO_CALLBACK (ext_yahoo_chat_userjoin) (yid->
+				                                          yd->client_id, id, room, currentmember);
 				y_list_free_1(members);
 				members = n;
@@ -1179,12 +1254,12 @@
 	case YAHOO_SERVICE_CHATEXIT:
 		if (who) {
-			YAHOO_CALLBACK(ext_yahoo_chat_userleave) (yid->yd->
-				client_id, id, room, who);
+			YAHOO_CALLBACK (ext_yahoo_chat_userleave) (yid->yd->
+			                                           client_id, id, room, who);
 		}
 		break;
 	case YAHOO_SERVICE_COMMENT:
 		if (who) {
-			YAHOO_CALLBACK(ext_yahoo_chat_message) (yid->yd->
-				client_id, id, who, room, msg, msgtype, utf8);
+			YAHOO_CALLBACK (ext_yahoo_chat_message) (yid->yd->
+			                                         client_id, id, who, room, msg, msgtype, utf8);
 		}
 		break;
@@ -1193,5 +1268,5 @@
 
 static void yahoo_process_message(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                  struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -1213,19 +1288,22 @@
 		struct yahoo_pair *pair = l->data;
 		if (pair->key == 1 || pair->key == 4) {
-			if (!message->from)
+			if (!message->from) {
 				message->from = pair->value;
-		} else if (pair->key == 5)
+			}
+		} else if (pair->key == 5) {
 			message->to = pair->value;
-		else if (pair->key == 15)
+		} else if (pair->key == 15) {
 			message->tm = strtol(pair->value, NULL, 10);
-		else if (pair->key == 97)
+		} else if (pair->key == 97) {
 			message->utf8 = atoi(pair->value);
+		}
 		/* This comes when the official client sends us a message */
-		else if (pair->key == 429)
+		else if (pair->key == 429) {
 			message->gunk = pair->value;
+		}
 		/* user message *//* sys message */
-		else if (pair->key == 14 || pair->key == 16)
+		else if (pair->key == 14 || pair->key == 16) {
 			message->msg = pair->value;
-		else if (pair->key == 31) {
+		} else if (pair->key == 31) {
 			if (message->i_31) {
 				messages = y_list_append(messages, message);
@@ -1233,8 +1311,10 @@
 			}
 			message->i_31 = atoi(pair->value);
-		} else if (pair->key == 32)
+		} else if (pair->key == 32) {
 			message->i_32 = atoi(pair->value);
-		else
-			LOG(("yahoo_process_message: status: %d, key: %d, value: %s", pkt->status, pair->key, pair->value));
+		} else {
+			LOG(("yahoo_process_message: status: %d, key: %d, value: %s", pkt->status, pair->key,
+			     pair->value));
+		}
 	}
 
@@ -1244,13 +1324,13 @@
 		message = l->data;
 		if (pkt->service == YAHOO_SERVICE_SYSMESSAGE) {
-			YAHOO_CALLBACK(ext_yahoo_system_message) (yd->client_id,
-				message->to, message->from, message->msg);
+			YAHOO_CALLBACK (ext_yahoo_system_message) (yd->client_id,
+			                                           message->to, message->from, message->msg);
 		} else if (pkt->status <= 2 || pkt->status == 5) {
 			/* Confirm message receipt if we got the gunk */
-			if(message->gunk) {
+			if (message->gunk) {
 				struct yahoo_packet *outpkt;
-                        
+
 				outpkt = yahoo_packet_new(YAHOO_SERVICE_MESSAGE_CONFIRM,
-					YPACKET_STATUS_DEFAULT, 0);
+				                          YPACKET_STATUS_DEFAULT, 0);
 				yahoo_packet_hash(outpkt, 1, yd->user);
 				yahoo_packet_hash(outpkt, 5, message->from);
@@ -1260,18 +1340,19 @@
 				yahoo_packet_hash(outpkt, 450, "0");
 				yahoo_send_packet(yid, outpkt, 0);
-                        
+
 				yahoo_packet_free(outpkt);
 			}
 
-			if (!strcmp(message->msg, "<ding>"))
-				YAHOO_CALLBACK(ext_yahoo_got_buzz) (yd->client_id,
-					message->to, message->from, message->tm);
-			else
-				YAHOO_CALLBACK(ext_yahoo_got_im) (yd->client_id,
-					message->to, message->from, message->msg,
-					message->tm, pkt->status, message->utf8);
+			if (!strcmp(message->msg, "<ding>")) {
+				YAHOO_CALLBACK (ext_yahoo_got_buzz) (yd->client_id,
+				                                     message->to, message->from, message->tm);
+			} else {
+				YAHOO_CALLBACK (ext_yahoo_got_im) (yd->client_id,
+				                                   message->to, message->from, message->msg,
+				                                   message->tm, pkt->status, message->utf8);
+			}
 		} else if (pkt->status == 0xffffffff) {
-			YAHOO_CALLBACK(ext_yahoo_error) (yd->client_id,
-				message->msg, 0, E_SYSTEM);
+			YAHOO_CALLBACK (ext_yahoo_error) (yd->client_id,
+			                                  message->msg, 0, E_SYSTEM);
 		}
 		FREE(message);
@@ -1286,11 +1367,11 @@
  * 3 level:
  * =======
- * 
+ *
  * 302 (318) - Beginning level 1
- * 	300 (318) - Begin level 2
- * 	302 (319) - End level 2 header
- * 		300 (319) - Begin level 3
- * 		301 (319) - End level 3
- * 	303 (319) - End level 2
+ *      300 (318) - Begin level 2
+ *      302 (319) - End level 2 header
+ *              300 (319) - Begin level 3
+ *              301 (319) - End level 3
+ *      303 (319) - End level 2
  * 303 (318) - End level 1
  *
@@ -1299,11 +1380,11 @@
  *
  * 302 (315) - Beginning level 1
- * 	300 (315) - Begin level 2
- * 	301 (315) - End level 2
+ *      300 (315) - Begin level 2
+ *      301 (315) - End level 2
  * 303 (315) - End level 1
  *
  */
 static void yahoo_process_status(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                 struct yahoo_packet *pkt)
 {
 	YList *l;
@@ -1315,13 +1396,13 @@
 
 	if (pkt->service == YAHOO_SERVICE_LOGOFF && pkt->status == -1) {
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id,
-			YAHOO_LOGIN_DUPL, NULL);
-		return;
-	}
-
-	/* 
-	 * Status updates may be spread accross multiple packets and not 
-	 * even on buddy boundaries, so keeping some state is important. 
-	 * So, continue where we left off, and only add a user entry to 
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id,
+		                                           YAHOO_LOGIN_DUPL, NULL);
+		return;
+	}
+
+	/*
+	 * Status updates may be spread accross multiple packets and not
+	 * even on buddy boundaries, so keeping some state is important.
+	 * So, continue where we left off, and only add a user entry to
 	 * the list once it's complete (301-315 End buddy).
 	 */
@@ -1332,35 +1413,37 @@
 
 		switch (pair->key) {
-		case 300:	/* Begin buddy */
+		case 300:       /* Begin buddy */
 			if (!strcmp(pair->value, "315") && !u) {
 				u = yd->half_user = y_new0(struct yahoo_process_status_entry, 1);
 			}
 			break;
-		case 301:	/* End buddy */
+		case 301:       /* End buddy */
 			if (!strcmp(pair->value, "315") && u) {
 				/* Sometimes user info comes in an odd format with no
 				   "begin buddy" but *with* an "end buddy". Don't add
 				   it twice. */
-				if (!y_list_find(users, u))
+				if (!y_list_find(users, u)) {
 					users = y_list_prepend(users, u);
+				}
 				u = yd->half_user = NULL;
 			}
 			break;
-		case 0:	/* we won't actually do anything with this */
+		case 0: /* we won't actually do anything with this */
 			NOTICE(("key %d:%s", pair->key, pair->value));
 			break;
-		case 1:	/* we don't get the full buddy list here. */
+		case 1: /* we don't get the full buddy list here. */
 			if (!yd->logged_in) {
 				yd->logged_in = 1;
-				if (yd->current_status < 0)
+				if (yd->current_status < 0) {
 					yd->current_status = yd->initial_status;
-				YAHOO_CALLBACK(ext_yahoo_login_response) (yd->
-					client_id, YAHOO_LOGIN_OK, NULL);
+				}
+				YAHOO_CALLBACK (ext_yahoo_login_response) (yd->
+				                                           client_id, YAHOO_LOGIN_OK, NULL);
 			}
 			break;
-		case 8:	/* how many online buddies we have */
+		case 8: /* how many online buddies we have */
 			NOTICE(("key %d:%s", pair->key, pair->value));
 			break;
-		case 7:	/* the current buddy */
+		case 7: /* the current buddy */
 			if (!u) {
 				/* This will only happen in case of a single level message */
@@ -1370,26 +1453,26 @@
 			u->name = pair->value;
 			break;
-		case 10:	/* state */
+		case 10:        /* state */
 			u->state = strtol(pair->value, NULL, 10);
 			break;
-		case 19:	/* custom status message */
+		case 19:        /* custom status message */
 			u->msg = pair->value;
 			break;
-		case 47:	/* is it an away message or not. Not applicable for YMSG16 anymore */
+		case 47:        /* is it an away message or not. Not applicable for YMSG16 anymore */
 			u->away = atoi(pair->value);
 			break;
-		case 137:	/* seconds idle */
+		case 137:       /* seconds idle */
 			u->idle = atoi(pair->value);
 			break;
-		case 11:	/* this is the buddy's session id */
+		case 11:        /* this is the buddy's session id */
 			u->buddy_session = atoi(pair->value);
 			break;
-		case 17:	/* in chat? */
+		case 17:        /* in chat? */
 			u->f17 = atoi(pair->value);
 			break;
-		case 13:	/* bitmask, bit 0 = pager, bit 1 = chat, bit 2 = game */
+		case 13:        /* bitmask, bit 0 = pager, bit 1 = chat, bit 2 = game */
 			u->flags = atoi(pair->value);
 			break;
-		case 60:	/* SMS -> 1 MOBILE USER */
+		case 60:        /* SMS -> 1 MOBILE USER */
 			/* sometimes going offline makes this 2, but invisible never sends it */
 			u->mobile = atoi(pair->value);
@@ -1422,11 +1505,11 @@
 			u->f213 = atoi(pair->value);
 			break;
-		case 16:	/* Custom error message */
-			YAHOO_CALLBACK(ext_yahoo_error) (yd->client_id,
-				pair->value, 0, E_CUSTOM);
+		case 16:        /* Custom error message */
+			YAHOO_CALLBACK (ext_yahoo_error) (yd->client_id,
+			                                  pair->value, 0, E_CUSTOM);
 			break;
 		default:
 			WARNING(("unknown status key %d:%s", pair->key,
-					pair->value));
+			         pair->value));
 			break;
 		}
@@ -1439,19 +1522,20 @@
 		if (u->name != NULL) {
 			if (pkt->service ==
-				YAHOO_SERVICE_LOGOFF
-				/*|| u->flags == 0 No flags for YMSG16 */ ) {
-				YAHOO_CALLBACK(ext_yahoo_status_changed) (yd->
-					client_id, u->name,
-					YAHOO_STATUS_OFFLINE, NULL, 1, 0, 0);
+			    YAHOO_SERVICE_LOGOFF
+			    /*|| u->flags == 0 No flags for YMSG16 */) {
+				YAHOO_CALLBACK (ext_yahoo_status_changed) (yd->
+				                                           client_id, u->name,
+				                                           YAHOO_STATUS_OFFLINE, NULL, 1, 0, 0);
 			} else {
 				/* Key 47 always seems to be 1 for YMSG16 */
-				if (!u->state)
+				if (!u->state) {
 					u->away = 0;
-				else
+				} else {
 					u->away = 1;
-
-				YAHOO_CALLBACK(ext_yahoo_status_changed) (yd->
-					client_id, u->name, u->state, u->msg,
-					u->away, u->idle, u->mobile);
+				}
+
+				YAHOO_CALLBACK (ext_yahoo_status_changed) (yd->
+				                                           client_id, u->name, u->state, u->msg,
+				                                           u->away, u->idle, u->mobile);
 			}
 		}
@@ -1464,5 +1548,5 @@
 
 static void yahoo_process_buddy_list(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                     struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -1480,8 +1564,9 @@
 		case 301:
 		case 302:
-			break;	/* Separators. Our logic does not need them */
+			break;  /* Separators. Our logic does not need them */
 		case 303:
-			if (318 == atoi(pair->value))
+			if (318 == atoi(pair->value)) {
 				last_packet = 1;
+			}
 			break;
 		case 65:
@@ -1491,14 +1576,15 @@
 			newbud = y_new0(struct yahoo_buddy, 1);
 			newbud->id = strdup(pair->value);
-			if (cur_group)
+			if (cur_group) {
 				newbud->group = strdup(cur_group);
-			else if (yd->buddies) {
+			} else if (yd->buddies) {
 				struct yahoo_buddy *lastbud =
-					(struct yahoo_buddy *)y_list_nth(yd->
-					buddies,
-					y_list_length(yd->buddies) - 1)->data;
+				        (struct yahoo_buddy *) y_list_nth(yd->
+				                                          buddies,
+				                                          y_list_length(yd->buddies) - 1)->data;
 				newbud->group = strdup(lastbud->group);
-			} else
+			} else {
 				newbud->group = strdup("Buddies");
+			}
 
 			yd->buddies = y_list_append(yd->buddies, newbud);
@@ -1509,20 +1595,22 @@
 
 	/* we could be getting multiple packets here */
-	if (pkt->hash && !last_packet)
-		return;
-
-	YAHOO_CALLBACK(ext_yahoo_got_buddies) (yd->client_id, yd->buddies);
+	if (pkt->hash && !last_packet) {
+		return;
+	}
+
+	YAHOO_CALLBACK (ext_yahoo_got_buddies) (yd->client_id, yd->buddies);
 
 	/* Logged in */
 	if (!yd->logged_in) {
 		yd->logged_in = 1;
-		if (yd->current_status < 0)
+		if (yd->current_status < 0) {
 			yd->current_status = yd->initial_status;
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id,
-			YAHOO_LOGIN_OK, NULL);
+		}
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id,
+		                                           YAHOO_LOGIN_OK, NULL);
 
 		/*
 		yahoo_set_away(yd->client_id, yd->initial_status, NULL,
-			(yd->initial_status == YAHOO_STATUS_AVAILABLE) ? 0 : 1);
+		        (yd->initial_status == YAHOO_STATUS_AVAILABLE) ? 0 : 1);
 
 		yahoo_get_yab(yd->client_id);
@@ -1533,5 +1621,5 @@
 
 static void yahoo_process_list(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                               struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -1543,19 +1631,20 @@
 
 		switch (pair->key) {
-		case 89:	/* identities */
-			{
-				char **identities =
-					y_strsplit(pair->value, ",", -1);
-				int i;
-				for (i = 0; identities[i]; i++)
-					yd->identities =
-						y_list_append(yd->identities,
-						strdup(identities[i]));
-				y_strfreev(identities);
+		case 89:        /* identities */
+		{
+			char **identities =
+			        y_strsplit(pair->value, ",", -1);
+			int i;
+			for (i = 0; identities[i]; i++) {
+				yd->identities =
+				        y_list_append(yd->identities,
+				                      strdup(identities[i]));
 			}
-			YAHOO_CALLBACK(ext_yahoo_got_identities) (yd->client_id,
-				yd->identities);
-			break;
-		case 59:	/* cookies */
+			y_strfreev(identities);
+		}
+			YAHOO_CALLBACK (ext_yahoo_got_identities) (yd->client_id,
+			                                           yd->identities);
+			break;
+		case 59:        /* cookies */
 			if (pair->value[0] == 'Y') {
 				FREE(yd->cookie_y);
@@ -1575,20 +1664,21 @@
 
 			break;
-		case 3:	/* my id */
-		case 90:	/* 1 */
-		case 100:	/* 0 */
-		case 101:	/* NULL */
-		case 102:	/* NULL */
-		case 93:	/* 86400/1440 */
-			break;
-		}
-	}
-
-	if (yd->cookie_y && yd->cookie_t)	/* We don't get cookie_c anymore */
-		YAHOO_CALLBACK(ext_yahoo_got_cookies) (yd->client_id);
+		case 3: /* my id */
+		case 90:        /* 1 */
+		case 100:       /* 0 */
+		case 101:       /* NULL */
+		case 102:       /* NULL */
+		case 93:        /* 86400/1440 */
+			break;
+		}
+	}
+
+	if (yd->cookie_y && yd->cookie_t) {     /* We don't get cookie_c anymore */
+		YAHOO_CALLBACK (ext_yahoo_got_cookies) (yd->client_id);
+	}
 }
 
 static void yahoo_process_verify(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                 struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -1596,11 +1686,11 @@
 	if (pkt->status != 0x01) {
 		DEBUG_MSG(("expected status: 0x01, got: %d", pkt->status));
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id,
-			YAHOO_LOGIN_LOCK, "");
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id,
+		                                           YAHOO_LOGIN_LOCK, "");
 		return;
 	}
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, yd->user);
@@ -1612,5 +1702,5 @@
 
 static void yahoo_process_picture_checksum(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                           struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -1638,10 +1728,10 @@
 	}
 
-	YAHOO_CALLBACK(ext_yahoo_got_buddyicon_checksum) (yd->client_id, to,
-		from, checksum);
+	YAHOO_CALLBACK (ext_yahoo_got_buddyicon_checksum) (yd->client_id, to,
+	                                                   from, checksum);
 }
 
 static void yahoo_process_picture(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                  struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -1658,17 +1748,17 @@
 		switch (pair->key) {
 		case 1:
-		case 4:	/* sender */
+		case 4: /* sender */
 			from = pair->value;
 			break;
-		case 5:	/* we */
+		case 5: /* we */
 			to = pair->value;
 			break;
-		case 13:	/* request / sending */
+		case 13:        /* request / sending */
 			status = atoi(pair->value);
 			break;
-		case 20:	/* url */
+		case 20:        /* url */
 			url = pair->value;
 			break;
-		case 192:	/*checksum */
+		case 192:       /*checksum */
 			checksum = atoi(pair->value);
 			break;
@@ -1677,11 +1767,11 @@
 
 	switch (status) {
-	case 1:		/* this is a request, ignore for now */
-		YAHOO_CALLBACK(ext_yahoo_got_buddyicon_request) (yd->client_id,
-			to, from);
+	case 1:         /* this is a request, ignore for now */
+		YAHOO_CALLBACK (ext_yahoo_got_buddyicon_request) (yd->client_id,
+		                                                  to, from);
 		break;
-	case 2:		/* this is cool - we get a picture :) */
-		YAHOO_CALLBACK(ext_yahoo_got_buddyicon) (yd->client_id, to,
-			from, url, checksum);
+	case 2:         /* this is cool - we get a picture :) */
+		YAHOO_CALLBACK (ext_yahoo_got_buddyicon) (yd->client_id, to,
+		                                          from, url, checksum);
 		break;
 	}
@@ -1689,5 +1779,5 @@
 
 static void yahoo_process_picture_upload(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                         struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -1695,24 +1785,25 @@
 	char *url = NULL;
 
-	if (pkt->status != 1)
-		return;		/* something went wrong */
-
+	if (pkt->status != 1) {
+		return;         /* something went wrong */
+
+	}
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
 
 		switch (pair->key) {
-		case 5:	/* we */
-			break;
-		case 20:	/* url */
+		case 5: /* we */
+			break;
+		case 20:        /* url */
 			url = pair->value;
 			break;
-		case 27:	/* local filename */
-			break;
-		case 38:	/* time */
-			break;
-		}
-	}
-
-	YAHOO_CALLBACK(ext_yahoo_buddyicon_uploaded) (yd->client_id, url);
+		case 27:        /* local filename */
+			break;
+		case 38:        /* time */
+			break;
+		}
+	}
+
+	YAHOO_CALLBACK (ext_yahoo_buddyicon_uploaded) (yd->client_id, url);
 }
 
@@ -1727,4 +1818,5 @@
 
 	struct yahoo_input_data *yid = y_new0(struct yahoo_input_data, 1);
+
 	yid->yd = yd;
 	yid->type = YAHOO_CONNECTION_PAGER;
@@ -1739,9 +1831,10 @@
 	host = yss->pager_host;
 
-	if (!host)
+	if (!host) {
 		host = yss->pager_host_list[0];
-
-	tag = YAHOO_CALLBACK(ext_yahoo_connect_async) (yd->client_id,
-		host, yss->pager_port, yahoo_connected, ccd, 0);
+	}
+
+	tag = YAHOO_CALLBACK (ext_yahoo_connect_async) (yd->client_id,
+	                                                host, yss->pager_port, yahoo_connected, ccd, 0);
 
 	/*
@@ -1749,13 +1842,13 @@
 	 * so ccd will have been freed
 	 */
-	if (tag > 0)
+	if (tag > 0) {
 		ccd->tag = tag;
-	else if (tag < 0)
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id,
-			YAHOO_LOGIN_SOCK, NULL);
-}
-
-struct yahoo_https_auth_data
-{
+	} else if (tag < 0) {
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id,
+		                                           YAHOO_LOGIN_SOCK, NULL);
+	}
+}
+
+struct yahoo_https_auth_data {
 	struct yahoo_input_data *yid;
 	char *token;
@@ -1774,19 +1867,21 @@
 	char *s, *end;
 	int len = strlen(key);
-	
+
 	s = response;
 	do {
 		if (strncmp(s, key, len) == 0 && s[len] == '=') {
 			s += len + 1;
-			if ((end = strchr(s, '\r')))
+			if ((end = strchr(s, '\r'))) {
 				return g_strndup(s, end - s);
-			else
+			} else {
 				return g_strdup(s);
-		}
-		
-		if ((s = strchr(s, '\n')))
-			s ++;
+			}
+		}
+
+		if ((s = strchr(s, '\n'))) {
+			s++;
+		}
 	} while (s && *s);
-	
+
 	return NULL;
 }
@@ -1794,10 +1889,9 @@
 static enum yahoo_status yahoo_https_status_parse(int code)
 {
-	switch (code)
-	{
-		case 1212: return (enum yahoo_status) YAHOO_LOGIN_PASSWD;
-		case 1213: return (enum yahoo_status) YAHOO_LOGIN_LOCK;
-		case 1235: return (enum yahoo_status) YAHOO_LOGIN_UNAME;
-		default: return (enum yahoo_status) code;
+	switch (code) {
+	case 1212: return (enum yahoo_status) YAHOO_LOGIN_PASSWD;
+	case 1213: return (enum yahoo_status) YAHOO_LOGIN_LOCK;
+	case 1235: return (enum yahoo_status) YAHOO_LOGIN_UNAME;
+	default: return (enum yahoo_status) code;
 	}
 }
@@ -1806,8 +1900,8 @@
 {
 	struct yahoo_https_auth_data *had = g_new0(struct yahoo_https_auth_data, 1);
-	
+
 	had->yid = yid;
 	had->chal = g_strdup(seed);
-	
+
 	yahoo_https_auth_token_init(had);
 }
@@ -1819,5 +1913,5 @@
 	char *login, *passwd, *chal;
 	char *url;
-	
+
 	login = g_strndup(yd->user, 3 * strlen(yd->user));
 	http_encode(login);
@@ -1826,10 +1920,10 @@
 	chal = g_strndup(had->chal, 3 * strlen(had->chal));
 	http_encode(chal);
-	
+
 	url = g_strdup_printf("https://login.yahoo.com/config/pwtoken_get?src=ymsgr&ts=%d&login=%s&passwd=%s&chal=%s",
-	                       (int) time(NULL), login, passwd, chal);
-	
+	                      (int) time(NULL), login, passwd, chal);
+
 	http_dorequest_url(url, yahoo_https_auth_token_finish, had);
-	
+
 	g_free(url);
 	g_free(chal);
@@ -1844,29 +1938,30 @@
 	struct yahoo_data *yd;
 	int st;
-	
-	if (y_list_find(inputs, had->yid) == NULL)
-		return;
-	
+
+	if (y_list_find(inputs, had->yid) == NULL) {
+		return;
+	}
+
 	yid = had->yid;
 	yd = yid->yd;
-	
+
 	if (req->status_code != 200) {
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id, 2000 + req->status_code, NULL);
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id, 2000 + req->status_code, NULL);
 		goto fail;
 	}
-	
+
 	if (sscanf(req->reply_body, "%d", &st) != 1 || st != 0) {
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id, yahoo_https_status_parse(st), NULL);
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id, yahoo_https_status_parse(st), NULL);
 		goto fail;
 	}
-	
+
 	if ((had->token = yahoo_ha_find_key(req->reply_body, "ymsgr")) == NULL) {
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id, 3001, NULL);
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id, 3001, NULL);
 		goto fail;
 	}
-	
+
 	yahoo_https_auth_init(had);
 	return;
-	
+
 fail:
 	g_free(had->token);
@@ -1878,10 +1973,10 @@
 {
 	char *url;
-	
+
 	url = g_strdup_printf("https://login.yahoo.com/config/pwtoken_login?src=ymsgr&ts=%d&token=%s",
 	                      (int) time(NULL), had->token);
-	
+
 	http_dorequest_url(url, yahoo_https_auth_finish, had);
-	
+
 	g_free(url);
 }
@@ -1895,36 +1990,37 @@
 	char *crumb = NULL;
 	int st;
-	
-	if (y_list_find(inputs, had->yid) == NULL)
-		return;
-	
+
+	if (y_list_find(inputs, had->yid) == NULL) {
+		return;
+	}
+
 	yid = had->yid;
 	yd = yid->yd;
-	
+
 	md5_byte_t result[16];
 	md5_state_t ctx;
-	
+
 	unsigned char yhash[32];
 
 	if (req->status_code != 200) {
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id, 2000 + req->status_code, NULL);
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id, 2000 + req->status_code, NULL);
 		goto fail;
 	}
-	
+
 	if (sscanf(req->reply_body, "%d", &st) != 1 || st != 0) {
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id, yahoo_https_status_parse(st), NULL);
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id, yahoo_https_status_parse(st), NULL);
 		goto fail;
 	}
-	
+
 	if ((yd->cookie_y = yahoo_ha_find_key(req->reply_body, "Y")) == NULL ||
 	    (yd->cookie_t = yahoo_ha_find_key(req->reply_body, "T")) == NULL ||
 	    (crumb = yahoo_ha_find_key(req->reply_body, "crumb")) == NULL) {
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id, 3002, NULL);
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id, 3002, NULL);
 		goto fail;
 	}
-	
-	md5_init(&ctx);  
-	md5_append(&ctx, (unsigned char*) crumb, 11);
-	md5_append(&ctx, (unsigned char*) had->chal, strlen(had->chal));
+
+	md5_init(&ctx);
+	md5_append(&ctx, (unsigned char *) crumb, 11);
+	md5_append(&ctx, (unsigned char *) had->chal, strlen(had->chal));
 	md5_finish(&ctx, result);
 	to_y64(yhash, result, 16);
@@ -1935,5 +2031,5 @@
 	yahoo_packet_hash(pack, 277, yd->cookie_y);
 	yahoo_packet_hash(pack, 278, yd->cookie_t);
-	yahoo_packet_hash(pack, 307, (char*) yhash);
+	yahoo_packet_hash(pack, 307, (char *) yhash);
 	yahoo_packet_hash(pack, 244, "524223");
 	yahoo_packet_hash(pack, 2, yd->user);
@@ -1941,9 +2037,9 @@
 	yahoo_packet_hash(pack, 98, "us");
 	yahoo_packet_hash(pack, 135, "7.5.0.647");
-	
+
 	yahoo_send_packet(yid, pack, 0);
-		
+
 	yahoo_packet_free(pack);
-	
+
 fail:
 	g_free(crumb);
@@ -1954,5 +2050,5 @@
 
 static void yahoo_process_auth(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                               struct yahoo_packet *pkt)
 {
 	char *seed = NULL;
@@ -1979,19 +2075,20 @@
 	}
 
-	if (!seed)
-		return;
-
-	if (m==2)
+	if (!seed) {
+		return;
+	}
+
+	if (m == 2) {
 		yahoo_https_auth(yid, seed, sn);
-	else {
+	} else {
 		/* call error */
 		WARNING(("unknown auth type %d", m));
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id,
-			YAHOO_LOGIN_UNKNOWN, NULL);
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id,
+		                                           YAHOO_LOGIN_UNKNOWN, NULL);
 	}
 }
 
 static void yahoo_process_auth_resp(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                    struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -2003,17 +2100,18 @@
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 0)
+		if (pair->key == 0) {
 			; /* login_id */
-		else if (pair->key == 1)
+		} else if (pair->key == 1) {
 			; /* handle */
-		else if (pair->key == 20)
+		} else if (pair->key == 20) {
 			url = pair->value;
-		else if (pair->key == 66)
+		} else if (pair->key == 66) {
 			login_status = atoi(pair->value);
+		}
 	}
 
 	if (pkt->status == YPACKET_STATUS_DISCONNECTED) {
-		YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id,
-			login_status, url);
+		YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id,
+		                                           login_status, url);
 		/*      yahoo_logoff(yd->client_id); */
 	}
@@ -2021,5 +2119,5 @@
 
 static void yahoo_process_mail(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                               struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -2032,14 +2130,15 @@
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 9)
+		if (pair->key == 9) {
 			count = strtol(pair->value, NULL, 10);
-		else if (pair->key == 43)
+		} else if (pair->key == 43) {
 			who = pair->value;
-		else if (pair->key == 42)
+		} else if (pair->key == 42) {
 			email = pair->value;
-		else if (pair->key == 18)
+		} else if (pair->key == 18) {
 			subj = pair->value;
-		else
+		} else {
 			LOG(("key: %d => value: %s", pair->key, pair->value));
+		}
 	}
 
@@ -2047,13 +2146,14 @@
 		char from[1024];
 		snprintf(from, sizeof(from), "%s (%s)", who, email);
-		YAHOO_CALLBACK(ext_yahoo_mail_notify) (yd->client_id, from,
-			subj, count);
-	} else if (count > 0)
-		YAHOO_CALLBACK(ext_yahoo_mail_notify) (yd->client_id, NULL,
-			NULL, count);
+		YAHOO_CALLBACK (ext_yahoo_mail_notify) (yd->client_id, from,
+		                                        subj, count);
+	} else if (count > 0) {
+		YAHOO_CALLBACK (ext_yahoo_mail_notify) (yd->client_id, NULL,
+		                                        NULL, count);
+	}
 }
 
 static void yahoo_process_new_contact(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                      struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -2067,24 +2167,26 @@
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 4)
+		if (pair->key == 4) {
 			who = pair->value;
-		else if (pair->key == 5)
+		} else if (pair->key == 5) {
 			me = pair->value;
-		else if (pair->key == 14)
+		} else if (pair->key == 14) {
 			msg = pair->value;
-		else if (pair->key == 13)
+		} else if (pair->key == 13) {
 			online = strtol(pair->value, NULL, 10);
-	}
-
-	if (who && online < 0)
-		YAHOO_CALLBACK(ext_yahoo_contact_added) (yd->client_id, me, who,
-			msg);
-	else if (online == 2)
-		YAHOO_CALLBACK(ext_yahoo_rejected) (yd->client_id, who, msg);
+		}
+	}
+
+	if (who && online < 0) {
+		YAHOO_CALLBACK (ext_yahoo_contact_added) (yd->client_id, me, who,
+		                                          msg);
+	} else if (online == 2) {
+		YAHOO_CALLBACK (ext_yahoo_rejected) (yd->client_id, who, msg);
+	}
 }
 
 /* UNUSED? */
 static void yahoo_process_contact(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                  struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -2102,39 +2204,41 @@
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 1)
+		if (pair->key == 1) {
 			id = pair->value;
-		else if (pair->key == 3)
+		} else if (pair->key == 3) {
 			who = pair->value;
-		else if (pair->key == 14)
+		} else if (pair->key == 14) {
 			msg = pair->value;
-		else if (pair->key == 7)
+		} else if (pair->key == 7) {
 			name = pair->value;
-		else if (pair->key == 10)
+		} else if (pair->key == 10) {
 			state = strtol(pair->value, NULL, 10);
-		else if (pair->key == 15)
+		} else if (pair->key == 15) {
 			; /* tm */
-		else if (pair->key == 13)
+		} else if (pair->key == 13) {
 			; /* online */
-		else if (pair->key == 47)
+		} else if (pair->key == 47) {
 			away = strtol(pair->value, NULL, 10);
-		else if (pair->key == 137)
+		} else if (pair->key == 137) {
 			idle = strtol(pair->value, NULL, 10);
-		else if (pair->key == 60)
+		} else if (pair->key == 60) {
 			mobile = strtol(pair->value, NULL, 10);
-
-	}
-
-	if (id)
-		YAHOO_CALLBACK(ext_yahoo_contact_added) (yd->client_id, id, who,
-			msg);
-	else if (name)
-		YAHOO_CALLBACK(ext_yahoo_status_changed) (yd->client_id, name,
-			state, msg, away, idle, mobile);
-	else if (pkt->status == 0x07)
-		YAHOO_CALLBACK(ext_yahoo_rejected) (yd->client_id, who, msg);
+		}
+
+	}
+
+	if (id) {
+		YAHOO_CALLBACK (ext_yahoo_contact_added) (yd->client_id, id, who,
+		                                          msg);
+	} else if (name) {
+		YAHOO_CALLBACK (ext_yahoo_status_changed) (yd->client_id, name,
+		                                           state, msg, away, idle, mobile);
+	} else if (pkt->status == 0x07) {
+		YAHOO_CALLBACK (ext_yahoo_rejected) (yd->client_id, who, msg);
+	}
 }
 
 static void yahoo_process_buddyadd(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                   struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -2146,20 +2250,27 @@
 
 	YList *l;
+
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 1)
+		if (pair->key == 1) {
 			; /* Me... don't care */
-		if (pair->key == 7)
+		}
+		if (pair->key == 7) {
 			who = pair->value;
-		if (pair->key == 65)
+		}
+		if (pair->key == 65) {
 			where = pair->value;
-		if (pair->key == 66)
+		}
+		if (pair->key == 66) {
 			status = strtol(pair->value, NULL, 10);
-	}
-
-	if (!who)
-		return;
-	if (!where)
+		}
+	}
+
+	if (!who) {
+		return;
+	}
+	if (!where) {
 		where = "Unknown";
+	}
 
 	bud = y_new0(struct yahoo_buddy, 1);
@@ -2181,12 +2292,12 @@
 	   accepted. Couldn't find any test account that doesn't require auth.
 	   unfortunately (if there is even such a thing?) */
-	   
-	/* A non-zero status (i've seen 2) seems to mean the buddy is already 
+
+	/* A non-zero status (i've seen 2) seems to mean the buddy is already
 	 * added and is online */
 	if (status) {
 		LOG(("Setting online see packet for info"));
 		yahoo_dump_unhandled(pkt);
-		YAHOO_CALLBACK(ext_yahoo_status_changed) (yd->client_id, who,
-			YAHOO_STATUS_AVAILABLE, NULL, 0, 0, 0);
+		YAHOO_CALLBACK (ext_yahoo_status_changed) (yd->client_id, who,
+		                                           YAHOO_STATUS_AVAILABLE, NULL, 0, 0, 0);
 	}
 #endif
@@ -2194,5 +2305,5 @@
 	if (status == 0) {
 		YList *tmp = y_list_append(NULL, bud);
-		YAHOO_CALLBACK(ext_yahoo_got_buddies) (yd->client_id, tmp);
+		YAHOO_CALLBACK (ext_yahoo_got_buddies) (yd->client_id, tmp);
 		y_list_free(tmp);
 	}
@@ -2200,5 +2311,5 @@
 
 static void yahoo_process_buddydel(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                   struct yahoo_packet *pkt)
 {
 	struct yahoo_data *yd = yid->yd;
@@ -2210,21 +2321,24 @@
 
 	YList *l;
+
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 1)
+		if (pair->key == 1) {
 			; /* Me... don't care */
-		else if (pair->key == 7)
+		} else if (pair->key == 7) {
 			who = pair->value;
-		else if (pair->key == 65)
+		} else if (pair->key == 65) {
 			where = pair->value;
-		else if (pair->key == 66)
+		} else if (pair->key == 66) {
 			; /* unk_66 */
-		else
+		} else {
 			DEBUG_MSG(("unknown key: %d = %s", pair->key,
-					pair->value));
-	}
-
-	if (!who || !where)
-		return;
+			           pair->value));
+		}
+	}
+
+	if (!who || !where) {
+		return;
+	}
 
 	bud = y_new0(struct yahoo_buddy, 1);
@@ -2253,17 +2367,22 @@
 
 static void yahoo_process_ignore(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                 struct yahoo_packet *pkt)
 {
 	YList *l;
+
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 0)
+		if (pair->key == 0) {
 			; /* who */
-		if (pair->key == 1)
+		}
+		if (pair->key == 1) {
 			; /* Me... don't care */
-		if (pair->key == 13)	/* 1 == ignore, 2 == unignore */
+		}
+		if (pair->key == 13) {  /* 1 == ignore, 2 == unignore */
 			;
-		if (pair->key == 66)
+		}
+		if (pair->key == 66) {
 			; /* status */
+		}
 	}
 
@@ -2277,10 +2396,10 @@
 
 /*	if(status)
-		YAHOO_CALLBACK(ext_yahoo_error)(yd->client_id, who, 0, status);
+                YAHOO_CALLBACK(ext_yahoo_error)(yd->client_id, who, 0, status);
 */
 }
 
 static void yahoo_process_voicechat(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                    struct yahoo_packet *pkt)
 {
 	char *who = NULL;
@@ -2289,19 +2408,24 @@
 
 	YList *l;
+
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 4)
+		if (pair->key == 4) {
 			who = pair->value;
-		if (pair->key == 5)
+		}
+		if (pair->key == 5) {
 			me = pair->value;
-		if (pair->key == 13)
+		}
+		if (pair->key == 13) {
 			; /* voice room */
-		if (pair->key == 57)
+		}
+		if (pair->key == 57) {
 			room = pair->value;
+		}
 	}
 
 	NOTICE(("got voice chat invite from %s in %s to identity %s", who, room,
-			me));
-	/* 
+	        me));
+	/*
 	 * send: s:0 1:me 5:who 57:room 13:1
 	 * ????  s:4 5:who 10:99 19:-1615114531
@@ -2315,21 +2439,23 @@
 
 static void yahoo_process_ping(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                               struct yahoo_packet *pkt)
 {
 	char *errormsg = NULL;
 
 	YList *l;
+
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 16)
+		if (pair->key == 16) {
 			errormsg = pair->value;
+		}
 	}
 
 	NOTICE(("got ping packet"));
-	YAHOO_CALLBACK(ext_yahoo_got_ping) (yid->yd->client_id, errormsg);
+	YAHOO_CALLBACK (ext_yahoo_got_ping) (yid->yd->client_id, errormsg);
 }
 
 static void yahoo_process_buddy_change_group(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                             struct yahoo_packet *pkt)
 {
 	YList *l;
@@ -2341,16 +2467,20 @@
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 1)
+		if (pair->key == 1) {
 			me = pair->value;
-		if (pair->key == 7)
+		}
+		if (pair->key == 7) {
 			who = pair->value;
-		if (pair->key == 224)
+		}
+		if (pair->key == 224) {
 			old_group = pair->value;
-		if (pair->key == 264)
+		}
+		if (pair->key == 264) {
 			new_group = pair->value;
-	}
-
-	YAHOO_CALLBACK(ext_yahoo_got_buddy_change_group) (yid->yd->client_id,
-		me, who, old_group, new_group);
+		}
+	}
+
+	YAHOO_CALLBACK (ext_yahoo_got_buddy_change_group) (yid->yd->client_id,
+	                                                   me, who, old_group, new_group);
 }
 
@@ -2376,8 +2506,9 @@
 
 	/* send initial packet */
-	if (who)
+	if (who) {
 		data = strdup("<RVWCFG>");
-	else
+	} else {
 		data = strdup("<RUPCFG>");
+	}
 	yahoo_add_to_send_queue(yid, data, strlen(data));
 	FREE(data);
@@ -2404,10 +2535,10 @@
 
 	yid->read_tag =
-		YAHOO_CALLBACK(ext_yahoo_add_handler) (yid->yd->client_id, fd,
-		YAHOO_INPUT_READ, yid);
+	        YAHOO_CALLBACK (ext_yahoo_add_handler) (yid->yd->client_id, fd,
+	                                                YAHOO_INPUT_READ, yid);
 }
 
 static void yahoo_webcam_get_server(struct yahoo_input_data *y, char *who,
-	char *key)
+                                    char *key)
 {
 	struct yahoo_input_data *yid = y_new0(struct yahoo_input_data, 1);
@@ -2421,7 +2552,7 @@
 	yid->wcm->key = strdup(key);
 
-	YAHOO_CALLBACK(ext_yahoo_connect_async) (yid->yd->client_id,
-		yss->webcam_host, yss->webcam_port,
-		_yahoo_webcam_get_server_connected, yid, 0);
+	YAHOO_CALLBACK (ext_yahoo_connect_async) (yid->yd->client_id,
+	                                          yss->webcam_host, yss->webcam_port,
+	                                          _yahoo_webcam_get_server_connected, yid, 0);
 
 }
@@ -2429,5 +2560,5 @@
 static YList *webcam_queue = NULL;
 static void yahoo_process_webcam_key(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                     struct yahoo_packet *pkt)
 {
 	char *key = NULL;
@@ -2435,16 +2566,20 @@
 
 	YList *l;
+
 	yahoo_dump_unhandled(pkt);
 	for (l = pkt->hash; l; l = l->next) {
 		struct yahoo_pair *pair = l->data;
-		if (pair->key == 5)
+		if (pair->key == 5) {
 			; /* me */
-		if (pair->key == 61)
+		}
+		if (pair->key == 61) {
 			key = pair->value;
+		}
 	}
 
 	l = webcam_queue;
-	if (!l)
-		return;
+	if (!l) {
+		return;
+	}
 	who = l->data;
 	webcam_queue = y_list_remove_link(webcam_queue, webcam_queue);
@@ -2455,5 +2590,5 @@
 
 static void yahoo_packet_process(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                 struct yahoo_packet *pkt)
 {
 	DEBUG_MSG(("yahoo_packet_process: 0x%02x", pkt->service));
@@ -2577,5 +2712,5 @@
 		yahoo_process_picture_upload(yid, pkt);
 		break;
-	case YAHOO_SERVICE_Y8_LIST:	/* Buddy List */
+	case YAHOO_SERVICE_Y8_LIST:     /* Buddy List */
 		yahoo_process_buddy_list(yid, pkt);
 		break;
@@ -2594,6 +2729,7 @@
 	int pktlen;
 
-	if (!yd)
+	if (!yd) {
 		return NULL;
+	}
 
 	DEBUG_MSG(("rxlen is %d", yid->rxlen));
@@ -2603,5 +2739,5 @@
 	}
 
-	pos += 4;		/* YMSG */
+	pos += 4;               /* YMSG */
 	pos += 2;
 	pos += 2;
@@ -2626,5 +2762,5 @@
 	pos += 4;
 	DEBUG_MSG(("Yahoo Service: 0x%02x Status: %d", pkt->service,
-			pkt->status));
+	           pkt->status));
 	pkt->id = yahoo_get32(yid->rxqueue + pos);
 	pos += 4;
@@ -2638,9 +2774,9 @@
 	if (yid->rxlen > 0) {
 		unsigned char *tmp = y_memdup(yid->rxqueue + YAHOO_PACKET_HDRLEN
-			+ pktlen, yid->rxlen);
+		                              + pktlen, yid->rxlen);
 		FREE(yid->rxqueue);
 		yid->rxqueue = tmp;
 		DEBUG_MSG(("new rxlen == %d, rxqueue == %p", yid->rxlen,
-				yid->rxqueue));
+		           yid->rxqueue));
 	} else {
 		DEBUG_MSG(("freed rxqueue == %p", yid->rxqueue));
@@ -2655,5 +2791,5 @@
 {
 	char *st, *en;
-	char *data = (char *)d;
+	char *data = (char *) d;
 	struct yab *yab = NULL;
 
@@ -2671,6 +2807,7 @@
 	}
 
-	if (!en)
+	if (!en) {
 		return NULL;
+	}
 
 	st = strstr(en, "id=\"");
@@ -2755,29 +2892,35 @@
 	struct yahoo_data *yd = yid->yd;
 
-	if (!yd)
+	if (!yd) {
 		return NULL;
+	}
 
 	do {
 		DEBUG_MSG(("rxlen is %d", yid->rxlen));
 
-		if (yid->rxlen <= strlen("<ct"))
+		if (yid->rxlen <= strlen("<ct")) {
 			return NULL;
+		}
 
 		/* start with <ct */
 		while (pos < yid->rxlen - strlen("<ct") + 1
-			&& memcmp(yid->rxqueue + pos, "<ct", strlen("<ct")))
+		       && memcmp(yid->rxqueue + pos, "<ct", strlen("<ct"))) {
 			pos++;
-
-		if (pos >= yid->rxlen - 1)
+		}
+
+		if (pos >= yid->rxlen - 1) {
 			return NULL;
+		}
 
 		end = pos + 2;
 		/* end with > */
 		while (end < yid->rxlen - strlen(">")
-			&& memcmp(yid->rxqueue + end, ">", strlen(">")))
+		       && memcmp(yid->rxqueue + end, ">", strlen(">"))) {
 			end++;
-
-		if (end >= yid->rxlen - 1)
+		}
+
+		if (end >= yid->rxlen - 1) {
 			return NULL;
+		}
 
 		yab = yahoo_yab_read(yid->rxqueue + pos, end + 2 - pos);
@@ -2785,12 +2928,12 @@
 		yid->rxlen -= end + 1;
 		DEBUG_MSG(("rxlen == %d, rxqueue == %p", yid->rxlen,
-				yid->rxqueue));
+		           yid->rxqueue));
 		if (yid->rxlen > 0) {
 			unsigned char *tmp =
-				y_memdup(yid->rxqueue + end + 1, yid->rxlen);
+			        y_memdup(yid->rxqueue + end + 1, yid->rxlen);
 			FREE(yid->rxqueue);
 			yid->rxqueue = tmp;
 			DEBUG_MSG(("new rxlen == %d, rxqueue == %p", yid->rxlen,
-					yid->rxqueue));
+			           yid->rxqueue));
 		} else {
 			DEBUG_MSG(("freed rxqueue == %p", yid->rxqueue));
@@ -2812,12 +2955,14 @@
 	struct yahoo_data *yd = yid->yd;
 
-	if (!yid || !yd)
+	if (!yid || !yd) {
 		return NULL;
+	}
 
 	DEBUG_MSG(("rxlen is %d", yid->rxlen));
 
 	len = yid->rxqueue[pos++];
-	if (yid->rxlen < len)
+	if (yid->rxlen < len) {
 		return NULL;
+	}
 
 	/* extract status (0 = ok, 6 = webcam not online) */
@@ -2825,10 +2970,10 @@
 
 	if (status == 0) {
-		pos += 2;	/* skip next 2 bytes */
+		pos += 2;       /* skip next 2 bytes */
 		server = y_memdup(yid->rxqueue + pos, 16);
 		pos += 16;
 	} else if (status == 6) {
-		YAHOO_CALLBACK(ext_yahoo_webcam_closed)
-			(yd->client_id, yid->wcm->user, 4);
+		YAHOO_CALLBACK (ext_yahoo_webcam_closed)
+		        (yd->client_id, yid->wcm->user, 4);
 	}
 
@@ -2842,5 +2987,5 @@
 		yid->rxqueue = tmp;
 		DEBUG_MSG(("new rxlen == %d, rxqueue == %p", yid->rxlen,
-				yid->rxqueue));
+		           yid->rxqueue));
 	} else {
 		DEBUG_MSG(("freed rxqueue == %p", yid->rxqueue));
@@ -2863,9 +3008,11 @@
 	struct yahoo_data *yd = yid->yd;
 
-	if (!yd)
+	if (!yd) {
 		return -1;
-
-	if (!yid->wcm || !yid->wcd || !yid->rxlen)
+	}
+
+	if (!yid->wcm || !yid->wcd || !yid->rxlen) {
 		return -1;
+	}
 
 	DEBUG_MSG(("rxlen is %d", yid->rxlen));
@@ -2876,6 +3023,7 @@
 		yid->wcd->packet_type = 0;
 
-		if (yid->rxlen < header_len)
+		if (yid->rxlen < header_len) {
 			return 0;
+		}
 
 		if (header_len >= 8) {
@@ -2899,6 +3047,7 @@
 	begin = pos;
 	pos += yid->wcd->to_read;
-	if (pos > yid->rxlen)
+	if (pos > yid->rxlen) {
 		pos = yid->rxlen;
+	}
 
 	/* if it is not an image then make sure we have the whole packet */
@@ -2913,5 +3062,5 @@
 
 	DEBUG_MSG(("packet type %.2X, data length %d", yid->wcd->packet_type,
-			yid->wcd->data_size));
+	           yid->wcd->data_size));
 
 	/* find out what kind of packet we got */
@@ -2920,13 +3069,15 @@
 		/* user requests to view webcam (uploading) */
 		if (yid->wcd->data_size &&
-			yid->wcm->direction == YAHOO_WEBCAM_UPLOAD) {
+		    yid->wcm->direction == YAHOO_WEBCAM_UPLOAD) {
 			end = begin;
-			while (end <= yid->rxlen && yid->rxqueue[end++] != 13) ;
+			while (end <= yid->rxlen && yid->rxqueue[end++] != 13) {
+				;
+			}
 			if (end > begin) {
 				who = y_memdup(yid->rxqueue + begin,
-					end - begin);
+				               end - begin);
 				who[end - begin - 1] = 0;
-				YAHOO_CALLBACK(ext_yahoo_webcam_viewer) (yd->
-					client_id, who + 2, 2);
+				YAHOO_CALLBACK (ext_yahoo_webcam_viewer) (yd->
+				                                          client_id, who + 2, 2);
 				FREE(who);
 			}
@@ -2938,56 +3089,57 @@
 			/* 1 = accepted viewing permission */
 			if (yid->wcd->timestamp == 0) {
-				YAHOO_CALLBACK(ext_yahoo_webcam_closed) (yd->
-					client_id, yid->wcm->user, 3);
+				YAHOO_CALLBACK (ext_yahoo_webcam_closed) (yd->
+				                                          client_id, yid->wcm->user, 3);
 			}
 		}
 		break;
-	case 0x01:		/* status packets?? */
+	case 0x01:              /* status packets?? */
 		/* timestamp contains status info */
 		/* 00 00 00 01 = we have data?? */
 		break;
-	case 0x02:		/* image data */
-		YAHOO_CALLBACK(ext_yahoo_got_webcam_image) (yd->client_id,
-			yid->wcm->user, yid->rxqueue + begin,
-			yid->wcd->data_size, pos - begin, yid->wcd->timestamp);
+	case 0x02:              /* image data */
+		YAHOO_CALLBACK (ext_yahoo_got_webcam_image) (yd->client_id,
+		                                             yid->wcm->user, yid->rxqueue + begin,
+		                                             yid->wcd->data_size, pos - begin, yid->wcd->timestamp);
 		break;
-	case 0x05:		/* response packets when uploading */
+	case 0x05:              /* response packets when uploading */
 		if (!yid->wcd->data_size) {
-			YAHOO_CALLBACK(ext_yahoo_webcam_data_request) (yd->
-				client_id, yid->wcd->timestamp);
+			YAHOO_CALLBACK (ext_yahoo_webcam_data_request) (yd->
+			                                                client_id, yid->wcd->timestamp);
 		}
 		break;
-	case 0x07:		/* connection is closing */
+	case 0x07:              /* connection is closing */
 		switch (reason) {
-		case 0x01:	/* user closed connection */
+		case 0x01:      /* user closed connection */
 			closed = 1;
 			break;
-		case 0x0F:	/* user cancelled permission */
+		case 0x0F:      /* user cancelled permission */
 			closed = 2;
 			break;
 		}
-		YAHOO_CALLBACK(ext_yahoo_webcam_closed) (yd->client_id,
-			yid->wcm->user, closed);
+		YAHOO_CALLBACK (ext_yahoo_webcam_closed) (yd->client_id,
+		                                          yid->wcm->user, closed);
 		break;
-	case 0x0C:		/* user connected */
-	case 0x0D:		/* user disconnected */
+	case 0x0C:              /* user connected */
+	case 0x0D:              /* user disconnected */
 		if (yid->wcd->data_size) {
 			who = y_memdup(yid->rxqueue + begin, pos - begin + 1);
 			who[pos - begin] = 0;
-			if (yid->wcd->packet_type == 0x0C)
+			if (yid->wcd->packet_type == 0x0C) {
 				connect = 1;
-			else
+			} else {
 				connect = 0;
-			YAHOO_CALLBACK(ext_yahoo_webcam_viewer) (yd->client_id,
-				who, connect);
+			}
+			YAHOO_CALLBACK (ext_yahoo_webcam_viewer) (yd->client_id,
+			                                          who, connect);
 			FREE(who);
 		}
 		break;
-	case 0x13:		/* user data */
+	case 0x13:              /* user data */
 		/* i=user_ip (ip of the user we are viewing) */
 		/* j=user_ext_ip (external ip of the user we */
 		/*                are viewing) */
 		break;
-	case 0x17:		/* ?? */
+	case 0x17:              /* ?? */
 		break;
 	}
@@ -3001,5 +3153,5 @@
 		yid->rxqueue = tmp;
 		DEBUG_MSG(("new rxlen == %d, rxqueue == %p", yid->rxlen,
-				yid->rxqueue));
+		           yid->rxqueue));
 	} else {
 		DEBUG_MSG(("freed rxqueue == %p", yid->rxqueue));
@@ -3008,6 +3160,7 @@
 
 	/* If we read a complete packet return success */
-	if (!yid->wcd->to_read)
+	if (!yid->wcd->to_read) {
 		return 1;
+	}
 
 	return 0;
@@ -3021,6 +3174,7 @@
 
 	LOG(("write callback: id=%d fd=%p data=%p", id, fd, data));
-	if (!yid || !yid->txqueues)
+	if (!yid || !yid->txqueues) {
 		return -2;
+	}
 
 	tx = yid->txqueues->data;
@@ -3028,6 +3182,7 @@
 	len = yahoo_send_data(fd, tx->queue, MIN(1024, tx->len));
 
-	if (len == -1 && errno == EAGAIN)
+	if (len == -1 && errno == EAGAIN) {
 		return 1;
+	}
 
 	if (len <= 0) {
@@ -3040,10 +3195,10 @@
 			free(tx);
 			yid->txqueues =
-				y_list_remove_link(yid->txqueues,
-				yid->txqueues);
+			        y_list_remove_link(yid->txqueues,
+			                           yid->txqueues);
 			y_list_free_1(l);
 		}
 		LOG(("yahoo_write_ready(%d, %p) len < 0", id, fd));
-		YAHOO_CALLBACK(ext_yahoo_remove_handler) (id, yid->write_tag);
+		YAHOO_CALLBACK (ext_yahoo_remove_handler) (id, yid->write_tag);
 		yid->write_tag = 0;
 		errno = e;
@@ -3062,14 +3217,14 @@
 		free(tx);
 		yid->txqueues =
-			y_list_remove_link(yid->txqueues, yid->txqueues);
+		        y_list_remove_link(yid->txqueues, yid->txqueues);
 		y_list_free_1(l);
 		/*
-		   if(!yid->txqueues) 
+		   if(!yid->txqueues)
 		   LOG(("yahoo_write_ready(%d, %d) !yxqueues", id, fd));
 		 */
 		if (!yid->txqueues) {
 			LOG(("yahoo_write_ready(%d, %p) !txqueues", id, fd));
-			YAHOO_CALLBACK(ext_yahoo_remove_handler) (id,
-				yid->write_tag);
+			YAHOO_CALLBACK (ext_yahoo_remove_handler) (id,
+			                                           yid->write_tag);
 			yid->write_tag = 0;
 		}
@@ -3080,5 +3235,5 @@
 
 static void yahoo_process_pager_connection(struct yahoo_input_data *yid,
-	int over)
+                                           int over)
 {
 	struct yahoo_packet *pkt;
@@ -3086,9 +3241,10 @@
 	int id = yd->client_id;
 
-	if (over)
-		return;
+	if (over) {
+		return;
+	}
 
 	while (find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER)
-		&& (pkt = yahoo_getdata(yid)) != NULL) {
+	       && (pkt = yahoo_getdata(yid)) != NULL) {
 
 		yahoo_packet_process(yid, pkt);
@@ -3099,12 +3255,13 @@
 
 static void yahoo_process_chatcat_connection(struct yahoo_input_data *yid,
-	int over)
-{
-	if (over)
-		return;
-
-	if (strstr((char *)yid->rxqueue + (yid->rxlen - 20), "</content>")) {
-		YAHOO_CALLBACK(ext_yahoo_chat_cat_xml) (yid->yd->client_id,
-			(char *)yid->rxqueue);
+                                             int over)
+{
+	if (over) {
+		return;
+	}
+
+	if (strstr((char *) yid->rxqueue + (yid->rxlen - 20), "</content>")) {
+		YAHOO_CALLBACK (ext_yahoo_chat_cat_xml) (yid->yd->client_id,
+		                                         (char *) yid->rxqueue);
 	}
 }
@@ -3122,11 +3279,13 @@
 	LOG(("Got data for YAB"));
 
-	if (over)
-		return;
+	if (over) {
+		return;
+	}
 
 	while (find_input_by_id_and_type(id, YAHOO_CONNECTION_YAB)
-		&& (yab = yahoo_getyab(yid)) != NULL) {
-		if (!yab->id)
+	       && (yab = yahoo_getyab(yid)) != NULL) {
+		if (!yab->id) {
 			continue;
+		}
 
 		changed = 1;
@@ -3141,12 +3300,12 @@
 				} else if (yab->fname && yab->lname) {
 					bud->real_name = y_new0(char,
-						strlen(yab->fname) +
-						strlen(yab->lname) + 2);
+					                        strlen(yab->fname) +
+					                        strlen(yab->lname) + 2);
 					sprintf(bud->real_name, "%s %s",
-						yab->fname, yab->lname);
+					        yab->fname, yab->lname);
 				} else if (yab->fname) {
 					bud->real_name = strdup(yab->fname);
 				}
-				break;	/* for */
+				break;  /* for */
 			}
 		}
@@ -3166,24 +3325,26 @@
 	}
 
-	if (changed)
-		YAHOO_CALLBACK(ext_yahoo_got_buddies) (yd->client_id,
-			yd->buddies);
+	if (changed) {
+		YAHOO_CALLBACK (ext_yahoo_got_buddies) (yd->client_id,
+		                                        yd->buddies);
+	}
 }
 #endif
 
 static void yahoo_process_search_connection(struct yahoo_input_data *yid,
-	int over)
+                                            int over)
 {
 	struct yahoo_found_contact *yct = NULL;
-	char *p = (char *)yid->rxqueue, *np, *cp;
+	char *p = (char *) yid->rxqueue, *np, *cp;
 	int k, n;
 	int start = 0, found = 0, total = 0;
 	YList *contacts = NULL;
 	struct yahoo_input_data *pyid =
-		find_input_by_id_and_type(yid->yd->client_id,
-		YAHOO_CONNECTION_PAGER);
-
-	if (!over || !pyid)
-		return;
+	        find_input_by_id_and_type(yid->yd->client_id,
+	                                  YAHOO_CONNECTION_PAGER);
+
+	if (!over || !pyid) {
+		return;
+	}
 
 	if (p && (p = strstr(p, "\r\n\r\n"))) {
@@ -3206,6 +3367,7 @@
 		}
 
-		if (p)
+		if (p) {
 			p++;
+		}
 
 		k = 0;
@@ -3214,6 +3376,7 @@
 			np = strchr(p, 4);
 
-			if (!np)
+			if (!np) {
 				break;
+			}
 			*np = 0;
 			p = np + 1;
@@ -3222,7 +3385,7 @@
 			case 1:
 				if (strlen(cp) > 2
-					&& y_list_length(contacts) < total) {
+				    && y_list_length(contacts) < total) {
 					yct = y_new0(struct yahoo_found_contact,
-						1);
+					             1);
 					contacts = y_list_append(contacts, yct);
 					yct->id = cp + 2;
@@ -3242,6 +3405,7 @@
 			case 5:
 				/* not worth the context switch for strcmp */
-				if (cp[0] != '\005' || cp[1] != '\000')
+				if (cp[0] != '\005' || cp[1] != '\000') {
 					yct->location = cp;
+				}
 				k = 0;
 				break;
@@ -3250,6 +3414,6 @@
 	}
 
-	YAHOO_CALLBACK(ext_yahoo_got_search_result) (yid->yd->client_id, found,
-		start, total, contacts);
+	YAHOO_CALLBACK (ext_yahoo_got_search_result) (yid->yd->client_id, found,
+	                                              start, total, contacts);
 
 	while (contacts) {
@@ -3357,6 +3521,6 @@
 
 	yid->read_tag =
-		YAHOO_CALLBACK(ext_yahoo_add_handler) (yid->yd->client_id,
-		yid->fd, YAHOO_INPUT_READ, yid);
+	        YAHOO_CALLBACK (ext_yahoo_add_handler) (yid->yd->client_id,
+	                                                yid->fd, YAHOO_INPUT_READ, yid);
 }
 
@@ -3366,6 +3530,7 @@
 	struct yahoo_input_data *yid;
 
-	if (!wcm || !wcm->server || !wcm->key)
-		return;
+	if (!wcm || !wcm->server || !wcm->key) {
+		return;
+	}
 
 	yid = y_new0(struct yahoo_input_data, 1);
@@ -3380,17 +3545,18 @@
 
 	LOG(("Connecting to: %s:%d", wcm->server, wcm->port));
-	YAHOO_CALLBACK(ext_yahoo_connect_async) (y->yd->client_id, wcm->server,
-		wcm->port, _yahoo_webcam_connected, yid, 0);
+	YAHOO_CALLBACK (ext_yahoo_connect_async) (y->yd->client_id, wcm->server,
+	                                          wcm->port, _yahoo_webcam_connected, yid, 0);
 
 }
 
 static void yahoo_process_webcam_master_connection(struct yahoo_input_data *yid,
-	int over)
+                                                   int over)
 {
 	char *server;
 	struct yahoo_server_settings *yss;
 
-	if (over)
-		return;
+	if (over) {
+		return;
+	}
 
 	server = yahoo_getwebcam_master(yid);
@@ -3402,6 +3568,7 @@
 		yid->wcm->conn_type = yss->conn_type;
 		yid->wcm->my_ip = strdup(yss->local_host);
-		if (yid->wcm->direction == YAHOO_WEBCAM_UPLOAD)
+		if (yid->wcm->direction == YAHOO_WEBCAM_UPLOAD) {
 			yid->wcm->description = strdup(yss->webcam_description);
+		}
 		yahoo_webcam_connect(yid);
 		FREE(server);
@@ -3410,25 +3577,29 @@
 
 static void yahoo_process_webcam_connection(struct yahoo_input_data *yid,
-	int over)
+                                            int over)
 {
 	int id = yid->yd->client_id;
 	void *fd = yid->fd;
 
-	if (over)
-		return;
+	if (over) {
+		return;
+	}
 
 	/* as long as we still have packets available keep processing them */
 	while (find_input_by_id_and_fd(id, fd)
-		&& yahoo_get_webcam_data(yid) == 1) ;
-}
-
-static void (*yahoo_process_connection[]) (struct yahoo_input_data *,
-	int over) = {
-yahoo_process_pager_connection, yahoo_process_ft_connection,
-		NULL, /*yahoo_process_yab_connection, */
-		yahoo_process_webcam_master_connection,
-		yahoo_process_webcam_connection,
-		yahoo_process_chatcat_connection,
-		yahoo_process_search_connection};
+	       && yahoo_get_webcam_data(yid) == 1) {
+		;
+	}
+}
+
+static void(*yahoo_process_connection[]) (struct yahoo_input_data *,
+                                          int over) = {
+	yahoo_process_pager_connection, yahoo_process_ft_connection,
+	NULL,         /*yahoo_process_yab_connection, */
+	yahoo_process_webcam_master_connection,
+	yahoo_process_webcam_connection,
+	yahoo_process_chatcat_connection,
+	yahoo_process_search_connection
+};
 
 int yahoo_read_ready(int id, void *fd, void *data)
@@ -3439,13 +3610,15 @@
 
 	LOG(("read callback: id=%d fd=%p data=%p", id, fd, data));
-	if (!yid)
+	if (!yid) {
 		return -2;
+	}
 
 	do {
-		len = YAHOO_CALLBACK(ext_yahoo_read) (fd, buf, sizeof(buf));
+		len = YAHOO_CALLBACK (ext_yahoo_read) (fd, buf, sizeof(buf));
 	} while (len == -1 && errno == EINTR);
 
-	if (len == -1 && (errno == EAGAIN || errno == EINTR))	/* we'll try again later */
+	if (len == -1 && (errno == EAGAIN || errno == EINTR)) { /* we'll try again later */
 		return 1;
+	}
 
 	if (len <= 0) {
@@ -3454,6 +3627,6 @@
 
 		if (yid->type == YAHOO_CONNECTION_PAGER) {
-			YAHOO_CALLBACK(ext_yahoo_login_response) (yid->yd->
-				client_id, YAHOO_LOGIN_SOCK, NULL);
+			YAHOO_CALLBACK (ext_yahoo_login_response) (yid->yd->
+			                                           client_id, YAHOO_LOGIN_SOCK, NULL);
 		}
 
@@ -3462,6 +3635,7 @@
 
 		/* no need to return an error, because we've already fixed it */
-		if (len == 0)
+		if (len == 0) {
 			return 1;
+		}
 
 		errno = e;
@@ -3471,5 +3645,5 @@
 
 	yid->rxqueue =
-		y_renew(unsigned char, yid->rxqueue, len + yid->rxlen + 1);
+	        y_renew(unsigned char, yid->rxqueue, len + yid->rxlen + 1);
 	memcpy(yid->rxqueue + yid->rxlen, buf, len);
 	yid->rxlen += len;
@@ -3488,6 +3662,7 @@
 	yd = y_new0(struct yahoo_data, 1);
 
-	if (!yd)
+	if (!yd) {
 		return 0;
+	}
 
 	yd->user = strdup(username);
@@ -3526,16 +3701,18 @@
 			char *host = yss->pager_host;
 
-			if (!host)
+			if (!host) {
 				host = yss->pager_host_list[ccd->server_i];
+			}
 
 			yss->pager_port = fallback_ports[ccd->i++];
-			tag = YAHOO_CALLBACK(ext_yahoo_connect_async) (yd->
-				client_id, host, yss->pager_port,
-				yahoo_connected, ccd, 0);
-
-			if (tag > 0)
+			tag = YAHOO_CALLBACK (ext_yahoo_connect_async) (yd->
+			                                                client_id, host, yss->pager_port,
+			                                                yahoo_connected, ccd, 0);
+
+			if (tag > 0) {
 				ccd->tag = tag;
+			}
 		} else if (yss->pager_host_list
-				&& yss->pager_host_list[ccd->server_i]) {
+		           && yss->pager_host_list[ccd->server_i]) {
 
 			/* Get back to the default port */
@@ -3545,11 +3722,12 @@
 
 			ccd->i = 0;
-			tag = YAHOO_CALLBACK(ext_yahoo_connect_async) (yd->client_id,
-				yss->pager_host_list[ccd->server_i], yss->pager_port,
-				yahoo_connected, ccd, 0);
+			tag = YAHOO_CALLBACK (ext_yahoo_connect_async) (yd->client_id,
+			                                                yss->pager_host_list[ccd->server_i],
+			                                                yss->pager_port,
+			                                                yahoo_connected, ccd, 0);
 		} else {
 			FREE(ccd);
-			YAHOO_CALLBACK(ext_yahoo_login_response) (yd->client_id,
-				YAHOO_LOGIN_SOCK, NULL);
+			YAHOO_CALLBACK (ext_yahoo_login_response) (yd->client_id,
+			                                           YAHOO_LOGIN_SOCK, NULL);
 		}
 		return;
@@ -3559,9 +3737,10 @@
 
 	/* fd == NULL && error == 0 means connect was cancelled */
-	if (!fd)
-		return;
+	if (!fd) {
+		return;
+	}
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_AUTH, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 	NOTICE(("Sending initial packet"));
 
@@ -3576,6 +3755,6 @@
 
 	yid->read_tag =
-		YAHOO_CALLBACK(ext_yahoo_add_handler) (yid->yd->client_id,
-		yid->fd, YAHOO_INPUT_READ, yid);
+	        YAHOO_CALLBACK (ext_yahoo_add_handler) (yid->yd->client_id,
+	                                                yid->fd, YAHOO_INPUT_READ, yid);
 }
 
@@ -3583,9 +3762,11 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
-	if (!yid)
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+
+	if (!yid) {
 		return 0;
-	else
+	} else {
 		return yid->fd;
+	}
 }
 
@@ -3598,32 +3779,35 @@
 
 void yahoo_send_im(int id, const char *from, const char *who, const char *what,
-	int utf8, int picture)
+                   int utf8, int picture)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_packet *pkt = NULL;
 	struct yahoo_data *yd;
 	char pic_str[10];
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_MESSAGE, (enum ypacket_status) YAHOO_STATUS_OFFLINE,
-		yd->session_id);
+	                       yd->session_id);
 
 	snprintf(pic_str, sizeof(pic_str), "%d", picture);
 
-	if (from && strcmp(from, yd->user))
+	if (from && strcmp(from, yd->user)) {
 		yahoo_packet_hash(pkt, 0, yd->user);
+	}
 	yahoo_packet_hash(pkt, 1, from ? from : yd->user);
 	yahoo_packet_hash(pkt, 5, who);
 	yahoo_packet_hash(pkt, 14, what);
 
-	if (utf8)
+	if (utf8) {
 		yahoo_packet_hash(pkt, 97, "1");
-
-	yahoo_packet_hash(pkt, 63, ";0");	/* imvironment name; or ;0 */
+	}
+
+	yahoo_packet_hash(pkt, 63, ";0");       /* imvironment name; or ;0 */
 	yahoo_packet_hash(pkt, 64, "0");
 	yahoo_packet_hash(pkt, 206, pic_str);
@@ -3637,13 +3821,15 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
-	if (!yid)
-		return;
+
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
 	pkt = yahoo_packet_new(YAHOO_SERVICE_NOTIFY, YPACKET_STATUS_NOTIFY,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 5, who);
@@ -3661,5 +3847,5 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
@@ -3667,6 +3853,7 @@
 	char s[4];
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
@@ -3678,5 +3865,5 @@
 	if (yd->current_status == YAHOO_STATUS_INVISIBLE) {
 		pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBLE_TOGGLE,
-			(enum ypacket_status) YAHOO_STATUS_AVAILABLE, 0);
+		                       (enum ypacket_status) YAHOO_STATUS_AVAILABLE, 0);
 		yahoo_packet_hash(pkt, 13, "2");
 		yahoo_send_packet(yid, pkt, 0);
@@ -3687,9 +3874,9 @@
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_STATUS_UPDATE,
-		yd->current_status, yd->session_id);
+	                       yd->current_status, yd->session_id);
 	snprintf(s, sizeof(s), "%d", yd->current_status);
 	yahoo_packet_hash(pkt, 10, s);
 	yahoo_packet_hash(pkt, 19, msg && state == YAHOO_STATUS_CUSTOM ? msg : "");
-	yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0");
+	yahoo_packet_hash(pkt, 47, (away == 2) ? "2" : (away) ? "1" : "0");
 	yahoo_send_packet(yid, pkt, 0);
 	yahoo_packet_free(pkt);
@@ -3697,5 +3884,5 @@
 	if (old_status == YAHOO_STATUS_INVISIBLE) {
 		pkt = yahoo_packet_new(YAHOO_SERVICE_Y6_VISIBLE_TOGGLE,
-			(enum ypacket_status) YAHOO_STATUS_AVAILABLE, 0);
+		                       (enum ypacket_status) YAHOO_STATUS_AVAILABLE, 0);
 		yahoo_packet_hash(pkt, 13, "1");
 		yahoo_send_packet(yid, pkt, 0);
@@ -3707,10 +3894,11 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
@@ -3722,5 +3910,5 @@
 		   connection reset will hopefully be clear enough. */
 		pkt = yahoo_packet_new(YAHOO_SERVICE_LOGOFF,
-			YPACKET_STATUS_DEFAULT, yd->session_id);
+		                       YPACKET_STATUS_DEFAULT, yd->session_id);
 		yd->current_status = -1;
 
@@ -3732,6 +3920,6 @@
 
 /*	do {
-		yahoo_input_close(yid);
-	} while((yid = find_input_by_id(id)));*/
+                yahoo_input_close(yid);
+        } while((yid = find_input_by_id(id)));*/
 
 }
@@ -3741,14 +3929,15 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_LIST, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 	yahoo_packet_hash(pkt, 1, yd->user);
 	if (pkt) {
@@ -3762,4 +3951,5 @@
 {
 	struct yahoo_input_data *yid = data;
+
 	if (fd == NULL || error) {
 		inputs = y_list_remove(inputs, yid);
@@ -3770,6 +3960,6 @@
 	yid->fd = fd;
 	yid->read_tag =
-		YAHOO_CALLBACK(ext_yahoo_add_handler) (yid->yd->client_id, fd,
-		YAHOO_INPUT_READ, yid);
+	        YAHOO_CALLBACK (ext_yahoo_add_handler) (yid->yd->client_id, fd,
+	                                                YAHOO_INPUT_READ, yid);
 }
 
@@ -3783,6 +3973,7 @@
 	char buff[2048];
 
-	if (!yd)
-		return;
+	if (!yd) {
+		return;
+	}
 
 	yid = y_new0(struct yahoo_input_data, 1);
@@ -3793,6 +3984,6 @@
 
 	snprintf(url, 1024,
-		"http://address.yahoo.com/yab/us?v=XM&prog=ymsgr&.intl=us"
-		"&diffs=1&t=0&tags=short&rt=0&prog-ver=8.1.0.249&useutf8=1&legenc=codepage-1252");
+	         "http://address.yahoo.com/yab/us?v=XM&prog=ymsgr&.intl=us"
+	         "&diffs=1&t=0&tags=short&rt=0&prog-ver=8.1.0.249&useutf8=1&legenc=codepage-1252");
 
 	snprintf(buff, sizeof(buff), "Y=%s; T=%s", yd->cookie_y, yd->cookie_t);
@@ -3801,5 +3992,5 @@
 
 	yahoo_http_get(yid->yd->client_id, url, buff, 0, 0,
-		_yahoo_http_connected, yid);
+	               _yahoo_http_connected, yid);
 }
 
@@ -3821,10 +4012,10 @@
 	}
 
-	YAHOO_CALLBACK(ext_yahoo_write) (fd, buff, strlen(buff));
+	YAHOO_CALLBACK (ext_yahoo_write) (fd, buff, strlen(buff));
 
 	yid->fd = fd;
 	yid->read_tag =
-		YAHOO_CALLBACK(ext_yahoo_add_handler) (yid->yd->client_id, fd,
-		YAHOO_INPUT_READ, yid);
+	        YAHOO_CALLBACK (ext_yahoo_add_handler) (yid->yd->client_id, fd,
+	                                                YAHOO_INPUT_READ, yid);
 
 	FREE(buff);
@@ -3843,6 +4034,7 @@
 	int size = 0;
 
-	if (!yd)
-		return;
+	if (!yd) {
+		return;
+	}
 
 	yid = y_new0(struct yahoo_input_data, 1);
@@ -3850,16 +4042,17 @@
 	yid->yd = yd;
 
-	if(yab->yid)
+	if (yab->yid) {
 		size = snprintf(post, sizeof(post), "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
-			"<ab k=\"%s\" cc=\"%d\">"
-			"<ct id=\"%d\" e=\"1\" yi=\"%s\" nn=\"%s\" />"
-			"</ab>", yd->user, 9, yab->yid,	/* Don't know why */
-			yab->id, yab->nname?yab->nname:"");
-	else
+		                "<ab k=\"%s\" cc=\"%d\">"
+		                "<ct id=\"%d\" e=\"1\" yi=\"%s\" nn=\"%s\" />"
+		                "</ab>", yd->user, 9, yab->yid, /* Don't know why */
+		                yab->id, yab->nname ? yab->nname : "");
+	} else {
 		size = snprintf(post, sizeof(post), "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
-			"<ab k=\"%s\" cc=\"%d\">"
-			"<ct a=\"1\" yi=\"%s\" nn=\"%s\" />"
-			"</ab>", yd->user, 1,	/* Don't know why */
-			yab->id, yab->nname?yab->nname:"");
+		                "<ab k=\"%s\" cc=\"%d\">"
+		                "<ct a=\"1\" yi=\"%s\" nn=\"%s\" />"
+		                "</ab>", yd->user, 1, /* Don't know why */
+		                yab->id, yab->nname ? yab->nname : "");
+	}
 
 	yad->yid = yid;
@@ -3867,5 +4060,5 @@
 
 	strcpy(url, "http://address.yahoo.com/yab/us?v=XM&prog=ymsgr&.intl=us"
-		"&sync=1&tags=short&noclear=1&useutf8=1&legenc=codepage-1252");
+	       "&sync=1&tags=short&noclear=1&useutf8=1&legenc=codepage-1252");
 
 	snprintf(buff, sizeof(buff), "Y=%s; T=%s", yd->cookie_y, yd->cookie_t);
@@ -3874,5 +4067,5 @@
 
 	yahoo_http_post(yid->yd->client_id, url, buff, size,
-		_yahoo_http_post_connected, yad);
+	                _yahoo_http_post_connected, yad);
 }
 
@@ -3880,14 +4073,15 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(active ? YAHOO_SERVICE_IDACT :
-		YAHOO_SERVICE_IDDEACT, YPACKET_STATUS_DEFAULT, yd->session_id);
+	                       YAHOO_SERVICE_IDDEACT, YPACKET_STATUS_DEFAULT, yd->session_id);
 	yahoo_packet_hash(pkt, 3, identity);
 	if (pkt) {
@@ -3900,14 +4094,15 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_USERSTAT, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 	if (pkt) {
 		yahoo_send_packet(yid, pkt, 0);
@@ -3920,13 +4115,15 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
-	if (!yid)
-		return;
+
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_PING, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 	yahoo_send_packet(yid, pkt, 0);
 	yahoo_packet_free(pkt);
@@ -3937,15 +4134,16 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATPING, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 	yahoo_send_packet(yid, pkt, 0);
 	yahoo_packet_free(pkt);
@@ -3954,24 +4152,27 @@
 
 void yahoo_add_buddy(int id, const char *who, const char *group,
-	const char *msg)
+                     const char *msg)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
-	if (!yd->logged_in)
-		return;
+	if (!yd->logged_in) {
+		return;
+	}
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_ADDBUDDY, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
-	if (msg != NULL)	/* add message/request "it's me add me" */
+	                       yd->session_id);
+	if (msg != NULL) {      /* add message/request "it's me add me" */
 		yahoo_packet_hash(pkt, 14, msg);
-	else
+	} else {
 		yahoo_packet_hash(pkt, 14, "");
+	}
 	yahoo_packet_hash(pkt, 65, group);
 	yahoo_packet_hash(pkt, 97, "1");
@@ -3990,14 +4191,15 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_REMBUDDY, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, yd->user);
@@ -4011,22 +4213,24 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
-	if (!yd->logged_in)
-		return;
+	if (!yd->logged_in) {
+		return;
+	}
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_Y7_AUTHORIZATION,
-		YPACKET_STATUS_DEFAULT, yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yd->session_id);
 	yahoo_packet_hash(pkt, 1, yd->user);
 	yahoo_packet_hash(pkt, 5, who);
-	if (reject)
+	if (reject) {
 		yahoo_packet_hash(pkt, 13, "2");
-	else {
+	} else {
 		yahoo_packet_hash(pkt, 241, "0");
 		yahoo_packet_hash(pkt, 13, "1");
@@ -4048,17 +4252,19 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
-	if (!yd->logged_in)
-		return;
+	if (!yd->logged_in) {
+		return;
+	}
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_IGNORECONTACT,
-		YPACKET_STATUS_DEFAULT, yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yd->session_id);
 	yahoo_packet_hash(pkt, 1, yd->user);
 	yahoo_packet_hash(pkt, 7, who);
@@ -4071,17 +4277,19 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
-	if (!yd->logged_in)
-		return;
+	if (!yd->logged_in) {
+		return;
+	}
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_STEALTH_PERM,
-		YPACKET_STATUS_DEFAULT, yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yd->session_id);
 	yahoo_packet_hash(pkt, 1, yd->user);
 	yahoo_packet_hash(pkt, 7, who);
@@ -4094,17 +4302,18 @@
 
 void yahoo_change_buddy_group(int id, const char *who, const char *old_group,
-	const char *new_group)
+                              const char *new_group)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_Y7_CHANGE_GROUP,
-		YPACKET_STATUS_DEFAULT, yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yd->session_id);
 	yahoo_packet_hash(pkt, 1, yd->user);
 	yahoo_packet_hash(pkt, 302, "240");
@@ -4124,14 +4333,15 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt = NULL;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_GROUPRENAME,
-		YPACKET_STATUS_DEFAULT, yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yd->session_id);
 	yahoo_packet_hash(pkt, 1, yd->user);
 	yahoo_packet_hash(pkt, 65, old_group);
@@ -4143,17 +4353,18 @@
 
 void yahoo_conference_addinvite(int id, const char *from, const char *who,
-	const char *room, const YList *members, const char *msg)
+                                const char *room, const YList *members, const char *msg)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFADDINVITE,
-		YPACKET_STATUS_DEFAULT, yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, (from ? from : yd->user));
@@ -4163,6 +4374,6 @@
 	yahoo_packet_hash(pkt, 13, "0");
 	for (; members; members = members->next) {
-		yahoo_packet_hash(pkt, 52, (char *)members->data);
-		yahoo_packet_hash(pkt, 53, (char *)members->data);
+		yahoo_packet_hash(pkt, 52, (char *) members->data);
+		yahoo_packet_hash(pkt, 53, (char *) members->data);
 	}
 	/* 52, 53 -> other members? */
@@ -4175,22 +4386,23 @@
 
 void yahoo_conference_invite(int id, const char *from, YList *who,
-	const char *room, const char *msg)
+                             const char *room, const char *msg)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFINVITE, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, (from ? from : yd->user));
 	yahoo_packet_hash(pkt, 50, yd->user);
 	for (; who; who = who->next) {
-		yahoo_packet_hash(pkt, 52, (char *)who->data);
+		yahoo_packet_hash(pkt, 52, (char *) who->data);
 	}
 	yahoo_packet_hash(pkt, 57, room);
@@ -4204,23 +4416,25 @@
 
 void yahoo_conference_logon(int id, const char *from, YList *who,
-	const char *room)
+                            const char *room)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFLOGON, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, (from ? from : yd->user));
 	yahoo_packet_hash(pkt, 3, (from ? from : yd->user));
 	yahoo_packet_hash(pkt, 57, room);
-	for (; who; who = who->next)
-		yahoo_packet_hash(pkt, 3, (char *)who->data);
+	for (; who; who = who->next) {
+		yahoo_packet_hash(pkt, 3, (char *) who->data);
+	}
 
 	yahoo_send_packet(yid, pkt, 0);
@@ -4230,22 +4444,24 @@
 
 void yahoo_conference_decline(int id, const char *from, YList *who,
-	const char *room, const char *msg)
+                              const char *room, const char *msg)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFDECLINE,
-		YPACKET_STATUS_DEFAULT, yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, (from ? from : yd->user));
 	yahoo_packet_hash(pkt, 3, (from ? from : yd->user));
-	for (; who; who = who->next)
-		yahoo_packet_hash(pkt, 3, (char *)who->data);
+	for (; who; who = who->next) {
+		yahoo_packet_hash(pkt, 3, (char *) who->data);
+	}
 	yahoo_packet_hash(pkt, 57, room);
 	yahoo_packet_hash(pkt, 14, msg);
@@ -4257,22 +4473,24 @@
 
 void yahoo_conference_logoff(int id, const char *from, YList *who,
-	const char *room)
+                             const char *room)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFLOGOFF, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, (from ? from : yd->user));
 	yahoo_packet_hash(pkt, 3, (from ? from : yd->user));
-	for (; who; who = who->next)
-		yahoo_packet_hash(pkt, 3, (char *)who->data);
+	for (; who; who = who->next) {
+		yahoo_packet_hash(pkt, 3, (char *) who->data);
+	}
 
 	yahoo_packet_hash(pkt, 57, room);
@@ -4284,28 +4502,31 @@
 
 void yahoo_conference_message(int id, const char *from, YList *who,
-	const char *room, const char *msg, int utf8)
+                              const char *room, const char *msg, int utf8)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CONFMSG, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, (from ? from : yd->user));
 	yahoo_packet_hash(pkt, 53, (from ? from : yd->user));
-	for (; who; who = who->next)
-		yahoo_packet_hash(pkt, 53, (char *)who->data);
+	for (; who; who = who->next) {
+		yahoo_packet_hash(pkt, 53, (char *) who->data);
+	}
 
 	yahoo_packet_hash(pkt, 57, room);
 	yahoo_packet_hash(pkt, 14, msg);
 
-	if (utf8)
+	if (utf8) {
 		yahoo_packet_hash(pkt, 97, "1");
+	}
 
 	yahoo_send_packet(yid, pkt, 0);
@@ -4322,6 +4543,7 @@
 	char buff[1024];
 
-	if (!yd)
-		return;
+	if (!yd) {
+		return;
+	}
 
 	yid = y_new0(struct yahoo_input_data, 1);
@@ -4331,9 +4553,9 @@
 	if (chatroomid == 0) {
 		snprintf(url, 1024,
-			"http://insider.msg.yahoo.com/ycontent/?chatcat=0");
+		         "http://insider.msg.yahoo.com/ycontent/?chatcat=0");
 	} else {
 		snprintf(url, 1024,
-			"http://insider.msg.yahoo.com/ycontent/?chatroom_%d=0",
-			chatroomid);
+		         "http://insider.msg.yahoo.com/ycontent/?chatroom_%d=0",
+		         chatroomid);
 	}
 
@@ -4343,22 +4565,23 @@
 
 	yahoo_http_get(yid->yd->client_id, url, buff, 0, 0,
-		_yahoo_http_connected, yid);
+	               _yahoo_http_connected, yid);
 }
 
 void yahoo_chat_logon(int id, const char *from, const char *room,
-	const char *roomid)
+                      const char *roomid)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATONLINE, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, (from ? from : yd->user));
@@ -4371,10 +4594,10 @@
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATJOIN, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, (from ? from : yd->user));
 	yahoo_packet_hash(pkt, 104, room);
 	yahoo_packet_hash(pkt, 129, roomid);
-	yahoo_packet_hash(pkt, 62, "2");	/* ??? */
+	yahoo_packet_hash(pkt, 62, "2");        /* ??? */
 
 	yahoo_send_packet(yid, pkt, 0);
@@ -4384,19 +4607,20 @@
 
 void yahoo_chat_message(int id, const char *from, const char *room,
-	const char *msg, const int msgtype, const int utf8)
+                        const char *msg, const int msgtype, const int utf8)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 	char buf[2];
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_COMMENT, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, (from ? from : yd->user));
@@ -4407,6 +4631,7 @@
 	yahoo_packet_hash(pkt, 124, buf);
 
-	if (utf8)
+	if (utf8) {
 		yahoo_packet_hash(pkt, 97, "1");
+	}
 
 	yahoo_send_packet(yid, pkt, 0);
@@ -4418,15 +4643,16 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_CHATLOGOUT, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, (from ? from : yd->user));
@@ -4440,15 +4666,16 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE, YPACKET_STATUS_DEFAULT,
-		0);
+	                       0);
 	yahoo_packet_hash(pkt, 4, yd->user);
 	yahoo_packet_hash(pkt, 5, who);
@@ -4460,14 +4687,15 @@
 
 void yahoo_send_picture_info(int id, const char *who, const char *url,
-	int checksum)
+                             int checksum)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 	char checksum_str[10];
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
@@ -4476,5 +4704,5 @@
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE, YPACKET_STATUS_DEFAULT,
-		0);
+	                       0);
 	yahoo_packet_hash(pkt, 1, yd->user);
 	yahoo_packet_hash(pkt, 4, yd->user);
@@ -4491,11 +4719,12 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 	char type_str[10];
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
@@ -4504,5 +4733,5 @@
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE_UPDATE,
-		YPACKET_STATUS_DEFAULT, 0);
+	                       YPACKET_STATUS_DEFAULT, 0);
 	yahoo_packet_hash(pkt, 1, yd->user);
 	yahoo_packet_hash(pkt, 5, who);
@@ -4516,11 +4745,12 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 	char checksum_str[10];
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	yd = yid->yd;
@@ -4529,8 +4759,9 @@
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_PICTURE_CHECKSUM,
-		YPACKET_STATUS_DEFAULT, 0);
+	                       YPACKET_STATUS_DEFAULT, 0);
 	yahoo_packet_hash(pkt, 1, yd->user);
-	if (who != 0)
+	if (who != 0) {
 		yahoo_packet_hash(pkt, 5, who);
+	}
 	yahoo_packet_hash(pkt, 192, checksum_str);
 	yahoo_packet_hash(pkt, 212, "1");
@@ -4543,8 +4774,9 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_webcam_user(id, who);
-
-	if (yid)
+	        find_input_by_id_and_webcam_user(id, who);
+
+	if (yid) {
 		yahoo_input_close(yid);
+	}
 }
 
@@ -4552,15 +4784,16 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_data *yd;
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
-
-	/* 
+	if (!yid) {
+		return;
+	}
+
+	/*
 	 * add the user to the queue.  this is a dirty hack, since
 	 * the yahoo server doesn't tell us who's key it's returning,
-	 * we have to just hope that it sends back keys in the same 
+	 * we have to just hope that it sends back keys in the same
 	 * order that we request them.
 	 * The queue is popped in yahoo_process_webcam_key
@@ -4571,9 +4804,10 @@
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_WEBCAM, YPACKET_STATUS_DEFAULT,
-		yd->session_id);
+	                       yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, yd->user);
-	if (who != NULL)
+	if (who != NULL) {
 		yahoo_packet_hash(pkt, 5, who);
+	}
 	yahoo_send_packet(yid, pkt, 0);
 
@@ -4582,14 +4816,15 @@
 
 void yahoo_webcam_send_image(int id, unsigned char *image, unsigned int length,
-	unsigned int timestamp)
+                             unsigned int timestamp)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_WEBCAM);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_WEBCAM);
 	unsigned char *packet;
 	unsigned char header_len = 13;
 	unsigned int pos = 0;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	packet = y_new0(unsigned char, header_len);
@@ -4597,14 +4832,15 @@
 	packet[pos++] = header_len;
 	packet[pos++] = 0;
-	packet[pos++] = 5;	/* version byte?? */
+	packet[pos++] = 5;      /* version byte?? */
 	packet[pos++] = 0;
 	pos += yahoo_put32(packet + pos, length);
-	packet[pos++] = 2;	/* packet type, image */
+	packet[pos++] = 2;      /* packet type, image */
 	pos += yahoo_put32(packet + pos, timestamp);
 	yahoo_add_to_send_queue(yid, packet, header_len);
 	FREE(packet);
 
-	if (length)
+	if (length) {
 		yahoo_add_to_send_queue(yid, image, length);
+	}
 }
 
@@ -4612,5 +4848,5 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_WEBCAM);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_WEBCAM);
 	char *packet = NULL;
 	char *data = NULL;
@@ -4619,9 +4855,10 @@
 	unsigned int len = 0;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	data = strdup("u=");
-	data = y_string_append(data, (char *)who);
+	data = y_string_append(data, (char *) who);
 	data = y_string_append(data, "\r\n");
 	len = strlen(data);
@@ -4630,8 +4867,8 @@
 	packet[pos++] = header_len;
 	packet[pos++] = 0;
-	packet[pos++] = 5;	/* version byte?? */
+	packet[pos++] = 5;      /* version byte?? */
 	packet[pos++] = 0;
 	pos += yahoo_put32(packet + pos, len);
-	packet[pos++] = 0;	/* packet type */
+	packet[pos++] = 0;      /* packet type */
 	pos += yahoo_put32(packet + pos, accept);
 	memcpy(packet + pos, data, len);
@@ -4644,12 +4881,13 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_packet *pkt;
 
-	if (!yid)
-		return;
+	if (!yid) {
+		return;
+	}
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_NOTIFY, YPACKET_STATUS_NOTIFY,
-		yid->yd->session_id);
+	                       yid->yd->session_id);
 
 	yahoo_packet_hash(pkt, 49, "WEBCAMINVITE");
@@ -4664,5 +4902,5 @@
 
 static void yahoo_search_internal(int id, int t, const char *text, int g,
-	int ar, int photo, int yahoo_only, int startpos, int total)
+                                  int ar, int photo, int yahoo_only, int startpos, int total)
 {
 	struct yahoo_data *yd = find_conn_by_id(id);
@@ -4672,6 +4910,7 @@
 	char *ctext, *p;
 
-	if (!yd)
-		return;
+	if (!yd) {
+		return;
+	}
 
 	yid = y_new0(struct yahoo_input_data, 1);
@@ -4685,14 +4924,15 @@
 
 	snprintf(buff, sizeof(buff), "&.sq=%%20&.tt=%d&.ss=%d", total,
-		startpos);
+	         startpos);
 
 	ctext = strdup(text);
-	while ((p = strchr(ctext, ' ')))
+	while ((p = strchr(ctext, ' '))) {
 		*p = '+';
+	}
 
 	snprintf(url, 1024,
-		"http://members.yahoo.com/interests?.oc=m&.kw=%s&.sb=%d&.g=%d&.ar=0%s%s%s",
-		ctext, t, g, photo ? "&.p=y" : "", yahoo_only ? "&.pg=y" : "",
-		startpos ? buff : "");
+	         "http://members.yahoo.com/interests?.oc=m&.kw=%s&.sb=%d&.g=%d&.ar=0%s%s%s",
+	         ctext, t, g, photo ? "&.p=y" : "", yahoo_only ? "&.pg=y" : "",
+	         startpos ? buff : "");
 
 	FREE(ctext);
@@ -4702,20 +4942,22 @@
 	inputs = y_list_prepend(inputs, yid);
 	yahoo_http_get(yid->yd->client_id, url, buff, 0, 0,
-		_yahoo_http_connected, yid);
+	               _yahoo_http_connected, yid);
 }
 
 void yahoo_search(int id, enum yahoo_search_type t, const char *text,
-	enum yahoo_search_gender g, enum yahoo_search_agerange ar, int photo,
-	int yahoo_only)
+                  enum yahoo_search_gender g, enum yahoo_search_agerange ar, int photo,
+                  int yahoo_only)
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_search_state *yss;
 
-	if (!yid)
-		return;
-
-	if (!yid->ys)
+	if (!yid) {
+		return;
+	}
+
+	if (!yid->ys) {
 		yid->ys = y_new0(struct yahoo_search_state, 1);
+	}
 
 	yss = yid->ys;
@@ -4735,23 +4977,25 @@
 {
 	struct yahoo_input_data *yid =
-		find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
+	        find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	struct yahoo_search_state *yss;
 
-	if (!yid || !yid->ys)
-		return;
+	if (!yid || !yid->ys) {
+		return;
+	}
 
 	yss = yid->ys;
 
-	if (start == -1)
+	if (start == -1) {
 		start = yss->lsearch_nstart + yss->lsearch_nfound;
+	}
 
 	yahoo_search_internal(id, yss->lsearch_type, yss->lsearch_text,
-		yss->lsearch_gender, yss->lsearch_agerange,
-		yss->lsearch_photo, yss->lsearch_yahoo_only,
-		start, yss->lsearch_ntotal);
+	                      yss->lsearch_gender, yss->lsearch_agerange,
+	                      yss->lsearch_photo, yss->lsearch_yahoo_only,
+	                      start, yss->lsearch_ntotal);
 }
 
 void yahoo_send_picture(int id, const char *name, unsigned long size,
-	yahoo_get_fd_callback callback, void *data)
+                        yahoo_get_fd_callback callback, void *data)
 {
 	/* Not Implemented */
@@ -4796,17 +5040,19 @@
 	out[23] = '$';
 	out[22] = '$';
-	
+
 	for (i = 0; i < 22; i++) {
-		if(r == 0)
+		if (r == 0) {
 			r = rand();
-
-		c = r%61;
-
-		if(c<26)
+		}
+
+		c = r % 61;
+
+		if (c < 26) {
 			out[i] = c + 'a';
-		else if (c<52)
+		} else if (c < 52) {
 			out[i] = c - 26 + 'A';
-		else
+		} else {
 			out[i] = c - 52 + '0';
+		}
 
 		r /= 61;
@@ -4819,13 +5065,14 @@
 static int _are_same_id(const void *sfd1, const void *id)
 {
-	return strcmp(((struct send_file_data *)sfd1)->id, (char *)id);
+	return strcmp(((struct send_file_data *) sfd1)->id, (char *) id);
 }
 
 static int _are_same_yid(const void *sfd1, const void *yid)
 {
-	if(((struct send_file_data *)sfd1)->yid == yid)
+	if (((struct send_file_data *) sfd1)->yid == yid) {
 		return 0;
-	else
+	} else {
 		return 1;
+	}
 }
 
@@ -4833,9 +5080,10 @@
 {
 	YList *l = y_list_find_custom(active_file_transfers, id,
-		_are_same_id);
-
-	if(l)
-		return (struct send_file_data *)l->data;
-	
+	                              _are_same_id);
+
+	if (l) {
+		return (struct send_file_data *) l->data;
+	}
+
 	return NULL;
 }
@@ -4844,9 +5092,10 @@
 {
 	YList *l = y_list_find_custom(active_file_transfers, yid,
-		_are_same_yid);
-
-	if(l)
-		return (struct send_file_data *)l->data;
-	
+	                              _are_same_yid);
+
+	if (l) {
+		return (struct send_file_data *) l->data;
+	}
+
 	return NULL;
 }
@@ -4859,7 +5108,8 @@
 static void yahoo_remove_active_transfer(struct send_file_data *sfd)
 {
-	if (sfd == NULL)
-		return;
-	
+	if (sfd == NULL) {
+		return;
+	}
+
 	active_file_transfers = y_list_remove(active_file_transfers, sfd);
 	free(sfd->id);
@@ -4885,10 +5135,10 @@
 	yid->fd = fd;
 	yid->read_tag =
-		YAHOO_CALLBACK(ext_yahoo_add_handler) (yid->yd->client_id, fd,
-		YAHOO_INPUT_READ, yid);
+	        YAHOO_CALLBACK (ext_yahoo_add_handler) (yid->yd->client_id, fd,
+	                                                YAHOO_INPUT_READ, yid);
 }
 
 static void yahoo_file_transfer_upload(struct yahoo_data *yd,
-	struct send_file_data *sfd)
+                                       struct send_file_data *sfd)
 {
 	char url[256];
@@ -4909,12 +5159,12 @@
 	recv_enc = yahoo_urlencode(sfd->who);
 
-	snprintf(url, sizeof(url), 
-		"http://%s/relay?token=%s&sender=%s&recver=%s", sfd->ip_addr,
-		token_enc, sender_enc, recv_enc);
+	snprintf(url, sizeof(url),
+	         "http://%s/relay?token=%s&sender=%s&recver=%s", sfd->ip_addr,
+	         token_enc, sender_enc, recv_enc);
 
 	snprintf(buff, sizeof(buff), "T=%s; Y=%s", yd->cookie_t, yd->cookie_y);
 
 	yahoo_http_post(yd->client_id, url, buff, sfd->size,
-		_yahoo_ft_upload_connected, sfd);
+	                _yahoo_ft_upload_connected, sfd);
 
 	FREE(token_enc);
@@ -4924,5 +5174,5 @@
 
 static void yahoo_init_ft_recv(struct yahoo_data *yd,
-	struct send_file_data *sfd)
+                               struct send_file_data *sfd)
 {
 	char url[256];
@@ -4943,12 +5193,12 @@
 	recv_enc = yahoo_urlencode(yd->user);
 
-	snprintf(url, sizeof(url), 
-		"http://%s/relay?token=%s&sender=%s&recver=%s", sfd->ip_addr,
-		token_enc, sender_enc, recv_enc);
+	snprintf(url, sizeof(url),
+	         "http://%s/relay?token=%s&sender=%s&recver=%s", sfd->ip_addr,
+	         token_enc, sender_enc, recv_enc);
 
 	snprintf(buff, sizeof(buff), "Y=%s; T=%s", yd->cookie_y, yd->cookie_t);
 
 	yahoo_http_head(yid->yd->client_id, url, buff, 0, NULL,
-		_yahoo_http_connected, yid);
+	                _yahoo_http_connected, yid);
 
 	FREE(token_enc);
@@ -4958,10 +5208,10 @@
 
 static void yahoo_file_transfer_accept(struct yahoo_input_data *yid,
-	struct send_file_data *sfd)
+                                       struct send_file_data *sfd)
 {
 	struct yahoo_packet *pkt;
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_Y7_FILETRANSFERACCEPT,
-		YPACKET_STATUS_DEFAULT, yid->yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yid->yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, yid->yd->user);
@@ -4980,5 +5230,5 @@
 
 static void yahoo_process_filetransferaccept(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                             struct yahoo_packet *pkt)
 {
 	YList *l;
@@ -5016,9 +5266,8 @@
 
 		yahoo_file_transfer_upload(yid->yd, sfd);
-	}
-	else {
-		YAHOO_CALLBACK(ext_yahoo_file_transfer_done)
-			(yid->yd->client_id, YAHOO_FILE_TRANSFER_UNKNOWN,
-			sfd ? sfd->data : NULL);
+	} else {
+		YAHOO_CALLBACK (ext_yahoo_file_transfer_done)
+		        (yid->yd->client_id, YAHOO_FILE_TRANSFER_UNKNOWN,
+		        sfd ? sfd->data : NULL);
 
 		yahoo_remove_active_transfer(sfd);
@@ -5027,5 +5276,5 @@
 
 static void yahoo_process_filetransferinfo(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                           struct yahoo_packet *pkt)
 {
 	YList *l;
@@ -5070,9 +5319,8 @@
 
 		yahoo_file_transfer_accept(yid, sfd);
-	}
-	else {
-		YAHOO_CALLBACK(ext_yahoo_file_transfer_done)
-			(yid->yd->client_id, YAHOO_FILE_TRANSFER_UNKNOWN,
-			sfd ? sfd->data : NULL);
+	} else {
+		YAHOO_CALLBACK (ext_yahoo_file_transfer_done)
+		        (yid->yd->client_id, YAHOO_FILE_TRANSFER_UNKNOWN,
+		        sfd ? sfd->data : NULL);
 
 		yahoo_remove_active_transfer(sfd);
@@ -5081,5 +5329,5 @@
 
 static void yahoo_send_filetransferinfo(struct yahoo_data *yd,
-	struct send_file_data *sfd)
+                                        struct send_file_data *sfd)
 {
 	struct yahoo_input_data *yid;
@@ -5087,9 +5335,9 @@
 
 	yid = find_input_by_id_and_type(yd->client_id, YAHOO_CONNECTION_PAGER);
-	sfd->ip_addr = YAHOO_CALLBACK(ext_yahoo_get_ip_addr)("relay.yahoo.com");
+	sfd->ip_addr = YAHOO_CALLBACK (ext_yahoo_get_ip_addr)("relay.yahoo.com");
 
 	if (!sfd->ip_addr) {
-		YAHOO_CALLBACK(ext_yahoo_file_transfer_done)
-			(yd->client_id, YAHOO_FILE_TRANSFER_RELAY, sfd->data);
+		YAHOO_CALLBACK (ext_yahoo_file_transfer_done)
+		        (yd->client_id, YAHOO_FILE_TRANSFER_RELAY, sfd->data);
 
 		yahoo_remove_active_transfer(sfd);
@@ -5099,5 +5347,5 @@
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_Y7_FILETRANSFERINFO,
-		YPACKET_STATUS_DEFAULT, yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yd->session_id);
 
 	yahoo_packet_hash(pkt, 1, yd->user);
@@ -5114,5 +5362,5 @@
 
 static void yahoo_process_filetransfer(struct yahoo_input_data *yid,
-	struct yahoo_packet *pkt)
+                                       struct yahoo_packet *pkt)
 {
 	YList *l;
@@ -5167,5 +5415,5 @@
 		/* Received a FT request from buddy */
 		sfd = y_new0(struct send_file_data, 1);
-        
+
 		sfd->client_id = yd->client_id;
 		sfd->id = strdup(id);
@@ -5173,11 +5421,10 @@
 		sfd->filename = strdup(filename);
 		sfd->size = size;
-        
+
 		yahoo_add_active_transfer(sfd);
 
-		YAHOO_CALLBACK(ext_yahoo_got_file) (yd->client_id, yd->user,
-			who, msg, filename, size, sfd->id);
-	}
-	else {
+		YAHOO_CALLBACK (ext_yahoo_got_file) (yd->client_id, yd->user,
+		                                     who, msg, filename, size, sfd->id);
+	} else {
 		/* Response to our request */
 		sfd = yahoo_get_active_transfer(id);
@@ -5185,9 +5432,8 @@
 		if (sfd && action == YAHOO_FILE_TRANSFER_ACCEPT) {
 			yahoo_send_filetransferinfo(yd, sfd);
-		}
-		else if (!sfd || action == YAHOO_FILE_TRANSFER_REJECT) {
-			YAHOO_CALLBACK(ext_yahoo_file_transfer_done)
-				(yd->client_id, YAHOO_FILE_TRANSFER_REJECT,
-				sfd ? sfd->data : NULL);
+		} else if (!sfd || action == YAHOO_FILE_TRANSFER_REJECT) {
+			YAHOO_CALLBACK (ext_yahoo_file_transfer_done)
+			        (yd->client_id, YAHOO_FILE_TRANSFER_REJECT,
+			        sfd ? sfd->data : NULL);
 
 			yahoo_remove_active_transfer(sfd);
@@ -5198,6 +5444,6 @@
 #if 0
 void yahoo_send_file(int id, const char *who, const char *msg,
-	const char *name, unsigned long size,
-	yahoo_get_fd_callback callback, void *data)
+                     const char *name, unsigned long size,
+                     yahoo_get_fd_callback callback, void *data)
 {
 	struct yahoo_packet *pkt = NULL;
@@ -5206,5 +5452,5 @@
 	struct yahoo_data *yd;
 	struct send_file_data *sfd;
-	
+
 	yid = find_input_by_id_and_type(id, YAHOO_CONNECTION_PAGER);
 	yd = find_conn_by_id(id);
@@ -5221,9 +5467,10 @@
 	yahoo_add_active_transfer(sfd);
 
-	if (!yd)
-		return;
+	if (!yd) {
+		return;
+	}
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_Y7_FILETRANSFER,
-		YPACKET_STATUS_DEFAULT, yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yd->session_id);
 
 	snprintf(size_str, sizeof(size_str), "%ld", size);
@@ -5251,5 +5498,5 @@
 	char resp[2];
 	struct yahoo_input_data *yid;
-	
+
 	struct send_file_data *sfd = yahoo_get_active_transfer(id);
 
@@ -5259,5 +5506,5 @@
 
 	pkt = yahoo_packet_new(YAHOO_SERVICE_Y7_FILETRANSFER,
-		YPACKET_STATUS_DEFAULT, yid->yd->session_id);
+	                       YPACKET_STATUS_DEFAULT, yid->yd->session_id);
 
 	snprintf(resp, sizeof(resp), "%d", response);
@@ -5272,6 +5519,7 @@
 	yahoo_packet_free(pkt);
 
-	if(response == YAHOO_FILE_TRANSFER_REJECT)
+	if (response == YAHOO_FILE_TRANSFER_REJECT) {
 		yahoo_remove_active_transfer(sfd);
+	}
 }
 #endif
@@ -5281,5 +5529,5 @@
 	struct send_file_data *sfd;
 	struct yahoo_data *yd = yid->yd;
-	
+
 	sfd = yahoo_get_active_transfer_with_yid(yid);
 
@@ -5289,12 +5537,13 @@
 	}
 
-	/* 
+	/*
 	 * We want to handle only the complete data with HEAD since we don't
 	 * want a situation where both the GET and HEAD are active.
 	 * With SEND, we really can't do much with partial response
 	 */
-	if ((sfd->state == FT_STATE_HEAD || sfd->state == FT_STATE_SEND) 
-			&& !over)
-		return;
+	if ((sfd->state == FT_STATE_HEAD || sfd->state == FT_STATE_SEND)
+	    && !over) {
+		return;
+	}
 
 	if (sfd->state == FT_STATE_HEAD) {
@@ -5304,10 +5553,10 @@
 		char *sender_enc = NULL, *recv_enc = NULL, *token_enc = NULL;
 
-		struct yahoo_input_data *yid_ft = 
-			y_new0(struct yahoo_input_data, 1);
-        
+		struct yahoo_input_data *yid_ft =
+		        y_new0(struct yahoo_input_data, 1);
+
 		yid_ft->yd = yid->yd;
 		yid_ft->type = YAHOO_CONNECTION_FT;
-        
+
 		inputs = y_list_prepend(inputs, yid_ft);
 		sfd->yid = yid_ft;
@@ -5317,55 +5566,55 @@
 		sender_enc = yahoo_urlencode(sfd->who);
 		recv_enc = yahoo_urlencode(yd->user);
-        
-		snprintf(url, sizeof(url), 
-			"http://%s/relay?token=%s&sender=%s&recver=%s", sfd->ip_addr,
-			token_enc, sender_enc, recv_enc);
+
+		snprintf(url, sizeof(url),
+		         "http://%s/relay?token=%s&sender=%s&recver=%s", sfd->ip_addr,
+		         token_enc, sender_enc, recv_enc);
 
 		snprintf(buff, sizeof(buff), "Y=%s; T=%s", yd->cookie_y,
-			yd->cookie_t);
+		         yd->cookie_t);
 
 
 		yahoo_http_get(yd->client_id, url, buff, 1, 1,
-			_yahoo_http_connected, yid_ft);
+		               _yahoo_http_connected, yid_ft);
 
 		FREE(token_enc);
 		FREE(sender_enc);
 		FREE(recv_enc);
-	}
-	else if (sfd->state == FT_STATE_RECV || 
-		sfd->state == FT_STATE_RECV_START) {
+	} else if (sfd->state == FT_STATE_RECV ||
+	           sfd->state == FT_STATE_RECV_START) {
 
 		unsigned char *data_begin = NULL;
 
-		if (yid->rxlen == 0)
+		if (yid->rxlen == 0) {
 			yahoo_remove_active_transfer(sfd);
+		}
 
 		if (sfd->state != FT_STATE_RECV_START &&
-			(data_begin = 
-				(unsigned char *)strstr((char *)yid->rxqueue,
-				"\r\n\r\n"))) {
+		    (data_begin =
+		             (unsigned char *) strstr((char *) yid->rxqueue,
+		                                      "\r\n\r\n"))) {
 
 			sfd->state = FT_STATE_RECV_START;
 
-			yid->rxlen -= 4+(data_begin-yid->rxqueue)/sizeof(char);
+			yid->rxlen -= 4 + (data_begin - yid->rxqueue) / sizeof(char);
 			data_begin += 4;
 
-			if (yid->rxlen > 0)
-				YAHOO_CALLBACK(ext_yahoo_got_ft_data) 
-					(yd->client_id, data_begin,
-					yid->rxlen, sfd->data);
-		}
-		else if (sfd->state == FT_STATE_RECV_START)
-			YAHOO_CALLBACK(ext_yahoo_got_ft_data) (yd->client_id,
-				yid->rxqueue, yid->rxlen, sfd->data);
+			if (yid->rxlen > 0) {
+				YAHOO_CALLBACK (ext_yahoo_got_ft_data)
+				        (yd->client_id, data_begin,
+				        yid->rxlen, sfd->data);
+			}
+		} else if (sfd->state == FT_STATE_RECV_START) {
+			YAHOO_CALLBACK (ext_yahoo_got_ft_data) (yd->client_id,
+			                                        yid->rxqueue, yid->rxlen, sfd->data);
+		}
 
 		FREE(yid->rxqueue);
 		yid->rxqueue = NULL;
 		yid->rxlen = 0;
-	}
-	else if (sfd->state == FT_STATE_SEND) {
+	} else if (sfd->state == FT_STATE_SEND) {
 		/* Sent file completed */
 		int len = 0;
-		char *off = strstr((char *)yid->rxqueue, "Content-Length: ");
+		char *off = strstr((char *) yid->rxqueue, "Content-Length: ");
 
 		if (off) {
@@ -5374,12 +5623,13 @@
 		}
 
-		if (len < sfd->size)
-			YAHOO_CALLBACK(ext_yahoo_file_transfer_done)
-				(yd->client_id,
-				YAHOO_FILE_TRANSFER_FAILED, sfd->data);
-		else
-			YAHOO_CALLBACK(ext_yahoo_file_transfer_done)
-				(yd->client_id,
-				YAHOO_FILE_TRANSFER_DONE, sfd->data);
+		if (len < sfd->size) {
+			YAHOO_CALLBACK (ext_yahoo_file_transfer_done)
+			        (yd->client_id,
+			        YAHOO_FILE_TRANSFER_FAILED, sfd->data);
+		} else {
+			YAHOO_CALLBACK (ext_yahoo_file_transfer_done)
+			        (yd->client_id,
+			        YAHOO_FILE_TRANSFER_DONE, sfd->data);
+		}
 
 		yahoo_remove_active_transfer(sfd);
@@ -5393,6 +5643,8 @@
 {
 	struct yahoo_data *yd = find_conn_by_id(id);
-	if (!yd)
+
+	if (!yd) {
 		return YAHOO_STATUS_OFFLINE;
+	}
 	return yd->current_status;
 }
@@ -5401,6 +5653,8 @@
 {
 	struct yahoo_data *yd = find_conn_by_id(id);
-	if (!yd)
+
+	if (!yd) {
 		return NULL;
+	}
 	return yd->buddies;
 }
@@ -5409,6 +5663,8 @@
 {
 	struct yahoo_data *yd = find_conn_by_id(id);
-	if (!yd)
+
+	if (!yd) {
 		return NULL;
+	}
 	return yd->ignore;
 }
@@ -5417,6 +5673,8 @@
 {
 	struct yahoo_data *yd = find_conn_by_id(id);
-	if (!yd)
+
+	if (!yd) {
 		return NULL;
+	}
 	return yd->identities;
 }
@@ -5425,16 +5683,23 @@
 {
 	struct yahoo_data *yd = find_conn_by_id(id);
-	if (!yd)
+
+	if (!yd) {
 		return NULL;
-	if (!strncasecmp(which, "y", 1))
+	}
+	if (!strncasecmp(which, "y", 1)) {
 		return yd->cookie_y;
-	if (!strncasecmp(which, "b", 1))
+	}
+	if (!strncasecmp(which, "b", 1)) {
 		return yd->cookie_b;
-	if (!strncasecmp(which, "t", 1))
+	}
+	if (!strncasecmp(which, "t", 1)) {
 		return yd->cookie_t;
-	if (!strncasecmp(which, "c", 1))
+	}
+	if (!strncasecmp(which, "c", 1)) {
 		return yd->cookie_c;
-	if (!strncasecmp(which, "login", 5))
+	}
+	if (!strncasecmp(which, "login", 5)) {
 		return yd->login_cookie;
+	}
 	return NULL;
 }
Index: protocols/yahoo/yahoo.c
===================================================================
--- protocols/yahoo/yahoo.c	(revision 25c4c78e2ddad482dfc9d5a104f76325fcc2f8e5)
+++ protocols/yahoo/yahoo.c	(revision 9216eff1a59e9d4a24b63c16ba4c2cacd051332c)
@@ -35,12 +35,10 @@
 
 /* A hack to handle removal of buddies not in the group "Buddies" correctly */
-struct byahoo_buddygroups
-{
+struct byahoo_buddygroups {
 	char *buddy;
 	char *group;
 };
 
-struct byahoo_data
-{
+struct byahoo_data {
 	int y2_id;
 	int current_status;
@@ -49,12 +47,10 @@
 };
 
-struct byahoo_input_data
-{
+struct byahoo_input_data {
 	int h;
 	void *d;
 };
 
-struct byahoo_conf_invitation
-{
+struct byahoo_conf_invitation {
 	char *name;
 	struct groupchat *c;
@@ -67,275 +63,270 @@
 static int byahoo_chat_id = 0;
 
-static char *byahoo_strip( const char *in )
+static char *byahoo_strip(const char *in)
 {
 	int len;
-	
+
 	/* This should get rid of the markup noise at the beginning of the string. */
-	while( *in )
-	{
-		if( g_strncasecmp( in, "<font", 5 ) == 0 ||
-		    g_strncasecmp( in, "<fade", 5 ) == 0 ||
-		    g_strncasecmp( in, "<alt", 4 ) == 0 )
-		{
-			char *s = strchr( in, '>' );
-			if( !s )
+	while (*in) {
+		if (g_strncasecmp(in, "<font", 5) == 0 ||
+		    g_strncasecmp(in, "<fade", 5) == 0 ||
+		    g_strncasecmp(in, "<alt", 4) == 0) {
+			char *s = strchr(in, '>');
+			if (!s) {
 				break;
-			
+			}
+
 			in = s + 1;
-		}
-		else if( strncmp( in, "\e[", 2 ) == 0 )
-		{
+		} else if (strncmp(in, "\e[", 2) == 0) {
 			const char *s;
-			
-			for( s = in + 2; *s && *s != 'm'; s ++ );
-			
-			if( *s != 'm' )
+
+			for (s = in + 2; *s && *s != 'm'; s++) {
+				;
+			}
+
+			if (*s != 'm') {
 				break;
-			
+			}
+
 			in = s + 1;
-		}
-		else
-		{
+		} else {
 			break;
 		}
 	}
-	
+
 	/* This is supposed to get rid of the noise at the end of the line. */
-	len = strlen( in );
-	while( len > 0 && ( in[len-1] == '>' || in[len-1] == 'm' ) )
-	{
+	len = strlen(in);
+	while (len > 0 && (in[len - 1] == '>' || in[len - 1] == 'm')) {
 		int blen = len;
 		const char *search;
-		
-		if( in[len-1] == '>' )
+
+		if (in[len - 1] == '>') {
 			search = "</";
-		else
+		} else {
 			search = "\e[";
-		
+		}
+
 		len -= 3;
-		while( len > 0 && strncmp( in + len, search, 2 ) != 0 )
-			len --;
-		
-		if( len <= 0 && strncmp( in, search, 2 ) != 0 )
-		{
+		while (len > 0 && strncmp(in + len, search, 2) != 0) {
+			len--;
+		}
+
+		if (len <= 0 && strncmp(in, search, 2) != 0) {
 			len = blen;
 			break;
 		}
 	}
-	
-	return( g_strndup( in, len ) );
-}
-
-static void byahoo_init( account_t *acc )
-{
-	set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc );
-	
+
+	return(g_strndup(in, len));
+}
+
+static void byahoo_init(account_t *acc)
+{
+	set_add(&acc->set, "mail_notifications", "false", set_eval_bool, acc);
+
 	acc->flags |= ACC_FLAG_AWAY_MESSAGE | ACC_FLAG_STATUS_MESSAGE;
 }
 
-static void byahoo_login( account_t *acc )
-{
-	struct im_connection *ic = imcb_new( acc );
-	struct byahoo_data *yd = ic->proto_data = g_new0( struct byahoo_data, 1 );
+static void byahoo_login(account_t *acc)
+{
+	struct im_connection *ic = imcb_new(acc);
+	struct byahoo_data *yd = ic->proto_data = g_new0(struct byahoo_data, 1);
 	char *s;
-	
+
 	yd->logged_in = FALSE;
 	yd->current_status = YAHOO_STATUS_AVAILABLE;
-	
-	if( ( s = strchr( acc->user, '@' ) ) && g_strcasecmp( s, "@yahoo.com" ) == 0 )
-		imcb_error( ic, "Your Yahoo! username should just be a username. "
-		                "Do not include any @domain part." );
-	
-	imcb_log( ic, "Connecting" );
-	yd->y2_id = yahoo_init( acc->user, acc->pass );
-	yahoo_login( yd->y2_id, yd->current_status );
-}
-
-static void byahoo_logout( struct im_connection *ic )
+
+	if ((s = strchr(acc->user, '@')) && g_strcasecmp(s, "@yahoo.com") == 0) {
+		imcb_error(ic, "Your Yahoo! username should just be a username. "
+		           "Do not include any @domain part.");
+	}
+
+	imcb_log(ic, "Connecting");
+	yd->y2_id = yahoo_init(acc->user, acc->pass);
+	yahoo_login(yd->y2_id, yd->current_status);
+}
+
+static void byahoo_logout(struct im_connection *ic)
 {
 	struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
 	GSList *l;
-	
-	while( ic->groupchats )
-		imcb_chat_free( ic->groupchats->data );
-	
-	for( l = yd->buddygroups; l; l = l->next )
-	{
+
+	while (ic->groupchats) {
+		imcb_chat_free(ic->groupchats->data);
+	}
+
+	for (l = yd->buddygroups; l; l = l->next) {
 		struct byahoo_buddygroups *bg = l->data;
-		
-		g_free( bg->buddy );
-		g_free( bg->group );
-		g_free( bg );
-	}
-	g_slist_free( yd->buddygroups );
-	
-	yahoo_logoff( yd->y2_id );
-	
-	g_free( yd );
-}
-
-static void byahoo_get_info(struct im_connection *ic, char *who) 
+
+		g_free(bg->buddy);
+		g_free(bg->group);
+		g_free(bg);
+	}
+	g_slist_free(yd->buddygroups);
+
+	yahoo_logoff(yd->y2_id);
+
+	g_free(yd);
+}
+
+static void byahoo_get_info(struct im_connection *ic, char *who)
 {
 	/* Just make an URL and let the user fetch the info */
-	imcb_log(ic, "%s\n%s: %s%s", _("User Info"), 
-			_("For now, fetch yourself"), yahoo_get_profile_url(),
-			who);
-}
-
-static int byahoo_buddy_msg( struct im_connection *ic, char *who, char *what, int flags )
+	imcb_log(ic, "%s\n%s: %s%s", _("User Info"),
+	         _("For now, fetch yourself"), yahoo_get_profile_url(),
+	         who);
+}
+
+static int byahoo_buddy_msg(struct im_connection *ic, char *who, char *what, int flags)
 {
 	struct byahoo_data *yd = ic->proto_data;
-	
-	yahoo_send_im( yd->y2_id, NULL, who, what, 1, 0 );
-	
+
+	yahoo_send_im(yd->y2_id, NULL, who, what, 1, 0);
+
 	return 1;
 }
 
-static int byahoo_send_typing( struct im_connection *ic, char *who, int typing )
+static int byahoo_send_typing(struct im_connection *ic, char *who, int typing)
 {
 	struct byahoo_data *yd = ic->proto_data;
-	
-	yahoo_send_typing( yd->y2_id, NULL, who, ( typing & OPT_TYPING ) != 0 );
-	
+
+	yahoo_send_typing(yd->y2_id, NULL, who, (typing & OPT_TYPING) != 0);
+
 	return 1;
 }
 
-static void byahoo_set_away( struct im_connection *ic, char *state, char *msg )
+static void byahoo_set_away(struct im_connection *ic, char *state, char *msg)
 {
 	struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
-	
-	if( state && msg == NULL )
-	{
+
+	if (state && msg == NULL) {
 		/* Use these states only if msg doesn't contain additional
 		   info since away messages are only supported with CUSTOM. */
-		if( g_strcasecmp( state, "Be Right Back" ) == 0 )
+		if (g_strcasecmp(state, "Be Right Back") == 0) {
 			yd->current_status = YAHOO_STATUS_BRB;
-		else if( g_strcasecmp( state, "Busy" ) == 0 )
+		} else if (g_strcasecmp(state, "Busy") == 0) {
 			yd->current_status = YAHOO_STATUS_BUSY;
-		else if( g_strcasecmp( state, "Not At Home" ) == 0 )
+		} else if (g_strcasecmp(state, "Not At Home") == 0) {
 			yd->current_status = YAHOO_STATUS_NOTATHOME;
-		else if( g_strcasecmp( state, "Not At Desk" ) == 0 )
+		} else if (g_strcasecmp(state, "Not At Desk") == 0) {
 			yd->current_status = YAHOO_STATUS_NOTATDESK;
-		else if( g_strcasecmp( state, "Not In Office" ) == 0 )
+		} else if (g_strcasecmp(state, "Not In Office") == 0) {
 			yd->current_status = YAHOO_STATUS_NOTINOFFICE;
-		else if( g_strcasecmp( state, "On Phone" ) == 0 )
+		} else if (g_strcasecmp(state, "On Phone") == 0) {
 			yd->current_status = YAHOO_STATUS_ONPHONE;
-		else if( g_strcasecmp( state, "On Vacation" ) == 0 )
+		} else if (g_strcasecmp(state, "On Vacation") == 0) {
 			yd->current_status = YAHOO_STATUS_ONVACATION;
-		else if( g_strcasecmp( state, "Out To Lunch" ) == 0 )
+		} else if (g_strcasecmp(state, "Out To Lunch") == 0) {
 			yd->current_status = YAHOO_STATUS_OUTTOLUNCH;
-		else if( g_strcasecmp( state, "Stepped Out" ) == 0 )
+		} else if (g_strcasecmp(state, "Stepped Out") == 0) {
 			yd->current_status = YAHOO_STATUS_STEPPEDOUT;
-		else if( g_strcasecmp( state, "Invisible" ) == 0 )
+		} else if (g_strcasecmp(state, "Invisible") == 0) {
 			yd->current_status = YAHOO_STATUS_INVISIBLE;
-		else
+		} else {
 			yd->current_status = YAHOO_STATUS_CUSTOM;
-	}
-	else if( msg )
+		}
+	} else if (msg) {
 		yd->current_status = YAHOO_STATUS_CUSTOM;
-	else
+	} else {
 		yd->current_status = YAHOO_STATUS_AVAILABLE;
-	
-	yahoo_set_away( yd->y2_id, yd->current_status, msg, state ? 2 : 0 );
-}
-
-static GList *byahoo_away_states( struct im_connection *ic )
+	}
+
+	yahoo_set_away(yd->y2_id, yd->current_status, msg, state ? 2 : 0);
+}
+
+static GList *byahoo_away_states(struct im_connection *ic)
 {
 	static GList *m = NULL;
 
-	if( m == NULL )
-	{
-		m = g_list_append( m, "Be Right Back" );
-		m = g_list_append( m, "Busy" );
-		m = g_list_append( m, "Not At Home" );
-		m = g_list_append( m, "Not At Desk" );
-		m = g_list_append( m, "Not In Office" );
-		m = g_list_append( m, "On Phone" );
-		m = g_list_append( m, "On Vacation" );
-		m = g_list_append( m, "Out To Lunch" );
-		m = g_list_append( m, "Stepped Out" );
-		m = g_list_append( m, "Invisible" );
-	}
-	
+	if (m == NULL) {
+		m = g_list_append(m, "Be Right Back");
+		m = g_list_append(m, "Busy");
+		m = g_list_append(m, "Not At Home");
+		m = g_list_append(m, "Not At Desk");
+		m = g_list_append(m, "Not In Office");
+		m = g_list_append(m, "On Phone");
+		m = g_list_append(m, "On Vacation");
+		m = g_list_append(m, "Out To Lunch");
+		m = g_list_append(m, "Stepped Out");
+		m = g_list_append(m, "Invisible");
+	}
+
 	return m;
 }
 
-static void byahoo_keepalive( struct im_connection *ic )
+static void byahoo_keepalive(struct im_connection *ic)
 {
 	struct byahoo_data *yd = ic->proto_data;
-	
-	yahoo_keepalive( yd->y2_id );
-}
-
-static void byahoo_add_buddy( struct im_connection *ic, char *who, char *group )
+
+	yahoo_keepalive(yd->y2_id);
+}
+
+static void byahoo_add_buddy(struct im_connection *ic, char *who, char *group)
 {
 	struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
 	bee_user_t *bu;
-	
-	if( group && ( bu = bee_user_by_handle( ic->bee, ic, who ) ) && bu->group )
-	{
+
+	if (group && (bu = bee_user_by_handle(ic->bee, ic, who)) && bu->group) {
 		GSList *bgl;
-		
+
 		/* If the person is in our list already, this is a group change. */
-		yahoo_change_buddy_group( yd->y2_id, who, bu->group->name, group );
-		
+		yahoo_change_buddy_group(yd->y2_id, who, bu->group->name, group);
+
 		/* No idea how often people have people in multiple groups and
 		   BitlBee doesn't currently support this anyway .. but keep
 		   this struct up-to-date for now. */
-		for( bgl = yd->buddygroups; bgl; bgl = bgl->next )
-		{
+		for (bgl = yd->buddygroups; bgl; bgl = bgl->next) {
 			struct byahoo_buddygroups *bg = bgl->data;
-			
-			if( g_strcasecmp( bg->buddy, who ) == 0 &&
-			    g_strcasecmp( bg->group, bu->group->name ) == 0 )
-			{
-				g_free( bg->group );
-				bg->group = g_strdup( group );
+
+			if (g_strcasecmp(bg->buddy, who) == 0 &&
+			    g_strcasecmp(bg->group, bu->group->name) == 0) {
+				g_free(bg->group);
+				bg->group = g_strdup(group);
 			}
 		}
-	}
-	else
-		yahoo_add_buddy( yd->y2_id, who, group ? group : BYAHOO_DEFAULT_GROUP, NULL );
-}
-
-static void byahoo_remove_buddy( struct im_connection *ic, char *who, char *group )
+	} else {
+		yahoo_add_buddy(yd->y2_id, who, group ? group : BYAHOO_DEFAULT_GROUP, NULL);
+	}
+}
+
+static void byahoo_remove_buddy(struct im_connection *ic, char *who, char *group)
 {
 	struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
 	GSList *bgl;
-	
-	yahoo_remove_buddy( yd->y2_id, who, BYAHOO_DEFAULT_GROUP );
-	
-	for( bgl = yd->buddygroups; bgl; bgl = bgl->next )
-	{
+
+	yahoo_remove_buddy(yd->y2_id, who, BYAHOO_DEFAULT_GROUP);
+
+	for (bgl = yd->buddygroups; bgl; bgl = bgl->next) {
 		struct byahoo_buddygroups *bg = bgl->data;
-		
-		if( g_strcasecmp( bg->buddy, who ) == 0 )
-			yahoo_remove_buddy( yd->y2_id, who, bg->group );
-	}
-}
-
-static void byahoo_chat_msg( struct groupchat *c, char *message, int flags )
+
+		if (g_strcasecmp(bg->buddy, who) == 0) {
+			yahoo_remove_buddy(yd->y2_id, who, bg->group);
+		}
+	}
+}
+
+static void byahoo_chat_msg(struct groupchat *c, char *message, int flags)
 {
 	struct byahoo_data *yd = (struct byahoo_data *) c->ic->proto_data;
-	
-	yahoo_conference_message( yd->y2_id, NULL, c->data, c->title, message, 1 );
-}
-
-static void byahoo_chat_invite( struct groupchat *c, char *who, char *msg )
+
+	yahoo_conference_message(yd->y2_id, NULL, c->data, c->title, message, 1);
+}
+
+static void byahoo_chat_invite(struct groupchat *c, char *who, char *msg)
 {
 	struct byahoo_data *yd = (struct byahoo_data *) c->ic->proto_data;
-	
-	yahoo_conference_invite( yd->y2_id, NULL, c->data, c->title, msg ? msg : "" );
-}
-
-static void byahoo_chat_leave( struct groupchat *c )
+
+	yahoo_conference_invite(yd->y2_id, NULL, c->data, c->title, msg ? msg : "");
+}
+
+static void byahoo_chat_leave(struct groupchat *c)
 {
 	struct byahoo_data *yd = (struct byahoo_data *) c->ic->proto_data;
-	
-	yahoo_conference_logoff( yd->y2_id, NULL, c->data, c->title );
-	imcb_chat_free( c );
-}
-
-static struct groupchat *byahoo_chat_with( struct im_connection *ic, char *who )
+
+	yahoo_conference_logoff(yd->y2_id, NULL, c->data, c->title);
+	imcb_chat_free(c);
+}
+
+static struct groupchat *byahoo_chat_with(struct im_connection *ic, char *who)
 {
 	struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
@@ -343,47 +334,48 @@
 	char *roomname;
 	YList *members;
-	
-	roomname = g_strdup_printf( "%s-Bee-%d", ic->acc->user, byahoo_chat_id );
-	
-	c = imcb_chat_new( ic, roomname );
-	imcb_chat_add_buddy( c, ic->acc->user );
-	
+
+	roomname = g_strdup_printf("%s-Bee-%d", ic->acc->user, byahoo_chat_id);
+
+	c = imcb_chat_new(ic, roomname);
+	imcb_chat_add_buddy(c, ic->acc->user);
+
 	/* FIXME: Free this thing when the chat's destroyed. We can't *always*
 	          do this because it's not always created here. */
-	c->data = members = g_new0( YList, 1 );
-	members->data = g_strdup( who );
-	
-	yahoo_conference_invite( yd->y2_id, NULL, members, roomname, "Please join my groupchat..." );
-	
-	g_free( roomname );
-	
+	c->data = members = g_new0(YList, 1);
+	members->data = g_strdup(who);
+
+	yahoo_conference_invite(yd->y2_id, NULL, members, roomname, "Please join my groupchat...");
+
+	g_free(roomname);
+
 	return c;
 }
 
-static void byahoo_auth_allow( struct im_connection *ic, const char *who )
+static void byahoo_auth_allow(struct im_connection *ic, const char *who)
 {
 	struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
-	
-	yahoo_confirm_buddy( yd->y2_id, who, 0, "" );
-}
-
-static void byahoo_auth_deny( struct im_connection *ic, const char *who )
+
+	yahoo_confirm_buddy(yd->y2_id, who, 0, "");
+}
+
+static void byahoo_auth_deny(struct im_connection *ic, const char *who)
 {
 	struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
-	
-	yahoo_confirm_buddy( yd->y2_id, who, 1, "" );
-}
-
-void byahoo_initmodule( )
+
+	yahoo_confirm_buddy(yd->y2_id, who, 1, "");
+}
+
+void byahoo_initmodule()
 {
 	struct prpl *ret = g_new0(struct prpl, 1);
+
 	ret->name = "yahoo";
-    ret->mms = 832;           /* this guess taken from libotr UPGRADING file */
+	ret->mms = 832;       /* this guess taken from libotr UPGRADING file */
 	ret->init = byahoo_init;
-	
+
 	ret->login = byahoo_login;
 	ret->keepalive = byahoo_keepalive;
 	ret->logout = byahoo_logout;
-	
+
 	ret->buddy_msg = byahoo_buddy_msg;
 	ret->get_info = byahoo_get_info;
@@ -393,5 +385,5 @@
 	ret->remove_buddy = byahoo_remove_buddy;
 	ret->send_typing = byahoo_send_typing;
-	
+
 	ret->chat_msg = byahoo_chat_msg;
 	ret->chat_invite = byahoo_chat_invite;
@@ -400,27 +392,27 @@
 
 	ret->handle_cmp = g_strcasecmp;
-	
+
 	ret->auth_allow = byahoo_auth_allow;
 	ret->auth_deny = byahoo_auth_deny;
-	
+
 	register_protocol(ret);
 }
 
-static struct im_connection *byahoo_get_ic_by_id( int id )
+static struct im_connection *byahoo_get_ic_by_id(int id)
 {
 	GSList *l;
 	struct im_connection *ic;
 	struct byahoo_data *yd;
-	
-	for( l = get_connections(); l; l = l->next )
-	{
+
+	for (l = get_connections(); l; l = l->next) {
 		ic = l->data;
 		yd = ic->proto_data;
-		
-		if( strcmp( ic->acc->prpl->name, "yahoo" ) == 0 && yd->y2_id == id )
-			return( ic );
-	}
-	
-	return( NULL );
+
+		if (strcmp(ic->acc->prpl->name, "yahoo") == 0 && yd->y2_id == id) {
+			return(ic);
+		}
+	}
+
+	return(NULL);
 }
 
@@ -428,6 +420,5 @@
 /* Now it's callback time! */
 
-struct byahoo_connect_callback_data
-{
+struct byahoo_connect_callback_data {
 	int fd;
 	yahoo_connect_callback callback;
@@ -436,20 +427,18 @@
 };
 
-void byahoo_connect_callback( gpointer data, gint source, b_input_condition cond )
+void byahoo_connect_callback(gpointer data, gint source, b_input_condition cond)
 {
 	struct byahoo_connect_callback_data *d = data;
-	
-	if( !byahoo_get_ic_by_id( d->id ) )
-	{
-		g_free( d );
+
+	if (!byahoo_get_ic_by_id(d->id)) {
+		g_free(d);
 		return;
 	}
-	
-	d->callback( NULL + d->fd, 0, d->data );
-	g_free( d );
-}
-
-struct byahoo_read_ready_data
-{
+
+	d->callback(NULL + d->fd, 0, d->data);
+	g_free(d);
+}
+
+struct byahoo_read_ready_data {
 	int id;
 	int fd;
@@ -458,19 +447,19 @@
 };
 
-gboolean byahoo_read_ready_callback( gpointer data, gint source, b_input_condition cond )
+gboolean byahoo_read_ready_callback(gpointer data, gint source, b_input_condition cond)
 {
 	struct byahoo_read_ready_data *d = data;
-	
-	if( !byahoo_get_ic_by_id( d->id ) )
+
+	if (!byahoo_get_ic_by_id(d->id)) {
 		/* WTF doesn't libyahoo clean this up? */
 		return FALSE;
-	
-	yahoo_read_ready( d->id, NULL + d->fd, d->data );
-	
+	}
+
+	yahoo_read_ready(d->id, NULL + d->fd, d->data);
+
 	return TRUE;
 }
 
-struct byahoo_write_ready_data
-{
+struct byahoo_write_ready_data {
 	int id;
 	int fd;
@@ -479,116 +468,111 @@
 };
 
-gboolean byahoo_write_ready_callback( gpointer data, gint source, b_input_condition cond )
+gboolean byahoo_write_ready_callback(gpointer data, gint source, b_input_condition cond)
 {
 	struct byahoo_write_ready_data *d = data;
-	
-	return yahoo_write_ready( d->id, NULL + d->fd, d->data );
-}
-
-void ext_yahoo_login_response( int id, int succ, const char *url )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
+
+	return yahoo_write_ready(d->id, NULL + d->fd, d->data);
+}
+
+void ext_yahoo_login_response(int id, int succ, const char *url)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
 	struct byahoo_data *yd = NULL;
-	
-	if( ic == NULL )
-	{
+
+	if (ic == NULL) {
 		/* libyahoo2 seems to call this one twice when something
 		   went wrong sometimes. Don't know why. Because we clean
 		   up the connection on the first failure, the second
 		   should be ignored. */
-		
+
 		return;
 	}
-	
+
 	yd = (struct byahoo_data *) ic->proto_data;
-	
-	if( succ == YAHOO_LOGIN_OK )
-	{
-		imcb_connected( ic );
-		
+
+	if (succ == YAHOO_LOGIN_OK) {
+		imcb_connected(ic);
+
 		yd->logged_in = TRUE;
-	}
-	else
-	{
+	} else {
 		char *errstr;
 		int allow_reconnect = FALSE;
-		
+
 		yd->logged_in = FALSE;
-		
-		if( succ == YAHOO_LOGIN_UNAME )
+
+		if (succ == YAHOO_LOGIN_UNAME) {
 			errstr = "Incorrect Yahoo! username";
-		else if( succ == YAHOO_LOGIN_PASSWD )
+		} else if (succ == YAHOO_LOGIN_PASSWD) {
 			errstr = "Incorrect Yahoo! password";
-		else if( succ == YAHOO_LOGIN_LOCK )
+		} else if (succ == YAHOO_LOGIN_LOCK) {
 			errstr = "Yahoo! account locked";
-		else if( succ == 1236 )
+		} else if (succ == 1236) {
 			errstr = "Yahoo! account locked or machine temporarily banned";
-		else if( succ == YAHOO_LOGIN_DUPL )
+		} else if (succ == YAHOO_LOGIN_DUPL) {
 			errstr = "Logged in on a different machine or device";
-		else if( succ == YAHOO_LOGIN_SOCK )
-		{
+		} else if (succ == YAHOO_LOGIN_SOCK) {
 			errstr = "Socket problem";
 			allow_reconnect = TRUE;
-		}
-		else
+		} else {
 			errstr = "Unknown error";
-		
-		if( url && *url )
-			imcb_error( ic, "Error %d (%s). See %s for more information.", succ, errstr, url );
-		else
-			imcb_error( ic, "Error %d (%s)", succ, errstr );
-		
-		imc_logout( ic, allow_reconnect );
-	}
-}
-
-void ext_yahoo_got_buddies( int id, YList *buds )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
+		}
+
+		if (url && *url) {
+			imcb_error(ic, "Error %d (%s). See %s for more information.", succ, errstr, url);
+		} else {
+			imcb_error(ic, "Error %d (%s)", succ, errstr);
+		}
+
+		imc_logout(ic, allow_reconnect);
+	}
+}
+
+void ext_yahoo_got_buddies(int id, YList *buds)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
 	struct byahoo_data *yd = ic->proto_data;
 	YList *bl = buds;
-	
-	while( bl )
-	{
+
+	while (bl) {
 		struct yahoo_buddy *b = bl->data;
 		struct byahoo_buddygroups *bg;
-		
-		if( strcmp( b->group, BYAHOO_DEFAULT_GROUP ) != 0 )
-		{
-			bg = g_new0( struct byahoo_buddygroups, 1 );
-			
-			bg->buddy = g_strdup( b->id );
-			bg->group = g_strdup( b->group );
-			yd->buddygroups = g_slist_append( yd->buddygroups, bg );
-		}
-		
-		imcb_add_buddy( ic, b->id, b->group );
-		imcb_rename_buddy( ic, b->id, b->real_name );
-		
+
+		if (strcmp(b->group, BYAHOO_DEFAULT_GROUP) != 0) {
+			bg = g_new0(struct byahoo_buddygroups, 1);
+
+			bg->buddy = g_strdup(b->id);
+			bg->group = g_strdup(b->group);
+			yd->buddygroups = g_slist_append(yd->buddygroups, bg);
+		}
+
+		imcb_add_buddy(ic, b->id, b->group);
+		imcb_rename_buddy(ic, b->id, b->real_name);
+
 		bl = bl->next;
 	}
 }
 
-void ext_yahoo_got_identities( int id, YList *ids )
-{
-}
-
-void ext_yahoo_got_cookies( int id )
-{
-}
-
-void ext_yahoo_status_changed( int id, const char *who, int stat, const char *msg, int away, int idle, int mobile )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
+void ext_yahoo_got_identities(int id, YList *ids)
+{
+}
+
+void ext_yahoo_got_cookies(int id)
+{
+}
+
+void ext_yahoo_status_changed(int id, const char *who, int stat, const char *msg, int away, int idle, int mobile)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
 	char *state_string = NULL;
 	int flags = OPT_LOGGED_IN;
-	
-	if( away )
+
+	if (away) {
 		flags |= OPT_AWAY;
-	if( mobile )
+	}
+	if (mobile) {
 		flags |= OPT_MOBILE;
-	
-	switch (stat)
-	{
+	}
+
+	switch (stat) {
 	case YAHOO_STATUS_BRB:
 		state_string = "Be Right Back";
@@ -632,145 +616,142 @@
 		break;
 	}
-	
-	imcb_buddy_status( ic, who, flags, state_string, msg );
-	
-	if( stat == YAHOO_STATUS_IDLE )
-		imcb_buddy_times( ic, who, 0, idle );
-}
-
-void ext_yahoo_got_buzz( int id, const char *me, const char *who, long tm )
-{
-}
-
-void ext_yahoo_got_im( int id, const char *me, const char *who, const char *msg, long tm, int stat, int utf8 )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
+
+	imcb_buddy_status(ic, who, flags, state_string, msg);
+
+	if (stat == YAHOO_STATUS_IDLE) {
+		imcb_buddy_times(ic, who, 0, idle);
+	}
+}
+
+void ext_yahoo_got_buzz(int id, const char *me, const char *who, long tm)
+{
+}
+
+void ext_yahoo_got_im(int id, const char *me, const char *who, const char *msg, long tm, int stat, int utf8)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
 	char *m;
-	
-	if( msg )
-	{
-		m = byahoo_strip( msg );
-		imcb_buddy_msg( ic, (char*) who, (char*) m, 0, 0 );
-		g_free( m );
-	}
-}
-
-void ext_yahoo_got_file( int id, const char *ignored, const char *who, const char *msg,
-                         const char *fname, unsigned long fesize, char *trid )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	
-	imcb_log( ic, "Got a file transfer (file = %s) from %s. Ignoring for now due to lack of support.", fname, who );
-}
-
-void ext_yahoo_got_ft_data( int id, const unsigned char *in, int len, void *data )
-{
-}
-
-void ext_yahoo_file_transfer_done( int id, int result, void *data )
-{
-}
-
-void ext_yahoo_typing_notify( int id, const char *ignored, const char *who, int stat )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	
-	if( stat == 1 )
-		imcb_buddy_typing( ic, (char*) who, OPT_TYPING );
-	else
-		imcb_buddy_typing( ic, (char*) who, 0 );
-}
-
-void ext_yahoo_system_message( int id, const char *me, const char *who, const char *msg )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	
-	imcb_log( ic, "Yahoo! system message: %s", msg );
-}
-
-void ext_yahoo_webcam_invite( int id, const char *ignored, const char *from )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	
-	imcb_log( ic, "Got a webcam invitation from %s. IRC+webcams is a no-no though...", from );
-}
-
-void ext_yahoo_error( int id, const char *err, int fatal, int num )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	
-	imcb_error( ic, "%s", err );
+
+	if (msg) {
+		m = byahoo_strip(msg);
+		imcb_buddy_msg(ic, (char *) who, (char *) m, 0, 0);
+		g_free(m);
+	}
+}
+
+void ext_yahoo_got_file(int id, const char *ignored, const char *who, const char *msg,
+                        const char *fname, unsigned long fesize, char *trid)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+
+	imcb_log(ic, "Got a file transfer (file = %s) from %s. Ignoring for now due to lack of support.", fname, who);
+}
+
+void ext_yahoo_got_ft_data(int id, const unsigned char *in, int len, void *data)
+{
+}
+
+void ext_yahoo_file_transfer_done(int id, int result, void *data)
+{
+}
+
+void ext_yahoo_typing_notify(int id, const char *ignored, const char *who, int stat)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+
+	if (stat == 1) {
+		imcb_buddy_typing(ic, (char *) who, OPT_TYPING);
+	} else {
+		imcb_buddy_typing(ic, (char *) who, 0);
+	}
+}
+
+void ext_yahoo_system_message(int id, const char *me, const char *who, const char *msg)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+
+	imcb_log(ic, "Yahoo! system message: %s", msg);
+}
+
+void ext_yahoo_webcam_invite(int id, const char *ignored, const char *from)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+
+	imcb_log(ic, "Got a webcam invitation from %s. IRC+webcams is a no-no though...", from);
+}
+
+void ext_yahoo_error(int id, const char *err, int fatal, int num)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+
+	imcb_error(ic, "%s", err);
 }
 
 /* TODO: Clear up the mess of inp and d structures */
-int ext_yahoo_add_handler( int id, void *fd_, yahoo_input_condition cond, void *data )
-{
-	struct byahoo_input_data *inp = g_new0( struct byahoo_input_data, 1 );
+int ext_yahoo_add_handler(int id, void *fd_, yahoo_input_condition cond, void *data)
+{
+	struct byahoo_input_data *inp = g_new0(struct byahoo_input_data, 1);
 	int fd = (long) fd_;
-	
-	if( cond == YAHOO_INPUT_READ )
-	{
-		struct byahoo_read_ready_data *d = g_new0( struct byahoo_read_ready_data, 1 );
-		
+
+	if (cond == YAHOO_INPUT_READ) {
+		struct byahoo_read_ready_data *d = g_new0(struct byahoo_read_ready_data, 1);
+
 		d->id = id;
 		d->fd = fd;
 		d->data = data;
-		
+
 		inp->d = d;
-		d->tag = inp->h = b_input_add( fd, B_EV_IO_READ, (b_event_handler) byahoo_read_ready_callback, (gpointer) d );
-	}
-	else if( cond == YAHOO_INPUT_WRITE )
-	{
-		struct byahoo_write_ready_data *d = g_new0( struct byahoo_write_ready_data, 1 );
-		
+		d->tag = inp->h = b_input_add(fd, B_EV_IO_READ, (b_event_handler) byahoo_read_ready_callback,
+		                              (gpointer) d);
+	} else if (cond == YAHOO_INPUT_WRITE) {
+		struct byahoo_write_ready_data *d = g_new0(struct byahoo_write_ready_data, 1);
+
 		d->id = id;
 		d->fd = fd;
 		d->data = data;
-		
+
 		inp->d = d;
-		d->tag = inp->h = b_input_add( fd, B_EV_IO_WRITE, (b_event_handler) byahoo_write_ready_callback, (gpointer) d );
-	}
-	else
-	{
-		g_free( inp );
+		d->tag = inp->h =
+		                 b_input_add(fd, B_EV_IO_WRITE, (b_event_handler) byahoo_write_ready_callback,
+		                             (gpointer) d);
+	} else {
+		g_free(inp);
 		return -1;
 		/* Panic... */
 	}
-	
-	byahoo_inputs = g_slist_append( byahoo_inputs, inp );
+
+	byahoo_inputs = g_slist_append(byahoo_inputs, inp);
 	return inp->h;
 }
 
-void ext_yahoo_remove_handler( int id, int tag )
+void ext_yahoo_remove_handler(int id, int tag)
 {
 	struct byahoo_input_data *inp;
 	GSList *l = byahoo_inputs;
-	
-	while( l )
-	{
+
+	while (l) {
 		inp = l->data;
-		if( inp->h == tag )
-		{
-			g_free( inp->d );
-			g_free( inp );
-			byahoo_inputs = g_slist_remove( byahoo_inputs, inp );
+		if (inp->h == tag) {
+			g_free(inp->d);
+			g_free(inp);
+			byahoo_inputs = g_slist_remove(byahoo_inputs, inp);
 			break;
 		}
 		l = l->next;
 	}
-	
-	b_event_remove( tag );
-}
-
-int ext_yahoo_connect_async( int id, const char *host, int port, yahoo_connect_callback callback, void *data, int use_ssl )
+
+	b_event_remove(tag);
+}
+
+int ext_yahoo_connect_async(int id, const char *host, int port, yahoo_connect_callback callback, void *data,
+                            int use_ssl)
 {
 	struct byahoo_connect_callback_data *d;
 	int fd;
-	
-	d = g_new0( struct byahoo_connect_callback_data, 1 );
-	if( ( fd = proxy_connect( host, port, (b_event_handler) byahoo_connect_callback, (gpointer) d ) ) < 0 )
-	{
-		g_free( d );
-		return( fd );
+
+	d = g_new0(struct byahoo_connect_callback_data, 1);
+	if ((fd = proxy_connect(host, port, (b_event_handler) byahoo_connect_callback, (gpointer) d)) < 0) {
+		g_free(d);
+		return(fd);
 	}
 	d->fd = fd;
@@ -778,235 +759,249 @@
 	d->data = data;
 	d->id = id;
-	
+
 	return fd;
 }
 
-char *ext_yahoo_get_ip_addr( const char *domain )
+char *ext_yahoo_get_ip_addr(const char *domain)
 {
 	return NULL;
 }
 
-int ext_yahoo_write( void *fd, char *buf, int len )
-{
-	return write( (long) fd, buf, len );
-}
-
-int ext_yahoo_read( void *fd, char *buf, int len )
-{
-	return read( (long) fd, buf, len );
-}
-
-void ext_yahoo_close( void *fd )
-{
-	close( (long) fd );
-}
-
-void ext_yahoo_got_buddy_change_group( int id, const char *me, const char *who,
-                                       const char *old_group, const char *new_group )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	
-	imcb_add_buddy( ic, who, new_group );
-}
-
-static void byahoo_accept_conf( void *data )
+int ext_yahoo_write(void *fd, char *buf, int len)
+{
+	return write((long) fd, buf, len);
+}
+
+int ext_yahoo_read(void *fd, char *buf, int len)
+{
+	return read((long) fd, buf, len);
+}
+
+void ext_yahoo_close(void *fd)
+{
+	close((long) fd);
+}
+
+void ext_yahoo_got_buddy_change_group(int id, const char *me, const char *who,
+                                      const char *old_group, const char *new_group)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+
+	imcb_add_buddy(ic, who, new_group);
+}
+
+static void byahoo_accept_conf(void *data)
 {
 	struct byahoo_conf_invitation *inv = data;
 	struct groupchat *b = NULL;
 	GSList *l;
-	
-	for( l = inv->ic->groupchats; l; l = l->next )
-	{
+
+	for (l = inv->ic->groupchats; l; l = l->next) {
 		b = l->data;
-		if( b == inv->c )
+		if (b == inv->c) {
 			break;
-	}
-	
-	if( b != NULL )
-	{
-		yahoo_conference_logon( inv->yid, NULL, inv->members, inv->name );
-		imcb_chat_add_buddy( inv->c, inv->ic->acc->user );
-	}
-	else
-	{
-		imcb_log( inv->ic, "Duplicate/corrupted invitation to `%s'.", inv->name );
-	}
-	
-	g_free( inv->name );
-	g_free( inv );
-}
-
-static void byahoo_reject_conf( void *data )
+		}
+	}
+
+	if (b != NULL) {
+		yahoo_conference_logon(inv->yid, NULL, inv->members, inv->name);
+		imcb_chat_add_buddy(inv->c, inv->ic->acc->user);
+	} else {
+		imcb_log(inv->ic, "Duplicate/corrupted invitation to `%s'.", inv->name);
+	}
+
+	g_free(inv->name);
+	g_free(inv);
+}
+
+static void byahoo_reject_conf(void *data)
 {
 	struct byahoo_conf_invitation *inv = data;
-	
-	yahoo_conference_decline( inv->yid, NULL, inv->members, inv->name, "User rejected groupchat" );
-	imcb_chat_free( inv->c );
-	g_free( inv->name );
-	g_free( inv );
-}
-
-void ext_yahoo_got_conf_invite( int id, const char *ignored,
-                                const char *who, const char *room, const char *msg, YList *members )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
+
+	yahoo_conference_decline(inv->yid, NULL, inv->members, inv->name, "User rejected groupchat");
+	imcb_chat_free(inv->c);
+	g_free(inv->name);
+	g_free(inv);
+}
+
+void ext_yahoo_got_conf_invite(int id, const char *ignored,
+                               const char *who, const char *room, const char *msg, YList *members)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
 	struct byahoo_conf_invitation *inv;
 	char txt[1024];
 	YList *m;
-	
-	if( g_strcasecmp( who, ic->acc->user ) == 0 )
+
+	if (g_strcasecmp(who, ic->acc->user) == 0) {
 		/* WTF, Yahoo! seems to echo these now? */
 		return;
-	
-	inv = g_malloc( sizeof( struct byahoo_conf_invitation ) );
-	memset( inv, 0, sizeof( struct byahoo_conf_invitation ) );
-	inv->name = g_strdup( room );
-	inv->c = imcb_chat_new( ic, (char*) room );
+	}
+
+	inv = g_malloc(sizeof(struct byahoo_conf_invitation));
+	memset(inv, 0, sizeof(struct byahoo_conf_invitation));
+	inv->name = g_strdup(room);
+	inv->c = imcb_chat_new(ic, (char *) room);
 	inv->c->data = members;
 	inv->yid = id;
 	inv->members = members;
 	inv->ic = ic;
-	
-	for( m = members; m; m = m->next )
-		if( g_strcasecmp( m->data, ic->acc->user ) != 0 )
-			imcb_chat_add_buddy( inv->c, m->data );
-	
-	g_snprintf( txt, 1024, "Got an invitation to chatroom %s from %s: %s", room, who, msg );
-	
-	imcb_ask( ic, txt, inv, byahoo_accept_conf, byahoo_reject_conf );
-}
-
-void ext_yahoo_conf_userdecline( int id, const char *ignored, const char *who, const char *room, const char *msg )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	
-	imcb_log( ic, "Invite to chatroom %s rejected by %s: %s", room, who, msg );
-}
-
-void ext_yahoo_conf_userjoin( int id, const char *ignored, const char *who, const char *room )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	struct groupchat *c = bee_chat_by_title( ic->bee, ic, room );
-	
-	if( c )
-		imcb_chat_add_buddy( c, (char*) who );
-}
-
-void ext_yahoo_conf_userleave( int id, const char *ignored, const char *who, const char *room )
-
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	struct groupchat *c = bee_chat_by_title( ic->bee, ic, room );
-	
-	if( c )
-		imcb_chat_remove_buddy( c, (char*) who, "" );
-}
-
-void ext_yahoo_conf_message( int id, const char *ignored, const char *who, const char *room, const char *msg, int utf8 )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	char *m = byahoo_strip( msg );
-	struct groupchat *c = bee_chat_by_title( ic->bee, ic, room );
-	
-	if( c )
-		imcb_chat_msg( c, (char*) who, (char*) m, 0, 0 );
-	g_free( m );
-}
-
-void ext_yahoo_chat_cat_xml( int id, const char *xml )
-{
-}
-
-void ext_yahoo_chat_join( int id, const char *who, const char *room, const char *topic, YList *members, void *fd )
-{
-}
-
-void ext_yahoo_chat_userjoin( int id, const char *me, const char *room, struct yahoo_chat_member *who )
+
+	for (m = members; m; m = m->next) {
+		if (g_strcasecmp(m->data, ic->acc->user) != 0) {
+			imcb_chat_add_buddy(inv->c, m->data);
+		}
+	}
+
+	g_snprintf(txt, 1024, "Got an invitation to chatroom %s from %s: %s", room, who, msg);
+
+	imcb_ask(ic, txt, inv, byahoo_accept_conf, byahoo_reject_conf);
+}
+
+void ext_yahoo_conf_userdecline(int id, const char *ignored, const char *who, const char *room, const char *msg)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+
+	imcb_log(ic, "Invite to chatroom %s rejected by %s: %s", room, who, msg);
+}
+
+void ext_yahoo_conf_userjoin(int id, const char *ignored, const char *who, const char *room)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+	struct groupchat *c = bee_chat_by_title(ic->bee, ic, room);
+
+	if (c) {
+		imcb_chat_add_buddy(c, (char *) who);
+	}
+}
+
+void ext_yahoo_conf_userleave(int id, const char *ignored, const char *who, const char *room)
+
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+	struct groupchat *c = bee_chat_by_title(ic->bee, ic, room);
+
+	if (c) {
+		imcb_chat_remove_buddy(c, (char *) who, "");
+	}
+}
+
+void ext_yahoo_conf_message(int id, const char *ignored, const char *who, const char *room, const char *msg, int utf8)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+	char *m = byahoo_strip(msg);
+	struct groupchat *c = bee_chat_by_title(ic->bee, ic, room);
+
+	if (c) {
+		imcb_chat_msg(c, (char *) who, (char *) m, 0, 0);
+	}
+	g_free(m);
+}
+
+void ext_yahoo_chat_cat_xml(int id, const char *xml)
+{
+}
+
+void ext_yahoo_chat_join(int id, const char *who, const char *room, const char *topic, YList *members, void *fd)
+{
+}
+
+void ext_yahoo_chat_userjoin(int id, const char *me, const char *room, struct yahoo_chat_member *who)
 {
 	free(who->id);
 	free(who->alias);
 	free(who->location);
-        free(who);
-}
-
-void ext_yahoo_chat_userleave( int id, const char *me, const char *room, const char *who )
-{
-}
-
-void ext_yahoo_chat_message( int id, const char *me, const char *who, const char *room, const char *msg, int msgtype, int utf8 )
-{
-}
-
-void ext_yahoo_chat_yahoologout( int id, const char *me )
-{
-}
-
-void ext_yahoo_chat_yahooerror( int id, const char *me )
-{
-}
-
-void ext_yahoo_contact_added( int id, const char *myid, const char *who, const char *msg )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	
-	imcb_ask_auth( ic, who, msg );
-}
-
-void ext_yahoo_rejected( int id, const char *who, const char *msg )
-{
-}
-
-void ext_yahoo_game_notify( int id, const char *me, const char *who, int stat, const char *msg )
-{
-}
-
-void ext_yahoo_mail_notify( int id, const char *from, const char *subj, int cnt )
-{
-	struct im_connection *ic = byahoo_get_ic_by_id( id );
-	
-	if( !set_getbool( &ic->acc->set, "mail_notifications" ) )
+	free(who);
+}
+
+void ext_yahoo_chat_userleave(int id, const char *me, const char *room, const char *who)
+{
+}
+
+void ext_yahoo_chat_message(int id, const char *me, const char *who, const char *room, const char *msg, int msgtype,
+                            int utf8)
+{
+}
+
+void ext_yahoo_chat_yahoologout(int id, const char *me)
+{
+}
+
+void ext_yahoo_chat_yahooerror(int id, const char *me)
+{
+}
+
+void ext_yahoo_contact_added(int id, const char *myid, const char *who, const char *msg)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+
+	imcb_ask_auth(ic, who, msg);
+}
+
+void ext_yahoo_rejected(int id, const char *who, const char *msg)
+{
+}
+
+void ext_yahoo_game_notify(int id, const char *me, const char *who, int stat, const char *msg)
+{
+}
+
+void ext_yahoo_mail_notify(int id, const char *from, const char *subj, int cnt)
+{
+	struct im_connection *ic = byahoo_get_ic_by_id(id);
+
+	if (!set_getbool(&ic->acc->set, "mail_notifications")) {
 		; /* The user doesn't care. */
-	else if( from && subj )
-		imcb_log( ic, "Received e-mail message from %s with subject `%s'", from, subj );
-	else if( cnt > 0 )
-		imcb_log( ic, "Received %d new e-mails", cnt );
-}
-
-void ext_yahoo_webcam_invite_reply( int id, const char *me, const char *from, int accept )
-{
-}
-
-void ext_yahoo_webcam_closed( int id, const char *who, int reason )
-{
-}
-
-void ext_yahoo_got_search_result( int id, int found, int start, int total, YList *contacts )
-{
-}
-
-void ext_yahoo_webcam_viewer( int id, const char *who, int connect )
-{
-}
-
-void ext_yahoo_webcam_data_request( int id, int send )
-{
-}
-
-int ext_yahoo_log( const char *fmt, ... )
-{
-	return( 0 );
-}
-
-void ext_yahoo_got_webcam_image( int id, const char * who, const unsigned char *image, unsigned int image_size, unsigned int real_size, unsigned int timestamp )
-{
-}
-
-void ext_yahoo_got_ping( int id, const char *msg )
-{
-}
-
-void ext_yahoo_got_buddyicon (int id, const char *me, const char *who, const char *url, int checksum) {}
-void ext_yahoo_got_buddyicon_checksum (int id, const char *me,const char *who, int checksum) {}
-
-void ext_yahoo_got_buddyicon_request(int id, const char *me, const char *who){}
-void ext_yahoo_buddyicon_uploaded(int id, const char *url){}
+	} else if (from && subj) {
+		imcb_log(ic, "Received e-mail message from %s with subject `%s'", from, subj);
+	} else if (cnt > 0) {
+		imcb_log(ic, "Received %d new e-mails", cnt);
+	}
+}
+
+void ext_yahoo_webcam_invite_reply(int id, const char *me, const char *from, int accept)
+{
+}
+
+void ext_yahoo_webcam_closed(int id, const char *who, int reason)
+{
+}
+
+void ext_yahoo_got_search_result(int id, int found, int start, int total, YList *contacts)
+{
+}
+
+void ext_yahoo_webcam_viewer(int id, const char *who, int connect)
+{
+}
+
+void ext_yahoo_webcam_data_request(int id, int send)
+{
+}
+
+int ext_yahoo_log(const char *fmt, ...)
+{
+	return(0);
+}
+
+void ext_yahoo_got_webcam_image(int id, const char * who, const unsigned char *image, unsigned int image_size,
+                                unsigned int real_size, unsigned int timestamp)
+{
+}
+
+void ext_yahoo_got_ping(int id, const char *msg)
+{
+}
+
+void ext_yahoo_got_buddyicon(int id, const char *me, const char *who, const char *url, int checksum)
+{
+}
+void ext_yahoo_got_buddyicon_checksum(int id, const char *me, const char *who, int checksum)
+{
+}
+
+void ext_yahoo_got_buddyicon_request(int id, const char *me, const char *who)
+{
+}
+void ext_yahoo_buddyicon_uploaded(int id, const char *url)
+{
+}
Index: protocols/yahoo/yahoo2.h
===================================================================
--- protocols/yahoo/yahoo2.h	(revision 25c4c78e2ddad482dfc9d5a104f76325fcc2f8e5)
+++ protocols/yahoo/yahoo2.h	(revision 9216eff1a59e9d4a24b63c16ba4c2cacd051332c)
@@ -30,21 +30,21 @@
 #include "bitlbee.h"
 #undef free
-#define free( x )		g_free( x )
+#define free(x)               g_free(x)
 #undef malloc
-#define malloc( x )		g_malloc( x )
+#define malloc(x)             g_malloc(x)
 #undef calloc
-#define calloc( x, y )		g_calloc( x, y )
+#define calloc(x, y)          g_calloc(x, y)
 #undef realloc
-#define realloc( x, y )		g_realloc( x, y )
+#define realloc(x, y)         g_realloc(x, y)
 #undef strdup
-#define strdup( x )		g_strdup( x )
+#define strdup(x)             g_strdup(x)
 #undef strndup
-#define strndup( x,y )		g_strndup( x,y )
+#define strndup(x, y)          g_strndup(x, y)
 #undef snprintf
 // #define snprintf( x... )	g_snprintf( x )
 #undef strcasecmp
-#define strcasecmp( x,y )	g_strcasecmp( x,y )
+#define strcasecmp(x, y)       g_strcasecmp(x, y)
 #undef strncasecmp
-#define strncasecmp( x,y,z )	g_strncasecmp( x,y,z )
+#define strncasecmp(x, y, z)    g_strncasecmp(x, y, z)
 
 
@@ -52,10 +52,10 @@
 
 /* returns the socket descriptor object for a given pager connection. shouldn't be needed */
-	void *yahoo_get_fd(int id);
+void *yahoo_get_fd(int id);
 
 /* says how much logging to do */
 /* see yahoo2_types.h for the different values */
-	int yahoo_set_log_level(enum yahoo_log_level level);
-	enum yahoo_log_level yahoo_get_log_level(void);
+int yahoo_set_log_level(enum yahoo_log_level level);
+enum yahoo_log_level yahoo_get_log_level(void);
 
 /* these functions should be self explanatory */
@@ -67,5 +67,5 @@
 /* you must call init before calling any other function */
 /*
- * The optional parameters to init are key/value pairs that specify 
+ * The optional parameters to init are key/value pairs that specify
  * server settings to use.  This list must be NULL terminated - even
  * if the list is empty.  If a parameter isn't set, a default value
@@ -74,5 +74,5 @@
  * are copied, so you can use const/auto/static/pointers/whatever
  * you want.  Parameters are:
- * 	NAME			TYPE		DEFAULT
+ *      NAME			TYPE		DEFAULT
  *	pager_host		char *		scs.msg.yahoo.com
  *	pager_port		int		5050
@@ -87,91 +87,91 @@
  * You should set at least local_host if you intend to use webcams
  */
-	int yahoo_init_with_attributes(const char *username,
-		const char *password, ...);
+int yahoo_init_with_attributes(const char *username,
+                               const char *password, ...);
 
 /* yahoo_init does the same as yahoo_init_with_attributes, assuming defaults
  * for all attributes */
-	int yahoo_init(const char *username, const char *password);
+int yahoo_init(const char *username, const char *password);
 
 /* release all resources held by this session */
 /* you need to call yahoo_close for a session only if
  * yahoo_logoff is never called for it (ie, it was never logged in) */
-	void yahoo_close(int id);
+void yahoo_close(int id);
 /* login logs in to the server */
 /* initial is of type enum yahoo_status.  see yahoo2_types.h */
-	void yahoo_login(int id, int initial);
-	void yahoo_logoff(int id);
+void yahoo_login(int id, int initial);
+void yahoo_logoff(int id);
 /* reloads status of all buddies */
-	void yahoo_refresh(int id);
+void yahoo_refresh(int id);
 /* activates/deactivates an identity */
-	void yahoo_set_identity_status(int id, const char *identity,
-		int active);
+void yahoo_set_identity_status(int id, const char *identity,
+                               int active);
 /* regets the entire buddy list from the server */
-	void yahoo_get_list(int id);
+void yahoo_get_list(int id);
 /* download buddy contact information from your yahoo addressbook */
-	void yahoo_get_yab(int id);
+void yahoo_get_yab(int id);
 /* add/modify an address book entry.  if yab->dbid is set, it will */
 /* modify that entry else it creates a new entry */
-	void yahoo_set_yab(int id, struct yab *yab);
-	void yahoo_keepalive(int id);
-	void yahoo_chat_keepalive(int id);
+void yahoo_set_yab(int id, struct yab *yab);
+void yahoo_keepalive(int id);
+void yahoo_chat_keepalive(int id);
 
 /* from is the identity you're sending from.  if NULL, the default is used */
 /* utf8 is whether msg is a utf8 string or not. */
-	void yahoo_send_im(int id, const char *from, const char *who,
-		const char *msg, int utf8, int picture);
+void yahoo_send_im(int id, const char *from, const char *who,
+                   const char *msg, int utf8, int picture);
 //	void yahoo_send_buzz(int id, const char *from, const char *who);
 /* if type is true, send typing notice, else send stopped typing notice */
-	void yahoo_send_typing(int id, const char *from, const char *who,
-		int typ);
+void yahoo_send_typing(int id, const char *from, const char *who,
+                       int typ);
 
 /* used to set away/back status. */
 /* away says whether the custom message is an away message or a sig */
-	void yahoo_set_away(int id, enum yahoo_status state, const char *msg,
-		int away);
-
-	void yahoo_add_buddy(int id, const char *who, const char *group,
-		const char *msg);
-	void yahoo_remove_buddy(int id, const char *who, const char *group);
-	void yahoo_confirm_buddy(int id, const char *who, int reject,
-		const char *msg);
-	void yahoo_stealth_buddy(int id, const char *who, int unstealth);
+void yahoo_set_away(int id, enum yahoo_status state, const char *msg,
+                    int away);
+
+void yahoo_add_buddy(int id, const char *who, const char *group,
+                     const char *msg);
+void yahoo_remove_buddy(int id, const char *who, const char *group);
+void yahoo_confirm_buddy(int id, const char *who, int reject,
+                         const char *msg);
+void yahoo_stealth_buddy(int id, const char *who, int unstealth);
 /* if unignore is true, unignore, else ignore */
-	void yahoo_ignore_buddy(int id, const char *who, int unignore);
-	void yahoo_change_buddy_group(int id, const char *who,
-		const char *old_group, const char *new_group);
-	void yahoo_group_rename(int id, const char *old_group,
-		const char *new_group);
-
-	void yahoo_conference_invite(int id, const char *from, YList *who,
-		const char *room, const char *msg);
-	void yahoo_conference_addinvite(int id, const char *from,
-		const char *who, const char *room, const YList *members,
-		const char *msg);
-	void yahoo_conference_decline(int id, const char *from, YList *who,
-		const char *room, const char *msg);
-	void yahoo_conference_message(int id, const char *from, YList *who,
-		const char *room, const char *msg, int utf8);
-	void yahoo_conference_logon(int id, const char *from, YList *who,
-		const char *room);
-	void yahoo_conference_logoff(int id, const char *from, YList *who,
-		const char *room);
+void yahoo_ignore_buddy(int id, const char *who, int unignore);
+void yahoo_change_buddy_group(int id, const char *who,
+                              const char *old_group, const char *new_group);
+void yahoo_group_rename(int id, const char *old_group,
+                        const char *new_group);
+
+void yahoo_conference_invite(int id, const char *from, YList *who,
+                             const char *room, const char *msg);
+void yahoo_conference_addinvite(int id, const char *from,
+                                const char *who, const char *room, const YList *members,
+                                const char *msg);
+void yahoo_conference_decline(int id, const char *from, YList *who,
+                              const char *room, const char *msg);
+void yahoo_conference_message(int id, const char *from, YList *who,
+                              const char *room, const char *msg, int utf8);
+void yahoo_conference_logon(int id, const char *from, YList *who,
+                            const char *room);
+void yahoo_conference_logoff(int id, const char *from, YList *who,
+                             const char *room);
 
 /* Get a list of chatrooms */
-	void yahoo_get_chatrooms(int id, int chatroomid);
+void yahoo_get_chatrooms(int id, int chatroomid);
 /* join room with specified roomname and roomid */
-	void yahoo_chat_logon(int id, const char *from, const char *room,
-		const char *roomid);
+void yahoo_chat_logon(int id, const char *from, const char *room,
+                      const char *roomid);
 /* Send message "msg" to room with specified roomname, msgtype is 1-normal message or 2-/me mesage */
-	void yahoo_chat_message(int id, const char *from, const char *room,
-		const char *msg, const int msgtype, const int utf8);
+void yahoo_chat_message(int id, const char *from, const char *room,
+                        const char *msg, const int msgtype, const int utf8);
 /* Log off chat */
-	void yahoo_chat_logoff(int id, const char *from);
+void yahoo_chat_logoff(int id, const char *from);
 
 /* requests a webcam feed */
 /* who is the person who's webcam you would like to view */
 /* if who is null, then you're the broadcaster */
-	void yahoo_webcam_get_feed(int id, const char *who);
-	void yahoo_webcam_close_feed(int id, const char *who);
+void yahoo_webcam_get_feed(int id, const char *who);
+void yahoo_webcam_close_feed(int id, const char *who);
 
 /* sends an image when uploading */
@@ -179,14 +179,14 @@
 /* in bytes. The timestamp is the time in milliseconds since we started the */
 /* webcam. */
-	void yahoo_webcam_send_image(int id, unsigned char *image,
-		unsigned int length, unsigned int timestamp);
+void yahoo_webcam_send_image(int id, unsigned char *image,
+                             unsigned int length, unsigned int timestamp);
 
 /* this function should be called if we want to allow a user to watch the */
 /* webcam. Who is the user we want to accept. */
 /* Accept user (accept = 1), decline user (accept = 0) */
-	void yahoo_webcam_accept_viewer(int id, const char *who, int accept);
+void yahoo_webcam_accept_viewer(int id, const char *who, int accept);
 
 /* send an invitation to a user to view your webcam */
-	void yahoo_webcam_invite(int id, const char *who);
+void yahoo_webcam_invite(int id, const char *who);
 
 /* will set up a connection and initiate file transfer.
@@ -194,7 +194,7 @@
  * the file data to
  */
-	void yahoo_send_file(int id, const char *who, const char *msg,
-		const char *name, unsigned long size,
-		yahoo_get_fd_callback callback, void *data);
+void yahoo_send_file(int id, const char *who, const char *msg,
+                     const char *name, unsigned long size,
+                     yahoo_get_fd_callback callback, void *data);
 
 /*
@@ -202,13 +202,13 @@
  * since that is your only chance to recognize future callbacks
  */
-	void yahoo_send_file_transfer_response(int client_id, int response,
-		char *id, void *data);
+void yahoo_send_file_transfer_response(int client_id, int response,
+                                       char *id, void *data);
 
 
 /* send a search request
  */
-	void yahoo_search(int id, enum yahoo_search_type t, const char *text,
-		enum yahoo_search_gender g, enum yahoo_search_agerange ar,
-		int photo, int yahoo_only);
+void yahoo_search(int id, enum yahoo_search_type t, const char *text,
+                  enum yahoo_search_gender g, enum yahoo_search_agerange ar,
+                  int photo, int yahoo_only);
 
 /* continue last search
@@ -217,26 +217,26 @@
  * where the above three are passed to ext_yahoo_got_search_result
  */
-	void yahoo_search_again(int id, int start);
+void yahoo_search_again(int id, int start);
 
 /* these should be called when input is available on a fd */
 /* registered by ext_yahoo_add_handler */
 /* if these return negative values, errno may be set */
-	int yahoo_read_ready(int id, void *fd, void *data);
-	int yahoo_write_ready(int id, void *fd, void *data);
+int yahoo_read_ready(int id, void *fd, void *data);
+int yahoo_write_ready(int id, void *fd, void *data);
 
 /* utility functions. these do not hit the server */
-	enum yahoo_status yahoo_current_status(int id);
-	const YList *yahoo_get_buddylist(int id);
-	const YList *yahoo_get_ignorelist(int id);
-	const YList *yahoo_get_identities(int id);
+enum yahoo_status yahoo_current_status(int id);
+const YList *yahoo_get_buddylist(int id);
+const YList *yahoo_get_ignorelist(int id);
+const YList *yahoo_get_identities(int id);
 /* 'which' could be y, t, c or login.  This may change in later versions. */
-	const char *yahoo_get_cookie(int id, const char *which);
+const char *yahoo_get_cookie(int id, const char *which);
 
 /* returns the url used to get user profiles - you must append the user id */
 /* as of now this is http://profiles.yahoo.com/ */
 /* You'll have to do urlencoding yourself, but see yahoo_httplib.h first */
-	const char *yahoo_get_profile_url(void);
-
-	void yahoo_buddyicon_request(int id, const char *who);
+const char *yahoo_get_profile_url(void);
+
+void yahoo_buddyicon_request(int id, const char *who);
 
 #include "yahoo_httplib.h"
Index: protocols/yahoo/yahoo2_callbacks.h
===================================================================
--- protocols/yahoo/yahoo2_callbacks.h	(revision 25c4c78e2ddad482dfc9d5a104f76325fcc2f8e5)
+++ protocols/yahoo/yahoo2_callbacks.h	(revision 9216eff1a59e9d4a24b63c16ba4c2cacd051332c)
@@ -45,15 +45,15 @@
  */
 
-	typedef enum {
-		YAHOO_INPUT_READ = 1 << 0,
-		YAHOO_INPUT_WRITE = 1 << 1,
-		YAHOO_INPUT_EXCEPTION = 1 << 2
-	} yahoo_input_condition;
+typedef enum {
+	YAHOO_INPUT_READ = 1 << 0,
+	        YAHOO_INPUT_WRITE = 1 << 1,
+	        YAHOO_INPUT_EXCEPTION = 1 << 2
+} yahoo_input_condition;
 
 /*
  * A callback function called when an asynchronous connect completes.
- * 
- * Params:
- *     fd    - The file descriptor object that has been connected, or NULL on 
+ *
+ * Params:
+ *     fd    - The file descriptor object that has been connected, or NULL on
  *             error
  *     error - The value of errno set by the call to connect or 0 if no error
@@ -63,6 +63,6 @@
  *	       function
  */
-	typedef void (*yahoo_connect_callback) (void *fd, int error,
-		void *callback_data);
+typedef void (*yahoo_connect_callback) (void *fd, int error,
+                                        void *callback_data);
 
 /*
@@ -72,5 +72,5 @@
  */
 
-/* 
+/*
  * should we use a callback structure or directly call functions
  * if you want the structure, you *must* define USE_STRUCT_CALLBACKS
@@ -80,27 +80,27 @@
 
 #ifdef USE_STRUCT_CALLBACKS
-#define YAHOO_CALLBACK_TYPE(x)	(*x)
+#define YAHOO_CALLBACK_TYPE(x)  (*x)
 struct yahoo_callbacks {
 #else
-#define YAHOO_CALLBACK_TYPE(x)	x
+#define YAHOO_CALLBACK_TYPE(x)  x
 #endif
 
 /*
  * Name: ext_yahoo_login_response
- * 	Called when the login process is complete
- * Params:
- * 	id   - the id that identifies the server connection
- * 	succ - enum yahoo_login_status
- * 	url  - url to reactivate account if locked
+ *      Called when the login process is complete
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      succ - enum yahoo_login_status
+ *      url  - url to reactivate account if locked
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_login_response) (int id, int succ,
-		const char *url);
+	                                                    const char *url);
 
 /*
  * Name: ext_yahoo_got_buddies
- * 	Called when the contact list is got from the server
- * Params:
- * 	id   - the id that identifies the server connection
- * 	buds - the buddy list
+ *      Called when the contact list is got from the server
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      buds - the buddy list
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddies) (int id, YList *buds);
@@ -108,8 +108,8 @@
 /*
  * Name: ext_yahoo_got_ignore
- * 	Called when the ignore list is got from the server
- * Params:
- * 	id   - the id that identifies the server connection
- * 	igns - the ignore list
+ *      Called when the ignore list is got from the server
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      igns - the ignore list
  */
 //	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ignore) (int id, YList *igns);
@@ -117,8 +117,8 @@
 /*
  * Name: ext_yahoo_got_identities
- * 	Called when the contact list is got from the server
- * Params:
- * 	id   - the id that identifies the server connection
- * 	ids  - the identity list
+ *      Called when the contact list is got from the server
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      ids  - the identity list
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_identities) (int id, YList *ids);
@@ -126,7 +126,7 @@
 /*
  * Name: ext_yahoo_got_cookies
- * 	Called when the cookie list is got from the server
- * Params:
- * 	id   - the id that identifies the server connection
+ *      Called when the cookie list is got from the server
+ * Params:
+ *      id   - the id that identifies the server connection
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_cookies) (int id);
@@ -134,179 +134,180 @@
 /*
  * Name: ext_yahoo_got_ping
- * 	Called when the ping packet is received from the server
- * Params:
- * 	id   - the id that identifies the server connection
+ *      Called when the ping packet is received from the server
+ * Params:
+ *      id   - the id that identifies the server connection
  *  errormsg - optional error message
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ping) (int id,
-		const char *errormsg);
+	                                              const char *errormsg);
 
 /*
  * Name: ext_yahoo_status_changed
- * 	Called when remote user's status changes.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	who  - the handle of the remote user
- * 	stat - status code (enum yahoo_status)
- * 	msg  - the message if stat == YAHOO_STATUS_CUSTOM
- * 	away - whether the contact is away or not (YAHOO_STATUS_CUSTOM)
- * 	idle - this is the number of seconds he is idle [if he is idle]
+ *      Called when remote user's status changes.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      who  - the handle of the remote user
+ *      stat - status code (enum yahoo_status)
+ *      msg  - the message if stat == YAHOO_STATUS_CUSTOM
+ *      away - whether the contact is away or not (YAHOO_STATUS_CUSTOM)
+ *      idle - this is the number of seconds he is idle [if he is idle]
  *	mobile - this is set for mobile users/buddies
  *	TODO: add support for pager, chat, and game states
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_status_changed) (int id,
-		const char *who, int stat, const char *msg, int away, int idle,
-		int mobile);
+	                                                    const char *who, int stat, const char *msg, int away,
+	                                                    int idle,
+	                                                    int mobile);
 
 /*
  * Name: ext_yahoo_got_buzz
- * 	Called when remote user sends you a buzz.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity the message was sent to
- * 	who  - the handle of the remote user
- * 	tm   - timestamp of message if offline
+ *      Called when remote user sends you a buzz.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity the message was sent to
+ *      who  - the handle of the remote user
+ *      tm   - timestamp of message if offline
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buzz) (int id, const char *me,
-		const char *who, long tm);
+	                                              const char *who, long tm);
 
 /*
  * Name: ext_yahoo_got_im
- * 	Called when remote user sends you a message.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity the message was sent to
- * 	who  - the handle of the remote user
- * 	msg  - the message - NULL if stat == 2
- * 	tm   - timestamp of message if offline
- * 	stat - message status - 0
- * 				1
- * 				2 == error sending message
- * 				5
- * 	utf8 - whether the message is encoded as utf8 or not
+ *      Called when remote user sends you a message.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity the message was sent to
+ *      who  - the handle of the remote user
+ *      msg  - the message - NULL if stat == 2
+ *      tm   - timestamp of message if offline
+ *      stat - message status - 0
+ *                              1
+ *                              2 == error sending message
+ *                              5
+ *      utf8 - whether the message is encoded as utf8 or not
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_im) (int id, const char *me,
-		const char *who, const char *msg, long tm, int stat, int utf8);
+	                                            const char *who, const char *msg, long tm, int stat, int utf8);
 
 /*
  * Name: ext_yahoo_got_conf_invite
- * 	Called when remote user sends you a conference invitation.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity the invitation was sent to
- * 	who  - the user inviting you
- * 	room - the room to join
- * 	msg  - the message
+ *      Called when remote user sends you a conference invitation.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity the invitation was sent to
+ *      who  - the user inviting you
+ *      room - the room to join
+ *      msg  - the message
  *	members - the initial members of the conference (null terminated list)
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_conf_invite) (int id,
-		const char *me, const char *who, const char *room,
-		const char *msg, YList *members);
+	                                                     const char *me, const char *who, const char *room,
+	                                                     const char *msg, YList *members);
 
 /*
  * Name: ext_yahoo_conf_userdecline
- * 	Called when someone declines to join the conference.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity in the conference
- * 	who  - the user who has declined
- * 	room - the room
- * 	msg  - the declining message
+ *      Called when someone declines to join the conference.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity in the conference
+ *      who  - the user who has declined
+ *      room - the room
+ *      msg  - the declining message
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userdecline) (int id,
-		const char *me, const char *who, const char *room,
-		const char *msg);
+	                                                      const char *me, const char *who, const char *room,
+	                                                      const char *msg);
 
 /*
  * Name: ext_yahoo_conf_userjoin
- * 	Called when someone joins the conference.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity in the conference
- * 	who  - the user who has joined
- * 	room - the room joined
+ *      Called when someone joins the conference.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity in the conference
+ *      who  - the user who has joined
+ *      room - the room joined
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userjoin) (int id,
-		const char *me, const char *who, const char *room);
+	                                                   const char *me, const char *who, const char *room);
 
 /*
  * Name: ext_yahoo_conf_userleave
- * 	Called when someone leaves the conference.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity in the conference
- * 	who  - the user who has left
- * 	room - the room left
+ *      Called when someone leaves the conference.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity in the conference
+ *      who  - the user who has left
+ *      room - the room left
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_userleave) (int id,
-		const char *me, const char *who, const char *room);
+	                                                    const char *me, const char *who, const char *room);
 
 /*
  * Name: ext_yahoo_chat_cat_xml
- * 	Called when ?
- * Params:
- * 	id      - the id that identifies the server connection
- * 	xml     - ?
+ *      Called when ?
+ * Params:
+ *      id      - the id that identifies the server connection
+ *      xml     - ?
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_cat_xml) (int id,
-		const char *xml);
+	                                                  const char *xml);
 
 /*
  * Name: ext_yahoo_chat_join
- * 	Called when joining the chatroom.
- * Params:
- * 	id      - the id that identifies the server connection
- * 	me   - the identity in the chatroom
- * 	room    - the room joined, used in all other chat calls, freed by 
- * 	          library after call
- * 	topic   - the topic of the room, freed by library after call
- *	members - the initial members of the chatroom (null terminated YList 
+ *      Called when joining the chatroom.
+ * Params:
+ *      id      - the id that identifies the server connection
+ *      me   - the identity in the chatroom
+ *      room    - the room joined, used in all other chat calls, freed by
+ *                library after call
+ *      topic   - the topic of the room, freed by library after call
+ *	members - the initial members of the chatroom (null terminated YList
  *	          of yahoo_chat_member's) Must be freed by the client
  *	fd	- the object where the connection is coming from (for tracking)
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_join) (int id, const char *me,
-		const char *room, const char *topic, YList *members, void *fd);
+	                                               const char *room, const char *topic, YList *members, void *fd);
 
 /*
  * Name: ext_yahoo_chat_userjoin
- * 	Called when someone joins the chatroom.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity in the chatroom
- * 	room - the room joined
- * 	who  - the user who has joined, Must be freed by the client
+ *      Called when someone joins the chatroom.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity in the chatroom
+ *      room - the room joined
+ *      who  - the user who has joined, Must be freed by the client
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userjoin) (int id,
-		const char *me, const char *room,
-		struct yahoo_chat_member *who);
+	                                                   const char *me, const char *room,
+	                                                   struct yahoo_chat_member *who);
 
 /*
  * Name: ext_yahoo_chat_userleave
- * 	Called when someone leaves the chatroom.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity in the chatroom
- * 	room - the room left
- * 	who  - the user who has left (Just the User ID)
+ *      Called when someone leaves the chatroom.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity in the chatroom
+ *      room - the room left
+ *      who  - the user who has left (Just the User ID)
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_userleave) (int id,
-		const char *me, const char *room, const char *who);
+	                                                    const char *me, const char *room, const char *who);
 
 /*
  * Name: ext_yahoo_chat_message
- * 	Called when someone messages in the chatroom.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity in the chatroom
- * 	room - the room
- * 	who  - the user who messaged (Just the user id)
- * 	msg  - the message
- * 	msgtype  - 1 = Normal message
- * 		   2 = /me type message
- * 	utf8 - whether the message is utf8 encoded or not
+ *      Called when someone messages in the chatroom.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity in the chatroom
+ *      room - the room
+ *      who  - the user who messaged (Just the user id)
+ *      msg  - the message
+ *      msgtype  - 1 = Normal message
+ *                 2 = /me type message
+ *      utf8 - whether the message is utf8 encoded or not
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_message) (int id,
-		const char *me, const char *who, const char *room,
-		const char *msg, int msgtype, int utf8);
+	                                                  const char *me, const char *who, const char *room,
+	                                                  const char *msg, int msgtype, int utf8);
 
 /*
@@ -315,14 +316,14 @@
  *	called when yahoo disconnects your chat session
  *	Note this is called whenver a disconnect happens, client or server
- *	requested. Care should be taken to make sure you know the origin 
+ *	requested. Care should be taken to make sure you know the origin
  *	of the disconnect request before doing anything here (auto-join's etc)
  * Params:
  *	id   - the id that identifies this connection
- * 	me   - the identity in the chatroom
+ *      me   - the identity in the chatroom
  * Returns:
  *	nothing.
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahoologout) (int id,
-		const char *me);
+	                                                      const char *me);
 
 /*
@@ -332,41 +333,41 @@
  *	Note this is called whenver chat message is sent into a room
  *	in error (fd not connected, room doesn't exists etc)
- *	Care should be taken to make sure you know the origin 
+ *	Care should be taken to make sure you know the origin
  *	of the error before doing anything about it.
  * Params:
  *	id   - the id that identifies this connection
- * 	me   - the identity in the chatroom
+ *      me   - the identity in the chatroom
  * Returns:
  *	nothing.
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_chat_yahooerror) (int id,
-		const char *me);
+	                                                     const char *me);
 
 /*
  * Name: ext_yahoo_conf_message
- * 	Called when someone messages in the conference.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity the conf message was sent to
- * 	who  - the user who messaged
- * 	room - the room
- * 	msg  - the message
- * 	utf8 - whether the message is utf8 encoded or not
+ *      Called when someone messages in the conference.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity the conf message was sent to
+ *      who  - the user who messaged
+ *      room - the room
+ *      msg  - the message
+ *      utf8 - whether the message is utf8 encoded or not
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_conf_message) (int id,
-		const char *me, const char *who, const char *room,
-		const char *msg, int utf8);
+	                                                  const char *me, const char *who, const char *room,
+	                                                  const char *msg, int utf8);
 
 /*
  * Name: ext_yahoo_got_file
- * 	Called when someone sends you a file
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the identity the file was sent to
- * 	who  - the user who sent the file
- * 	msg  - the message
- * 	fname- the file name if direct transfer
- * 	fsize- the file size if direct transfer
- * 	trid - transfer id. Unique for this transfer
+ *      Called when someone sends you a file
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the identity the file was sent to
+ *      who  - the user who sent the file
+ *      msg  - the message
+ *      fname- the file name if direct transfer
+ *      fsize- the file size if direct transfer
+ *      trid - transfer id. Unique for this transfer
  *
  * NOTE: Subsequent callbacks for file transfer do not send all of this
@@ -376,156 +377,157 @@
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_file) (int id, const char *me,
-		const char *who, const char *msg, const char *fname,
-		unsigned long fesize, char *trid);
+	                                              const char *who, const char *msg, const char *fname,
+	                                              unsigned long fesize, char *trid);
 
 /*
  * Name: ext_yahoo_got_ft_data
- * 	Called multiple times when parts of the file are received
- * Params:
- * 	id   - the id that identifies the server connection
- * 	in   - The data
- * 	len  - Length of the data
- * 	data - callback data
+ *      Called multiple times when parts of the file are received
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      in   - The data
+ *      len  - Length of the data
+ *      data - callback data
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_ft_data) (int id,
-		const unsigned char *in, int len, void *data);
+	                                                 const unsigned char *in, int len, void *data);
 
 /*
  * Name: ext_yahoo_file_transfer_done
- * 	File transfer is done
- * Params:
- * 	id     - the id that identifies the server connection
- * 	result - To notify if it finished successfully or with a failure
- * 	data   - callback data
+ *      File transfer is done
+ * Params:
+ *      id     - the id that identifies the server connection
+ *      result - To notify if it finished successfully or with a failure
+ *      data   - callback data
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_file_transfer_done) (int id,
-		int result, void *data);
+	                                                        int result, void *data);
 
 /*
  * Name: ext_yahoo_contact_added
- * 	Called when a contact is added to your list
- * Params:
- * 	id   - the id that identifies the server connection
- * 	myid - the identity he was added to
- * 	who  - who was added
- * 	msg  - any message sent
+ *      Called when a contact is added to your list
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      myid - the identity he was added to
+ *      who  - who was added
+ *      msg  - any message sent
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_contact_added) (int id,
-		const char *myid, const char *who, const char *msg);
+	                                                   const char *myid, const char *who, const char *msg);
 
 /*
  * Name: ext_yahoo_rejected
- * 	Called when a contact rejects your add
- * Params:
- * 	id   - the id that identifies the server connection
- * 	who  - who rejected you
- * 	msg  - any message sent
+ *      Called when a contact rejects your add
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      who  - who rejected you
+ *      msg  - any message sent
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_rejected) (int id, const char *who,
-		const char *msg);
+	                                              const char *msg);
 
 /*
  * Name: ext_yahoo_typing_notify
- * 	Called when remote user starts or stops typing.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the handle of the identity the notification is sent to
- * 	who  - the handle of the remote user
- * 	stat - 1 if typing, 0 if stopped typing
+ *      Called when remote user starts or stops typing.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the handle of the identity the notification is sent to
+ *      who  - the handle of the remote user
+ *      stat - 1 if typing, 0 if stopped typing
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_typing_notify) (int id,
-		const char *me, const char *who, int stat);
+	                                                   const char *me, const char *who, int stat);
 
 /*
  * Name: ext_yahoo_game_notify
- * 	Called when remote user starts or stops a game.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the handle of the identity the notification is sent to
- * 	who  - the handle of the remote user
- * 	stat - 1 if game, 0 if stopped gaming
- * 	msg  - game description and/or other text
+ *      Called when remote user starts or stops a game.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the handle of the identity the notification is sent to
+ *      who  - the handle of the remote user
+ *      stat - 1 if game, 0 if stopped gaming
+ *      msg  - game description and/or other text
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_game_notify) (int id, const char *me,
-		const char *who, int stat, const char *msg);
+	                                                 const char *who, int stat, const char *msg);
 
 /*
  * Name: ext_yahoo_mail_notify
- * 	Called when you receive mail, or with number of messages
- * Params:
- * 	id   - the id that identifies the server connection
- * 	from - who the mail is from - NULL if only mail count
- * 	subj - the subject of the mail - NULL if only mail count
- * 	cnt  - mail count - 0 if new mail notification
+ *      Called when you receive mail, or with number of messages
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      from - who the mail is from - NULL if only mail count
+ *      subj - the subject of the mail - NULL if only mail count
+ *      cnt  - mail count - 0 if new mail notification
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_mail_notify) (int id,
-		const char *from, const char *subj, int cnt);
+	                                                 const char *from, const char *subj, int cnt);
 
 /*
  * Name: ext_yahoo_system_message
- * 	System message
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - the handle of the identity the notification is sent to
- * 	who  - the source of the system message (there are different types)
- * 	msg  - the message
+ *      System message
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - the handle of the identity the notification is sent to
+ *      who  - the source of the system message (there are different types)
+ *      msg  - the message
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_system_message) (int id,
-		const char *me, const char *who, const char *msg);
+	                                                    const char *me, const char *who, const char *msg);
 
 /*
  * Name: ext_yahoo_got_buddyicon
- * 	Buddy icon received
- * Params:
- * 	id - the id that identifies the server connection
- * 	me - the handle of the identity the notification is sent to
- * 	who - the person the buddy icon is for
- * 	url - the url to use to load the icon
- * 	checksum - the checksum of the icon content
+ *      Buddy icon received
+ * Params:
+ *      id - the id that identifies the server connection
+ *      me - the handle of the identity the notification is sent to
+ *      who - the person the buddy icon is for
+ *      url - the url to use to load the icon
+ *      checksum - the checksum of the icon content
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon) (int id,
-		const char *me, const char *who, const char *url, int checksum);
+	                                                   const char *me, const char *who, const char *url,
+	                                                   int checksum);
 
 /*
  * Name: ext_yahoo_got_buddyicon_checksum
- * 	Buddy icon checksum received
- * Params:
- * 	id - the id that identifies the server connection
- * 	me - the handle of the identity the notification is sent to
- * 	who - the yahoo id of the buddy icon checksum is for
- * 	checksum - the checksum of the icon content
+ *      Buddy icon checksum received
+ * Params:
+ *      id - the id that identifies the server connection
+ *      me - the handle of the identity the notification is sent to
+ *      who - the yahoo id of the buddy icon checksum is for
+ *      checksum - the checksum of the icon content
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_checksum) (int id,
-		const char *me, const char *who, int checksum);
+	                                                            const char *me, const char *who, int checksum);
 
 /*
  * Name: ext_yahoo_got_buddyicon_request
- * 	Buddy icon request received
- * Params:
- * 	id - the id that identifies the server connection
- * 	me - the handle of the identity the notification is sent to
- * 	who - the yahoo id of the buddy that requested the buddy icon
+ *      Buddy icon request received
+ * Params:
+ *      id - the id that identifies the server connection
+ *      me - the handle of the identity the notification is sent to
+ *      who - the yahoo id of the buddy that requested the buddy icon
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddyicon_request) (int id,
-		const char *me, const char *who);
+	                                                           const char *me, const char *who);
 
 /*
  * Name: ext_yahoo_got_buddyicon_request
- * 	Buddy icon request received
- * Params:
- * 	id - the id that identifies the server connection
- * 	url - remote url, the uploaded buddy icon can be fetched from
+ *      Buddy icon request received
+ * Params:
+ *      id - the id that identifies the server connection
+ *      url - remote url, the uploaded buddy icon can be fetched from
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_buddyicon_uploaded) (int id,
-		const char *url);
+	                                                        const char *url);
 
 /*
  * Name: ext_yahoo_got_webcam_image
- * 	Called when you get a webcam update
+ *      Called when you get a webcam update
  *	An update can either be receiving an image, a part of an image or
  *	just an update with a timestamp
  * Params:
- * 	id         - the id that identifies the server connection
- * 	who        - the user who's webcam we're viewing
+ *      id         - the id that identifies the server connection
+ *      who        - the user who's webcam we're viewing
  *	image      - image data
  *	image_size - length of the image in bytes
@@ -544,37 +546,37 @@
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_webcam_image) (int id,
-		const char *who, const unsigned char *image,
-		unsigned int image_size, unsigned int real_size,
-		unsigned int timestamp);
+	                                                      const char *who, const unsigned char *image,
+	                                                      unsigned int image_size, unsigned int real_size,
+	                                                      unsigned int timestamp);
 
 /*
  * Name: ext_yahoo_webcam_invite
- * 	Called when you get a webcam invitation
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - identity the invitation is to
- * 	from - who the invitation is from
+ *      Called when you get a webcam invitation
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - identity the invitation is to
+ *      from - who the invitation is from
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite) (int id,
-		const char *me, const char *from);
+	                                                   const char *me, const char *from);
 
 /*
  * Name: ext_yahoo_webcam_invite_reply
- * 	Called when you get a response to a webcam invitation
- * Params:
- * 	id   - the id that identifies the server connection
- * 	me   - identity the invitation response is to
- * 	from - who the invitation response is from
+ *      Called when you get a response to a webcam invitation
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      me   - identity the invitation response is to
+ *      from - who the invitation response is from
  *	accept - 0 (decline), 1 (accept)
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_invite_reply) (int id,
-		const char *me, const char *from, int accept);
+	                                                         const char *me, const char *from, int accept);
 
 /*
  * Name: ext_yahoo_webcam_closed
- * 	Called when the webcam connection closed
- * Params:
- * 	id   - the id that identifies the server connection
- * 	who  - the user who we where connected to
+ *      Called when the webcam connection closed
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      who  - the user who we where connected to
  *	reason - reason why the connection closed
  *	         1 = user stopped broadcasting
@@ -584,5 +586,5 @@
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_closed) (int id,
-		const char *who, int reason);
+	                                                   const char *who, int reason);
 
 /*
@@ -590,26 +592,26 @@
  *      Called when the search result received from server
  * Params:
- *      id  	 - the id that identifies the server connection
- * 	found	 - total number of results returned in the current result set
- * 	start	 - offset from where the current result set starts
- * 	total	 - total number of results available (start + found <= total)
- * 	contacts - the list of results as a YList of yahoo_found_contact
- * 		   these will be freed after this function returns, so
- * 		   if you need to use the information, make a copy
+ *      id       - the id that identifies the server connection
+ *      found	 - total number of results returned in the current result set
+ *      start	 - offset from where the current result set starts
+ *      total	 - total number of results available (start + found <= total)
+ *      contacts - the list of results as a YList of yahoo_found_contact
+ *                 these will be freed after this function returns, so
+ *                 if you need to use the information, make a copy
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_search_result) (int id,
-		int found, int start, int total, YList *contacts);
+	                                                       int found, int start, int total, YList *contacts);
 
 /*
  * Name: ext_yahoo_error
- * 	Called on error.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	err  - the error message
- * 	fatal- whether this error is fatal to the connection or not
- * 	num  - Which error is this
+ *      Called on error.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      err  - the error message
+ *      fatal- whether this error is fatal to the connection or not
+ *      num  - Which error is this
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_error) (int id, const char *err,
-		int fatal, int num);
+	                                           int fatal, int num);
 
 /*
@@ -622,5 +624,5 @@
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_viewer) (int id,
-		const char *who, int connect);
+	                                                   const char *who, int connect);
 
 /*
@@ -632,13 +634,13 @@
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_webcam_data_request) (int id,
-		int send);
+	                                                         int send);
 
 /*
  * Name: ext_yahoo_log
- * 	Called to log a message.
- * Params:
- * 	fmt  - the printf formatted message
- * Returns:
- * 	0
+ *      Called to log a message.
+ * Params:
+ *      fmt  - the printf formatted message
+ * Returns:
+ *      0
  */
 	int YAHOO_CALLBACK_TYPE(ext_yahoo_log) (const char *fmt, ...);
@@ -646,24 +648,24 @@
 /*
  * Name: ext_yahoo_add_handler
- * 	Add a listener for the fd.  Must call yahoo_read_ready
- * 	when a YAHOO_INPUT_READ fd is ready and yahoo_write_ready
- * 	when a YAHOO_INPUT_WRITE fd is ready.
- * Params:
- * 	id   - the id that identifies the server connection
- * 	fd   - the fd object on which to listen
- * 	cond - the condition on which to call the callback
- * 	data - callback data to pass to yahoo_*_ready
- * 	
+ *      Add a listener for the fd.  Must call yahoo_read_ready
+ *      when a YAHOO_INPUT_READ fd is ready and yahoo_write_ready
+ *      when a YAHOO_INPUT_WRITE fd is ready.
+ * Params:
+ *      id   - the id that identifies the server connection
+ *      fd   - the fd object on which to listen
+ *      cond - the condition on which to call the callback
+ *      data - callback data to pass to yahoo_*_ready
+ *
  * Returns: a tag to be used when removing the handler
  */
 	int YAHOO_CALLBACK_TYPE(ext_yahoo_add_handler) (int id, void *fd,
-		yahoo_input_condition cond, void *data);
+	                                                yahoo_input_condition cond, void *data);
 
 /*
  * Name: ext_yahoo_remove_handler
- * 	Remove the listener for the fd.
- * Params:
- * 	id   - the id that identifies the connection
- * 	tag  - the handler tag to remove
+ *      Remove the listener for the fd.
+ * Params:
+ *      id   - the id that identifies the connection
+ *      tag  - the handler tag to remove
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_remove_handler) (int id, int tag);
@@ -671,10 +673,10 @@
 /*
  * Name: ext_yahoo_connect
- * 	Connect to a host:port
- * Params:
- * 	host - the host to connect to
- * 	port - the port to connect on
- * Returns:
- * 	a unix file descriptor to the socket
+ *      Connect to a host:port
+ * Params:
+ *      host - the host to connect to
+ *      port - the port to connect on
+ * Returns:
+ *      a unix file descriptor to the socket
  */
 //	int YAHOO_CALLBACK_TYPE(ext_yahoo_connect) (const char *host, int port);
@@ -682,32 +684,32 @@
 /*
  * Name: ext_yahoo_connect_async
- * 	Connect to a host:port asynchronously. This function should return
- * 	immediately returing a tag used to identify the connection handler,
- * 	or a pre-connect error (eg: host name lookup failure).
- * 	Once the connect completes (successfully or unsuccessfully), callback
- * 	should be called (see the signature for yahoo_connect_callback).
- * 	The callback may safely be called before this function returns, but
- * 	it should not be called twice.
- * Params:
- * 	id   - the id that identifies this connection
- * 	host - the host to connect to
- * 	port - the port to connect on
- * 	callback - function to call when connect completes
- * 	callback_data - data to pass to the callback function
- * 	use_ssl - Whether we need an SSL connection
- * Returns:
- * 	a tag signifying the connection attempt
+ *      Connect to a host:port asynchronously. This function should return
+ *      immediately returing a tag used to identify the connection handler,
+ *      or a pre-connect error (eg: host name lookup failure).
+ *      Once the connect completes (successfully or unsuccessfully), callback
+ *      should be called (see the signature for yahoo_connect_callback).
+ *      The callback may safely be called before this function returns, but
+ *      it should not be called twice.
+ * Params:
+ *      id   - the id that identifies this connection
+ *      host - the host to connect to
+ *      port - the port to connect on
+ *      callback - function to call when connect completes
+ *      callback_data - data to pass to the callback function
+ *      use_ssl - Whether we need an SSL connection
+ * Returns:
+ *      a tag signifying the connection attempt
  */
 	int YAHOO_CALLBACK_TYPE(ext_yahoo_connect_async) (int id,
-		const char *host, int port, yahoo_connect_callback callback,
-		void *callback_data, int use_ssl);
+	                                                  const char *host, int port, yahoo_connect_callback callback,
+	                                                  void *callback_data, int use_ssl);
 
 /*
  * Name: ext_yahoo_get_ip_addr
- * 	get IP Address for a domain name
- * Params:
- * 	domain - Domain name
- * Returns:
- * 	Newly allocated string containing the IP Address in IPv4 notation
+ *      get IP Address for a domain name
+ * Params:
+ *      domain - Domain name
+ * Returns:
+ *      Newly allocated string containing the IP Address in IPv4 notation
  */
 	char *YAHOO_CALLBACK_TYPE(ext_yahoo_get_ip_addr) (const char *domain);
@@ -715,11 +717,11 @@
 /*
  * Name: ext_yahoo_write
- * 	Write data from the buffer into the socket for the specified connection
- * Params:
- * 	fd  - the file descriptor object that identifies this connection
- * 	buf - Buffer to write the data from
- * 	len - Length of the data
- * Returns:
- * 	Number of bytes written or -1 for error
+ *      Write data from the buffer into the socket for the specified connection
+ * Params:
+ *      fd  - the file descriptor object that identifies this connection
+ *      buf - Buffer to write the data from
+ *      len - Length of the data
+ * Returns:
+ *      Number of bytes written or -1 for error
  */
 	int YAHOO_CALLBACK_TYPE(ext_yahoo_write) (void *fd, char *buf, int len);
@@ -727,11 +729,11 @@
 /*
  * Name: ext_yahoo_read
- * 	Read data into a buffer from socket for the specified connection
- * Params:
- * 	fd  - the file descriptor object that identifies this connection
- * 	buf - Buffer to read the data into
- * 	len - Max length to read
- * Returns:
- * 	Number of bytes read or -1 for error
+ *      Read data into a buffer from socket for the specified connection
+ * Params:
+ *      fd  - the file descriptor object that identifies this connection
+ *      buf - Buffer to read the data into
+ *      len - Max length to read
+ * Returns:
+ *      Number of bytes read or -1 for error
  */
 	int YAHOO_CALLBACK_TYPE(ext_yahoo_read) (void *fd, char *buf, int len);
@@ -739,10 +741,10 @@
 /*
  * Name: ext_yahoo_close
- * 	Close the file descriptor object and free its resources. Libyahoo2 will not
- * 	use this object again.
- * Params:
- * 	fd  - the file descriptor object that identifies this connection
- * Returns:
- * 	Nothing
+ *      Close the file descriptor object and free its resources. Libyahoo2 will not
+ *      use this object again.
+ * Params:
+ *      fd  - the file descriptor object that identifies this connection
+ * Returns:
+ *      Nothing
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_close) (void *fd);
@@ -750,17 +752,18 @@
 /*
  * Name: ext_yahoo_got_buddy_change_group
- * 	Acknowledgement of buddy changing group
- * Params:
- * 	id: client id
- * 	me: The user
- * 	who: Buddy name
- * 	old_group: Old group name
- * 	new_group: New group name
- * Returns:
- * 	Nothing
+ *      Acknowledgement of buddy changing group
+ * Params:
+ *      id: client id
+ *      me: The user
+ *      who: Buddy name
+ *      old_group: Old group name
+ *      new_group: New group name
+ * Returns:
+ *      Nothing
  */
 	void YAHOO_CALLBACK_TYPE(ext_yahoo_got_buddy_change_group) (int id,
-		const char *me, const char *who, const char *old_group,
-		const char *new_group);
+	                                                            const char *me, const char *who,
+	                                                            const char *old_group,
+	                                                            const char *new_group);
 
 #ifdef USE_STRUCT_CALLBACKS
Index: protocols/yahoo/yahoo2_types.h
===================================================================
--- protocols/yahoo/yahoo2_types.h	(revision 25c4c78e2ddad482dfc9d5a104f76325fcc2f8e5)
+++ protocols/yahoo/yahoo2_types.h	(revision 9216eff1a59e9d4a24b63c16ba4c2cacd051332c)
@@ -29,173 +29,173 @@
 #endif
 
-	enum yahoo_service {	/* these are easier to see in hex */
-		YAHOO_SERVICE_LOGON = 1,
-		YAHOO_SERVICE_LOGOFF,
-		YAHOO_SERVICE_ISAWAY,
-		YAHOO_SERVICE_ISBACK,
-		YAHOO_SERVICE_IDLE,	/* 5 (placemarker) */
-		YAHOO_SERVICE_MESSAGE,
-		YAHOO_SERVICE_IDACT,
-		YAHOO_SERVICE_IDDEACT,
-		YAHOO_SERVICE_MAILSTAT,
-		YAHOO_SERVICE_USERSTAT,	/* 0xa */
-		YAHOO_SERVICE_NEWMAIL,
-		YAHOO_SERVICE_CHATINVITE,
-		YAHOO_SERVICE_CALENDAR,
-		YAHOO_SERVICE_NEWPERSONALMAIL,
-		YAHOO_SERVICE_NEWCONTACT,
-		YAHOO_SERVICE_ADDIDENT,	/* 0x10 */
-		YAHOO_SERVICE_ADDIGNORE,
-		YAHOO_SERVICE_PING,
-		YAHOO_SERVICE_GOTGROUPRENAME,	/* < 1, 36(old), 37(new) */
-		YAHOO_SERVICE_SYSMESSAGE = 0x14,
-		YAHOO_SERVICE_SKINNAME = 0x15,
-		YAHOO_SERVICE_PASSTHROUGH2 = 0x16,
-		YAHOO_SERVICE_CONFINVITE = 0x18,
-		YAHOO_SERVICE_CONFLOGON,
-		YAHOO_SERVICE_CONFDECLINE,
-		YAHOO_SERVICE_CONFLOGOFF,
-		YAHOO_SERVICE_CONFADDINVITE,
-		YAHOO_SERVICE_CONFMSG,
-		YAHOO_SERVICE_CHATLOGON,
-		YAHOO_SERVICE_CHATLOGOFF,
-		YAHOO_SERVICE_CHATMSG = 0x20,
-		YAHOO_SERVICE_GAMELOGON = 0x28,
-		YAHOO_SERVICE_GAMELOGOFF,
-		YAHOO_SERVICE_GAMEMSG = 0x2a,
-		YAHOO_SERVICE_FILETRANSFER = 0x46,
-		YAHOO_SERVICE_VOICECHAT = 0x4A,
-		YAHOO_SERVICE_NOTIFY,
-		YAHOO_SERVICE_VERIFY,
-		YAHOO_SERVICE_P2PFILEXFER,
-		YAHOO_SERVICE_PEERTOPEER = 0x4F,	/* Checks if P2P possible */
-		YAHOO_SERVICE_WEBCAM,
-		YAHOO_SERVICE_AUTHRESP = 0x54,
-		YAHOO_SERVICE_LIST,
-		YAHOO_SERVICE_AUTH = 0x57,
-		YAHOO_SERVICE_AUTHBUDDY = 0x6d,
-		YAHOO_SERVICE_ADDBUDDY = 0x83,
-		YAHOO_SERVICE_REMBUDDY,
-		YAHOO_SERVICE_IGNORECONTACT,	/* > 1, 7, 13 < 1, 66, 13, 0 */
-		YAHOO_SERVICE_REJECTCONTACT,
-		YAHOO_SERVICE_GROUPRENAME = 0x89,	/* > 1, 65(new), 66(0), 67(old) */
-		YAHOO_SERVICE_Y7_PING = 0x8A,
-		YAHOO_SERVICE_CHATONLINE = 0x96,	/* > 109(id), 1, 6(abcde) < 0,1 */
-		YAHOO_SERVICE_CHATGOTO,
-		YAHOO_SERVICE_CHATJOIN,	/* > 1 104-room 129-1600326591 62-2 */
-		YAHOO_SERVICE_CHATLEAVE,
-		YAHOO_SERVICE_CHATEXIT = 0x9b,
-		YAHOO_SERVICE_CHATADDINVITE = 0x9d,
-		YAHOO_SERVICE_CHATLOGOUT = 0xa0,
-		YAHOO_SERVICE_CHATPING,
-		YAHOO_SERVICE_COMMENT = 0xa8,
-		YAHOO_SERVICE_GAME_INVITE = 0xb7,
-		YAHOO_SERVICE_STEALTH_PERM = 0xb9,
-		YAHOO_SERVICE_STEALTH_SESSION = 0xba,
-		YAHOO_SERVICE_AVATAR = 0xbc,
-		YAHOO_SERVICE_PICTURE_CHECKSUM = 0xbd,
-		YAHOO_SERVICE_PICTURE = 0xbe,
-		YAHOO_SERVICE_PICTURE_UPDATE = 0xc1,
-		YAHOO_SERVICE_PICTURE_UPLOAD = 0xc2,
-		YAHOO_SERVICE_YAB_UPDATE = 0xc4,
-		YAHOO_SERVICE_Y6_VISIBLE_TOGGLE = 0xc5,	/* YMSG13, key 13: 2 = invisible, 1 = visible */
-		YAHOO_SERVICE_Y6_STATUS_UPDATE = 0xc6,	/* YMSG13 */
-		YAHOO_SERVICE_PICTURE_STATUS = 0xc7,	/* YMSG13, key 213: 0 = none, 1 = avatar, 2 = picture */
-		YAHOO_SERVICE_VERIFY_ID_EXISTS = 0xc8,
-		YAHOO_SERVICE_AUDIBLE = 0xd0,
-		YAHOO_SERVICE_Y7_PHOTO_SHARING = 0xd2,
-		YAHOO_SERVICE_Y7_CONTACT_DETAILS = 0xd3,	/* YMSG13 */
-		YAHOO_SERVICE_Y7_CHAT_SESSION = 0xd4,
-		YAHOO_SERVICE_Y7_AUTHORIZATION = 0xd6,	/* YMSG13 */
-		YAHOO_SERVICE_Y7_FILETRANSFER = 0xdc,	/* YMSG13 */
-		YAHOO_SERVICE_Y7_FILETRANSFERINFO,	/* YMSG13 */
-		YAHOO_SERVICE_Y7_FILETRANSFERACCEPT,	/* YMSG13 */
-		YAHOO_SERVICE_Y7_MINGLE = 0xe1,	/* YMSG13 */
-		YAHOO_SERVICE_Y7_CHANGE_GROUP = 0xe7,	/* YMSG13 */
-		YAHOO_SERVICE_MYSTERY = 0xef,	/* Don't know what this is for */
-		YAHOO_SERVICE_Y8_STATUS = 0xf0,	/* YMSG15 */
-		YAHOO_SERVICE_Y8_LIST = 0Xf1,	/* YMSG15 */
-		YAHOO_SERVICE_MESSAGE_CONFIRM = 0xfb,
-		YAHOO_SERVICE_WEBLOGIN = 0x0226,
-		YAHOO_SERVICE_SMS_MSG = 0x02ea
-	};
-
-	enum yahoo_status {
-		YAHOO_STATUS_AVAILABLE = 0,
-		YAHOO_STATUS_BRB,
-		YAHOO_STATUS_BUSY,
-		YAHOO_STATUS_NOTATHOME,
-		YAHOO_STATUS_NOTATDESK,
-		YAHOO_STATUS_NOTINOFFICE,
-		YAHOO_STATUS_ONPHONE,
-		YAHOO_STATUS_ONVACATION,
-		YAHOO_STATUS_OUTTOLUNCH,
-		YAHOO_STATUS_STEPPEDOUT,
-		YAHOO_STATUS_INVISIBLE = 12,
-		YAHOO_STATUS_CUSTOM = 99,
-		YAHOO_STATUS_IDLE = 999,
-		YAHOO_STATUS_OFFLINE = 0x5a55aa56	/* don't ask */
-	};
-
-	enum ypacket_status {
-		YPACKET_STATUS_DISCONNECTED = -1,
-		YPACKET_STATUS_DEFAULT = 0,
-		YPACKET_STATUS_SERVERACK = 1,
-		YPACKET_STATUS_GAME = 0x2,
-		YPACKET_STATUS_AWAY = 0x4,
-		YPACKET_STATUS_CONTINUED = 0x5,
-		YPACKET_STATUS_INVISIBLE = 12,
-		YPACKET_STATUS_NOTIFY = 0x16,	/* TYPING */
-		YPACKET_STATUS_WEBLOGIN = 0x5a55aa55,
-		YPACKET_STATUS_OFFLINE = 0x5a55aa56
-	};
-
-#define YAHOO_STATUS_GAME	0x2	/* Games don't fit into the regular status model */
-
-	enum yahoo_login_status {
-		YAHOO_LOGIN_OK = 0,
-		YAHOO_LOGIN_LOGOFF = 1,
-		YAHOO_LOGIN_UNAME = 3,
-		YAHOO_LOGIN_PASSWD = 13,
-		YAHOO_LOGIN_LOCK = 14,
-		YAHOO_LOGIN_DUPL = 99,
-		YAHOO_LOGIN_SOCK = -1,
-		YAHOO_LOGIN_UNKNOWN = 999
-	};
-
-	enum yahoo_error {
-		E_UNKNOWN = -1,
-		E_CONNECTION = -2,
-		E_SYSTEM = -3,
-		E_CUSTOM = 0,
-
-		/* responses from ignore buddy */
-		E_IGNOREDUP = 2,
-		E_IGNORENONE = 3,
-		E_IGNORECONF = 12,
-
-		/* conference */
-		E_CONFNOTAVAIL = 20
-	};
-
-	enum yahoo_log_level {
-		YAHOO_LOG_NONE = 0,
-		YAHOO_LOG_FATAL,
-		YAHOO_LOG_ERR,
-		YAHOO_LOG_WARNING,
-		YAHOO_LOG_NOTICE,
-		YAHOO_LOG_INFO,
-		YAHOO_LOG_DEBUG
-	};
-
-	enum yahoo_file_transfer {
-		YAHOO_FILE_TRANSFER_INIT = 1,
-		YAHOO_FILE_TRANSFER_ACCEPT = 3,
-		YAHOO_FILE_TRANSFER_REJECT = 4,
-		YAHOO_FILE_TRANSFER_DONE = 5,
-		YAHOO_FILE_TRANSFER_RELAY,
-		YAHOO_FILE_TRANSFER_FAILED,
-		YAHOO_FILE_TRANSFER_UNKNOWN
-	};
+enum yahoo_service {            /* these are easier to see in hex */
+	YAHOO_SERVICE_LOGON = 1,
+	YAHOO_SERVICE_LOGOFF,
+	YAHOO_SERVICE_ISAWAY,
+	YAHOO_SERVICE_ISBACK,
+	YAHOO_SERVICE_IDLE,             /* 5 (placemarker) */
+	YAHOO_SERVICE_MESSAGE,
+	YAHOO_SERVICE_IDACT,
+	YAHOO_SERVICE_IDDEACT,
+	YAHOO_SERVICE_MAILSTAT,
+	YAHOO_SERVICE_USERSTAT,         /* 0xa */
+	YAHOO_SERVICE_NEWMAIL,
+	YAHOO_SERVICE_CHATINVITE,
+	YAHOO_SERVICE_CALENDAR,
+	YAHOO_SERVICE_NEWPERSONALMAIL,
+	YAHOO_SERVICE_NEWCONTACT,
+	YAHOO_SERVICE_ADDIDENT,         /* 0x10 */
+	YAHOO_SERVICE_ADDIGNORE,
+	YAHOO_SERVICE_PING,
+	YAHOO_SERVICE_GOTGROUPRENAME,           /* < 1, 36(old), 37(new) */
+	YAHOO_SERVICE_SYSMESSAGE = 0x14,
+	YAHOO_SERVICE_SKINNAME = 0x15,
+	YAHOO_SERVICE_PASSTHROUGH2 = 0x16,
+	YAHOO_SERVICE_CONFINVITE = 0x18,
+	YAHOO_SERVICE_CONFLOGON,
+	YAHOO_SERVICE_CONFDECLINE,
+	YAHOO_SERVICE_CONFLOGOFF,
+	YAHOO_SERVICE_CONFADDINVITE,
+	YAHOO_SERVICE_CONFMSG,
+	YAHOO_SERVICE_CHATLOGON,
+	YAHOO_SERVICE_CHATLOGOFF,
+	YAHOO_SERVICE_CHATMSG = 0x20,
+	YAHOO_SERVICE_GAMELOGON = 0x28,
+	YAHOO_SERVICE_GAMELOGOFF,
+	YAHOO_SERVICE_GAMEMSG = 0x2a,
+	YAHOO_SERVICE_FILETRANSFER = 0x46,
+	YAHOO_SERVICE_VOICECHAT = 0x4A,
+	YAHOO_SERVICE_NOTIFY,
+	YAHOO_SERVICE_VERIFY,
+	YAHOO_SERVICE_P2PFILEXFER,
+	YAHOO_SERVICE_PEERTOPEER = 0x4F,                /* Checks if P2P possible */
+	YAHOO_SERVICE_WEBCAM,
+	YAHOO_SERVICE_AUTHRESP = 0x54,
+	YAHOO_SERVICE_LIST,
+	YAHOO_SERVICE_AUTH = 0x57,
+	YAHOO_SERVICE_AUTHBUDDY = 0x6d,
+	YAHOO_SERVICE_ADDBUDDY = 0x83,
+	YAHOO_SERVICE_REMBUDDY,
+	YAHOO_SERVICE_IGNORECONTACT,            /* > 1, 7, 13 < 1, 66, 13, 0 */
+	YAHOO_SERVICE_REJECTCONTACT,
+	YAHOO_SERVICE_GROUPRENAME = 0x89,               /* > 1, 65(new), 66(0), 67(old) */
+	YAHOO_SERVICE_Y7_PING = 0x8A,
+	YAHOO_SERVICE_CHATONLINE = 0x96,                /* > 109(id), 1, 6(abcde) < 0,1 */
+	YAHOO_SERVICE_CHATGOTO,
+	YAHOO_SERVICE_CHATJOIN,         /* > 1 104-room 129-1600326591 62-2 */
+	YAHOO_SERVICE_CHATLEAVE,
+	YAHOO_SERVICE_CHATEXIT = 0x9b,
+	YAHOO_SERVICE_CHATADDINVITE = 0x9d,
+	YAHOO_SERVICE_CHATLOGOUT = 0xa0,
+	YAHOO_SERVICE_CHATPING,
+	YAHOO_SERVICE_COMMENT = 0xa8,
+	YAHOO_SERVICE_GAME_INVITE = 0xb7,
+	YAHOO_SERVICE_STEALTH_PERM = 0xb9,
+	YAHOO_SERVICE_STEALTH_SESSION = 0xba,
+	YAHOO_SERVICE_AVATAR = 0xbc,
+	YAHOO_SERVICE_PICTURE_CHECKSUM = 0xbd,
+	YAHOO_SERVICE_PICTURE = 0xbe,
+	YAHOO_SERVICE_PICTURE_UPDATE = 0xc1,
+	YAHOO_SERVICE_PICTURE_UPLOAD = 0xc2,
+	YAHOO_SERVICE_YAB_UPDATE = 0xc4,
+	YAHOO_SERVICE_Y6_VISIBLE_TOGGLE = 0xc5,         /* YMSG13, key 13: 2 = invisible, 1 = visible */
+	YAHOO_SERVICE_Y6_STATUS_UPDATE = 0xc6,          /* YMSG13 */
+	YAHOO_SERVICE_PICTURE_STATUS = 0xc7,            /* YMSG13, key 213: 0 = none, 1 = avatar, 2 = picture */
+	YAHOO_SERVICE_VERIFY_ID_EXISTS = 0xc8,
+	YAHOO_SERVICE_AUDIBLE = 0xd0,
+	YAHOO_SERVICE_Y7_PHOTO_SHARING = 0xd2,
+	YAHOO_SERVICE_Y7_CONTACT_DETAILS = 0xd3,                /* YMSG13 */
+	YAHOO_SERVICE_Y7_CHAT_SESSION = 0xd4,
+	YAHOO_SERVICE_Y7_AUTHORIZATION = 0xd6,          /* YMSG13 */
+	YAHOO_SERVICE_Y7_FILETRANSFER = 0xdc,           /* YMSG13 */
+	YAHOO_SERVICE_Y7_FILETRANSFERINFO,              /* YMSG13 */
+	YAHOO_SERVICE_Y7_FILETRANSFERACCEPT,            /* YMSG13 */
+	YAHOO_SERVICE_Y7_MINGLE = 0xe1,         /* YMSG13 */
+	YAHOO_SERVICE_Y7_CHANGE_GROUP = 0xe7,           /* YMSG13 */
+	YAHOO_SERVICE_MYSTERY = 0xef,           /* Don't know what this is for */
+	YAHOO_SERVICE_Y8_STATUS = 0xf0,         /* YMSG15 */
+	YAHOO_SERVICE_Y8_LIST = 0Xf1,           /* YMSG15 */
+	YAHOO_SERVICE_MESSAGE_CONFIRM = 0xfb,
+	YAHOO_SERVICE_WEBLOGIN = 0x0226,
+	YAHOO_SERVICE_SMS_MSG = 0x02ea
+};
+
+enum yahoo_status {
+	YAHOO_STATUS_AVAILABLE = 0,
+	YAHOO_STATUS_BRB,
+	YAHOO_STATUS_BUSY,
+	YAHOO_STATUS_NOTATHOME,
+	YAHOO_STATUS_NOTATDESK,
+	YAHOO_STATUS_NOTINOFFICE,
+	YAHOO_STATUS_ONPHONE,
+	YAHOO_STATUS_ONVACATION,
+	YAHOO_STATUS_OUTTOLUNCH,
+	YAHOO_STATUS_STEPPEDOUT,
+	YAHOO_STATUS_INVISIBLE = 12,
+	YAHOO_STATUS_CUSTOM = 99,
+	YAHOO_STATUS_IDLE = 999,
+	YAHOO_STATUS_OFFLINE = 0x5a55aa56               /* don't ask */
+};
+
+enum ypacket_status {
+	YPACKET_STATUS_DISCONNECTED = -1,
+	YPACKET_STATUS_DEFAULT = 0,
+	YPACKET_STATUS_SERVERACK = 1,
+	YPACKET_STATUS_GAME = 0x2,
+	YPACKET_STATUS_AWAY = 0x4,
+	YPACKET_STATUS_CONTINUED = 0x5,
+	YPACKET_STATUS_INVISIBLE = 12,
+	YPACKET_STATUS_NOTIFY = 0x16,           /* TYPING */
+	YPACKET_STATUS_WEBLOGIN = 0x5a55aa55,
+	YPACKET_STATUS_OFFLINE = 0x5a55aa56
+};
+
+#define YAHOO_STATUS_GAME       0x2     /* Games don't fit into the regular status model */
+
+enum yahoo_login_status {
+	YAHOO_LOGIN_OK = 0,
+	YAHOO_LOGIN_LOGOFF = 1,
+	YAHOO_LOGIN_UNAME = 3,
+	YAHOO_LOGIN_PASSWD = 13,
+	YAHOO_LOGIN_LOCK = 14,
+	YAHOO_LOGIN_DUPL = 99,
+	YAHOO_LOGIN_SOCK = -1,
+	YAHOO_LOGIN_UNKNOWN = 999
+};
+
+enum yahoo_error {
+	E_UNKNOWN = -1,
+	E_CONNECTION = -2,
+	E_SYSTEM = -3,
+	E_CUSTOM = 0,
+
+	/* responses from ignore buddy */
+	E_IGNOREDUP = 2,
+	E_IGNORENONE = 3,
+	E_IGNORECONF = 12,
+
+	/* conference */
+	E_CONFNOTAVAIL = 20
+};
+
+enum yahoo_log_level {
+	YAHOO_LOG_NONE = 0,
+	YAHOO_LOG_FATAL,
+	YAHOO_LOG_ERR,
+	YAHOO_LOG_WARNING,
+	YAHOO_LOG_NOTICE,
+	YAHOO_LOG_INFO,
+	YAHOO_LOG_DEBUG
+};
+
+enum yahoo_file_transfer {
+	YAHOO_FILE_TRANSFER_INIT = 1,
+	YAHOO_FILE_TRANSFER_ACCEPT = 3,
+	YAHOO_FILE_TRANSFER_REJECT = 4,
+	YAHOO_FILE_TRANSFER_DONE = 5,
+	YAHOO_FILE_TRANSFER_RELAY,
+	YAHOO_FILE_TRANSFER_FAILED,
+	YAHOO_FILE_TRANSFER_UNKNOWN
+};
 
 #define YAHOO_PROTO_VER 0x0010
@@ -222,25 +222,25 @@
 #define YAHOO_STYLE_URLOFF "\033[xlm"
 
-	enum yahoo_connection_type {
-		YAHOO_CONNECTION_PAGER = 0,
-		YAHOO_CONNECTION_FT,
-		YAHOO_CONNECTION_YAB,
-		YAHOO_CONNECTION_WEBCAM_MASTER,
-		YAHOO_CONNECTION_WEBCAM,
-		YAHOO_CONNECTION_CHATCAT,
-		YAHOO_CONNECTION_SEARCH,
-		YAHOO_CONNECTION_AUTH
-	};
-
-	enum yahoo_webcam_direction_type {
-		YAHOO_WEBCAM_DOWNLOAD = 0,
-		YAHOO_WEBCAM_UPLOAD
-	};
-
-	enum yahoo_stealth_visibility_type {
-		YAHOO_STEALTH_DEFAULT = 0,
-		YAHOO_STEALTH_ONLINE,
-		YAHOO_STEALTH_PERM_OFFLINE
-	};
+enum yahoo_connection_type {
+	YAHOO_CONNECTION_PAGER = 0,
+	YAHOO_CONNECTION_FT,
+	YAHOO_CONNECTION_YAB,
+	YAHOO_CONNECTION_WEBCAM_MASTER,
+	YAHOO_CONNECTION_WEBCAM,
+	YAHOO_CONNECTION_CHATCAT,
+	YAHOO_CONNECTION_SEARCH,
+	YAHOO_CONNECTION_AUTH
+};
+
+enum yahoo_webcam_direction_type {
+	YAHOO_WEBCAM_DOWNLOAD = 0,
+	YAHOO_WEBCAM_UPLOAD
+};
+
+enum yahoo_stealth_visibility_type {
+	YAHOO_STEALTH_DEFAULT = 0,
+	YAHOO_STEALTH_ONLINE,
+	YAHOO_STEALTH_PERM_OFFLINE
+};
 
 /* chat member attribs */
@@ -251,143 +251,143 @@
 #define YAHOO_CHAT_WEBCAM 0x10
 
-	enum yahoo_webcam_conn_type { Y_WCM_DIALUP, Y_WCM_DSL, Y_WCM_T1 };
-
-	struct yahoo_webcam {
-		int direction;	/* Uploading or downloading */
-		int conn_type;	/* 0=Dialup, 1=DSL/Cable, 2=T1/Lan */
-
-		char *user;	/* user we are viewing */
-		char *server;	/* webcam server to connect to */
-		int port;	/* webcam port to connect on */
-		char *key;	/* key to connect to the server with */
-		char *description;	/* webcam description */
-		char *my_ip;	/* own ip number */
-	};
-
-	struct yahoo_webcam_data {
-		unsigned int data_size;
-		unsigned int to_read;
-		unsigned int timestamp;
-		unsigned char packet_type;
-	};
-
-	struct yahoo_data {
-		char *user;
-		char *password;
-
-		char *cookie_y;
-		char *cookie_t;
-		char *cookie_c;
-		char *cookie_b;
-		char *login_cookie;
-		char *crumb;
-		char *seed;
-
-		YList *buddies;
-		YList *ignore;
-		YList *identities;
-		char *login_id;
-
-		int current_status;
-		int initial_status;
-		int logged_in;
-
-		int session_id;
-
-		int client_id;
-
-		char *rawbuddylist;
-		char *ignorelist;
-
-		void *server_settings;
-
-		struct yahoo_process_status_entry *half_user;
-	};
-
-	struct yab {
-		int yid;
-		char *id;
-		char *fname;
-		char *lname;
-		char *nname;
-		char *email;
-		char *hphone;
-		char *wphone;
-		char *mphone;
-		int dbid;
-	};
-
-	struct yahoo_buddy {
-		char *group;
-		char *id;
-		char *real_name;
-		struct yab *yab_entry;
-	};
-
-	enum yahoo_search_type {
-		YAHOO_SEARCH_KEYWORD = 0,
-		YAHOO_SEARCH_YID,
-		YAHOO_SEARCH_NAME
-	};
-
-	enum yahoo_search_gender {
-		YAHOO_GENDER_NONE = 0,
-		YAHOO_GENDER_MALE,
-		YAHOO_GENDER_FEMALE
-	};
-
-	enum yahoo_search_agerange {
-		YAHOO_AGERANGE_NONE = 0
-	};
-
-	struct yahoo_found_contact {
-		char *id;
-		char *gender;
-		char *location;
-		int age;
-		int online;
-	};
+enum yahoo_webcam_conn_type { Y_WCM_DIALUP, Y_WCM_DSL, Y_WCM_T1 };
+
+struct yahoo_webcam {
+	int direction;          /* Uploading or downloading */
+	int conn_type;          /* 0=Dialup, 1=DSL/Cable, 2=T1/Lan */
+
+	char *user;             /* user we are viewing */
+	char *server;           /* webcam server to connect to */
+	int port;               /* webcam port to connect on */
+	char *key;              /* key to connect to the server with */
+	char *description;              /* webcam description */
+	char *my_ip;            /* own ip number */
+};
+
+struct yahoo_webcam_data {
+	unsigned int data_size;
+	unsigned int to_read;
+	unsigned int timestamp;
+	unsigned char packet_type;
+};
+
+struct yahoo_data {
+	char *user;
+	char *password;
+
+	char *cookie_y;
+	char *cookie_t;
+	char *cookie_c;
+	char *cookie_b;
+	char *login_cookie;
+	char *crumb;
+	char *seed;
+
+	YList *buddies;
+	YList *ignore;
+	YList *identities;
+	char *login_id;
+
+	int current_status;
+	int initial_status;
+	int logged_in;
+
+	int session_id;
+
+	int client_id;
+
+	char *rawbuddylist;
+	char *ignorelist;
+
+	void *server_settings;
+
+	struct yahoo_process_status_entry *half_user;
+};
+
+struct yab {
+	int yid;
+	char *id;
+	char *fname;
+	char *lname;
+	char *nname;
+	char *email;
+	char *hphone;
+	char *wphone;
+	char *mphone;
+	int dbid;
+};
+
+struct yahoo_buddy {
+	char *group;
+	char *id;
+	char *real_name;
+	struct yab *yab_entry;
+};
+
+enum yahoo_search_type {
+	YAHOO_SEARCH_KEYWORD = 0,
+	YAHOO_SEARCH_YID,
+	YAHOO_SEARCH_NAME
+};
+
+enum yahoo_search_gender {
+	YAHOO_GENDER_NONE = 0,
+	YAHOO_GENDER_MALE,
+	YAHOO_GENDER_FEMALE
+};
+
+enum yahoo_search_agerange {
+	YAHOO_AGERANGE_NONE = 0
+};
+
+struct yahoo_found_contact {
+	char *id;
+	char *gender;
+	char *location;
+	int age;
+	int online;
+};
 
 /*
  * Function pointer to be passed to http get/post and send file
  */
-	typedef void (*yahoo_get_fd_callback) (int id, void *fd, int error,
-		void *data);
+typedef void (*yahoo_get_fd_callback) (int id, void *fd, int error,
+                                       void *data);
 
 /*
  * Function pointer to be passed to yahoo_get_url_handle
  */
-	typedef void (*yahoo_get_url_handle_callback) (int id, void *fd,
-		int error, const char *filename, unsigned long size,
-		void *data);
-
-	struct yahoo_chat_member {
-		char *id;
-		int age;
-		int attribs;
-		char *alias;
-		char *location;
-	};
-
-	struct yahoo_process_status_entry { 
-		char *name;     /* 7      name */ 
-		int state;      /* 10     state */ 
-		int flags;      /* 13     flags, bit 0 = pager, bit 1 = chat, bit 2 = game */ 
-		int mobile;     /* 60     mobile */ 
-		char *msg;      /* 19     custom status message */ 
-		int away;       /* 47     away (or invisible) */ 
-		int buddy_session; /* 11  state */ 
-		int f17;        /* 17     in chat? then what about flags? */ 
-		int idle;       /* 137    seconds idle */ 
-		int f138;       /* 138    state */ 
-		char *f184;     /* 184    state */ 
-		int f192;       /* 192    state */ 
-		int f10001;     /* 10001  state */ 
-		int f10002;     /* 10002  state */ 
-		int f198;       /* 198    state */ 
-		char *f197;     /* 197    state */ 
-		char *f205;     /* 205    state */ 
-		int f213;       /* 213    state */ 
-	};
+typedef void (*yahoo_get_url_handle_callback) (int id, void *fd,
+                                               int error, const char *filename, unsigned long size,
+                                               void *data);
+
+struct yahoo_chat_member {
+	char *id;
+	int age;
+	int attribs;
+	char *alias;
+	char *location;
+};
+
+struct yahoo_process_status_entry {
+	char *name;             /* 7      name */
+	int state;              /* 10     state */
+	int flags;              /* 13     flags, bit 0 = pager, bit 1 = chat, bit 2 = game */
+	int mobile;             /* 60     mobile */
+	char *msg;              /* 19     custom status message */
+	int away;               /* 47     away (or invisible) */
+	int buddy_session;         /* 11  state */
+	int f17;                /* 17     in chat? then what about flags? */
+	int idle;               /* 137    seconds idle */
+	int f138;               /* 138    state */
+	char *f184;             /* 184    state */
+	int f192;               /* 192    state */
+	int f10001;             /* 10001  state */
+	int f10002;             /* 10002  state */
+	int f198;               /* 198    state */
+	char *f197;             /* 197    state */
+	char *f205;             /* 205    state */
+	int f213;               /* 213    state */
+};
 
 #ifdef __cplusplus
Index: protocols/yahoo/yahoo_debug.h
===================================================================
--- protocols/yahoo/yahoo_debug.h	(revision 25c4c78e2ddad482dfc9d5a104f76325fcc2f8e5)
+++ protocols/yahoo/yahoo_debug.h	(revision 9216eff1a59e9d4a24b63c16ba4c2cacd051332c)
@@ -22,17 +22,19 @@
 extern int yahoo_log_message(char *fmt, ...);
 
-#define NOTICE(x) if(yahoo_get_log_level() >= YAHOO_LOG_NOTICE) { yahoo_log_message x; yahoo_log_message("\n"); }
+#define NOTICE(x) if (yahoo_get_log_level() >= YAHOO_LOG_NOTICE) { yahoo_log_message x; yahoo_log_message("\n"); }
 
-#define LOG(x) if(yahoo_get_log_level() >= YAHOO_LOG_INFO) { yahoo_log_message("%s:%d: ", __FILE__, __LINE__); \
-	yahoo_log_message x; \
-	yahoo_log_message("\n"); }
+#define LOG(x) if (yahoo_get_log_level() >= YAHOO_LOG_INFO) { yahoo_log_message("%s:%d: ", __FILE__, __LINE__); \
+		                                              yahoo_log_message x; \
+		                                              yahoo_log_message("\n"); }
 
-#define WARNING(x) if(yahoo_get_log_level() >= YAHOO_LOG_WARNING) { yahoo_log_message("%s:%d: warning: ", __FILE__, __LINE__); \
-	yahoo_log_message x; \
-	yahoo_log_message("\n"); }
+#define WARNING(x) if (yahoo_get_log_level() >= YAHOO_LOG_WARNING) { yahoo_log_message("%s:%d: warning: ", __FILE__, \
+		                                                                       __LINE__); \
+		                                                     yahoo_log_message x; \
+		                                                     yahoo_log_message("\n"); }
 
-#define DEBUG_MSG(x) if(yahoo_get_log_level() >= YAHOO_LOG_DEBUG) { yahoo_log_message("%s:%d: debug: ", __FILE__, __LINE__); \
-	yahoo_log_message x; \
-	yahoo_log_message("\n"); }
+#define DEBUG_MSG(x) if (yahoo_get_log_level() >= YAHOO_LOG_DEBUG) { yahoo_log_message("%s:%d: debug: ", __FILE__, \
+		                                                                       __LINE__); \
+		                                                     yahoo_log_message x; \
+		                                                     yahoo_log_message("\n"); }
 
 
Index: protocols/yahoo/yahoo_httplib.c
===================================================================
--- protocols/yahoo/yahoo_httplib.c	(revision 25c4c78e2ddad482dfc9d5a104f76325fcc2f8e5)
+++ protocols/yahoo/yahoo_httplib.c	(revision 9216eff1a59e9d4a24b63c16ba4c2cacd051332c)
@@ -32,6 +32,6 @@
 char *strchr(), *strrchr();
 # if !HAVE_MEMCPY
-#  define memcpy(d, s, n) bcopy ((s), (d), (n))
-#  define memmove(d, s, n) bcopy ((s), (d), (n))
+#  define memcpy(d, s, n) bcopy((s), (d), (n))
+#  define memmove(d, s, n) bcopy((s), (d), (n))
 # endif
 #endif
@@ -53,7 +53,7 @@
 #ifdef USE_STRUCT_CALLBACKS
 extern struct yahoo_callbacks *yc;
-#define YAHOO_CALLBACK(x)	yc->x
+#define YAHOO_CALLBACK(x)       yc->x
 #else
-#define YAHOO_CALLBACK(x)	x
+#define YAHOO_CALLBACK(x)       x
 #endif
 
@@ -69,19 +69,22 @@
 
 		do {
-			rc = YAHOO_CALLBACK(ext_yahoo_read) (fd, &c, 1);
-		} while (rc == -1 && (errno == EINTR || errno == EAGAIN));	/* this is bad - it should be done asynchronously */
+			rc = YAHOO_CALLBACK (ext_yahoo_read) (fd, &c, 1);
+		} while (rc == -1 && (errno == EINTR || errno == EAGAIN));      /* this is bad - it should be done asynchronously */
 
 		if (rc == 1) {
-			if (c == '\r')	/* get rid of \r */
+			if (c == '\r') { /* get rid of \r */
 				continue;
+			}
 			*ptr = c;
-			if (c == '\n')
+			if (c == '\n') {
 				break;
+			}
 			ptr++;
 		} else if (rc == 0) {
-			if (n == 1)
-				return (0);	/* EOF, no data */
-			else
-				break;	/* EOF, w/ data */
+			if (n == 1) {
+				return (0);     /* EOF, no data */
+			} else {
+				break;  /* EOF, w/ data */
+			}
 		} else {
 			return -1;
@@ -95,5 +98,5 @@
 
 static int url_to_host_port_path(const char *url,
-	char *host, int *port, char *path, int *ssl)
+                                 char *host, int *port, char *path, int *ssl)
 {
 	char *urlcopy = NULL;
@@ -127,8 +130,9 @@
 
 	if (!colon || (slash && slash < colon)) {
-		if (*ssl)
+		if (*ssl) {
 			*port = 443;
-		else
+		} else {
 			*port = 80;
+		}
 	} else {
 		*colon = 0;
@@ -161,12 +165,15 @@
 	int len = strlen(instr);
 
-	if (!(str = y_new(char, 3 *len + 1)))
-		 return "";
+	if (!(str = y_new(char, 3 * len + 1))) {
+		return "";
+	}
 
 	while (instr[ipos]) {
-		while (isurlchar(instr[ipos]))
+		while (isurlchar(instr[ipos])) {
 			str[bpos++] = instr[ipos++];
-		if (!instr[ipos])
+		}
+		if (!instr[ipos]) {
 			break;
+		}
 
 		snprintf(&str[bpos], 4, "%%%02x", instr[ipos] & 0xff);
@@ -192,16 +199,20 @@
 	int len = strlen(instr);
 
-	if (!(str = y_new(char, len + 1)))
-		 return "";
+	if (!(str = y_new(char, len + 1))) {
+		return "";
+	}
 
 	while (instr[ipos]) {
-		while (instr[ipos] && instr[ipos] != '%')
+		while (instr[ipos] && instr[ipos] != '%') {
 			if (instr[ipos] == '+') {
 				str[bpos++] = ' ';
 				ipos++;
-			} else
+			} else {
 				str[bpos++] = instr[ipos++];
-		if (!instr[ipos])
+			}
+		}
+		if (!instr[ipos]) {
 			break;
+		}
 
 		if (instr[ipos + 1] && instr[ipos + 2]) {
@@ -210,5 +221,5 @@
 			entity[1] = instr[ipos++];
 			sscanf(entity, "%2x", &dec);
-			str[bpos++] = (char)dec;
+			str[bpos++] = (char) dec;
 		} else {
 			str[bpos++] = instr[ipos++];
@@ -230,25 +241,29 @@
 	char entity[4] = { 0, 0, 0, 0 };
 	char *entitymap[5][2] = {
-		{"amp;", "&"},
-		{"quot;", "\""},
-		{"lt;", "<"},
-		{"gt;", "<"},
-		{"nbsp;", " "}
+		{ "amp;", "&" },
+		{ "quot;", "\"" },
+		{ "lt;", "<" },
+		{ "gt;", "<" },
+		{ "nbsp;", " " }
 	};
 	unsigned dec;
 	int len = strlen(instr);
 
-	if (!(str = y_new(char, len + 1)))
-		 return "";
+	if (!(str = y_new(char, len + 1))) {
+		return "";
+	}
 
 	while (instr[ipos]) {
-		while (instr[ipos] && instr[ipos] != '&')
+		while (instr[ipos] && instr[ipos] != '&') {
 			if (instr[ipos] == '+') {
 				str[bpos++] = ' ';
 				ipos++;
-			} else
+			} else {
 				str[bpos++] = instr[ipos++];
-		if (!instr[ipos] || !instr[ipos + 1])
+			}
+		}
+		if (!instr[ipos] || !instr[ipos + 1]) {
 			break;
+		}
 		ipos++;
 
@@ -256,18 +271,20 @@
 			ipos++;
 			epos = 0;
-			while (instr[ipos] != ';')
+			while (instr[ipos] != ';') {
 				entity[epos++] = instr[ipos++];
+			}
 			sscanf(entity, "%u", &dec);
-			str[bpos++] = (char)dec;
+			str[bpos++] = (char) dec;
 			ipos++;
 		} else {
 			int i;
-			for (i = 0; i < 5; i++)
+			for (i = 0; i < 5; i++) {
 				if (!strncmp(instr + ipos, entitymap[i][0],
-						strlen(entitymap[i][0]))) {
+				             strlen(entitymap[i][0]))) {
 					str[bpos++] = entitymap[i][1][0];
 					ipos += strlen(entitymap[i][0]);
 					break;
 				}
+			}
 		}
 	}
@@ -294,7 +311,9 @@
 {
 	struct callback_data *ccd = data;
-	if (error == 0)
-		YAHOO_CALLBACK(ext_yahoo_write) (fd, ccd->request,
-			strlen(ccd->request));
+
+	if (error == 0) {
+		YAHOO_CALLBACK (ext_yahoo_write) (fd, ccd->request,
+		                                  strlen(ccd->request));
+	}
 	free(ccd->request);
 	ccd->callback(ccd->id, fd, error, ccd->user_data);
@@ -303,7 +322,8 @@
 
 static void yahoo_send_http_request(int id, char *host, int port, char *request,
-	yahoo_get_fd_callback callback, void *data, int use_ssl)
+                                    yahoo_get_fd_callback callback, void *data, int use_ssl)
 {
 	struct callback_data *ccd = y_new0(struct callback_data, 1);
+
 	ccd->callback = callback;
 	ccd->id = id;
@@ -311,10 +331,10 @@
 	ccd->user_data = data;
 
-	YAHOO_CALLBACK(ext_yahoo_connect_async) (id, host, port,
-		connect_complete, ccd, use_ssl);
+	YAHOO_CALLBACK (ext_yahoo_connect_async) (id, host, port,
+	                                          connect_complete, ccd, use_ssl);
 }
 
 void yahoo_http_post(int id, const char *url, const char *cookies,
-	long content_length, yahoo_get_fd_callback callback, void *data)
+                     long content_length, yahoo_get_fd_callback callback, void *data)
 {
 	char host[255];
@@ -324,16 +344,17 @@
 	int ssl = 0;
 
-	if (!url_to_host_port_path(url, host, &port, path, &ssl))
+	if (!url_to_host_port_path(url, host, &port, path, &ssl)) {
 		return;
+	}
 
 	/* thanks to kopete dumpcap */
 	snprintf(buff, sizeof(buff),
-		"POST %s HTTP/1.1\r\n"
-		"Cookie: %s\r\n"
-		"User-Agent: Mozilla/5.0\r\n"
-		"Host: %s\r\n"
-		"Content-Length: %ld\r\n"
-		"Cache-Control: no-cache\r\n"
-		"\r\n", path, cookies, host, content_length);
+	         "POST %s HTTP/1.1\r\n"
+	         "Cookie: %s\r\n"
+	         "User-Agent: Mozilla/5.0\r\n"
+	         "Host: %s\r\n"
+	         "Content-Length: %ld\r\n"
+	         "Cache-Control: no-cache\r\n"
+	         "\r\n", path, cookies, host, content_length);
 
 	yahoo_send_http_request(id, host, port, buff, callback, data, ssl);
@@ -341,5 +362,5 @@
 
 void yahoo_http_get(int id, const char *url, const char *cookies, int http11,
-	int keepalive, yahoo_get_fd_callback callback, void *data)
+                    int keepalive, yahoo_get_fd_callback callback, void *data)
 {
 	char host[255];
@@ -350,21 +371,23 @@
 	int ssl = 0;
 
-	if (!url_to_host_port_path(url, host, &port, path, &ssl))
+	if (!url_to_host_port_path(url, host, &port, path, &ssl)) {
 		return;
+	}
 
 	/* Allow cases when we don't need to send a cookie */
-	if (cookies)
+	if (cookies) {
 		snprintf(cookiebuff, sizeof(cookiebuff), "Cookie: %s\r\n",
-			cookies);
-	else
+		         cookies);
+	} else {
 		cookiebuff[0] = '\0';
+	}
 
 	snprintf(buff, sizeof(buff),
-		"GET %s HTTP/1.%s\r\n"
-		"%sHost: %s\r\n"
-		"User-Agent: Mozilla/4.5 [en] (" PACKAGE "/" VERSION ")\r\n"
-		"Accept: */*\r\n"
-		"%s" "\r\n", path, http11?"1":"0", cookiebuff, host,
-		keepalive? "Connection: Keep-Alive\r\n":"Connection: close\r\n");
+	         "GET %s HTTP/1.%s\r\n"
+	         "%sHost: %s\r\n"
+	         "User-Agent: Mozilla/4.5 [en] (" PACKAGE "/" VERSION ")\r\n"
+	         "Accept: */*\r\n"
+	         "%s" "\r\n", path, http11 ? "1" : "0", cookiebuff, host,
+	         keepalive ? "Connection: Keep-Alive\r\n" : "Connection: close\r\n");
 
 	yahoo_send_http_request(id, host, port, buff, callback, data, ssl);
@@ -372,5 +395,5 @@
 
 void yahoo_http_head(int id, const char *url, const char *cookies, int len,
-	char *payload, yahoo_get_fd_callback callback, void *data)
+                     char *payload, yahoo_get_fd_callback callback, void *data)
 {
 	char host[255];
@@ -381,24 +404,26 @@
 	int ssl = 0;
 
-	if (!url_to_host_port_path(url, host, &port, path, &ssl))
+	if (!url_to_host_port_path(url, host, &port, path, &ssl)) {
 		return;
+	}
 
 	/* Allow cases when we don't need to send a cookie */
-	if (cookies)
+	if (cookies) {
 		snprintf(cookiebuff, sizeof(cookiebuff), "Cookie: %s\r\n",
-			cookies);
-	else
+		         cookies);
+	} else {
 		cookiebuff[0] = '\0';
+	}
 
 	snprintf(buff, sizeof(buff),
-		"HEAD %s HTTP/1.0\r\n"
-		"Accept: */*\r\n"
-		"Host: %s:%d\r\n"
-		"User-Agent: Mozilla/4.5 [en] (" PACKAGE "/" VERSION ")\r\n"
-		"%s"
-		"Content-Length: %d\r\n"
-		"Cache-Control: no-cache\r\n"
-		"\r\n%s", path, host, port, cookiebuff, len,
-		payload?payload:"");
+	         "HEAD %s HTTP/1.0\r\n"
+	         "Accept: */*\r\n"
+	         "Host: %s:%d\r\n"
+	         "User-Agent: Mozilla/4.5 [en] (" PACKAGE "/" VERSION ")\r\n"
+	         "%s"
+	         "Content-Length: %d\r\n"
+	         "Cache-Control: no-cache\r\n"
+	         "\r\n%s", path, host, port, cookiebuff, len,
+	         payload ? payload : "");
 
 	yahoo_send_http_request(id, host, port, buff, callback, data, ssl);
Index: protocols/yahoo/yahoo_httplib.h
===================================================================
--- protocols/yahoo/yahoo_httplib.h	(revision 25c4c78e2ddad482dfc9d5a104f76325fcc2f8e5)
+++ protocols/yahoo/yahoo_httplib.h	(revision 9216eff1a59e9d4a24b63c16ba4c2cacd051332c)
@@ -29,17 +29,17 @@
 #include "yahoo2_types.h"
 
-	char *yahoo_urlencode(const char *instr);
-	char *yahoo_urldecode(const char *instr);
-	char *yahoo_xmldecode(const char *instr);
+char *yahoo_urlencode(const char *instr);
+char *yahoo_urldecode(const char *instr);
+char *yahoo_xmldecode(const char *instr);
 
-	int yahoo_tcp_readline(char *ptr, int maxlen, void *fd);
-	void yahoo_http_post(int id, const char *url, const char *cookies,
-		long size, yahoo_get_fd_callback callback, void *data);
-	void yahoo_http_get(int id, const char *url, const char *cookies,
-		int http11, int keepalive, yahoo_get_fd_callback callback,
-		void *data);
-	void yahoo_http_head(int id, const char *url, const char *cookies,
-		int size, char *payload, yahoo_get_fd_callback callback,
-		void *data);
+int yahoo_tcp_readline(char *ptr, int maxlen, void *fd);
+void yahoo_http_post(int id, const char *url, const char *cookies,
+                     long size, yahoo_get_fd_callback callback, void *data);
+void yahoo_http_get(int id, const char *url, const char *cookies,
+                    int http11, int keepalive, yahoo_get_fd_callback callback,
+                    void *data);
+void yahoo_http_head(int id, const char *url, const char *cookies,
+                     int size, char *payload, yahoo_get_fd_callback callback,
+                     void *data);
 
 #ifdef __cplusplus
Index: protocols/yahoo/yahoo_util.c
===================================================================
--- protocols/yahoo/yahoo_util.c	(revision 25c4c78e2ddad482dfc9d5a104f76325fcc2f8e5)
+++ protocols/yahoo/yahoo_util.c	(revision 9216eff1a59e9d4a24b63c16ba4c2cacd051332c)
@@ -27,8 +27,8 @@
 #  define strrchr rindex
 # endif
-char *strchr (), *strrchr ();
+char *strchr(), *strrchr();
 # if !HAVE_MEMCPY
-#  define memcpy(d, s, n) bcopy ((s), (d), (n))
-#  define memmove(d, s, n) bcopy ((s), (d), (n))
+#  define memcpy(d, s, n) bcopy((s), (d), (n))
+#  define memmove(d, s, n) bcopy((s), (d), (n))
 # endif
 #endif
@@ -57,5 +57,6 @@
 {
 	char **v;
-	for(v = vector; *v; v++) {
+
+	for (v = vector; *v; v++) {
 		FREE(*v);
 	}
@@ -67,14 +68,17 @@
 	char ** vector;
 	char *s, *p;
-	int i=0;
+	int i = 0;
 	int l = strlen(sep);
-	if(nelem <= 0) {
+
+	if (nelem <= 0) {
 		char * s;
-		nelem=0;
+		nelem = 0;
 		if (*str) {
-			for(s=strstr(str, sep); s; s=strstr(s+l, sep),nelem++)
+			for (s = strstr(str, sep); s; s = strstr(s + l, sep), nelem++) {
 				;
-			if(strcmp(str+strlen(str)-l, sep))
+			}
+			if (strcmp(str + strlen(str) - l, sep)) {
 				nelem++;
+			}
 		}
 	}
@@ -82,14 +86,15 @@
 	vector = y_new(char *, nelem + 1);
 
-	for(p=str, s=strstr(p,sep); i<nelem && s; p=s+l, s=strstr(p,sep), i++) {
-		int len = s-p;
-		vector[i] = y_new(char, len+1);
+	for (p = str, s = strstr(p, sep); i < nelem && s; p = s + l, s = strstr(p, sep), i++) {
+		int len = s - p;
+		vector[i] = y_new(char, len + 1);
 		strncpy(vector[i], p, len);
 		vector[i][len] = '\0';
 	}
 
-	if(i<nelem && *str) /* str didn't end with sep, and str isn't empty */
+	if (i < nelem && *str) { /* str didn't end with sep, and str isn't empty */
 		vector[i++] = strdup(p);
-			
+	}
+
 	vector[i] = NULL;
 
@@ -100,6 +105,8 @@
 {
 	void * new_chunk = malloc(n);
-	if(new_chunk)
+
+	if (new_chunk) {
 		memcpy(new_chunk, addr, n);
+	}
 	return new_chunk;
 }
Index: protocols/yahoo/yahoo_util.h
===================================================================
--- protocols/yahoo/yahoo_util.h	(revision 25c4c78e2ddad482dfc9d5a104f76325fcc2f8e5)
+++ protocols/yahoo/yahoo_util.h	(revision 9216eff1a59e9d4a24b63c16ba4c2cacd051332c)
@@ -30,26 +30,26 @@
 # include <glib.h>
 
-# define FREE(x)	if(x) {g_free(x); x=NULL;}
+# define FREE(x)        if (x) { g_free(x); x = NULL; }
 
-# define y_new		g_new
-# define y_new0		g_new0
-# define y_renew	g_renew
+# define y_new          g_new
+# define y_new0         g_new0
+# define y_renew        g_renew
 
-# define y_memdup	g_memdup
-# define y_strsplit	g_strsplit
-# define y_strfreev	g_strfreev
+# define y_memdup       g_memdup
+# define y_strsplit     g_strsplit
+# define y_strfreev     g_strfreev
 # ifndef strdup
-#  define strdup	g_strdup
+#  define strdup        g_strdup
 # endif
 # ifndef strncasecmp
-#  define strncasecmp	g_strncasecmp
-#  define strcasecmp	g_strcasecmp
+#  define strncasecmp   g_strncasecmp
+#  define strcasecmp    g_strcasecmp
 # endif
 
-# define snprintf	g_snprintf
+# define snprintf       g_snprintf
 #ifdef vsnprintf
 #undef vsnprintf
 #endif
-# define vsnprintf	g_vsnprintf
+# define vsnprintf      g_vsnprintf
 
 #else
@@ -58,9 +58,9 @@
 # include <stdarg.h>
 
-# define FREE(x)		if(x) {free(x); x=NULL;}
+# define FREE(x)                if (x) { free(x); x = NULL; }
 
-# define y_new(type, n)		(type *)malloc(sizeof(type) * (n))
-# define y_new0(type, n)	(type *)calloc((n), sizeof(type))
-# define y_renew(type, mem, n)	(type *)realloc(mem, n)
+# define y_new(type, n)         (type *) malloc(sizeof(type) * (n))
+# define y_new0(type, n)        (type *) calloc((n), sizeof(type))
+# define y_renew(type, mem, n)  (type *) realloc(mem, n)
 
 void *y_memdup(const void *addr, int n);
@@ -87,12 +87,12 @@
 
 #ifndef MIN
-#define MIN(x,y) ((x)<(y)?(x):(y))
+#define MIN(x, y) ((x) < (y) ? (x) : (y))
 #endif
 
 #ifndef MAX
-#define MAX(x,y) ((x)>(y)?(x):(y))
+#define MAX(x, y) ((x) > (y) ? (x) : (y))
 #endif
 
-/* 
+/*
  * The following three functions return newly allocated memory.
  * You must free it yourself
