view plugins/icq/chatsession.h @ 1223:96ab3e7b7035

[gaim-migrate @ 1233] sort names in chat irc-style. works for aim too since @ and + won't be in screennames. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 09 Dec 2000 00:09:19 +0000
parents 201ec77f3a60
children 4c510ca3563f
line wrap: on
line source


#ifndef _CHAT_SESSION_H
#define _CHAT_SESSION_H

#include "icq.h"
#include "icqtypes.h"

/* chat session statuses- request receiver */
#define CHAT_STATUS_LISTENING    1
#define CHAT_STATUS_CONNECTED    3
#define CHAT_STATUS_WAIT_NAME    4
#define CHAT_STATUS_WAIT_FONT    6

/* chat session statuses- request sender */
#define CHAT_STATUS_CONNECTING   2
#define CHAT_STATUS_WAIT_ALLINFO 5

/* once negotiation is complete, both sides enter ready state */
#define CHAT_STATUS_READY        7

/* chat session states:

   accepting chat request 
	 
   1. remote user initiates chat by sending chat request to message listen 
	    port
	 2. local user accepts chat, ack packet sent back to remote user and
	    chat listen port opened
			* chat session created on local side with ID of ack packet
			  LISTENING
			* remote chat session created with ID of ack packet
			  CONNECTING
	 3. remote client connects to local chat listen port, sends hello and
	    sends info packet with name and colors
			* local chat session associated with new icq_TCPLink according to uin
	 4.	local client sends back big info packet with name, colors, and font
		  
	 5. remote client sends font packet, connection is considered established
	 
	 sending chat request
	 
	 1. local user initiates chat by sending chat request to remote message
	    listen port
	 2. remote user accepts chat, ack packet received from remote client and
	    remote client opens chat listen port
	 3. local client connects to remote chat listen port, sends hello and
	    sends info packet with name and colors
	 4. remote client sends back big info packet with name, colors, and font
	 5. local client sends font packet, connection is considered established

   1. icq_RecvChatRequest - provides session ID (same as packet sequence)
	 2. icq_SendChatAck - pass session ID
	     ICQ_NOTIFY_CONNECTED
			 ICQ_NOTIFY_SENT
			 ICQ_NOTIFY_CHAT, CHAT_STATUS_LISTENING
   3. ICQ_NOTIFY_CHAT, CHAT_STATUS_WAIT_NAME
	 4. ICQ_NOTIFY_CHAT, CHAT_STATUS_WAIT_FONT
	 5. ICQ_NOTIFY_CHAT, CHAT_STATUS_CONNECTED
	    ICQ_NOTIFY_CHATDATA, ....
			ICQ_NOTIFY_SUCCESS
*/

typedef struct icq_ChatSession_s {

  DWORD id;
  int status;
  ICQLINK *icqlink;

  DWORD remote_uin;
  char *remote_handle;

} icq_ChatSession;

icq_ChatSession *icq_ChatSessionNew(ICQLINK *);
void icq_ChatSessionDelete(void *);
void icq_ChatSessionClose(icq_ChatSession *);
void icq_ChatSessionSetStatus(icq_ChatSession *, int);
icq_ChatSession *icq_FindChatSession(ICQLINK *, DWORD);

#endif