Index: protocols/skype/skype.c
===================================================================
--- protocols/skype/skype.c	(revision 6b13103dad92d505e038c268af66aeb04b7b4d87)
+++ protocols/skype/skype.c	(revision 3d4547175e9aa348e9aeb845002d4a4045325dc5)
@@ -30,5 +30,5 @@
 #define SKYPE_DEFAULT_PORT "2727"
 #define IRC_LINE_SIZE 16384
-#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
 
 /*
@@ -151,5 +151,5 @@
 	{ "SKYPEME", "Skype Me" },
 	{ "ONLINE", "Online" },
-	{ NULL, NULL}
+	{ NULL, NULL }
 };
 
@@ -163,6 +163,7 @@
 	struct pollfd pfd[1];
 
-	if (!sd->ssl)
+	if (!sd->ssl) {
 		return FALSE;
+	}
 
 	pfd[0].fd = sd->fd;
@@ -196,6 +197,7 @@
 {
 	struct skype_buddy_ask_data *bla = data;
+
 	skype_printf(bla->ic, "SET USER %s ISAUTHORIZED TRUE\n",
-		bla->handle);
+	             bla->handle);
 	g_free(bla->handle);
 	g_free(bla);
@@ -205,6 +207,7 @@
 {
 	struct skype_buddy_ask_data *bla = data;
+
 	skype_printf(bla->ic, "SET USER %s ISAUTHORIZED FALSE\n",
-		bla->handle);
+	             bla->handle);
 	g_free(bla->handle);
 	g_free(bla);
@@ -214,5 +217,5 @@
 {
 	struct skype_buddy_ask_data *bla = g_new0(struct skype_buddy_ask_data,
-		1);
+	                                          1);
 	char *buf;
 
@@ -228,6 +231,7 @@
 {
 	struct skype_buddy_ask_data *bla = data;
+
 	skype_printf(bla->ic, "SET CALL %s STATUS INPROGRESS\n",
-		bla->handle);
+	             bla->handle);
 	g_free(bla->handle);
 	g_free(bla);
@@ -237,6 +241,7 @@
 {
 	struct skype_buddy_ask_data *bla = data;
+
 	skype_printf(bla->ic, "SET CALL %s STATUS FINISHED\n",
-		bla->handle);
+	             bla->handle);
 	g_free(bla->handle);
 	g_free(bla);
@@ -246,5 +251,5 @@
 {
 	struct skype_buddy_ask_data *bla = g_new0(struct skype_buddy_ask_data,
-		1);
+	                                          1);
 
 	bla->ic = ic;
@@ -297,6 +302,7 @@
 		struct skype_group *sg = g_list_nth_data(sd->groups, i);
 		for (j = 0; j < g_list_length(sg->users); j++) {
-			if (!strcmp(g_list_nth_data(sg->users, j), username))
+			if (!strcmp(g_list_nth_data(sg->users, j), username)) {
 				return sg->name;
+			}
 		}
 	}
@@ -311,6 +317,7 @@
 	for (i = 0; i < g_list_length(sd->groups); i++) {
 		struct skype_group *sg = g_list_nth_data(sd->groups, i);
-		if (!strcmp(sg->name, name))
+		if (!strcmp(sg->name, name)) {
 			return sg;
+		}
 	}
 	return NULL;
@@ -339,27 +346,33 @@
 	status++;
 	ptr = strchr(++user, ' ');
-	if (!ptr)
+	if (!ptr) {
 		return;
+	}
 	*ptr = '\0';
 	ptr++;
 	if (!strncmp(ptr, "ONLINESTATUS ", 13)) {
-		if (!strlen(user) || !strcmp(user, sd->username))
+		if (!strlen(user) || !strcmp(user, sd->username)) {
 			return;
+		}
 		if (!set_getbool(&ic->acc->set, "test_join")
-				&& !strcmp(user, "echo123"))
+		    && !strcmp(user, "echo123")) {
 			return;
+		}
 		ptr = g_strdup_printf("%s@skype.com", user);
 		imcb_add_buddy(ic, ptr, skype_group_by_username(ic, user));
 		if (strcmp(status, "OFFLINE") && (strcmp(status, "SKYPEOUT") ||
-			!set_getbool(&ic->acc->set, "skypeout_offline")))
+		                                  !set_getbool(&ic->acc->set, "skypeout_offline"))) {
 			flags |= OPT_LOGGED_IN;
-		if (strcmp(status, "ONLINE") && strcmp(status, "SKYPEME"))
+		}
+		if (strcmp(status, "ONLINE") && strcmp(status, "SKYPEME")) {
 			flags |= OPT_AWAY;
+		}
 		imcb_buddy_status(ic, ptr, flags, NULL, NULL);
 		g_free(ptr);
 	} else if (!strncmp(ptr, "RECEIVEDAUTHREQUEST ", 20)) {
 		char *message = ptr + 20;
-		if (strlen(message))
+		if (strlen(message)) {
 			skype_buddy_ask(ic, user, message);
+		}
 	} else if (!strncmp(ptr, "BUDDYSTATUS ", 12)) {
 		char *st = ptr + 12;
@@ -374,9 +387,11 @@
 		g_free(buf);
 		buf = ptr + 10;
-		if (bu)
+		if (bu) {
 			imcb_buddy_status(ic, bu->handle, bu->flags, NULL,
-					*buf ? buf : NULL);
-		if (set_getbool(&ic->acc->set, "show_moods"))
+			                  *buf ? buf : NULL);
+		}
+		if (set_getbool(&ic->acc->set, "show_moods")) {
 			imcb_log(ic, "User `%s' changed mood text to `%s'", user, buf);
+		}
 	} else if (!strncmp(ptr, "FULLNAME ", 9)) {
 		char *name = ptr + 9;
@@ -389,33 +404,33 @@
 			g_free(buf);
 		}
-	} else if (!strncmp(ptr, "PHONE_HOME ", 11))
+	} else if (!strncmp(ptr, "PHONE_HOME ", 11)) {
 		sd->info_phonehome = g_strdup(ptr + 11);
-	else if (!strncmp(ptr, "PHONE_OFFICE ", 13))
+	} else if (!strncmp(ptr, "PHONE_OFFICE ", 13)) {
 		sd->info_phoneoffice = g_strdup(ptr + 13);
-	else if (!strncmp(ptr, "PHONE_MOBILE ", 13))
+	} else if (!strncmp(ptr, "PHONE_MOBILE ", 13)) {
 		sd->info_phonemobile = g_strdup(ptr + 13);
-	else if (!strncmp(ptr, "NROF_AUTHED_BUDDIES ", 20))
+	} else if (!strncmp(ptr, "NROF_AUTHED_BUDDIES ", 20)) {
 		sd->info_nrbuddies = g_strdup(ptr + 20);
-	else if (!strncmp(ptr, "TIMEZONE ", 9))
+	} else if (!strncmp(ptr, "TIMEZONE ", 9)) {
 		sd->info_tz = g_strdup(ptr + 9);
-	else if (!strncmp(ptr, "LASTONLINETIMESTAMP ", 20))
+	} else if (!strncmp(ptr, "LASTONLINETIMESTAMP ", 20)) {
 		sd->info_seen = g_strdup(ptr + 20);
-	else if (!strncmp(ptr, "SEX ", 4))
+	} else if (!strncmp(ptr, "SEX ", 4)) {
 		sd->info_sex = g_strdup(ptr + 4);
-	else if (!strncmp(ptr, "LANGUAGE ", 9))
+	} else if (!strncmp(ptr, "LANGUAGE ", 9)) {
 		sd->info_language = g_strdup(ptr + 9);
-	else if (!strncmp(ptr, "COUNTRY ", 8))
+	} else if (!strncmp(ptr, "COUNTRY ", 8)) {
 		sd->info_country = g_strdup(ptr + 8);
-	else if (!strncmp(ptr, "PROVINCE ", 9))
+	} else if (!strncmp(ptr, "PROVINCE ", 9)) {
 		sd->info_province = g_strdup(ptr + 9);
-	else if (!strncmp(ptr, "CITY ", 5))
+	} else if (!strncmp(ptr, "CITY ", 5)) {
 		sd->info_city = g_strdup(ptr + 5);
-	else if (!strncmp(ptr, "HOMEPAGE ", 9))
+	} else if (!strncmp(ptr, "HOMEPAGE ", 9)) {
 		sd->info_homepage = g_strdup(ptr + 9);
-	else if (!strncmp(ptr, "ABOUT ", 6)) {
+	} else if (!strncmp(ptr, "ABOUT ", 6)) {
 		/* Support multiple about lines. */
