summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ/src/cookies.h
blob: 2e00fa5a241bef8a828afb1441fd2b7ab6ce48e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// ---------------------------------------------------------------------------80
//                ICQ plugin for Miranda Instant Messenger
//                ________________________________________
//
// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede
// Copyright © 2001-2002 Jon Keating, Richard Hughes
// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater
// Copyright © 2004-2010 Joe Kucera
// Copyright © 2012-2017 Miranda NG Team
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
// -----------------------------------------------------------------------------

#ifndef __COOKIES_H
#define __COOKIES_H

#define CKT_MESSAGE           0x01
#define CKT_FILE              0x02
#define CKT_SEARCH            0x04
#define CKT_SERVERLIST        0x08
#define CKT_SERVICEREQUEST    0x0A
#define CKT_REVERSEDIRECT     0x0C
#define CKT_FAMILYSPECIAL     0x10
#define CKT_OFFLINEMESSAGE    0x12
#define CKT_DIRECTORY_QUERY   0x18
#define CKT_DIRECTORY_UPDATE  0x19
#define CKT_AVATAR            0x20

struct CIcqProto;

/* Basic structure used to hold operation cookies list */

struct icq_cookie_info : public MZeroedObject
{
	DWORD dwCookie;
	MCONTACT hContact;
	void *pvExtra;
	time_t dwTime;
	BYTE bType;
};

/* Specific structures to hold request specific data - pvExtra */

struct cookie_family_request
{
	WORD wFamily;
	void (CIcqProto::*familyHandler)(HNETLIBCONN hConn, char* cookie, size_t cookieLen);
};

struct cookie_offline_messages
{
	int nMessages;
	int nMissed;
};

#define ACKTYPE_NONE   0
#define ACKTYPE_SERVER 1
#define ACKTYPE_CLIENT 2

struct cookie_message_data
{
	DWORD dwMsgID1;
	DWORD dwMsgID2;
	WORD bMessageType;
	BYTE nAckType;
	BYTE isOffline;
};

#define REQUESTTYPE_OWNER        0
#define REQUESTTYPE_USERAUTO     1
#define REQUESTTYPE_USERMINIMAL  2
#define REQUESTTYPE_USERDETAILED 3
#define REQUESTTYPE_PROFILE      4

struct cookie_fam15_data
{
	BYTE bRequestType;
};

#define SEARCHTYPE_UID     0
#define SEARCHTYPE_EMAIL   1
#define SEARCHTYPE_NAMES   2
#define SEARCHTYPE_DETAILS 4

struct cookie_search
{
	BYTE bSearchType;
	char* szObject;
	DWORD dwMainId;
	DWORD dwStatus;
};

struct cookie_avatar
{
	DWORD dwUin;
	MCONTACT hContact;
	size_t hashlen;
	BYTE *hash;
	size_t cbData;
	wchar_t *szFile;
};

struct cookie_reverse_connect : public cookie_message_data
{
	MCONTACT hContact;
	DWORD dwUin;
	int type;
	void *ft;
};

#define DIRECTORYREQUEST_INFOUSER       0x01
#define DIRECTORYREQUEST_INFOOWNER      0x02
#define DIRECTORYREQUEST_INFOMULTI      0x03
#define DIRECTORYREQUEST_SEARCH         0x08
#define DIRECTORYREQUEST_UPDATEOWNER    0x10
#define DIRECTORYREQUEST_UPDATENOTE     0x11
#define DIRECTORYREQUEST_UPDATEPRIVACY  0x12

struct cookie_directory_data
{
	BYTE bRequestType;
};

#endif /* __COOKIES_H */