changeset 1362:3cea00ca7a34

[gaim-migrate @ 1372] yay. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 22 Dec 2000 10:48:19 +0000
parents 5d4464379703
children b454b1d084ce
files NEWS plugins/jabber/jabber.c
diffstat 2 files changed, 35 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Fri Dec 22 08:55:12 2000 +0000
+++ b/NEWS	Fri Dec 22 10:48:19 2000 +0000
@@ -1,8 +1,23 @@
 -=[ GAIM ]=-  The Pimpin' Penguin AIM Clone That's Good For The Soul!
 
-0.11.0:
+0.11.0-pre4:
 	Rob: HOORAY FOR DISNEYLAND!
 
+	Eric: One more prerelease. I'm actually starting to think these
+	prereleases are a good idea; a lot of people reported a lot of
+	bugs in pre3 and most of them are fixed now. Also, it helps with
+	the whole release early-release often philosophy.
+
+	The big news in this prerelease is two more protocols: Jabber and
+	Napster. Both of them don't have any of the features that make
+	these services cool, yet. You can't use the transports in Jabber
+	and you can't download file in Napster. But you will be able to,
+	soon :)
+
+	Rob and I are going on vacation starting today until after New
+	Year's, which is a lot of the reason we wanted to get this release
+	out; it's much improved over pre3. Happy Holidays everyone.
+
 0.11.0-pre3 (12/15/2000):
 	Rob: Well, I hadn't initially planned on an 0.11.0pre3 but it 
 	looks like it was needed.  That's not necessarially a bad thing,
--- a/plugins/jabber/jabber.c	Fri Dec 22 08:55:12 2000 +0000
+++ b/plugins/jabber/jabber.c	Fri Dec 22 10:48:19 2000 +0000
@@ -110,6 +110,7 @@
 
 struct jabber_data {
 	gjconn jc;
+	gboolean did_import;
 };
 
 static char *jabber_name()
@@ -422,6 +423,7 @@
 static void jabber_handlemessage(gjconn j, jpacket p)
 {
 	xmlnode y;
+	gboolean same = TRUE;
 
 	char *from = NULL, *msg = NULL;
 
@@ -434,11 +436,15 @@
 		return;
 	}
 
-	from = g_strdup_printf("%s@%s", p->from->user, p->from->server);
+	if (jid_cmp(p->from, jid_new(j->p, GJ_GC(j)->username))) {
+		from = g_strdup_printf("%s@%s", p->from->user, p->from->server);
+		same = FALSE;
+	}
 
 	serv_got_im(GJ_GC(j), from, msg, 0);
 
-	g_free(from);
+	if (!same)
+		g_free(from);
 
 	return;
 }
@@ -523,8 +529,10 @@
 	xmlnode_put_attrib(g, "to", Jid);
 	if (!strcmp(ask, "subscribe"))
 		xmlnode_put_attrib(g, "type", "subscribed");
+	else if (!strcmp(ask, "unsubscribe"))
+		xmlnode_put_attrib(g, "type", "unsubscribed");
 	else
-		xmlnode_put_attrib(g, "type", "unsubscribed");
+		return;
 
 	gjab_send(j, g);
 }
@@ -545,15 +553,6 @@
 		ask = xmlnode_get_attrib(x, "ask");
 		who = jid_new(j->p, Jid);
 
-		if (ask) {
-			g = xmlnode_new_tag("presence");
-			xmlnode_put_attrib(g, "to", Jid);
-			if (!strcmp(ask, "subscribe"))
-				xmlnode_put_attrib(g, "type", "subscribed");
-			else
-				xmlnode_put_attrib(g, "type", "unsubscribed");
-		}
-
 		if ((g = xmlnode_get_firstchild(x))) {
 			while (g) {
 				if (strncasecmp(xmlnode_get_name(g), "group", 5) == 0) {
@@ -625,21 +624,22 @@
 		if (jpacket_subtype(p) == JPACKET__SET) {
 		} else if (jpacket_subtype(p) == JPACKET__RESULT) {
 			xmlnode querynode;
-			char *xmlns;
+			char *xmlns, *from;
 
+			from = xmlnode_get_attrib(p->x, "from");
 			querynode = xmlnode_get_tag(p->x, "query");
 			xmlns = xmlnode_get_attrib(querynode, "xmlns");
 
-			if (!xmlns || NSCHECK(querynode, NS_AUTH)) {
+			if ((!xmlns && !from) || NSCHECK(querynode, NS_AUTH)) {
 				debug_printf("auth success\n");
 
 				account_online(GJ_GC(j));
 				serv_finish_login(GJ_GC(j));
 
-				/*
 				if (bud_list_cache_exists(GJ_GC(j)))
 					do_import(NULL, GJ_GC(j));
-				*/
+
+				((struct jabber_data *)GJ_GC(j)->proto_data)->did_import = TRUE;
 
 				gjab_reqroster(j);
 
@@ -763,6 +763,9 @@
 	char *realwho;
 	gjconn j = ((struct jabber_data *)gc->proto_data)->jc;
 
+	if (!((struct jabber_data *)gc->proto_data)->did_import)
+		return;
+
 	if (!name)
 		return;