]> andersk Git - libfaim.git/blobdiff - utils/faimtest/faimtest.c
- Thu Jun 14 17:37:47 PDT 2001
[libfaim.git] / utils / faimtest / faimtest.c
index e246c8baa2f1903511e6c66ffeb934811e9eeb3c..89b9857ae0b07231cbad369edb7cac6c1daa030d 100644 (file)
@@ -164,6 +164,7 @@ static char *listingpath;
 static unsigned char *buddyicon = NULL;
 static int buddyiconlen = 0;
 static time_t buddyiconstamp = 0;
+static unsigned short buddyiconsum = 0;
 
 static void faimtest_debugcb(struct aim_session_t *sess, int level, const char *format, va_list va)
 {
@@ -408,7 +409,9 @@ int main(int argc, char **argv)
       buddyicon = malloc(buddyiconlen);
       fread(buddyicon, 1, st.st_size, f);
 
-      dvprintf("read %d bytes of %s for buddy icon\n", buddyiconlen, buddyiconpath);
+      buddyiconsum = aim_iconsum(buddyicon, buddyiconlen);
+
+      dvprintf("read %d bytes of %s for buddy icon (sum 0x%08x)\n", buddyiconlen, buddyiconpath, buddyiconsum);
 
       fclose(f);
 
@@ -502,6 +505,7 @@ int faimtest_rateresp(struct aim_session_t *sess, struct command_rx_struct *comm
     char buddies[128];
     /* this is the new profile */
     char profile[256];
+    char awaymsg[] = {"blah blah blah Ole! blah blah blah"};
 
     /* Caution: Buddy1 and Buddy2 are real people! (who I don't know) */
     snprintf(buddies, sizeof(buddies), "Buddy1&Buddy2&%s&", ohcaptainmycaptain?ohcaptainmycaptain:"blah");
@@ -510,7 +514,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_GETFILE | AIM_CAPS_SENDFILE | AIM_CAPS_IMIMAGE /*| AIM_CAPS_GAMES | AIM_CAPS_SAVESTOCKS*/);
+    aim_bos_setprofile(sess, command->conn, profile, awaymsg, AIM_CAPS_BUDDYICON | AIM_CAPS_CHAT | 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) */
@@ -1214,12 +1218,13 @@ static int faimtest_handlecmd(struct aim_session_t *sess, struct command_rx_stru
     args.msglen = strlen(iconmsg);
     args.iconlen = buddyiconlen;
     args.iconstamp = buddyiconstamp;
+    args.iconsum = buddyiconsum;
 
     aim_send_im_ext(sess, command->conn, &args);
 
   } else if (strstr(tmpstr, "sendicon") && buddyicon) {
 
-    aim_send_icon(sess, command->conn, userinfo->sn, buddyicon, buddyiconlen, buddyiconstamp);
+    aim_send_icon(sess, command->conn, userinfo->sn, buddyicon, buddyiconlen, buddyiconstamp, buddyiconsum);
 
   } else if (strstr(tmpstr, "warnme")) {
 
This page took 0.039746 seconds and 4 git commands to generate.