summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk.h
blob: f85659968c8da70f0b2405c032a43aa542c9a12f (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
/*
Copyright (c) 2013-14 Miranda NG project (http://miranda-ng.org)

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 version 2
of the License.

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, see <http://www.gnu.org/licenses/>.
*/

#define VK_APP_ID  3917910

// LongPool servers events
#define VKPOLL_MSG_REMOVED   0
#define VKPOLL_MSG_NEWFLAGS  1
#define VKPOLL_MSG_ADDFLAGS  2
#define VKPOLL_MSG_DELFLAGS  3
#define VKPOLL_MSG_ADDED     4
#define VKPOLL_USR_ONLINE    8
#define VKPOLL_USR_OFFLINE   9
#define VKPOLL_CHAT_CHANGED 51
#define VKPOLL_USR_UTN      61
#define VKPOLL_CHAT_UTN     62
#define VKPOLL_RING         70

// Flags for VKPOLL_MSG_ADDED
#define VKFLAG_MSGUNREAD	1	// ñîîáùåíèå íå ïðî÷èòàíî
#define VKFLAG_MSGOUTBOX	2	// èñõîäÿùåå ñîîáùåíèå
#define VKFLAG_MSGREPLIED	4	// íà ñîîáùåíèå áûë ñîçäàí îòâåò
#define VKFLAG_MSGIMPORTANT	8	// ïîìå÷åííîå ñîîáùåíèå
#define VKFLAG_MSGCHAT		16	// ñîîáùåíèå îòïðàâëåíî ÷åðåç ÷àò
#define VKFLAG_MSGFRIENDS	32	// ñîîáùåíèå îòïðàâëåíî äðóãîì
#define VKFLAG_MSGSPAM		64	// ñîîáùåíèå ïîìå÷åíî êàê "Ñïàì"
#define VKFLAG_MSGDELÅTÅD	128	// ñîîáùåíèå óäàëåíî (â êîðçèíå)
#define VKFLAG_MSGFIXED		256	// ñîîáùåíèå ïðîâåðåíî ïîëüçîâàòåëåì íà ñïàì
#define VKFLAG_MSGMEDIA		512	// ñîîáùåíèå ñîäåðæèò ìåäèàêîíòåíò

// Errors
#define VKERR_NOERRORS				0	// No error
#define VKERR_UNKNOWN				1	// Unknown error occurred
#define VKERR_TOO_MANY_REQ_PER_SEC	6	// Too many requests per second
#define VKERR_AUTHORIZATION_FAILED	5	// User authorization failed
#define VKERR_FLOOD_CONTROL			9	// Flood control
#define VKERR_INTERNAL_SERVER_ERR	10	// Internal server error
#define VKERR_CAPTCHA_NEEDED		14	// Captcha needed
#define VKERR_HIMSELF_AS_FRIEND		174	// Cannot add user himself as friend
#define VKERR_YOU_ON_BLACKLIST		175	// Cannot add this user to friends as they have put you on their blacklist
#define VKERR_USER_ON_BLACKLIST		176	// Cannot add this user to friends as you put him on blacklist

#define VK_API_VER "5.25"
#define VER_API CHAR_PARAM("v", VK_API_VER)


#if defined(_DEBUG)
	#define VK_NODUMPHEADERS 0
#else
	#define VK_NODUMPHEADERS NLHRF_NODUMPHEADERS
#endif

struct CVkProto;
extern LIST<CVkProto> vk_Instances;
extern HINSTANCE hInst;

LPCSTR findHeader(NETLIBHTTPREQUEST *hdr, LPCSTR szField);
bool tlstrstr(TCHAR* _s1, TCHAR* _s2);

void InitIcons(void);
HANDLE GetIconHandle(int iCommand);