-		if (!sd->info_about)
+		if (!sd->info_about) {
 			sd->info_about = g_strdup(ptr + 6);
-		else {
+		} else {
 			GString *st = g_string_new(sd->info_about);
 			g_string_append_printf(st, "\n%s", ptr + 6);
@@ -430,28 +445,32 @@
 		g_string_append_printf(st, "Skype Name: %s\n", user);
 		if (sd->info_fullname) {
-			if (strlen(sd->info_fullname))
+			if (strlen(sd->info_fullname)) {
 				g_string_append_printf(st, "Full Name: %s\n",
-					sd->info_fullname);
+				                       sd->info_fullname);
+			}
 			g_free(sd->info_fullname);
 			sd->info_fullname = NULL;
 		}
 		if (sd->info_phonehome) {
-			if (strlen(sd->info_phonehome))
+			if (strlen(sd->info_phonehome)) {
 				g_string_append_printf(st, "Home Phone: %s\n",
-					sd->info_phonehome);
+				                       sd->info_phonehome);
+			}
 			g_free(sd->info_phonehome);
 			sd->info_phonehome = NULL;
 		}
 		if (sd->info_phoneoffice) {
-			if (strlen(sd->info_phoneoffice))
+			if (strlen(sd->info_phoneoffice)) {
 				g_string_append_printf(st, "Office Phone: %s\n",
-					sd->info_phoneoffice);
+				                       sd->info_phoneoffice);
+			}
 			g_free(sd->info_phoneoffice);
 			sd->info_phoneoffice = NULL;
 		}
 		if (sd->info_phonemobile) {
-			if (strlen(sd->info_phonemobile))
+			if (strlen(sd->info_phonemobile)) {
 				g_string_append_printf(st, "Mobile Phone: %s\n",
-					sd->info_phonemobile);
+				                       sd->info_phonemobile);
+			}
 			g_free(sd->info_phonemobile);
 			sd->info_phonemobile = NULL;
