diff options
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 6 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_chats.cpp | 6 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.h | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_struct.h | 4 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 13 |
5 files changed, 21 insertions, 10 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index c659926377..b9f27e8e92 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -1490,7 +1490,11 @@ void CVkProto::ShowCaptchaInBrowser(HBITMAP hBitmap) void CVkProto::AddVkDeactivateEvent(MCONTACT hContact, CMStringW& wszType)
{
- debugLogW(L"CVkProto::AddVkDeactivateEvent hContact=%d, wszType=%s bShowVkDeactivateEvents=%d", hContact, wszType.c_str(), (int)m_vkOptions.bShowVkDeactivateEvents);
+ debugLogW(L"CVkProto::AddVkDeactivateEvent hContact=%d, wszType=%s bShowVkDeactivateEvents=<%d,%d,%d>",
+ hContact, wszType.c_str(),
+ (int)m_vkOptions.bShowVkDeactivateEvents,
+ (int)getBool(hContact, "ShowVkDeactivateEvents", true),
+ (int)(db_get_b(hContact, "CList", "Hidden", 0) == 0));
CVKDeactivateEvent vkDeactivateEvent[] = {
{ L"", Translate("User restored control over own page") },
diff --git a/protocols/VKontakte/src/vk_chats.cpp b/protocols/VKontakte/src/vk_chats.cpp index e1c7f76840..6c8f384bac 100644 --- a/protocols/VKontakte/src/vk_chats.cpp +++ b/protocols/VKontakte/src/vk_chats.cpp @@ -206,10 +206,8 @@ void CVkProto::OnReceiveChatInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe if (hContact)
continue;
- hContact = SetContactInfo(jnUser, true);
- db_set_b(hContact, "CList", "Hidden", 1);
- db_set_b(hContact, "CList", "NotOnList", 1);
- db_set_dw(hContact, "Ignore", "Mask1", 0);
+ hContact = SetContactInfo(jnUser, true, VKContactType::vkContactMUCUser);
+
}
const JSONNode &jnMsgs = jnResponse["msgs"];
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 90f5f1ece3..eb09cd0279 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -294,7 +294,7 @@ private: void RetrieveStatusMusic(const CMStringW &StatusMsg);
void OnReceiveStatus(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
void OnReceiveStatusMsg(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
- MCONTACT SetContactInfo(const JSONNode &jnItem, bool flag = false, bool self = false);
+ MCONTACT SetContactInfo(const JSONNode &jnItem, bool flag = false, VKContactType vkContactType = VKContactType::vkContactNormal);
void TrackVisitor();
void RetrieveMyInfo(void);
void OnReceiveMyInfo(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
diff --git a/protocols/VKontakte/src/vk_struct.h b/protocols/VKontakte/src/vk_struct.h index 54a1f4b623..e9ae771006 100644 --- a/protocols/VKontakte/src/vk_struct.h +++ b/protocols/VKontakte/src/vk_struct.h @@ -339,4 +339,6 @@ struct CVKOptions { struct CVKDeactivateEvent {
wchar_t *wszType;
char *szDescription;
-};
\ No newline at end of file +};
+
+enum VKContactType : BYTE { vkContactNormal, vkContactSelf, vkContactMUCUser };
\ No newline at end of file diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index e89d4d6416..0ef8721a1f 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -272,7 +272,7 @@ void CVkProto::OnReceiveMyInfo(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pReq) RetrievePollingInfo();
}
-MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self)
+MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, VKContactType vkContactType)
{
if (!jnItem) {
debugLogA("CVkProto::SetContactInfo pItem == nullptr");
@@ -288,14 +288,21 @@ MCONTACT CVkProto::SetContactInfo(const JSONNode &jnItem, bool flag, bool self) if (userid == m_myUserId) {
if (hContact != 0)
- if (self)
+ if (vkContactType == VKContactType::vkContactSelf)
hContact = 0;
else
- SetContactInfo(jnItem, flag, true);
+ SetContactInfo(jnItem, flag, VKContactType::vkContactSelf);
}
else if (hContact == 0)
return 0;
+ if (vkContactType == VKContactType::vkContactMUCUser) {
+ db_set_b(hContact, "CList", "Hidden", 1);
+ db_set_b(hContact, "CList", "NotOnList", 1);
+ db_set_dw(hContact, "Ignore", "Mask1", 0);
+ }
+
+
CMStringW wszNick, wszValue;
int iValue;
|