ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/modules/jabber libEBjabber.c,1.2,1.3


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/modules/jabber libEBjabber.c,1.2,1.3
Date: Sun, 16 Mar 2003 07:35:17 -0500

Update of /cvsroot/ayttm/ayttm/modules/jabber
In directory subversions:/tmp/cvs-serv10166/modules/jabber

Modified Files:
        libEBjabber.c 
Log Message:
fix(?) registration


Index: libEBjabber.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/modules/jabber/libEBjabber.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- libEBjabber.c       16 Jan 2003 09:51:03 -0000      1.2
+++ libEBjabber.c       16 Mar 2003 12:34:58 -0000      1.3
@@ -241,6 +241,8 @@
        eb_debug(DBG_JBR,  "jid: %s\n", jid);
        JConn=JCnewConn();
        strncpy(JConn->jid,jid, LINE_LENGTH);
+       /* We assume we have an account, and don't need to register one */
+       JConn->reg_flag = 0;
        JConn->conn=jab_new(jid, passwd);
        if(!JConn->conn) {
                snprintf(buff, 4096, "Connection to the jabber server: %s 
failed!", host);
@@ -263,8 +265,6 @@
                         jabber_callback_handler, JConn);
        JConn->listenerID = lID;
        eb_debug(DBG_JBR,  "*** ListenerID: %i FD: %i\n", lID, JConn->conn->fd);
-       /* We assume we have an account, and don't need to register one */
-       JConn->reg_flag = 0;
        return(JConn);
 }
 
@@ -521,6 +521,9 @@
        char *ptr=NULL;
        Agent *agent=NULL;
 
+       if (!from)
+               return 0;
+       
        strncpy(buffer, from, 256);
        strtok(buffer, "/");
        ptr=strchr(buffer, '@');
@@ -877,6 +880,8 @@
                        eb_debug(DBG_JBR, "Received error: [%i]%s from %s[%s], 
sent to %s\n", atoi(code), desc, from, name, to);
                        switch(atoi(code)) {
                        case 401: /* Unauthorized */
+                               if (JConn->reg_flag)
+                                       break;
                                //FIXME: We need to change our status to 
offline first
                                JD=calloc(sizeof(JABBER_Dialog), 1);
                                name = xmlnode_get_tag_data(packet->iq, 
"username");
@@ -1053,6 +1058,7 @@
        jd->JConn->reg_flag = 1;
        jd->JConn->id = atoi (jab_reg (jd->JConn->conn));
        eb_debug(DBG_JBR,  "Leaving\n");
+       jd->JConn->conn->sid = NULL;
 }
 
 void j_allow_subscribe(void *data) {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]