@@ -459,7 +478,8 @@
 		g_string_append_printf(st, "Personal Information\n");
 		if (sd->info_nrbuddies) {
-			if (strlen(sd->info_nrbuddies))
+			if (strlen(sd->info_nrbuddies)) {
 				g_string_append_printf(st,
-					"Contacts: %s\n", sd->info_nrbuddies);
+				                       "Contacts: %s\n", sd->info_nrbuddies);
+			}
 			g_free(sd->info_nrbuddies);
 			sd->info_nrbuddies = NULL;
@@ -469,9 +489,9 @@
 				char ib[256];
 				time_t t = time(NULL);
-				t += atoi(sd->info_tz)-(60*60*24);
+				t += atoi(sd->info_tz) - (60 * 60 * 24);
 				struct tm *gt = gmtime(&t);
 				strftime(ib, 256, "%H:%M:%S", gt);
 				g_string_append_printf(st,
-					"Local Time: %s\n", ib);
+				                       "Local Time: %s\n", ib);
 			}
 			g_free(sd->info_tz);
@@ -485,5 +505,5 @@
 				strftime(ib, 256, ("%Y. %m. %d. %H:%M"), tm);
 				g_string_append_printf(st,
-					"Last Seen: %s\n", ib);
+				                       "Last Seen: %s\n", ib);
 			}
 			g_free(sd->info_seen);
@@ -492,5 +512,5 @@
 		if (sd->info_birthday) {
 			if (strlen(sd->info_birthday) &&
-				strcmp(sd->info_birthday, "0")) {
+			    strcmp(sd->info_birthday, "0")) {
 				char ib[256];
 				struct tm tm;
@@ -498,5 +518,5 @@
 				strftime(ib, 256, "%B %d, %Y", &tm);
 				g_string_append_printf(st,
-					"Birthday: %s\n", ib);
+				                       "Birthday: %s\n", ib);
 
 				strftime(ib, 256, "%Y", &tm);
@@ -505,5 +525,5 @@
 				struct tm *lt = localtime(&t);
 				g_string_append_printf(st,
-					"Age: %d\n", lt->tm_year+1900-year);
+				                       "Age: %d\n", lt->tm_year + 1900 - year);
 			}
 			g_free(sd->info_birthday);
@@ -513,8 +533,9 @@
 			if (strlen(sd->info_sex)) {
 				char *iptr = sd->info_sex;
-				while (*iptr++)
+				while (*iptr++) {
 					*iptr = g_ascii_tolower(*iptr);
+				}
 				g_string_append_printf(st,
-					"Gender: %s\n", sd->info_sex);
+				                       "Gender: %s\n", sd->info_sex);
 			}
 			g_free(sd->info_sex);
@@ -524,10 +545,11 @@
 			if (strlen(sd->info_language)) {
 				char *iptr = strchr(sd->info_language, ' ');
-				if (iptr)
+				if (iptr) {
 					iptr++;
-				else
+				} else {
 					iptr = sd->info_language;
+				}
 				g_string_append_printf(st,
-					"Language: %s\n", iptr);
+				                       "Language: %s\n", iptr);
 			}
 			g_free(sd->info_language);
@@ -537,10 +559,11 @@
 			if (strlen(sd->info_country)) {
 				char *iptr = strchr(sd->info_country, ' ');
-				if (iptr)
+				if (iptr) {
 					iptr++;
-				else
+				} else {
 					iptr = sd->info_country;
+				}
 				g_string_append_printf(st,
-					"Country: %s\n", iptr);
+				                       "Country: %s\n", iptr);
 			}
 			g_free(sd->info_country);
@@ -548,28 +571,32 @@
 		}
 		if (sd->info_province) {
-			if (strlen(sd->info_province))
+			if (strlen(sd->info_province)) {
 				g_string_append_printf(st,
-					"Region: %s\n", sd->info_province);
+				                       "Region: %s\n", sd->info_province);
+			}
 			g_free(sd->info_province);
 			sd->info_province = NULL;
 		}
 		if (sd->info_city) {
-			if (strlen(sd->info_city))
+			if (strlen(sd->info_city)) {
 				g_string_append_printf(st,
-					"City: %s\n", sd->info_city);
+				                       "City: %s\n", sd->info_city);
+			}
 			g_free(sd->info_city);
 			sd->info_city = NULL;
 		}
 		if (sd->info_homepage) {
-			if (strlen(sd->info_homepage))
+			if (strlen(sd->info_homepage)) {
 				g_string_append_printf(st,
-					"Homepage: %s\n", sd->info_homepage);
+				                       "Homepage: %s\n", sd->info_homepage);
+			}
 			g_free(sd->info_homepage);
 			sd->info_homepage = NULL;
 		}
 		if (sd->info_about) {
-			if (strlen(sd->info_about))
+			if (strlen(sd->info_about)) {
 				g_string_append_printf(st, "%s\n",
-					sd->info_about);
+				                       sd->info_about);
+			}
 			g_free(sd->info_about);
 			sd->info_about = NULL;
@@ -584,19 +611,22 @@
 	struct skype_data *sd = ic->proto_data;
 	char buf[IRC_LINE_SIZE];
+
 	if (!strcmp(sd->type, "SAID")) {
-		if (!sd->is_edit)
+		if (!sd->is_edit) {
 			g_snprintf(buf, IRC_LINE_SIZE, "%s", body);
-		else {
+		} else {
 			g_snprintf(buf, IRC_LINE_SIZE, "%s %s", set_getstr(&ic->acc->set, "edit_prefix"), body);
 			sd->is_edit = 0;
 		}
-	} else
+	} else {
 		g_snprintf(buf, IRC_LINE_SIZE, "/me %s", body);
-	if (!gc)
+	}
+	if (!gc) {
 		/* Private message */
 		imcb_buddy_msg(ic, sd->handle, buf, 0, 0);
-	else
+	} else {
 		/* Groupchat message */
 		imcb_chat_msg(gc, sd->handle, buf, 0, 0);
+	}
 }
 
