summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-11-03 17:55:37 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-11-03 17:55:37 +0000
commit43865da50e05ff4225123b476addd3247083dc16 (patch)
tree7f4235e1710baf4381221760444bb563100b8a29 /protocols/VKontakte
parentf903074b63cf7a6f63476e14be1476056e6b76e3 (diff)
VKontakte:
minor fix for translation add ‘Wipe contacts missing in friend list’ proto menu item git-svn-id: http://svn.miranda-ng.org/main/trunk@15673 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp2
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp8
-rw-r--r--protocols/VKontakte/src/vk_proto.h5
-rw-r--r--protocols/VKontakte/src/vk_thread.cpp20
4 files changed, 30 insertions, 5 deletions
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index ab650d932e..2db8f0961a 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -84,7 +84,7 @@ void CVkProto::AddCListEvent(bool bNews)
cle.hContact = hContact;
cle.hDbEvent = NULL;
TCHAR toolTip[255];
- mir_sntprintf(toolTip, TranslateT("New %s"), bNews ? TranslateT("news") : TranslateT("notifications"));
+ mir_sntprintf(toolTip, bNews ? TranslateT("New news") : TranslateT("New notifications"));
cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp
index 7f61927ca8..e5ff0b1bd8 100644
--- a/protocols/VKontakte/src/vk_proto.cpp
+++ b/protocols/VKontakte/src/vk_proto.cpp
@@ -208,6 +208,7 @@ void CVkProto::InitMenus()
CreateProtoService(PS_DESTROYKICKCHAT, &CVkProto::SvcDestroyKickChat);
CreateProtoService(PS_OPENBROADCAST, &CVkProto::SvcOpenBroadcast);
CreateProtoService(PS_LOADVKNEWS, &CVkProto::SvcLoadVKNews);
+ CreateProtoService(PS_WIPENONFRIENDS, &CVkProto::SvcWipeNonFriendContacts);
CreateProtoService(PS_SETSTATUSMSG, &CVkProto::SvcSetStatusMsg);
CreateProtoService(PS_WALLPOST, &CVkProto::SvcWallPost);
@@ -243,6 +244,13 @@ void CVkProto::InitMenus()
SET_UID(mi, 0x7c449456, 0xb731, 0x48cc, 0x9c, 0x4e, 0x20, 0xe4, 0x66, 0x7a, 0x16, 0x23);
g_hProtoMenuItems[PMI_LOADVKNEWS] = 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);
+
mi.pszService = PS_VISITPROFILE;
mi.position = 10009 + PMI_VISITPROFILE;
mi.hIcolibItem = IcoLib_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE));
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h
index 6623addcb8..8eee5fe7c4 100644
--- a/protocols/VKontakte/src/vk_proto.h
+++ b/protocols/VKontakte/src/vk_proto.h
@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PS_CREATECHAT "/CreateNewChat"
#define PS_LOADVKNEWS "/LoadVKNews"
+#define PS_WIPENONFRIENDS "/WipeNonFriendContacts"
#define PS_GETSERVERHISTORY "/SyncHistory"
#define PS_GETSERVERHISTORYLAST1DAY "/GetServerHystoryLast1Day"
#define PS_GETSERVERHISTORYLAST3DAY "/GetServerHystoryLast3Day"
@@ -94,6 +95,7 @@ struct CVkProto : public PROTO<CVkProto>
INT_PTR __cdecl SvcVisitProfile(WPARAM hContact, LPARAM);
INT_PTR __cdecl SvcAddAsFriend(WPARAM hContact, LPARAM);
+ INT_PTR __cdecl SvcWipeNonFriendContacts(WPARAM, LPARAM);
INT_PTR __cdecl SvcDeleteFriend(WPARAM hContact, LPARAM);
INT_PTR __cdecl SvcBanUser(WPARAM hContact, LPARAM);
INT_PTR __cdecl SvcReportAbuse(WPARAM hContact, LPARAM);
@@ -228,7 +230,7 @@ struct CVkProto : public PROTO<CVkProto>
void RetrieveUserInfo(LONG userId);
void RetrieveUsersInfo(bool flag = false, bool bRepeat = false);
void OnReceiveUserInfo(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
- void RetrieveFriends();
+ void RetrieveFriends(bool bCleanNonFriendContacts = false);
void OnReceiveFriends(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
void MarkMessagesRead(const CMStringA &mids);
@@ -310,6 +312,7 @@ private:
PMI_SETSTATUSMSG,
PMI_WALLPOST,
PMI_LOADVKNEWS,
+ PMI_WIPENONFRIENDS,
PMI_VISITPROFILE,
PMI_COUNT
};
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp
index f6a02cbfa4..09ffbb81f7 100644
--- a/protocols/VKontakte/src/vk_thread.cpp
+++ b/protocols/VKontakte/src/vk_thread.cpp
@@ -500,7 +500,7 @@ void CVkProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
}
}
-void CVkProto::RetrieveFriends()
+void CVkProto::RetrieveFriends(bool bCleanNonFriendContacts)
{
debugLogA("CVkProto::RetrieveFriends");
if (!IsOnline())
@@ -508,7 +508,7 @@ void CVkProto::RetrieveFriends()
Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/friends.get.json", true, &CVkProto::OnReceiveFriends)
<< INT_PARAM("count", 1000)
<< CHAR_PARAM("fields", fieldsName)
- <<VER_API);
+ << VER_API)->pUserInfo = new CVkSendMsgParam(NULL, bCleanNonFriendContacts ? 1 : 0);
}
void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq)
@@ -521,8 +521,11 @@ void CVkProto::OnReceiveFriends(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq
const JSONNode &jnResponse = CheckJsonResponse(pReq, reply, jnRoot);
if (!jnResponse)
return;
+
+ CVkSendMsgParam *param = (CVkSendMsgParam *)pReq->pUserInfo;
+ bool bCleanContacts = getBool("AutoClean") || (param->iMsgID != 0);
+ delete param;
- bool bCleanContacts = getBool("AutoClean");
LIST<void> arContacts(10, PtrKeySortT);
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
@@ -571,6 +574,17 @@ INT_PTR __cdecl CVkProto::SvcAddAsFriend(WPARAM hContact, LPARAM)
return 0;
}
+INT_PTR CVkProto::SvcWipeNonFriendContacts(WPARAM, LPARAM)
+{
+ debugLogA("CVkProto::SvcWipeNonFriendContacts");
+ if (IDNO == MessageBox(NULL, TranslateT("Are you sure to wipe local contacts missing in your friend list?"),
+ TranslateT("Attention!"), MB_ICONWARNING | MB_YESNO))
+ return 0;
+
+ RetrieveFriends(true);
+ return 0;
+}
+
INT_PTR __cdecl CVkProto::SvcDeleteFriend(WPARAM hContact, LPARAM flag)
{
debugLogA("CVkProto::SvcDeleteFriend");