]> andersk Git - libfaim.git/commitdiff
- Thu Jun 14 17:37:47 PDT 2001
authormid <mid>
Fri, 15 Jun 2001 00:46:44 +0000 (00:46 +0000)
committermid <mid>
Fri, 15 Jun 2001 00:46:44 +0000 (00:46 +0000)
  - Rearrange aim_setprofile().  It will now let you _not_ send a profile,
      if you really want to (pass NULL).  Note that this is quite different
      than sending a _blank_ profile.  Also fixes the "asci" bug.

CHANGES
include/aim.h
src/misc.c
utils/faimtest/faimtest.c

diff --git a/CHANGES b/CHANGES
index bce2798f015650a32b410f27b98c13c242b83f41..2b73234255c0cd00e5441a61af37d5b371697e12 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,11 @@
 
 No release numbers
 ------------------
+ - Thu Jun 14 17:37:47 PDT 2001
+  - Rearrange aim_setprofile().  It will now let you _not_ send a profile,
+      if you really want to (pass NULL).  Note that this is quite different
+      than sending a _blank_ profile.  Also fixes the "asci" bug.
+
  - Mon Jun  4 12:57:46 PDT 2001
   - Fix chatnav.  Whoops.
 
index 16217d501699147d1516a4121451b167911f7a68..b2fd37bdfbd7f9e6de5b63fc2e5675c50aa9c20b 100644 (file)
@@ -548,7 +548,7 @@ faim_export unsigned long aim_flap_nop(struct aim_session_t *sess, struct aim_co
 faim_export unsigned long aim_bos_setidle(struct aim_session_t *, struct aim_conn_t *, u_long);
 faim_export unsigned long aim_bos_changevisibility(struct aim_session_t *, struct aim_conn_t *, int, char *);
 faim_export unsigned long aim_bos_setbuddylist(struct aim_session_t *, struct aim_conn_t *, char *);
-faim_export unsigned long aim_bos_setprofile(struct aim_session_t *, struct aim_conn_t *, char *, char *, unsigned short);
+faim_export unsigned long aim_bos_setprofile(struct aim_session_t *sess, struct aim_conn_t *conn, const char *profile, const char *awaymsg, unsigned short caps);
 faim_export unsigned long aim_bos_setgroupperm(struct aim_session_t *, struct aim_conn_t *, u_long);
 faim_export unsigned long aim_bos_clientready(struct aim_session_t *, struct aim_conn_t *);
 faim_export unsigned long aim_bos_reqrate(struct aim_session_t *, struct aim_conn_t *);
index 8b83e1e66552e578b32c706b3f86575c70da51e9..0da3d0d1f477d35ec14af48b24f8b916154449f7 100644 (file)
@@ -204,27 +204,35 @@ faim_export unsigned long aim_bos_setbuddylist(struct aim_session_t *sess,
  */
 faim_export unsigned long aim_bos_setprofile(struct aim_session_t *sess,
                                             struct aim_conn_t *conn, 
-                                            char *profile,
-                                            char *awaymsg,
+                                            const char *profile,
+                                            const char *awaymsg,
                                             unsigned short caps)
 {
   struct command_tx_struct *newpacket;
   int i = 0, tmp, caplen;
+  static const char defencoding[] = {"text/aolrtf; charset=\"us-ascii\""};
 
-  if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, 1152+strlen(profile)+1+(awaymsg?strlen(awaymsg):0))))
+  i = 10;
+  if (profile)
+    i += 4+strlen(defencoding)+4+strlen(profile);
+  if (awaymsg)
+    i += 4+strlen(defencoding)+4+strlen(awaymsg);
+  i += 4+512; /* for capabilities */
+
+  if (!(newpacket = aim_tx_new(sess, conn, AIM_FRAMETYPE_OSCAR, 0x0002, i)))
     return -1;
 
-  i += aim_putsnac(newpacket->data, 0x0002, 0x004, 0x0000, sess->snac_nextid);
-  i += aim_puttlv_str(newpacket->data+i, 0x0001, strlen("text/aolrtf; charset=\"us-ascii\""), "text/x-aolrtf; charset=\"us-ascii\"");
-  i += aim_puttlv_str(newpacket->data+i, 0x0002, strlen(profile), profile);
-  /* why do we send this twice?  */
-  i += aim_puttlv_str(newpacket->data+i, 0x0003, strlen("text/aolrtf; charset=\"us-ascii\""), "text/x-aolrtf; charset=\"us-ascii\"");
-  
-  /* Away message -- we send this no matter what, even if its blank */
-  if (awaymsg)
+  i = aim_putsnac(newpacket->data, 0x0002, 0x004, 0x0000, sess->snac_nextid);
+
+  if (profile) {
+    i += aim_puttlv_str(newpacket->data+i, 0x0001, strlen(defencoding), defencoding);
+    i += aim_puttlv_str(newpacket->data+i, 0x0002, strlen(profile), profile);
+  }
+
+  if (awaymsg) {
+    i += aim_puttlv_str(newpacket->data+i, 0x0003, strlen(defencoding), defencoding);
     i += aim_puttlv_str(newpacket->data+i, 0x0004, strlen(awaymsg), awaymsg);
-  else
-    i += aim_puttlv_str(newpacket->data+i, 0x0004, 0x0000, NULL);
+  }
 
   /* Capability information. */
  
index a121fb1e6d4550c30ca9e91060104b5cc54cef4f..89b9857ae0b07231cbad369edb7cac6c1daa030d 100644 (file)
@@ -505,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");
@@ -513,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) */
This page took 0.076485 seconds and 5 git commands to generate.