diff src/protocols/zephyr/zephyr.c @ 4349:0c68d402f59f

[gaim-migrate @ 4614] XML Blist Gaim stores all the buddy lists in one big happy file now. You can order the buddies however you want, and they'll stay ordered that way. We can also store some per-buddy information now, which will be cool. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 19 Jan 2003 22:16:52 +0000
parents a614423c648f
children 3196d9044a45
line wrap: on
line diff
--- a/src/protocols/zephyr/zephyr.c	Sun Jan 19 22:03:57 2003 +0000
+++ b/src/protocols/zephyr/zephyr.c	Sun Jan 19 22:16:52 2003 +0000
@@ -320,10 +320,10 @@
 
 			if (ZParseLocations(&notice, NULL, &nlocs, &user) != ZERR_NONE)
 				return;
-			if ((b = find_buddy(zgc, user)) == NULL) {
+			if ((b = find_buddy(zgc->user, user)) == NULL) {
 				char *e = strchr(user, '@');
 				if (e) *e = '\0';
-				b = find_buddy(zgc, user);
+				b = find_buddy(zgc->user, user);
 			}
 			if (!b) {
 				free(user);
@@ -445,18 +445,20 @@
 	memset(&(ald.uid), 0, sizeof(ZUnique_Id_t));
 	ald.version = NULL;
 
-	gr = zgc->groups;
+	gr = groups;
 	while (gr) {
 		struct group *g = gr->data;
 		m = g->members;
 		while (m) {
 			struct buddy *b = m->data;
-			char *chk;
-			chk = zephyr_normalize(b->name);
-			/* doesn't matter if this fails or not; we'll just move on to the next one */
-			ZRequestLocations(chk, &ald, UNACKED, ZAUTH);
-			free(ald.user);
-			free(ald.version);
+			if(b->user->gc == zgc) {
+				char *chk;
+				chk = zephyr_normalize(b->name);
+				/* doesn't matter if this fails or not; we'll just move on to the next one */
+				ZRequestLocations(chk, &ald, UNACKED, ZAUTH);
+				free(ald.user);
+				free(ald.version);
+			}
 			m = m->next;
 		}
 		gr = gr->next;
@@ -571,7 +573,7 @@
 		while (fgets(buff, BUFSIZ, fd)) {
 			strip_comments(buff);
 			if (buff[0])
-				add_buddy(zgc, "Anyone", buff, buff);
+				add_buddy(zgc->user, "Anyone", buff, buff);
 		}
 		fclose(fd);
 	}
@@ -606,8 +608,6 @@
 	account_online(zgc);
 	serv_finish_login(zgc);
 
-	if (bud_list_cache_exists(zgc))
-		do_import(zgc, NULL);
 	process_anyone();
 	process_zsubs();
 
@@ -667,24 +667,26 @@
 		return;
 	}
 
-	gr = zgc->groups;
+	gr = groups;
 	while (gr) {
 		g = gr->data;
 		m = g->members;
 		while (m) {
 			b = m->data;
-			if ((ptr = strchr(b->name, '@')) != NULL) {
-				ptr2 = ptr + 1;
-				/* We should only strip the realm name if the principal
-				   is in the user's realm
-				*/
-				if (!g_strcasecmp(ptr2,ZGetRealm())) {
-					*ptr = '\0';
+			if(b->user->gc == zgc) {
+				if ((ptr = strchr(b->name, '@')) != NULL) {
+					ptr2 = ptr + 1;
+					/* We should only strip the realm name if the principal
+					   is in the user's realm
+					   */
+					if (!g_strcasecmp(ptr2,ZGetRealm())) {
+						*ptr = '\0';
+					}
 				}
+				fprintf(fd, "%s\n", b->name);
+				if (ptr)
+					*ptr = '@';
 			}
-			fprintf(fd, "%s\n", b->name);
-			if (ptr)
-				*ptr = '@';
 			m = m->next;
 		}
 		gr = gr->next;