@@ -606,10 +636,12 @@
 	char *id = strchr(line, ' ');
 
-	if (!++id)
+	if (!++id) {
 		return;
+	}
 	char *info = strchr(id, ' ');
 
-	if (!info)
+	if (!info) {
 		return;
+	}
 	*info = '\0';
 	info++;
@@ -622,8 +654,9 @@
 		 */
 		skype_printf(ic, "GET CHATMESSAGE %s FROM_HANDLE\n", id);
-		if (!strcmp(info, "STATUS RECEIVED"))
+		if (!strcmp(info, "STATUS RECEIVED")) {
 			skype_printf(ic, "GET CHATMESSAGE %s BODY\n", id);
-		else
+		} else {
 			sd->is_edit = 1;
+		}
 		skype_printf(ic, "GET CHATMESSAGE %s TYPE\n", id);
 		skype_printf(ic, "GET CHATMESSAGE %s CHATNAME\n", id);
@@ -648,5 +681,5 @@
 		info += 5;
 		sd->body = g_list_append(sd->body, g_strdup(info));
-	}	else if (!strncmp(info, "TYPE ", 5)) {
+	} else if (!strncmp(info, "TYPE ", 5)) {
 		info += 5;
 		g_free(sd->type);
@@ -660,12 +693,13 @@
 				char *body = g_list_nth_data(sd->body, i);
 				if (!strcmp(sd->type, "SAID") ||
-					!strcmp(sd->type, "EMOTED")) {
+				    !strcmp(sd->type, "EMOTED")) {
 					skype_parse_chatmessage_said_emoted(ic, gc, body);
-				} else if (!strcmp(sd->type, "SETTOPIC") && gc)
+				} else if (!strcmp(sd->type, "SETTOPIC") && gc) {
 					imcb_chat_topic(gc,
-						sd->handle, body, 0);
-				else if (!strcmp(sd->type, "LEFT") && gc)
+					                sd->handle, body, 0);
+				} else if (!strcmp(sd->type, "LEFT") && gc) {
 					imcb_chat_remove_buddy(gc,
-						sd->handle, NULL);
+					                       sd->handle, NULL);
+				}
 			}
 			g_list_free(sd->body);
@@ -681,17 +715,20 @@
 	char buf[IRC_LINE_SIZE];
 
-	if (!++id)
+	if (!++id) {
 		return;
+	}
 	char *info = strchr(id, ' ');
 
-	if (!info)
+	if (!info) {
 		return;
+	}
 	*info = '\0';
 	info++;
-	if (!strncmp(info, "FAILUREREASON ", 14))
+	if (!strncmp(info, "FAILUREREASON ", 14)) {
 		sd->failurereason = atoi(strchr(info, ' '));
-	else if (!strcmp(info, "STATUS RINGING")) {
-		if (sd->call_id)
+	} else if (!strcmp(info, "STATUS RINGING")) {
+		if (sd->call_id) {
 			g_free(sd->call_id);
+		}
 		sd->call_id = g_strdup(id);
 		skype_printf(ic, "GET CALL %s PARTNER_HANDLE\n", id);
@@ -710,6 +747,7 @@
 		sd->call_status = SKYPE_CALL_REFUSED;
 	} else if (!strcmp(info, "STATUS UNPLACED")) {
-		if (sd->call_id)
+		if (sd->call_id) {
 			g_free(sd->call_id);
+		}
 		/* Save the ID for later usage (Cancel/Finish). */
 		sd->call_id = g_strdup(id);
@@ -717,22 +755,24 @@
 	} else if (!strcmp(info, "STATUS FAILED")) {
 		imcb_error(ic, "Call failed: %s",
-			skype_call_strerror(sd->failurereason));
+		           skype_call_strerror(sd->failurereason));
 		sd->call_id = NULL;
 	} else if (!strncmp(info, "DURATION ", 9)) {
-		if (sd->call_duration)
+		if (sd->call_duration) {
 			g_free(sd->call_duration);
-		sd->call_duration = g_strdup(info+9);
+		}
+		sd->call_duration = g_strdup(info + 9);
 	} else if (!strncmp(info, "PARTNER_HANDLE ", 15)) {
 		info += 15;
-		if (!sd->call_status)
+		if (!sd->call_status) {
 			return;
+		}
 		switch (sd->call_status) {
 		case SKYPE_CALL_RINGING:
-			if (sd->call_out)
+			if (sd->call_out) {
 				imcb_log(ic, "You are currently ringing the user %s.", info);
-			else {
+			} else {
 				g_snprintf(buf, IRC_LINE_SIZE,
-					"The user %s is currently ringing you.",
-					info);
+				           "The user %s is currently ringing you.",
+				           info);
 				skype_call_ask(ic, sd->call_id, buf);
 			}
@@ -740,32 +780,34 @@
 		case SKYPE_CALL_MISSED:
 			imcb_log(ic, "You have missed a call from user %s.",
-				info);
+			         info);
 			break;
 		case SKYPE_CALL_CANCELLED:
 			imcb_log(ic, "You cancelled the call to the user %s.",
-				info);
+			         info);
 			sd->call_status = 0;
 			sd->call_out = FALSE;
 			break;
 		case SKYPE_CALL_REFUSED:
