]> andersk Git - libfaim.git/blobdiff - aim_chat.c
- Fri Sep 1 23:34:28 UTC 2000
[libfaim.git] / aim_chat.c
index 0543ade2b06f0c56359fc020cbb1eccd2f72032b..765e19dcd69031a8d6a8edea621f5f5ee38dfec4 100644 (file)
@@ -55,7 +55,7 @@ u_long aim_chat_send_im(struct aim_session_t *sess,
   if (!sess || !conn || !msg)
     return 0;
   
-  if (!(newpacket = aim_tx_new(0x0002, conn, 1152)))
+  if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 1152)))
     return -1;
 
   newpacket->lock = 1; /* lock struct */
@@ -70,6 +70,8 @@ u_long aim_chat_send_im(struct aim_session_t *sess,
   for (i=0;i<8;i++)
     curbyte += aimutil_put8(newpacket->data+curbyte, (u_char) random());
 
+  aim_cachecookie(sess, aim_mkcookie(newpacket->data+curbyte-8, AIM_COOKIETYPE_CHAT, NULL));
+
   /*
    * metaTLV start.  -- i assume this is a metaTLV.  it could be the
    *                    channel ID though.
@@ -130,7 +132,7 @@ u_long aim_chat_join(struct aim_session_t *sess,
   if (!sess || !conn || !roomname)
     return 0;
   
-  if (!(newpacket = aim_tx_new(0x0002, conn, 10+9+strlen(roomname)+2)))
+  if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+9+strlen(roomname)+2)))
     return -1;
 
   newpacket->lock = 1;
@@ -430,11 +432,13 @@ int aim_chat_parse_incoming(struct aim_session_t *sess,
   i = 10; /* skip snac */
 
   /*
-   * ICBM Cookie.  Ignore it.
+   * ICBM Cookie.  Cache it.
    */ 
   for (z=0; z<8; z++,i++)
     cookie[z] = command->data[i];
 
+  aim_cachecookie(sess, aim_mkcookie(cookie, AIM_COOKIETYPE_ICBM, NULL));
+
   /*
    * Channel ID
    *
@@ -513,7 +517,7 @@ u_long aim_chat_clientready(struct aim_session_t *sess,
   struct command_tx_struct *newpacket;
   int i;
 
-  if (!(newpacket = aim_tx_new(0x0002, conn, 0x20)))
+  if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 0x20)))
     return -1;
 
   newpacket->lock = 1;
@@ -567,7 +571,7 @@ u_long aim_chat_invite(struct aim_session_t *sess,
   if (!sess || !conn || !sn || !msg || !roomname)
     return 0;
 
-  if (!(newpacket = aim_tx_new(0x0002, conn, 1152+strlen(sn)+strlen(roomname)+strlen(msg))))
+  if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 1152+strlen(sn)+strlen(roomname)+strlen(msg))))
     return -1;
 
   newpacket->lock = 1;
@@ -579,6 +583,7 @@ u_long aim_chat_invite(struct aim_session_t *sess,
    */
   for (i=0;i<8;i++)
     curbyte += aimutil_put8(newpacket->data+curbyte, (u_char)rand());
+  aim_cachecookie(sess, aim_mkcookie(newpacket->data+curbyte-8, AIM_COOKIETYPE_CHAT, NULL));
 
   /*
    * Channel (2)
This page took 0.033568 seconds and 4 git commands to generate.