diff src/protocols/gg/confer.c @ 12007:8724718d387f

[gaim-migrate @ 14300] Further updates to gg from Bartosz Oler. This makes the login and token retrieval processes asynchronous. There are also some encoding fixes and various cleanups. There are some changes from me to make it work on win32. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 08 Nov 2005 19:45:09 +0000
parents d5599677bf32
children 508512caa22e
line wrap: on
line diff
--- a/src/protocols/gg/confer.c	Tue Nov 08 18:56:15 2005 +0000
+++ b/src/protocols/gg/confer.c	Tue Nov 08 19:45:09 2005 +0000
@@ -33,13 +33,13 @@
 	g_return_val_if_fail(name != NULL, NULL);
 
 	return gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, name,
-				gaim_connection_get_account(gc));
+			gaim_connection_get_account(gc));
 }
 /* }}} */
 
 /* void ggp_confer_participants_add_uin(GaimConnection *gc, const gchar *chat_name, const uin_t uin) {{{ */
 void ggp_confer_participants_add_uin(GaimConnection *gc, const gchar *chat_name,
-								   const uin_t uin)
+							 const uin_t uin)
 {
 	GaimConversation *conv;
 	GGPInfo *info = gc->proto_data;
@@ -52,23 +52,27 @@
 	for (l = info->chats; l != NULL; l = l->next) {
 		chat = l->data;
 
-		if (g_utf8_collate(chat->name, chat_name) == 0) {
-			if (g_list_find(chat->participants, str_uin) == NULL) {
-				chat->participants = g_list_append(chat->participants, str_uin);
-				conv = ggp_confer_find_by_name(gc, chat_name);
+		if (g_utf8_collate(chat->name, chat_name) != 0)
+			continue;
+
+		if (g_list_find(chat->participants, str_uin) == NULL) {
+			chat->participants = g_list_append(
+						chat->participants, str_uin);
 
-				gaim_conv_chat_add_user(GAIM_CONV_CHAT(conv),
-						ggp_buddy_get_name(gc, uin), NULL, GAIM_CBFLAGS_NONE, TRUE);
-			}
-			break;
+			conv = ggp_confer_find_by_name(gc, chat_name);
+
+			gaim_conv_chat_add_user(GAIM_CONV_CHAT(conv),
+				ggp_buddy_get_name(gc, uin), NULL,
+				GAIM_CBFLAGS_NONE, TRUE);
 		}
+		break;
 	}
 }
 /* }}} */
 
 /* void ggp_confer_participants_add(GaimConnection *gc, const gchar *chat_name, const uin_t *recipients, int count) {{{ */
 void ggp_confer_participants_add(GaimConnection *gc, const gchar *chat_name,
-							   const uin_t *recipients, int count)
+				 const uin_t *recipients, int count)
 {
 	GaimConversation *conv;
 	GGPInfo *info = gc->proto_data;
@@ -80,28 +84,34 @@
 	for (l = info->chats; l != NULL; l = l->next) {
 		chat = l->data;
 
-		if (g_utf8_collate(chat->name, chat_name) == 0) {
+		if (g_utf8_collate(chat->name, chat_name) != 0)
+			continue;
 
-			for (i = 0; i < count; i++) {
-				uin = g_strdup_printf("%lu", (unsigned long int)recipients[i]);
-				if (g_list_find(chat->participants, uin) == NULL) {
-					chat->participants = g_list_append(chat->participants, uin);
-					conv = ggp_confer_find_by_name(gc, chat_name);
+		for (i = 0; i < count; i++) {
+			uin = g_strdup_printf("%lu", (unsigned long int)recipients[i]);
+
+			if (g_list_find(chat->participants, uin) != NULL) {
+				g_free(uin);
+				continue;
+			}
 
-					gaim_conv_chat_add_user(GAIM_CONV_CHAT(conv),
-							ggp_buddy_get_name(gc, recipients[i]),
-							NULL, GAIM_CBFLAGS_NONE, TRUE);
-				}
-				g_free(uin);
-			}
-			break;
+			chat->participants = g_list_append(chat->participants, uin);
+			conv = ggp_confer_find_by_name(gc, chat_name);
+
+			gaim_conv_chat_add_user(GAIM_CONV_CHAT(conv),
+				ggp_buddy_get_name(gc, recipients[i]),
+				NULL, GAIM_CBFLAGS_NONE, TRUE);
+
+			g_free(uin);
 		}
+		break;
 	}
 }
 /* }}} */
 
 /* const char *ggp_confer_find_by_participants(GaimConnection *gc, const uin_t *recipients, int count) {{{ */
-const char *ggp_confer_find_by_participants(GaimConnection *gc, const uin_t *recipients, int count)
+const char *ggp_confer_find_by_participants(GaimConnection *gc,
+					    const uin_t *recipients, int count)
 {
 	GGPInfo *info = gc->proto_data;
 	GGPChat *chat = NULL;
@@ -157,4 +167,4 @@
 }
 /* }}} */
 
-/* vim: set ts=4 sts=0 sw=4 noet: */
+/* vim: set ts=8 sts=0 sw=8 noet: */