-			if (sd->call_out)
+			if (sd->call_out) {
 				imcb_log(ic, "The user %s refused the call.",
-					info);
-			else
+				         info);
+			} else {
 				imcb_log(ic,
-					"You refused the call from user %s.",
-					info);
+				         "You refused the call from user %s.",
+				         info);
+			}
 			sd->call_out = FALSE;
 			break;
 		case SKYPE_CALL_FINISHED:
-			if (sd->call_duration)
+			if (sd->call_duration) {
 				imcb_log(ic,
-					"You finished the call to the user %s "
-					"(duration: %s seconds).",
-					info, sd->call_duration);
-			else
+				         "You finished the call to the user %s "
+				         "(duration: %s seconds).",
+				         info, sd->call_duration);
+			} else {
 				imcb_log(ic,
-					"You finished the call to the user %s.",
-					info);
+				         "You finished the call to the user %s.",
+				         info);
+			}
 			sd->call_out = FALSE;
 			break;
@@ -783,19 +825,21 @@
 	char *id = strchr(line, ' ');
 
-	if (!++id)
+	if (!++id) {
 		return;
+	}
 	char *info = strchr(id, ' ');
 
-	if (!info)
+	if (!info) {
 		return;
+	}
 	*info = '\0';
 	info++;
 	if (!strcmp(info, "STATUS NEW")) {
 		skype_printf(ic, "GET FILETRANSFER %s PARTNER_HANDLE\n",
-			id);
+		             id);
 		sd->filetransfer_status = SKYPE_FILETRANSFER_NEW;
 	} else if (!strcmp(info, "STATUS FAILED")) {
 		skype_printf(ic, "GET FILETRANSFER %s PARTNER_HANDLE\n",
-			id);
+		             id);
 		sd->filetransfer_status = SKYPE_FILETRANSFER_FAILED;
 	} else if (!strcmp(info, "STATUS COMPLETED")) {
@@ -810,14 +854,15 @@
 	} else if (!strncmp(info, "PARTNER_HANDLE ", 15)) {
 		info += 15;
-		if (!sd->filetransfer_status)
+		if (!sd->filetransfer_status) {
 			return;
+		}
 		switch (sd->filetransfer_status) {
 		case SKYPE_FILETRANSFER_NEW:
 			imcb_log(ic, "The user %s offered a new file for you.",
-				info);
+			         info);
 			break;
 		case SKYPE_FILETRANSFER_FAILED:
 			imcb_log(ic, "Failed to transfer file from user %s.",
-				info);
+			         info);
 			break;
 		case SKYPE_FILETRANSFER_COMPLETED:
@@ -826,5 +871,6 @@
 		case SKYPE_FILETRANSFER_TRANSFERRING:
 			if (sd->filetransfer_path) {
-				imcb_log(ic, "File transfer from user %s started, saving to %s.", info, sd->filetransfer_path);
+				imcb_log(ic, "File transfer from user %s started, saving to %s.", info,
+				         sd->filetransfer_path);
 				g_free(sd->filetransfer_path);
 				sd->filetransfer_path = NULL;
@@ -842,8 +888,9 @@
 
 	for (i = 0; i < g_list_length(sd->groups); i++) {
-		struct skype_group *sg = (struct skype_group *)g_list_nth_data(sd->groups, i);
-
-		if (sg->id == id)
+		struct skype_group *sg = (struct skype_group *) g_list_nth_data(sd->groups, i);
+
+		if (sg->id == id) {
 			return sg;
+		}
 	}
 	return NULL;
@@ -859,6 +906,7 @@
 	}
 	sg->users = NULL;
-	if (usersonly)
+	if (usersonly) {
 		return;
+	}
 	g_free(sg->name);
 	g_free(sg);
@@ -883,11 +931,13 @@
 	char *id = strchr(line, ' ');
 
-	if (!++id)
+	if (!++id) {
 		return;
+	}
 
 	char *info = strchr(id, ' ');
 
-	if (!info)
+	if (!info) {
 		return;
+	}
 	*info = '\0';
 	info++;
@@ -923,7 +973,8 @@
 			g_strfreev(users);
 			skype_group_users(ic, sg);
-		} else
+		} else {
 			log_message(LOGLVL_ERROR,
-				"No skype group with id %s. That's probably a bug.", id);
+			            "No skype group with id %s. That's probably a bug.", id);
+		}
 	} else if (!strncmp(info, "NROFUSERS ", 10)) {
 		if (!sd->pending_user) {
@@ -942,10 +993,12 @@
 			g_free(sd->pending_user);
 			sd->pending_user = NULL;
-		} else
+		} else {
 			log_message(LOGLVL_ERROR,
-					"No skype group with id %s. That's probably a bug.", id);
-	} else if (!strcmp(info, "TYPE CUSTOM_GROUP"))
+			            "No skype group with id %s. That's probably a bug.", id);
+		}
+	} else if (!strcmp(info, "TYPE CUSTOM_GROUP")) {
 		/* This one is interesting, query its users. */
 		skype_printf(ic, "GET GROUP %s USERS\n", id);
+	}
 }
 
@@ -956,17 +1009,20 @@
 	char *id = strchr(line, ' ');
 
