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.
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 *);
*/
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. */
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");
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) */