]> andersk Git - libfaim.git/commitdiff
- Fri Dec 1 23:48:38 UTC 2000
authormid <mid>
Fri, 1 Dec 2000 23:51:45 +0000 (23:51 +0000)
committermid <mid>
Fri, 1 Dec 2000 23:51:45 +0000 (23:51 +0000)
  - Store exchange along with room name in the great chat hack

CHANGES
aim_chat.c
aim_conn.c
aim_msgcookie.c
aim_rxhandlers.c
faim/aim.h
utils/faimtest/faimtest.c

diff --git a/CHANGES b/CHANGES
index 83d4e92020d5e6a94a4c28a04a2c8fa14eafb6d8..06efdeb1d78ac72cf863e1147fd2a6021108a199 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
 
 No release numbers
 ------------------
+ - Fri Dec  1 23:48:38 UTC 2000
+  - Store exchange along with room name in the great chat hack
+
  - Fri Dec  1 22:25:56 UTC 2000
   - Fix numerous tiny (but sometimes catastrophic) bugs dealing
       with connection death (particularly with chat connections)
index 6ad5d15bd8b60b81dfbc801475d9c0b9edf45f52..85331edaf10b04e37660d4390b776604b0ddc658 100644 (file)
@@ -155,10 +155,8 @@ faim_export unsigned long aim_chat_join(struct aim_session_t *sess,
   i+= aimutil_put16(newpacket->data+i, 2+1+strlen(roomname)+2);
   i+= aimutil_put16(newpacket->data+i, exchange);
   i+= aimutil_put8(newpacket->data+i, strlen(roomname));
-  memcpy(newpacket->data+i, roomname, strlen(roomname));
-  i+= strlen(roomname);
-  //i+= aimutil_putstr(newpacket->data+i, roomname, strlen(roomname));
-  i+= aimutil_put16(newpacket->data+i, 0x0000);
+  i+= aimutil_putstr(newpacket->data+i, roomname, strlen(roomname));
+  i+= aimutil_put16(newpacket->data+i, 0x0000); /* instance? */
 
   /*
    * Chat hack.
@@ -169,8 +167,8 @@ faim_export unsigned long aim_chat_join(struct aim_session_t *sess,
    *      redirect!
    *
    */
-  sess->pendingjoin = (char *)malloc(strlen(roomname)+1);
-  strcpy(sess->pendingjoin, roomname);
+  sess->pendingjoin = strdup(roomname);
+  sess->pendingjoinexchange = exchange;
 
   newpacket->lock = 0;
   aim_tx_enqueue(sess, newpacket);
index 6914f0ed057f96c5e117014767f64d76a5602367..836c0d442652e9ab70485632c29b239fbc4eafa5 100644 (file)
@@ -709,7 +709,9 @@ faim_export void aim_session_init(struct aim_session_t *sess, unsigned long flag
   sess->queue_outgoing = NULL;
   sess->queue_incoming = NULL;
   sess->pendingjoin = NULL;
+  sess->pendingjoinexchange = 0;
   aim_initsnachash(sess);
+  sess->msgcookies = NULL;
   sess->snac_nextid = 0x00000001;
 
   sess->flags = 0;
index c9cb58a93570e8cb38e02c926224c76f90265433..fb457eee1ea11dad5510294e62fb3e22c84c2fb1 100644 (file)
@@ -123,7 +123,7 @@ faim_export int aim_purgecookies(struct aim_session_t *sess, int maxage)
     if (cur->addtime > (time(NULL) - maxage)) {
       struct aim_msgcookie_t *remed = NULL;
 
-#if DEBUG > 1
+#if 1
       printf("aimmsgcookie: WARNING purged obsolete message cookie %x%x%x%x %x%x%x%x\n",
             cur->cookie[0], cur->cookie[1], cur->cookie[2], cur->cookie[3],
             cur->cookie[4], cur->cookie[5], cur->cookie[6], cur->cookie[7]);
index bc67cbf0193783064e1936238b4ca85131d3eadc..97fe6553b8cfb0383a33c75f773a664e491aab6d 100644 (file)
@@ -781,9 +781,10 @@ faim_internal int aim_handleredirect_middle(struct aim_session_t *sess,
        */
       userfunc = aim_callhandler(command->conn, 0x0001, 0x0005);
       if (userfunc)
-       ret =  userfunc(sess, command, serviceid, ip, cookie, sess->pendingjoin);
+       ret =  userfunc(sess, command, serviceid, ip, cookie, sess->pendingjoin, (int)sess->pendingjoinexchange);
       free(sess->pendingjoin);
       sess->pendingjoin = NULL;
+      sess->pendingjoinexchange = 0;
     }
   else
     {
index e0ed0b37178c4a89c3623a6b4926f4c76c74ffea..8e345a4d66f84cc9977017d49f00c00aa15e77db 100644 (file)
@@ -338,6 +338,7 @@ struct aim_session_t {
    * request and the resulting redirect.)
    */ 
   char *pendingjoin;
+  unsigned short pendingjoinexchange;
 
   /*
    * Outstanding snac handling 
index 687ca7ced5a78b67fdbfa8bc371d233934b46475..bd2c06a5f8eb70c2b3b515dd5201bb8eb0f64e0e 100644 (file)
@@ -509,9 +509,11 @@ int faimtest_handleredirect(struct aim_session_t *sess, struct command_rx_struct
     case 0x000e: /* Chat */
       {
        char *roomname = NULL;
+       int exchange;
        struct aim_conn_t *tstconn = NULL;
 
        roomname = va_arg(ap, char *);
+       exchange = va_arg(ap, int);
 
        tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, ip);
        if ( (tstconn==NULL) || (tstconn->status & AIM_CONN_STATUS_RESOLVERR))
@@ -520,7 +522,7 @@ int faimtest_handleredirect(struct aim_session_t *sess, struct command_rx_struct
            if (tstconn) aim_conn_kill(sess, &tstconn);
            return 1;
          }             
-       printf("faimtest: chat: connected\n");
+       printf("faimtest: chat: connected to %s on exchange %d\n", roomname, exchange);
 
        /*
         * We must do this to attach the stored name to the connection!
This page took 0.066879 seconds and 5 git commands to generate.