listcount = aimutil_itemcnt(localcpy, '&');
packlen = aimutil_tokslen(localcpy, 99, '&') + listcount + 9;
- if (!(newpacket = aim_tx_new(0x0002, conn, packlen)))
+ if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen)))
return -1;
newpacket->lock = 1;
#endif
free(localcpy);
- if (!(newpacket = aim_tx_new(0x0002, conn, packet_login_phase3c_hi_b_len - 6)))
+ if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packet_login_phase3c_hi_b_len - 6)))
return -1;
newpacket->lock = 1;
* Gives BOS your profile.
*
*
- * The large data chunk given here is of unknown decoding.
- * What I do know is that each 0x20 byte repetition
- * represents a capability. People with only the
- * first two reptitions can support normal messaging
- * and chat (client version 2.0 or 3.0). People with
- * the third as well can also support voice chat (client
- * version 3.5 or higher). IOW, if we don't send this,
- * we won't get chat invitations (get "software doesn't
- * support chat" error).
- *
- * This data is broadcast along with your oncoming
- * buddy command to everyone who has you on their
- * buddy list, as a type 0x0002 TLV.
- *
*/
u_long aim_bos_setprofile(struct aim_session_t *sess,
struct aim_conn_t *conn,
unsigned int caps)
{
struct command_tx_struct *newpacket;
- int i = 0;
+ int i = 0, tmp, caplen;
- if (!(newpacket = aim_tx_new(0x0002, conn, 1152+strlen(profile)+1+(awaymsg?strlen(awaymsg):0))))
+ if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 1152+strlen(profile)+1+(awaymsg?strlen(awaymsg):0))))
return -1;
i += aim_putsnac(newpacket->data, 0x0002, 0x004, 0x0000, sess->snac_nextid);
i += aim_puttlv_str(newpacket->data+i, 0x0004, 0x0000, NULL);
/* Capability information. */
- {
- int isave;
- i += aimutil_put16(newpacket->data+i, 0x0005);
- isave = i;
- i += aimutil_put16(newpacket->data+i, 0);
- if (caps & AIM_CAPS_BUDDYICON)
- i += aimutil_putstr(newpacket->data+i, aim_caps[0], 0x10);
- if (caps & AIM_CAPS_VOICE)
- i += aimutil_putstr(newpacket->data+i, aim_caps[1], 0x10);
- if (caps & AIM_CAPS_IMIMAGE)
- i += aimutil_putstr(newpacket->data+i, aim_caps[2], 0x10);
- if (caps & AIM_CAPS_CHAT)
- i += aimutil_putstr(newpacket->data+i, aim_caps[3], 0x10);
- if (caps & AIM_CAPS_GETFILE)
- i += aimutil_putstr(newpacket->data+i, aim_caps[4], 0x10);
- if (caps & AIM_CAPS_SENDFILE)
- i += aimutil_putstr(newpacket->data+i, aim_caps[5], 0x10);
- aimutil_put16(newpacket->data+isave, i-isave-2);
- }
+
+ tmp = (i += aimutil_put16(newpacket->data+i, 0x0005));
+ i += aimutil_put16(newpacket->data+i, 0x0000); /* rewritten later */
+ i += (caplen = aim_putcap(newpacket->data+i, 512, caps));
+ aimutil_put16(newpacket->data+tmp, caplen); /* rewrite TLV size */
+
newpacket->commandlen = i;
aim_tx_enqueue(sess, newpacket);
int command_2_len = 0x52;
struct command_tx_struct *newpacket;
- if (!(newpacket = aim_tx_new(0x0002, conn, command_2_len)))
+ if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, command_2_len)))
return -1;
newpacket->lock = 1;
if (conn->type != AIM_CONN_TYPE_BOS)
packlen += 2;
- if(!(newpacket = aim_tx_new(0x0002, conn, packlen)));
+ if(!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, packlen)));
newpacket->lock = 1;
{
struct command_tx_struct *newpacket;
- if (!(newpacket = aim_tx_new(0x0002, conn, 12)))
+ if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 12)))
return -1;
newpacket->lock = 1;
struct command_tx_struct *newpacket;
int i;
- if (!(newpacket = aim_tx_new(0x0002, conn, 10 + (4*11))))
+ if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10 + (4*11))))
return -1;
newpacket->lock = 1;
{
struct command_tx_struct *newpacket;
- if (!(newpacket = aim_tx_new(0x0002, conn, 10)))
+ if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10)))
return 0;
newpacket->lock = 1;
if (!longdata)
return aim_genericreq_n(sess, conn, family, subtype);
- if (!(newpacket = aim_tx_new(0x0002, conn, 10+sizeof(u_long))))
+ if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+sizeof(u_long))))
return -1;
newpacket->lock = 1;
if (!shortdata)
return aim_genericreq_n(sess, conn, family, subtype);
- if (!(newpacket = aim_tx_new(0x0002, conn, 10+sizeof(u_short))))
+ if (!(newpacket = aim_tx_new(AIM_FRAMETYPE_OSCAR, 0x0002, conn, 10+sizeof(u_short))))
return -1;
newpacket->lock = 1;