diff plugins/jabber/jabber.c @ 1344:8b5ed2f0496c

[gaim-migrate @ 1354] jabber stuff. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 21 Dec 2000 10:31:42 +0000
parents f48cb8ddca59
children d6e6fcaa1f39
line wrap: on
line diff
--- a/plugins/jabber/jabber.c	Thu Dec 21 06:56:48 2000 +0000
+++ b/plugins/jabber/jabber.c	Thu Dec 21 10:31:42 2000 +0000
@@ -49,6 +49,8 @@
 #include "gaim.h"
 #include <jabber/jabber.h>
 
+#include "pixmaps/available.xpm"
+
 /* The priv member of gjconn's is a gaim_connection for now. */
 #define GJ_GC(x) ((struct gaim_connection *)(x)->priv)
 
@@ -439,8 +441,10 @@
 
   debug_printf("jabber: presence: %s, %s %s\n", to, from, type);
 
-  if (!(b = find_buddy(GJ_GC(j), from)))
-          add_buddy(GJ_GC(j), "Extra", from, from);
+  if (!(b = find_buddy(GJ_GC(j), from))) {
+          add_buddy(GJ_GC(j), "Buddies", from, from);
+	  do_export(NULL, NULL);
+  }
 
   if (type && (strcasecmp(type, "unavailable") == 0))
           serv_got_update(GJ_GC(j), from, 0, 0, 0, 0, 0, 0);
@@ -481,6 +485,7 @@
                                         if (!(b = find_buddy(GJ_GC(j), jid))) {
                                                 debug_printf("adding buddy: %s\n", jid);
                                                 b = add_buddy(GJ_GC(j), groupname, jid, name?name:jid);
+						do_export(0, 0);
                                         } else {
                                                 debug_printf("updating buddy: %s/%s\n", jid, name);
                                                 g_snprintf(b->name, sizeof(b->name), "%s", jid);
@@ -493,7 +498,8 @@
                 } else {
                         struct buddy *b;
                         if (!(b = find_buddy(GJ_GC(j), jid))) {
-                                b = add_buddy(GJ_GC(j), "Extra", jid, name?name:jid);
+                                b = add_buddy(GJ_GC(j), "Buddies", jid, name?name:jid);
+				do_export(0, 0);
                         }
                 }
 
@@ -523,7 +529,6 @@
                   querynode = xmlnode_get_tag(p->x, "query");
                   xmlns = xmlnode_get_attrib(querynode, "xmlns");
 
-                  /* XXX this just doesn't look right */
                   if (!xmlns || NSCHECK(querynode, NS_AUTH)) {
                           debug_printf("auth success\n");
                           
@@ -578,11 +583,11 @@
           break;
   case JCONN_STATE_CONNECTED:
           debug_printf("jabber: connected.\n");
-          set_login_progress(GJ_GC(j), 1, "Connected");
+          set_login_progress(GJ_GC(j), 3, "Connected");
           break;
   case JCONN_STATE_ON:
           debug_printf("jabber: logging in...\n");
-          set_login_progress(GJ_GC(j), 1, "Logging in...");
+          set_login_progress(GJ_GC(j), 5, "Logging in...");
           gjab_auth(j);
           break;
   default:
@@ -596,14 +601,11 @@
 	struct jabber_data *jd = gc->proto_data = g_new0(struct jabber_data, 1);
 
 	set_login_progress(gc, 1, "Connecting");
-	while (gtk_events_pending())
-		gtk_main_iteration();
 
         if (!(jd->jc = gjab_new(user->username, user->password, gc))) {
 		debug_printf("jabber: unable to connect (jab_new failed)\n");
 		hide_login_progress(gc, "Unable to connect");
 		signoff(gc);
-		g_free(jd);
                 return;
         }