]> andersk Git - libfaim.git/blob - aim_chat.c
Big ICBM handling cleanup, including fix for the last of the IM crashes.
[libfaim.git] / aim_chat.c
1 /*
2  * aim_chat.c
3  *
4  * Routines for the Chat service.  Nothing works (yet).
5  *
6  */
7
8 #include "aim.h"
9
10 /*
11  * FIXME: Doesn't work.
12  *
13  */
14 u_long aim_chat_join(struct aim_conn_t *conn, const char *roomname)
15 {
16   struct command_tx_struct newpacket;
17   
18   newpacket.lock = 1;
19   if (conn)
20     newpacket.conn = conn;
21   else
22     newpacket.conn = aim_getconn_type(AIM_CONN_TYPE_BOS);
23   newpacket.type = 0x0002;
24   
25   newpacket.commandlen = 12+7+strlen(roomname)+6;
26   newpacket.data = (char *) malloc(newpacket.commandlen);
27   memset(newpacket.data, 0x00, newpacket.commandlen);
28   
29   aim_putsnac(newpacket.data, 0x0001, 0x0004, 0x0000, aim_snac_nextid);
30
31   newpacket.data[10] = 0x00;
32   newpacket.data[11] = 0x0e;
33   newpacket.data[12] = 0x00;
34   newpacket.data[13] = 0x01;
35   newpacket.data[14] = 0x00;
36   newpacket.data[15] = 0x0c;
37   newpacket.data[16] = 0x00;
38   newpacket.data[17] = 0x04;
39   newpacket.data[18] = strlen(roomname) & 0x00ff;
40   memcpy(&(newpacket.data[19]), roomname, strlen(roomname));
41   
42   {
43     u_int i = 0;
44     printf("\n\n\n");
45     for (i = 0;i < newpacket.commandlen; i++)
46       printf("0x%02x ", newpacket.data[i]);
47     printf("\n\n\n");
48   }
49
50   aim_tx_enqueue(&newpacket);
51
52   {
53     struct aim_snac_t snac;
54     
55     snac.id = aim_snac_nextid;
56     snac.family = 0x0001;
57     snac.type = 0x0004;
58     snac.flags = 0x0000;
59
60     snac.data = malloc(strlen(roomname));
61     memcpy(snac.data, roomname, strlen(roomname));
62
63     aim_newsnac(&snac);
64   }
65
66   return (aim_snac_nextid++);
67 }
This page took 0.075122 seconds and 5 git commands to generate.