]> andersk Git - libfaim.git/commitdiff
- Sun Dec 17 07:19:04 UTC 2000
authormid <mid>
Sun, 17 Dec 2000 07:22:01 +0000 (07:22 +0000)
committermid <mid>
Sun, 17 Dec 2000 07:22:01 +0000 (07:22 +0000)
  - Update the capability block list

CHANGES
aim_info.c
faim/aim.h
utils/faimtest/faimtest.c

diff --git a/CHANGES b/CHANGES
index 3f04d26bba0efb47281a783b6a494eed5f827575..79d5983914ece7a89a80909c55226b28953ec96a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
 
 No release numbers
 ------------------
+ - Sun Dec 17 07:19:04 UTC 2000
+  - Update the capability block list
+
  - Sat Dec 16 01:34:19 UTC 2000
   - Rename paramid to rateclass
   - Add a long comment about the rate system
index 396ddb9994ada66dce037693abea0cbbc97f7fe9..09bb4a22eaccc8eb674835854ab2bb6b1c3c469e 100644 (file)
@@ -94,7 +94,7 @@ faim_internal int aim_parse_locateerr(struct aim_session_t *sess,
 /*
  * Capability blocks.  
  */
-u_char aim_caps[6][16] = {
+u_char aim_caps[8][16] = {
   
   /* Buddy icon */
   {0x09, 0x46, 0x13, 0x46, 0x4c, 0x7f, 0x11, 0xd1, 
@@ -118,7 +118,15 @@ u_char aim_caps[6][16] = {
   
   /* Send file */
   {0x09, 0x46, 0x13, 0x43, 0x4c, 0x7f, 0x11, 0xd1, 
-   0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}
+   0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00},
+
+  /* Saves stock portfolios */
+  {0x09, 0x46, 0x13, 0x47, 0x4c, 0x7f, 0x11, 0xd1,
+   0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00},
+
+  /* Games */
+  {0x09, 0x46, 0x13, 0x4a, 0x4c, 0x7f, 0x11, 0xd1,
+   0x22, 0x82, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00},
 };
 
 faim_internal unsigned short aim_getcap(unsigned char *capblock, int buflen)
@@ -126,21 +134,29 @@ faim_internal unsigned short aim_getcap(unsigned char *capblock, int buflen)
   u_short ret = 0;
   int y;
   int offset = 0;
+  int identified;
 
   while (offset < buflen) {
+    identified = 0;
     for(y=0; y < (sizeof(aim_caps)/0x10); y++) {
       if (memcmp(&aim_caps[y], capblock+offset, 0x10) == 0) {
        switch(y) {
-       case 0: ret |= AIM_CAPS_BUDDYICON; break;
-       case 1: ret |= AIM_CAPS_VOICE; break;
-       case 2: ret |= AIM_CAPS_IMIMAGE; break;
-       case 3: ret |= AIM_CAPS_CHAT; break;
-       case 4: ret |= AIM_CAPS_GETFILE; break;
-       case 5: ret |= AIM_CAPS_SENDFILE; break;
-       default: ret |= 0xff00; break;
+       case 0: ret |= AIM_CAPS_BUDDYICON; identified++; break;
+       case 1: ret |= AIM_CAPS_VOICE; identified++; break;
+       case 2: ret |= AIM_CAPS_IMIMAGE; identified++; break;
+       case 3: ret |= AIM_CAPS_CHAT; identified++; break;
+       case 4: ret |= AIM_CAPS_GETFILE; identified++; break;
+       case 5: ret |= AIM_CAPS_SENDFILE; identified++; break;
+       case 6: ret |= AIM_CAPS_GAMES; identified++; break;
+       case 7: ret |= AIM_CAPS_SAVESTOCKS; identified++; break;
        }
       }
     }
+    if (!identified) {
+      printf("faim: unknown capability!\n");
+      ret |= 0xff00;
+    }
+
     offset += 0x10;
   } 
   return ret;
@@ -177,6 +193,14 @@ faim_internal int aim_putcap(unsigned char *capblock, int buflen, u_short caps)
     memcpy(capblock+offset, aim_caps[5], sizeof(aim_caps[5]));
     offset += sizeof(aim_caps[5]);
   }
+  if ((caps & AIM_CAPS_GAMES) && (offset < buflen)) {
+    memcpy(capblock+offset, aim_caps[6], sizeof(aim_caps[6]));
+    offset += sizeof(aim_caps[6]);
+  }
+  if ((caps & AIM_CAPS_SAVESTOCKS) && (offset < buflen)) {
+    memcpy(capblock+offset, aim_caps[7], sizeof(aim_caps[7]));
+    offset += sizeof(aim_caps[7]);
+  }
 
   return offset;
 }
index a29c1091234e94460e6d082d6ab02406449b80fe..d1f3616f86f93dd228fc790432630605b6561bda 100644 (file)
@@ -620,8 +620,10 @@ faim_export struct aim_conn_t *aim_directim_connect(struct aim_session_t *, stru
 #define AIM_CAPS_CHAT 0x08
 #define AIM_CAPS_GETFILE 0x10
 #define AIM_CAPS_SENDFILE 0x20
+#define AIM_CAPS_GAMES 0x40
+#define AIM_CAPS_SAVESTOCKS 0x80
 
-extern u_char aim_caps[6][16];
+extern u_char aim_caps[8][16];
 faim_internal unsigned short aim_getcap(unsigned char *capblock, int buflen);
 faim_internal int aim_putcap(unsigned char *capblock, int buflen, u_short caps);
 
index d0c0453a3ead9750f8bc0cfd247e3d202ac1208e..04e31109612638f198677e37340044c6d67891ff 100644 (file)
@@ -346,7 +346,7 @@ int faimtest_rateresp(struct aim_session_t *sess, struct command_rx_struct *comm
     aim_bos_ackrateresp(sess, command->conn);  /* ack rate info response */
     aim_bos_reqpersonalinfo(sess, command->conn);
     aim_bos_reqlocaterights(sess, command->conn);
-    aim_bos_setprofile(sess, command->conn, profile, NULL, AIM_CAPS_BUDDYICON | AIM_CAPS_CHAT | AIM_CAPS_VOICE | AIM_CAPS_GETFILE | AIM_CAPS_SENDFILE | AIM_CAPS_IMIMAGE);
+    aim_bos_setprofile(sess, command->conn, profile, NULL, AIM_CAPS_BUDDYICON | AIM_CAPS_CHAT | AIM_CAPS_VOICE | AIM_CAPS_GETFILE | AIM_CAPS_SENDFILE | AIM_CAPS_IMIMAGE | AIM_CAPS_GAMES | AIM_CAPS_SAVESTOCKS);
     aim_bos_reqbuddyrights(sess, command->conn);
 
     /* send the buddy list and profile (required, even if empty) */
This page took 0.10375 seconds and 5 git commands to generate.