-	if (!++id)
+	if (!++id) {
 		return;
+	}
 	struct groupchat *gc;
 	char *info = strchr(id, ' ');
 
-	if (!info)
+	if (!info) {
 		return;
+	}
 	*info = '\0';
 	info++;
 	/* Remove fake chat if we created one in skype_chat_with() */
 	gc = bee_chat_by_title(ic->bee, ic, "");
-	if (gc)
+	if (gc) {
 		imcb_chat_free(gc);
+	}
 	if (!strcmp(info, "STATUS MULTI_SUBSCRIBED")) {
 		gc = bee_chat_by_title(ic->bee, ic, id);
@@ -988,5 +1044,5 @@
 		/*skype_printf(ic, "OPEN CHAT %s\n", id);*/
 		g_snprintf(buf, IRC_LINE_SIZE, "%s@skype.com",
-				sd->groupchat_with);
+		           sd->groupchat_with);
 		imcb_chat_add_buddy(gc, buf);
 		imcb_chat_add_buddy(gc, sd->username);
@@ -997,6 +1053,7 @@
 	} else if (!strcmp(info, "STATUS UNSUBSCRIBED")) {
 		gc = bee_chat_by_title(ic->bee, ic, id);
-		if (gc)
-			gc->data = (void *)FALSE;
+		if (gc) {
+			gc->data = (void *) FALSE;
+		}
 	} else if (!strncmp(info, "ADDER ", 6)) {
 		info += 6;
@@ -1015,9 +1072,10 @@
 			sd->adder = NULL;
 		}
-	} else if (!strncmp(info, "MEMBERS ", 8) || !strncmp(info, "ACTIVEMEMBERS ", 14) ) {
-		if (!strncmp(info, "MEMBERS ", 8))
+	} else if (!strncmp(info, "MEMBERS ", 8) || !strncmp(info, "ACTIVEMEMBERS ", 14)) {
+		if (!strncmp(info, "MEMBERS ", 8)) {
 			info += 8;
-		else
+		} else {
 			info += 14;
+		}
 		gc = bee_chat_by_title(ic->bee, ic, id);
 		/* Hack! We set ->data to TRUE
@@ -1025,16 +1083,19 @@
 		 * so that we won't rejoin
 		 * after a /part. */
-		if (!gc || gc->data)
+		if (!gc || gc->data) {
 			return;
+		}
 		char **members = g_strsplit(info, " ", 0);
 		int i;
 		for (i = 0; members[i]; i++) {
-			if (!strcmp(members[i], sd->username))
+			if (!strcmp(members[i], sd->username)) {
 				continue;
+			}
 			g_snprintf(buf, IRC_LINE_SIZE, "%s@skype.com",
-					members[i]);
+			           members[i]);
 			if (!g_list_find_custom(gc->in_room, buf,
-				(GCompareFunc)strcmp))
+			                        (GCompareFunc) strcmp)) {
 				imcb_chat_add_buddy(gc, buf);
+			}
 		}
 		imcb_chat_add_buddy(gc, sd->username);
@@ -1045,7 +1106,7 @@
 static void skype_parse_password(struct im_connection *ic, char *line)
 {
-	if (!strncmp(line+9, "OK", 2))
+	if (!strncmp(line + 9, "OK", 2)) {
 		imcb_connected(ic);
-	else {
+	} else {
 		imcb_error(ic, "Authentication Failed");
 		imc_logout(ic, TRUE);
@@ -1055,5 +1116,5 @@
 static void skype_parse_profile(struct im_connection *ic, char *line)
 {
-	imcb_log(ic, "SkypeOut balance value is '%s'.", line+21);
+	imcb_log(ic, "SkypeOut balance value is '%s'.", line + 21);
 }
 
@@ -1081,6 +1142,7 @@
 static void skype_parse_groups(struct im_connection *ic, char *line)
 {
-	if (!set_getbool(&ic->acc->set, "read_groups"))
+	if (!set_getbool(&ic->acc->set, "read_groups")) {
 		return;
+	}
 
 	char **i;
@@ -1100,11 +1162,13 @@
 	char *id = line + strlen("ALTER GROUP");
 
-	if (!++id)
+	if (!++id) {
 		return;
+	}
 
 	char *info = strchr(id, ' ');
 
-	if (!info)
+	if (!info) {
 		return;
+	}
 	*info = '\0';
 	info++;
@@ -1119,7 +1183,8 @@
 			imcb_add_buddy(ic, buf, sg->name);
 			g_free(buf);
-		} else
+		} else {
 			log_message(LOGLVL_ERROR,
-				"No skype group with id %s. That's probably a bug.", id);
+			            "No skype group with id %s. That's probably a bug.", id);
+		}
 	}
 }
