summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src/vk_proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/VKontakte/src/vk_proto.cpp')
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp170
1 files changed, 51 insertions, 119 deletions
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 8382ce48e1..f4b87918d7 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -46,7 +46,10 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
m_bNotifyForEndLoadingHistory(false),
m_bNotifyForEndLoadingHistoryAllContact(false),
m_hAPIConnection(NULL),
- m_pollingConn(NULL)
+ m_pollingConn(NULL),
+ m_bSetBroadcast(false),
+ m_bNeedSendOnline (false),
+ m_vkOptions(this)
{
InitQueue();
@@ -67,83 +70,12 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) :
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
- m_defaultGroup = getTStringA("ProtoGroup");
- if (m_defaultGroup == NULL)
- m_defaultGroup = mir_tstrdup(_T("VKontakte"));
- Clist_CreateGroup(NULL, m_defaultGroup);
-
- m_bServerDelivery = getBool("ServerDelivery", true);
- m_bHideChats = getBool("HideChats", true);
- m_bMesAsUnread = getBool("MesAsUnread");
- m_bUseLocalTime = getBool("UseLocalTime");
- m_bReportAbuse = getBool("ReportAbuseOnBanUser");
- m_bClearServerHistory = getBool("ClearServerHistoryOnBanUser");
- m_bRemoveFromFrendlist = getBool("RemoveFromFrendlistOnBanUser");
- m_bRemoveFromClist = getBool("RemoveFromClistOnBanUser");
- m_bPopUpSyncHistory = getBool("PopUpSyncHistory");
- m_iMarkMessageReadOn = (MarkMsgReadOn)getByte("MarkMessageReadOn", markOnRead);
- m_bStikersAsSmyles = getBool("StikersAsSmyles");
- m_bUserForceOnlineOnActivity = getBool("UserForceOnlineOnActivity");
- m_iMusicSendMetod = (MusicSendMetod)getByte("MusicSendMetod", sendBroadcastOnly);
- m_iSyncHistoryMetod = (SyncHistoryMetod)getByte("SyncHistoryMetod", syncOff);
- CMStringA szListeningTo(m_szModuleName);
- szListeningTo += "Enabled";
- db_set_b(NULL, "ListeningTo", szListeningTo, m_iMusicSendMetod == 0 ? 0 : 1);
-
- m_bNewsEnabled = getBool("NewsEnabled");
- m_iMaxLoadNewsPhoto = getByte("MaxLoadNewsPhoto", 5);
- m_bNotificationsEnabled = getBool("NotificationsEnabled");
- m_bNotificationsMarkAsViewed = getBool("NotificationsMarkAsViewed", true);
- m_bSpecialContactAlwaysEnabled = getBool("SpecialContactAlwaysEnabled");
- m_iNewsInterval = getDword("NewsInterval", 15);
- m_iNotificationsInterval = getDword("NotificationsInterval", 1);
- m_iIMGBBCSupport = (IMGBBCSypport)getByte("IMGBBCSupport", imgNo);
- m_iBBCForNews = (BBCSupport)getByte("BBCForNews", bbcBasic);
- m_iBBCForAttachments = (BBCSupport)getByte("BBCForAttachments", bbcBasic);
- m_bUseBBCOnAttacmentsAsNews = getBool("UseBBCOnAttacmentsAsNews", true);
- m_bNewsAutoClearHistory = getBool("NewsAutoClearHistory");
- m_iNewsAutoClearHistoryInterval = getDword("NewsAutoClearHistoryInterval", 60*60*24*3);
-
- m_bNewsFilterPosts = getBool("NewsFilterPosts", true);
- m_bNewsFilterPhotos = getBool("NewsFilterPhotos", true);
- m_bNewsFilterTags = getBool("NewsFilterTags", true);
- m_bNewsFilterWallPhotos = getBool("NewsFilterWallPhotos", true);
- m_bNewsSourceFriends = getBool("NewsSourceFriends", true);
- m_bNewsSourceGroups = getBool("NewsSourceGroups", true);
- m_bNewsSourcePages = getBool("NewsSourcePages", true);
- m_bNewsSourceFollowing = getBool("NewsSourceFollowing", true);
- m_bNewsSourceIncludeBanned = getBool("NewsSourceIncludeBanned");
- m_bNewsSourceNoReposts = getBool("NewsSourceNoReposts");
-
- m_bNotificationFilterComments = getBool("NotificationFilterComments", true);
- m_bNotificationFilterLikes = getBool("NotificationFilterLikes", true);
- m_bNotificationFilterReposts = getBool("NotificationFilterReposts", true);
- m_bNotificationFilterMentions = getBool("NotificationFilterMentions", true);
- m_bNotificationFilterInvites = getBool("NotificationFilterInvites", true);
-
- m_bUseNonStandardNotifications = getBool("UseNonStandardNotifications", false);
-
- m_bUseNonStandardUrlEncode = getBool("UseNonStandardUrlEncode", true);
- m_iInvisibleInterval = getDword("InvisibleInterval", 10);
-
- m_bShortenLinksForAudio = getBool("ShortenLinksForAudio", true);
-
- m_bSplitFormatFwdMsg = getBool("SplitFormatFwdMsg", true);
-
- m_bSyncReadMessageStatusFromServer = getBool("SyncReadMessageStatusFromServer", false);
- m_bLoadFullCList = getBool("LoadFullCList", false);
-
- m_bSetBroadcast = false;
- m_bNeedSendOnline = false;
- delSetting("InviteGroupIds");
+ Clist_CreateGroup(NULL, m_vkOptions.ptszDefaultGroup);
- m_ReturnChatMessage = getTStringA("ReturnChatMessage");
- if (m_ReturnChatMessage == NULL)
- m_ReturnChatMessage = mir_tstrdup(TranslateT("I'm back"));
+ CMStringA szListeningTo(FORMAT, "%sEnabled", m_szModuleName);
+ db_set_b(NULL, "ListeningTo", szListeningTo, m_vkOptions.iMusicSendMetod == 0 ? 0 : 1);
- m_VKLang = getTStringA("VKLang");
-
- m_iMaxFriendsCount = getDword("MaxFriendsCount", 1000);
+ delSetting("InviteGroupIds");
// Set all contacts offline -- in case we crashed
SetAllContactStatuses(ID_STATUS_OFFLINE);
@@ -233,49 +165,49 @@ void CVkProto::InitMenus()
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_CHAT_JOIN);
mi.name.a = LPGEN("Create new chat");
SET_UID(mi, 0xc217748d, 0x7218, 0x4a62, 0xab, 0x37, 0x9, 0x58, 0x6a, 0x88, 0x71, 0x3e);
- g_hProtoMenuItems[PMI_CREATECHAT] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
+ m_hProtoMenuItems[PMI_CREATECHAT] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = PS_SETSTATUSMSG;
mi.position = 10009 + PMI_SETSTATUSMSG;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_STATUS));
mi.name.a = LPGEN("Status message");
SET_UID(mi, 0x696bd932, 0xeee4, 0x4c4c, 0xa6, 0xf8, 0xb3, 0x72, 0xdf, 0xc6, 0xfa, 0xd1);
- g_hProtoMenuItems[PMI_SETSTATUSMSG] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
+ m_hProtoMenuItems[PMI_SETSTATUSMSG] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = PS_WALLPOST;
mi.position = 10009 + PMI_WALLPOST;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
mi.name.a = LPGEN("Send message to my wall");
SET_UID(mi, 0x50a80044, 0xdddd, 0x47e6, 0x9e, 0x90, 0x32, 0x7b, 0x88, 0x13, 0x21, 0x4e);
- g_hProtoMenuItems[PMI_WALLPOST] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
+ m_hProtoMenuItems[PMI_WALLPOST] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = PS_LOADVKNEWS;
mi.position = 10009 + PMI_LOADVKNEWS;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
mi.name.a = LPGEN("Load news from VK");
SET_UID(mi, 0x7c449456, 0xb731, 0x48cc, 0x9c, 0x4e, 0x20, 0xe4, 0x66, 0x7a, 0x16, 0x23);
- g_hProtoMenuItems[PMI_LOADVKNEWS] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
+ m_hProtoMenuItems[PMI_LOADVKNEWS] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETALLSERVERHISTORY;
mi.position = 10009 + PMI_GETALLSERVERHISTORY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.name.a = LPGEN("Load history for all contacts from VK");
SET_UID(mi, 0xe5028605, 0x92eb, 0x4956, 0xa0, 0xd0, 0x53, 0xb, 0x11, 0x44, 0x8f, 0x14);
- g_hProtoMenuItems[PMI_GETALLSERVERHISTORY] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
+ m_hProtoMenuItems[PMI_GETALLSERVERHISTORY] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = PS_WIPENONFRIENDS;
mi.position = 10009 + PMI_WIPENONFRIENDS;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
mi.name.a = LPGEN("Wipe contacts missing in friend list");
SET_UID(mi, 0xcfe99159, 0xf237, 0x4546, 0x80, 0x3e, 0x51, 0x88, 0x26, 0x55, 0xdc, 0x5f);
- g_hProtoMenuItems[PMI_WIPENONFRIENDS] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
+ m_hProtoMenuItems[PMI_WIPENONFRIENDS] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = PS_VISITPROFILE;
mi.position = 10009 + PMI_VISITPROFILE;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
mi.name.a = LPGEN("Visit profile");
SET_UID(mi, 0x9550515e, 0x2a45, 0x4913, 0x95, 0x1a, 0x1e, 0xfa, 0x7, 0xc6, 0x2d, 0x60);
- g_hProtoMenuItems[PMI_VISITPROFILE] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
+ m_hProtoMenuItems[PMI_VISITPROFILE] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// Contact Menu Items
mi.root = NULL;
@@ -285,70 +217,70 @@ void CVkProto::InitMenus()
mi.position = -200001000 + CMI_VISITPROFILE;
mi.name.t = LPGENT("Visit profile");
SET_UID(mi, 0x828cc50e, 0x398d, 0x43a2, 0xbf, 0xd3, 0xa9, 0x96, 0x47, 0x9d, 0x52, 0xff);
- g_hContactMenuItems[CMI_VISITPROFILE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_VISITPROFILE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_MARKMESSAGESASREAD;
mi.position = -200001000 + CMI_MARKMESSAGESASREAD;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_MARKMESSAGESASREAD));
mi.name.t = LPGENT("Mark messages as read");
SET_UID(mi, 0x2587a649, 0xe5d5, 0x4e90, 0x8b, 0x35, 0x81, 0x4c, 0xb1, 0x5, 0x94, 0x7);
- g_hContactMenuItems[CMI_MARKMESSAGESASREAD] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_MARKMESSAGESASREAD] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_WALLPOST;
mi.position = -200001000 + CMI_WALLPOST;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL));
mi.name.t = LPGENT("Send message to user\'s wall");
SET_UID(mi, 0xd8841aaf, 0x15f6, 0x4be9, 0x9f, 0x4f, 0x16, 0xa9, 0x47, 0x6a, 0x19, 0x81);
- g_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_ADDASFRIEND;
mi.position = -200001000 + CMI_ADDASFRIEND;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDADD));
mi.name.t = LPGENT("Add as friend");
SET_UID(mi, 0xf11b9a7f, 0x569, 0x4023, 0xb0, 0xd6, 0xa3, 0x16, 0xf6, 0xd4, 0xfb, 0xb5);
- g_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_DELETEFRIEND;
mi.position = -200001000 + CMI_DELETEFRIEND;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
mi.name.t = LPGENT("Delete from friend list");
SET_UID(mi, 0x1e26514, 0x854f, 0x4e60, 0x8c, 0xf8, 0xab, 0xaa, 0xe0, 0xc3, 0xa5, 0xa7);
- g_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_BANUSER;
mi.position = -200001000 + CMI_BANUSER;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BAN));
mi.name.t = LPGENT("Ban user");
SET_UID(mi, 0x7ba06bab, 0xf770, 0x4938, 0x9c, 0x76, 0xef, 0x40, 0xbc, 0x55, 0x0, 0x9b);
- g_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_REPORTABUSE;
mi.position = -200001000 + CMI_REPORTABUSE;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_ABUSE));
mi.name.t = LPGENT("Report abuse");
SET_UID(mi, 0x56454cb9, 0xd80, 0x4050, 0xbe, 0xfc, 0x2c, 0xf6, 0x10, 0x2a, 0x7d, 0x19);
- g_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_DESTROYKICKCHAT;
mi.position = -200001000 + CMI_DESTROYKICKCHAT;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL));
mi.name.t = LPGENT("Destroy room");
SET_UID(mi, 0x4fa6e75a, 0x30cd, 0x4482, 0xae, 0x8f, 0x0, 0x38, 0xd0, 0x17, 0x33, 0xcd);
- g_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_OPENBROADCAST;
mi.position = -200001000 + CMI_OPENBROADCAST;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_BROADCAST));
mi.name.t = LPGENT("Open broadcast");
SET_UID(mi, 0x85251a06, 0xf734, 0x4985, 0x8c, 0x36, 0x6f, 0x66, 0x46, 0xf9, 0xa0, 0x10);
- g_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_LOADVKNEWS;
mi.position = -200001000 + CMI_LOADVKNEWS;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION));
mi.name.t = LPGENT("Load news from VK");
SET_UID(mi, 0xe1f6888b, 0x21ae, 0x409f, 0x82, 0xa2, 0x7b, 0x72, 0xef, 0x47, 0x9, 0xc0);
- g_hContactMenuItems[CMI_LOADVKNEWS] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_LOADVKNEWS] = Menu_AddContactMenuItem(&mi, m_szModuleName);
// Sync history menu
mi.pszService = PS_GETSERVERHISTORY;
@@ -356,51 +288,51 @@ void CVkProto::InitMenus()
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.name.t = LPGENT("Reload messages from vk.com...");
SET_UID(mi, 0xc6b59e9f, 0x5250, 0x4146, 0xb6, 0xf3, 0x2d, 0xe1, 0x4, 0x3b, 0x95, 0xf5);
- g_hContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactMenuItems[CMI_GETSERVERHISTORY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
- mi.root = g_hContactMenuItems[CMI_GETSERVERHISTORY];
+ mi.root = m_hContactMenuItems[CMI_GETSERVERHISTORY];
mi.pszService = PS_GETSERVERHISTORYLAST1DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST1DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.name.t = LPGENT("for last 1 day");
SET_UID(mi, 0x508dce88, 0x1a9a, 0x4dd7, 0x90, 0xf4, 0x41, 0x35, 0x7b, 0xc3, 0x17, 0xed);
- g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST3DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST3DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.name.t = LPGENT("for last 3 days");
SET_UID(mi, 0x9a878764, 0x5bbf, 0x433a, 0xbd, 0x50, 0xa9, 0xb9, 0x16, 0x1f, 0x99, 0x29);
- g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST7DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST7DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.name.t = LPGENT("for last week");
SET_UID(mi, 0xc6482460, 0xd280, 0x4596, 0x97, 0x4b, 0xf7, 0xfa, 0x6d, 0xe, 0xd5, 0xda);
- g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST30DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST30DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.name.t = LPGENT("for last 30 days");
SET_UID(mi, 0xc48e8a9f, 0x2860, 0x4d5b, 0xa8, 0xdf, 0xb8, 0x3f, 0xdf, 0x7b, 0xa2, 0xba);
- g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETSERVERHISTORYLAST90DAY;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST90DAY;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.name.t = LPGENT("for last 90 days");
SET_UID(mi, 0xd8e30530, 0xa585, 0x4672, 0xa6, 0x39, 0x18, 0xc9, 0xc9, 0xcb, 0xc7, 0x7d);
- g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi, m_szModuleName);
mi.pszService = PS_GETALLSERVERHISTORYFORCONTACT;
mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETALLSERVERHISTORYFORCONTACT;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_HISTORY));
mi.name.t = LPGENT("for all time");
SET_UID(mi, 0xaee3d02b, 0x3667, 0x47c8, 0x9f, 0x43, 0x14, 0xb7, 0xab, 0x52, 0x14, 0x94);
- g_hContactHistoryMenuItems[CHMI_GETALLSERVERHISTORYFORCONTACT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
+ m_hContactHistoryMenuItems[CHMI_GETALLSERVERHISTORYFORCONTACT] = Menu_AddContactMenuItem(&mi, m_szModuleName);
}
int CVkProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM)
@@ -408,19 +340,19 @@ int CVkProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM)
LONG userID = getDword(hContact, "ID", -1);
bool bisFriend = (getBool(hContact, "Auth", true) == 0);
bool bisBroadcast = !(IsEmpty(ptrT(db_get_tsa(hContact, m_szModuleName, "AudioUrl"))));
- Menu_ShowItem(g_hContactMenuItems[CMI_VISITPROFILE], userID != VK_FEED_USER);
- Menu_ShowItem(g_hContactMenuItems[CMI_MARKMESSAGESASREAD], !isChatRoom(hContact) && userID != VK_FEED_USER);
- Menu_ShowItem(g_hContactMenuItems[CMI_WALLPOST], !isChatRoom(hContact));
- Menu_ShowItem(g_hContactMenuItems[CMI_ADDASFRIEND], !bisFriend && !isChatRoom(hContact) && userID != VK_FEED_USER);
- Menu_ShowItem(g_hContactMenuItems[CMI_DELETEFRIEND], bisFriend && userID != VK_FEED_USER);
- Menu_ShowItem(g_hContactMenuItems[CMI_BANUSER], !isChatRoom(hContact) && userID != VK_FEED_USER);
- Menu_ShowItem(g_hContactMenuItems[CMI_REPORTABUSE], !isChatRoom(hContact) && userID != VK_FEED_USER);
- Menu_ShowItem(g_hContactMenuItems[CMI_DESTROYKICKCHAT], isChatRoom(hContact) && getBool(hContact, "off"));
- Menu_ShowItem(g_hContactMenuItems[CMI_OPENBROADCAST], !isChatRoom(hContact) && bisBroadcast);
- Menu_ShowItem(g_hContactMenuItems[CMI_GETSERVERHISTORY], !isChatRoom(hContact) && userID != VK_FEED_USER);
- Menu_ShowItem(g_hContactMenuItems[CMI_LOADVKNEWS], userID == VK_FEED_USER);
+ Menu_ShowItem(m_hContactMenuItems[CMI_VISITPROFILE], userID != VK_FEED_USER);
+ Menu_ShowItem(m_hContactMenuItems[CMI_MARKMESSAGESASREAD], !isChatRoom(hContact) && userID != VK_FEED_USER);
+ Menu_ShowItem(m_hContactMenuItems[CMI_WALLPOST], !isChatRoom(hContact));
+ Menu_ShowItem(m_hContactMenuItems[CMI_ADDASFRIEND], !bisFriend && !isChatRoom(hContact) && userID != VK_FEED_USER);
+ Menu_ShowItem(m_hContactMenuItems[CMI_DELETEFRIEND], bisFriend && userID != VK_FEED_USER);
+ Menu_ShowItem(m_hContactMenuItems[CMI_BANUSER], !isChatRoom(hContact) && userID != VK_FEED_USER);
+ Menu_ShowItem(m_hContactMenuItems[CMI_REPORTABUSE], !isChatRoom(hContact) && userID != VK_FEED_USER);
+ Menu_ShowItem(m_hContactMenuItems[CMI_DESTROYKICKCHAT], isChatRoom(hContact) && getBool(hContact, "off"));
+ Menu_ShowItem(m_hContactMenuItems[CMI_OPENBROADCAST], !isChatRoom(hContact) && bisBroadcast);
+ Menu_ShowItem(m_hContactMenuItems[CMI_GETSERVERHISTORY], !isChatRoom(hContact) && userID != VK_FEED_USER);
+ Menu_ShowItem(m_hContactMenuItems[CMI_LOADVKNEWS], userID == VK_FEED_USER);
for (int i = 0; i < CHMI_COUNT; i++)
- Menu_ShowItem(g_hContactHistoryMenuItems[i], !isChatRoom(hContact) && userID != VK_FEED_USER);
+ Menu_ShowItem(m_hContactHistoryMenuItems[i], !isChatRoom(hContact) && userID != VK_FEED_USER);
return 0;
}
@@ -428,13 +360,13 @@ void CVkProto::UnInitMenus()
{
debugLogA("CVkProto::UnInitMenus");
for (int i = 0; i < PMI_COUNT; i++)
- Menu_RemoveItem(g_hProtoMenuItems[i]);
+ Menu_RemoveItem(m_hProtoMenuItems[i]);
for (int i = 0; i < CHMI_COUNT; i++)
- Menu_RemoveItem(g_hContactHistoryMenuItems[i]);
+ Menu_RemoveItem(m_hContactHistoryMenuItems[i]);
for (int i = 0; i < CMI_COUNT; i++)
- Menu_RemoveItem(g_hContactMenuItems[i]);
+ Menu_RemoveItem(m_hContactMenuItems[i]);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -579,7 +511,7 @@ int CVkProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam)
//////////////////////////////////////////////////////////////////////////////
-MCONTACT CVkProto::AddToList(int, PROTOSEARCHRESULT* psr)
+MCONTACT CVkProto::AddToList(int, PROTOSEARCHRESULT *psr)
{
debugLogA("CVkProto::AddToList");
@@ -592,7 +524,7 @@ MCONTACT CVkProto::AddToList(int, PROTOSEARCHRESULT* psr)
return hContact;
}
-int CVkProto::AuthRequest(MCONTACT hContact,const TCHAR* message)
+int CVkProto::AuthRequest(MCONTACT hContact, const TCHAR *message)
{
debugLogA("CVkProto::AuthRequest");
if (!IsOnline())
@@ -685,7 +617,7 @@ int CVkProto::UserIsTyping(MCONTACT hContact, int type)
if (userID == -1 || !IsOnline() || userID == VK_FEED_USER)
return 1;
- if (m_iMarkMessageReadOn == markOnTyping)
+ if (m_vkOptions.iMarkMessageReadOn == MarkMsgReadOn::markOnTyping)
MarkMessagesRead(hContact);
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/messages.setActivity.json", true, &CVkProto::OnReceiveSmth, AsyncHttpRequest::rpLow)