summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk.h
blob: 152f77c8ebcd9235a7571963167acfbc33a68330 (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
/*
Copyright (c) 2013-24 Miranda NG team (https://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/>.
*/

#pragma once

#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_MSG_EDITED	5
#define VKPOLL_READ_ALL_IN	6
#define VKPOLL_READ_ALL_OUT	7
#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_MSGDELETED	128	// сообщение удалено (в корзине)
#define VKFLAG_MSGFIXED		256	// сообщение проверено пользователем на спам
#define VKFLAG_MSGMEDIA		512	// сообщение содержит медиаконтент

// Errors
#define VKERR_NO_JSONNODE						-2	// No JSON Node in server reply
#define VKERR_OFFLINE							-1	// Proto is offline
#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_ACCESS_DENIED						15	// Access denied
#define VKERR_VALIDATION_REQUIRED				17	// Validation Required
#define VKERR_COULD_NOT_SAVE_FILE				105	// Couldn't save file
#define VKERR_INVALID_ALBUM_ID					114	// Invalid album id
#define VKERR_INVALID_SERVER					118	// Invalid server
#define VKERR_INVALID_PARAMETERS				100	// One of the parameters specified was missing or invalid
#define VKERR_INVALID_HASH						121	// Invalid hash
#define VKERR_INVALID_AUDIO						123	// Invalid audio
#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 VKERR_ACC_WALL_POST_DENIED				214	// Access to adding post denied
#define VKERR_AUDIO_DEL_COPYRIGHT				270	// The audio file was removed by the copyright holder and cannot be reuploaded.
#define VKERR_INVALID_FILENAME					301	// Invalid filename
#define VKERR_INVALID_FILESIZE					302	// Invalid filesize
#define VKERR_CANT_SEND_USER_ON_BLACKLIST		900	// Can't send messages for users from blacklist
#define VKERR_CANT_SEND_USER_WITHOUT_DIALOGS	901	// Can't send messages for users without dialogs
#define VKERR_CANT_SEND_YOU_ON_BLACKLIST		902	// Can't send messages to this user due to their privacy settings
#define VKERR_MESSAGE_IS_TOO_LONG				914	// Message is too long

// File upload custom error
#define VKERR_FILE_NOT_EXIST					10100	// File does not exist
#define VKERR_FTYPE_NOT_SUPPORTED				10101	// File type not supported
#define VKERR_ERR_OPEN_FILE						10103	// Error open file
#define VKERR_ERR_READ_FILE						10104	// Error read file
#define VKERR_FILE_NOT_UPLOADED					10105	// File upload error
#define VKERR_INVALID_URL						10106	// Upload server returned empty URL
#define VKERR_INVALID_USER						10107	// Invalid or unknown recipient user ID

#define VK_USER_DEACTIVATE_ACTION	9321

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

#define VK_FEED_USER 2147483647L
#define VK_INVALID_USER 0L

#define VK_CHAT_MIN 2000000000
#define VK_CHAT_MAX VK_CHAT_MIN + 100000000
#define VK_USERID_MAX1 1900000000
#define VK_USERID_MIN2 200000000000
#define VK_USERID_MAX2 1000000000000

#define VK_MAX_FORWARD_MESSAGES 100

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

struct CVkProto;
extern mir_cs csInstances;
extern bool g_bMessageState;

bool wlstrstr(wchar_t *_s1, wchar_t *_s2);

void InitIcons(void);

char* ExpUrlEncode(const char *szUrl, bool strict = false);

bool IsEmpty(LPCWSTR str);
bool IsEmpty(LPCSTR str);

typedef long VKUserID_t;
typedef long VKMessageID_t;