@@ -1128,5 +1193,5 @@
 
 static gboolean skype_read_callback(gpointer data, gint fd,
-				    b_input_condition cond)
+                                    b_input_condition cond)
 {
 	struct im_connection *ic = data;
@@ -1158,9 +1223,10 @@
 	cond = cond;
 
-	if (!sd || sd->fd == -1)
+	if (!sd || sd->fd == -1) {
 		return FALSE;
+	}
 	/* Read the whole data. */
 	st = ssl_read(sd->ssl, buf, sizeof(buf));
-	if (st >= IRC_LINE_SIZE-1) {
+	if (st >= IRC_LINE_SIZE - 1) {
 		/* As we don't buffer incoming data, if IRC_LINE_SIZE amount of bytes
 		 * were received, there's a good chance last message was truncated
@@ -1175,14 +1241,17 @@
 		lineptr = lines;
 		while ((line = *lineptr)) {
-			if (!strlen(line))
+			if (!strlen(line)) {
 				break;
-			if (set_getbool(&ic->acc->set, "skypeconsole_receive"))
+			}
+			if (set_getbool(&ic->acc->set, "skypeconsole_receive")) {
 				imcb_buddy_msg(ic, "skypeconsole", line, 0, 0);
-			for (i = 0; i < ARRAY_SIZE(parsers); i++)
+			}
+			for (i = 0; i < ARRAY_SIZE(parsers); i++) {
 				if (!strncmp(line, parsers[i].k,
-					strlen(parsers[i].k))) {
+				             strlen(parsers[i].k))) {
 					parsers[i].v(ic, line);
 					break;
 				}
+			}
 			lineptr++;
 		}
@@ -1205,10 +1274,12 @@
 	int st;
 
-	if (!sd)
+	if (!sd) {
 		return FALSE;
-
-	if (sd->bfd <= 0)
+	}
+
+	if (sd->bfd <= 0) {
 		sd->bfd = b_input_add(sd->fd, B_EV_IO_READ,
-			skype_read_callback, ic);
+		                      skype_read_callback, ic);
+	}
 
 	/* Log in */
@@ -1260,5 +1331,5 @@
 	imcb_log(ic, "Connecting");
 	sd->ssl = ssl_connect(set_getstr(&acc->set, "server"),
-		set_getint(&acc->set, "port"), FALSE, skype_connected, ic);
+	                      set_getint(&acc->set, "port"), FALSE, skype_connected, ic);
 	sd->fd = sd->ssl ? ssl_getfd(sd->ssl) : -1;
 	sd->username = g_strdup(acc->user);
@@ -1266,6 +1337,7 @@
 	sd->ic = ic;
 
-	if (set_getbool(&acc->set, "skypeconsole"))
+	if (set_getbool(&acc->set, "skypeconsole")) {
 		imcb_add_buddy(ic, "skypeconsole", NULL);
+	}
 }
 
@@ -1277,14 +1349,16 @@
 	skype_printf(ic, "SET USERSTATUS OFFLINE\n");
 
-	while (ic->groupchats)
+	while (ic->groupchats) {
 		imcb_chat_free(ic->groupchats->data);
+	}
 
 	for (i = 0; i < g_list_length(sd->groups); i++) {
-		struct skype_group *sg = (struct skype_group *)g_list_nth_data(sd->groups, i);
+		struct skype_group *sg = (struct skype_group *) g_list_nth_data(sd->groups, i);
 		skype_group_free(sg, FALSE);
 	}
 
-	if (sd->ssl)
+	if (sd->ssl) {
 		ssl_disconnect(sd->ssl);
+	}
 
 	g_free(sd->username);
@@ -1295,5 +1369,5 @@
 
 static int skype_buddy_msg(struct im_connection *ic, char *who, char *message,
-			   int flags)
+                           int flags)
 {
 	char *ptr, *nick;
@@ -1305,11 +1379,13 @@
 	nick = g_strdup(who);
 	ptr = strchr(nick, '@');
-	if (ptr)
+	if (ptr) {
 		*ptr = '\0';
-
-	if (!strncmp(who, "skypeconsole", 12))
+	}
+
+	if (!strncmp(who, "skypeconsole", 12)) {
 		st = skype_printf(ic, "%s\n", message);
-	else
+	} else {
 		st = skype_printf(ic, "MESSAGE %s %s\n", nick, message);
+	}
 	g_free(nick);
 
@@ -1321,7 +1397,9 @@
 	int i;
 
-	for (i = 0; skype_away_state_list[i].full_name; i++)
-		if (g_strcasecmp(skype_away_state_list[i].full_name, name) == 0)
+	for (i = 0; skype_away_state_list[i].full_name; i++) {
+		if (g_strcasecmp(skype_away_state_list[i].full_name, name) == 0) {
 			return skype_away_state_list + i;
+		}
+	}
 
 	return NULL;
@@ -1329,5 +1407,5 @@
 
 static void skype_set_away(struct im_connection *ic, char *state_txt,
-			   char *message)
+                           char *message)
 {
 	const struct skype_away_state *state;
@@ -1336,8 +1414,9 @@
 	message = message;
 
-	if (state_txt == NULL)
+	if (state_txt == NULL) {
 		state = skype_away_state_by_name("Online");
-	else
+	} else {
 		state = skype_away_state_by_name(state_txt);
+	}
 	skype_printf(ic, "SET USERSTATUS %s\n", state->code);
 }
@@ -1351,8 +1430,10 @@
 	ic = ic;
 
-	if (l == NULL)
-		for (i = 0; skype_away_state_list[i].full_name; i++)
+	if (l == NULL) {
+		for (i = 0; skype_away_state_list[i].full_name; i++) {
 			l = g_list_append(l,
-				(void *)skype_away_state_list[i].full_name);
+			                  (void *) skype_away_state_list[i].full_name);
+		}
+	}
 
 	return l;
@@ -1391,6 +1472,7 @@
 	char *ptr = strchr(nick, '@');
 
-	if (ptr)
+	if (ptr) {
 		*ptr = '\0';
+	}
 	skype_printf(ic, "CALL %s\n", nick);
 	g_free(nick);
