1152
|
1
|
|
2 #ifndef _CHAT_SESSION_H
|
|
3 #define _CHAT_SESSION_H
|
|
4
|
|
5 #include "icq.h"
|
|
6 #include "icqtypes.h"
|
|
7
|
|
8 /* chat session states:
|
|
9
|
|
10 accepting chat request
|
|
11
|
|
12 1. remote user initiates chat by sending chat request to message listen
|
|
13 port
|
|
14 2. local user accepts chat, ack packet sent back to remote user and
|
|
15 chat listen port opened
|
|
16 * chat session created on local side with ID of ack packet
|
|
17 LISTENING
|
|
18 * remote chat session created with ID of ack packet
|
|
19 CONNECTING
|
|
20 3. remote client connects to local chat listen port, sends hello and
|
|
21 sends info packet with name and colors
|
|
22 * local chat session associated with new icq_TCPLink according to uin
|
|
23 4. local client sends back big info packet with name, colors, and font
|
|
24
|
|
25 5. remote client sends font packet, connection is considered established
|
|
26
|
|
27 sending chat request
|
|
28
|
|
29 1. local user initiates chat by sending chat request to remote message
|
|
30 listen port
|
|
31 2. remote user accepts chat, ack packet received from remote client and
|
|
32 remote client opens chat listen port
|
|
33 3. local client connects to remote chat listen port, sends hello and
|
|
34 sends info packet with name and colors
|
|
35 4. remote client sends back big info packet with name, colors, and font
|
|
36 5. local client sends font packet, connection is considered established
|
|
37
|
|
38 1. icq_RecvChatRequest - provides session ID (same as packet sequence)
|
|
39 2. icq_SendChatAck - pass session ID
|
|
40 ICQ_NOTIFY_CONNECTED
|
|
41 ICQ_NOTIFY_SENT
|
|
42 ICQ_NOTIFY_CHAT, CHAT_STATUS_LISTENING
|
|
43 3. ICQ_NOTIFY_CHAT, CHAT_STATUS_WAIT_NAME
|
|
44 4. ICQ_NOTIFY_CHAT, CHAT_STATUS_WAIT_FONT
|
|
45 5. ICQ_NOTIFY_CHAT, CHAT_STATUS_CONNECTED
|
|
46 ICQ_NOTIFY_CHATDATA, ....
|
|
47 ICQ_NOTIFY_SUCCESS
|
|
48 */
|
|
49
|
|
50 icq_ChatSession *icq_ChatSessionNew(ICQLINK *);
|
|
51 void icq_ChatSessionDelete(void *);
|
|
52 void icq_ChatSessionSetStatus(icq_ChatSession *, int);
|
|
53 icq_ChatSession *icq_FindChatSession(ICQLINK *, DWORD);
|
|
54
|
|
55 #endif
|