@@ -1403,9 +1485,10 @@
 	if (sd->call_id) {
 		skype_printf(ic, "SET CALL %s STATUS FINISHED\n",
-				sd->call_id);
+		             sd->call_id);
 		g_free(sd->call_id);
 		sd->call_id = 0;
-	} else
+	} else {
 		imcb_error(ic, "There are no active calls currently.");
+	}
 }
 
@@ -1415,8 +1498,9 @@
 	struct im_connection *ic = acc->ic;
 
-	if (value)
+	if (value) {
 		skype_call(ic, value);
-	else
+	} else {
 		skype_hangup(ic);
+	}
 	return value;
 }
@@ -1429,10 +1513,11 @@
 	nick = g_strdup(who);
 	ptr = strchr(nick, '@');
-	if (ptr)
+	if (ptr) {
 		*ptr = '\0';
+	}
 
 	if (!group) {
 		skype_printf(ic, "SET USER %s BUDDYSTATUS 2 Please authorize me\n",
-				nick);
+		             nick);
 		g_free(nick);
 	} else {
@@ -1459,6 +1544,7 @@
 	nick = g_strdup(who);
 	ptr = strchr(nick, '@');
-	if (ptr)
+	if (ptr) {
 		*ptr = '\0';
+	}
 	skype_printf(ic, "SET USER %s BUDDYSTATUS 1\n", nick);
 	g_free(nick);
@@ -1478,6 +1564,7 @@
 {
 	struct im_connection *ic = gc->ic;
+
 	skype_printf(ic, "ALTER CHAT %s LEAVE\n", gc->title);
-	gc->data = (void *)TRUE;
+	gc->data = (void *) TRUE;
 }
 
@@ -1489,6 +1576,7 @@
 	nick = g_strdup(who);
 	ptr = strchr(nick, '@');
-	if (ptr)
+	if (ptr) {
 		*ptr = '\0';
+	}
 	skype_printf(ic, "ALTER CHAT %s ADDMEMBERS %s\n", gc->title, nick);
 	g_free(nick);
@@ -1499,6 +1587,7 @@
 	struct im_connection *ic = gc->ic;
 	struct skype_data *sd = ic->proto_data;
+
 	skype_printf(ic, "ALTER CHAT %s SETTOPIC %s\n",
-		gc->title, message);
+	             gc->title, message);
 	sd->topic_wait = 1;
 }
@@ -1508,8 +1597,10 @@
 	struct skype_data *sd = ic->proto_data;
 	char *ptr, *nick;
+
 	nick = g_strdup(who);
 	ptr = strchr(nick, '@');
-	if (ptr)
+	if (ptr) {
 		*ptr = '\0';
+	}
 	skype_printf(ic, "CHAT CREATE %s\n", nick);
 	sd->groupchat_with = g_strdup(nick);
@@ -1524,8 +1615,10 @@
 	struct skype_data *sd = ic->proto_data;
 	char *ptr, *nick;
+
 	nick = g_strdup(who);
 	ptr = strchr(nick, '@');
-	if (ptr)
+	if (ptr) {
 		*ptr = '\0';
+	}
 	sd->is_info = TRUE;
 	skype_printf(ic, "GET USER %s FULLNAME\n", nick);
@@ -1556,5 +1649,5 @@
 
 	s = set_add(&acc->set, "server", SKYPE_DEFAULT_SERVER, set_eval_account,
-		acc);
+	            acc);
 	s->flags |= ACC_SET_OFFLINE_ONLY;
 
@@ -1563,5 +1656,5 @@
 
 	s = set_add(&acc->set, "display_name", NULL, skype_set_display_name,
-		acc);
+	            acc);
 	s->flags |= SET_NOSAVE | ACC_SET_ONLINE_ONLY;
 
@@ -1581,5 +1674,5 @@
 
 	s = set_add(&acc->set, "skypeconsole_receive", "false", set_eval_bool,
-		acc);
+	            acc);
 	s->flags |= ACC_SET_OFFLINE_ONLY;
 
@@ -1593,5 +1686,5 @@
 
 	s = set_add(&acc->set, "edit_prefix", "EDIT:",
-			NULL, acc);
+	            NULL, acc);
 
 	s = set_add(&acc->set, "read_groups", "false", set_eval_bool, acc);
@@ -1608,11 +1701,12 @@
 	if (ret == NULL) {
 		static const struct buddy_action ba[2] = {
-			{"CALL", "Initiate a call" },
-			{"HANGUP", "Hang up a call" },
+			{ "CALL", "Initiate a call" },
+			{ "HANGUP", "Hang up a call" },
 		};
 		int i;
 
-		for (i = 0; i < ARRAY_SIZE(ba); i++)
-			ret = g_list_prepend(ret, (void *)(ba + i));
+		for (i = 0; i < ARRAY_SIZE(ba); i++) {
+			ret = g_list_prepend(ret, (void *) (ba + i));
+		}
 	}
 
@@ -1626,8 +1720,9 @@
 	data = data;
 
-	if (!g_strcasecmp(action, "CALL"))
+	if (!g_strcasecmp(action, "CALL")) {
 		skype_call(bu->ic, bu->handle);
-	else if (!g_strcasecmp(action, "HANGUP"))
+	} else if (!g_strcasecmp(action, "HANGUP")) {
 		skype_hangup(bu->ic);
+	}
 
 	return NULL;
