summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/vk_messages.cpp2
-rw-r--r--protocols/VKontakte/src/vk_options.cpp14
-rw-r--r--protocols/VKontakte/src/vk_options.h4
-rw-r--r--protocols/VKontakte/src/vk_pollserver.cpp6
-rw-r--r--protocols/VKontakte/src/vk_struct.cpp2
-rw-r--r--protocols/VKontakte/src/vk_struct.h2
6 files changed, 23 insertions, 7 deletions
diff --git a/protocols/VKontakte/src/vk_messages.cpp b/protocols/VKontakte/src/vk_messages.cpp
index c45984ec03..8c764ba623 100644
--- a/protocols/VKontakte/src/vk_messages.cpp
+++ b/protocols/VKontakte/src/vk_messages.cpp
@@ -290,7 +290,7 @@ void CVkProto::OnReceiveMessages(NETLIBHTTPREQUEST *reply, AsyncHttpRequest *pRe
recv.flags |= PREF_CREATEREAD;
if (isOut)
recv.flags |= PREF_SENT;
- else if (m_vkOptions.bUserForceOnlineOnActivity)
+ else if (m_vkOptions.bUserForceInvisibleOnActivity)
SetInvisible(hContact);
T2Utf pszBody(tszBody);
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp
index 22ed05e0e4..f528338eb5 100644
--- a/protocols/VKontakte/src/vk_options.cpp
+++ b/protocols/VKontakte/src/vk_options.cpp
@@ -232,6 +232,7 @@ CVkOptionAdvancedForm::CVkOptionAdvancedForm(CVkProto *proto):
m_cbHideChats(this, IDC_HIDECHATS),
m_cbSyncReadMessageStatusFromServer(this, IDC_SYNC_MSG_STATUS),
m_cbMesAsUnread(this, IDC_MESASUREAD),
+ m_cbForceInvisibleStatus(this, IDC_FORCE_ONLINE_ON_ACT),
m_edtInvInterval(this, IDC_ED_INT_INVIS),
m_spInvInterval(this, IDC_SPIN_INT_INVIS),
m_cbUseNonStandardNotifications(this, IDC_USENOSTDURLENCODE),
@@ -249,6 +250,7 @@ CVkOptionAdvancedForm::CVkOptionAdvancedForm(CVkProto *proto):
CreateLink(m_cbHideChats, m_proto->m_vkOptions.bHideChats);
CreateLink(m_cbSyncReadMessageStatusFromServer, m_proto->m_vkOptions.bSyncReadMessageStatusFromServer);
CreateLink(m_cbMesAsUnread, m_proto->m_vkOptions.bMesAsUnread);
+ CreateLink(m_cbForceInvisibleStatus, m_proto->m_vkOptions.bUserForceInvisibleOnActivity);
CreateLink(m_edtInvInterval, m_proto->m_vkOptions.iInvisibleInterval);
CreateLink(m_cbUseNonStandardNotifications, m_proto->m_vkOptions.bUseNonStandardNotifications);
@@ -259,6 +261,8 @@ CVkOptionAdvancedForm::CVkOptionAdvancedForm(CVkProto *proto):
CreateLink(m_cbRemoveFromCList, m_proto->m_vkOptions.bRemoveFromCList);
CreateLink(m_edtReturnChatMessage, "ReturnChatMessage", TranslateT("I\'m back"));
+
+ m_cbForceInvisibleStatus.OnChange = Callback(this, &CVkOptionAdvancedForm::On_cbForceInvisibleStatusChange);
}
void CVkOptionAdvancedForm::OnInitDialog()
@@ -271,6 +275,8 @@ void CVkOptionAdvancedForm::OnInitDialog()
m_spInvInterval.SendMsg(UDM_SETRANGE, 0, MAKELONG(60, 0));
m_spInvInterval.SendMsg(UDM_SETPOS, 0, m_proto->m_vkOptions.iInvisibleInterval);
+
+ On_cbForceInvisibleStatusChange(&m_cbForceInvisibleStatus);
}
void CVkOptionAdvancedForm::OnApply()
@@ -287,6 +293,14 @@ void CVkOptionAdvancedForm::OnApply()
m_proto->m_vkOptions.ptszReturnChatMessage = m_edtReturnChatMessage.GetText();
}
+void CVkOptionAdvancedForm::On_cbForceInvisibleStatusChange(CCtrlCheck *)
+{
+ bool bEnable = m_cbForceInvisibleStatus.GetState() != 0;
+
+ m_edtInvInterval.Enable(bEnable);
+ m_spInvInterval.Enable(bEnable);
+}
+
////////////////////// News and notifications ////////////////////////////////
CVkOptionFeedsForm::CVkOptionFeedsForm(CVkProto *proto):
diff --git a/protocols/VKontakte/src/vk_options.h b/protocols/VKontakte/src/vk_options.h
index a594668df3..578a907513 100644
--- a/protocols/VKontakte/src/vk_options.h
+++ b/protocols/VKontakte/src/vk_options.h
@@ -77,7 +77,8 @@ class CVkOptionAdvancedForm : public CVkDlgBase
CCtrlCheck m_cbHideChats;
CCtrlCheck m_cbSyncReadMessageStatusFromServer;
CCtrlCheck m_cbMesAsUnread;
-
+
+ CCtrlCheck m_cbForceInvisibleStatus;
CCtrlEdit m_edtInvInterval;
CCtrlButton m_spInvInterval;
@@ -100,6 +101,7 @@ public:
CVkOptionAdvancedForm(CVkProto *proto);
void OnInitDialog();
void OnApply();
+ void On_cbForceInvisibleStatusChange(CCtrlCheck*);
};
////////////////////// News and notifications ////////////////////////////////
diff --git a/protocols/VKontakte/src/vk_pollserver.cpp b/protocols/VKontakte/src/vk_pollserver.cpp
index 143b1e7191..545b740322 100644
--- a/protocols/VKontakte/src/vk_pollserver.cpp
+++ b/protocols/VKontakte/src/vk_pollserver.cpp
@@ -92,7 +92,7 @@ void CVkProto::PollUpdates(const JSONNode &jnUpdates)
}
else
SetSrmmReadStatus(hContact);
- if (m_vkOptions.bUserForceOnlineOnActivity)
+ if (m_vkOptions.bUserForceInvisibleOnActivity)
SetInvisible(hContact);
if (m_vkOptions.bSyncReadMessageStatusFromServer)
MarkDialogAsRead(hContact);
@@ -123,7 +123,7 @@ void CVkProto::PollUpdates(const JSONNode &jnUpdates)
}
else
SetSrmmReadStatus(hContact);
- if (m_vkOptions.bUserForceOnlineOnActivity)
+ if (m_vkOptions.bUserForceInvisibleOnActivity)
SetInvisible(hContact);
}
break;
@@ -157,7 +157,7 @@ void CVkProto::PollUpdates(const JSONNode &jnUpdates)
hContact = FindUser(uid);
if (hContact != NULL) {
ForkThread(&CVkProto::ContactTypingThread, (void *)hContact);
- if (m_vkOptions.bUserForceOnlineOnActivity)
+ if (m_vkOptions.bUserForceInvisibleOnActivity)
SetInvisible(hContact);
}
break;
diff --git a/protocols/VKontakte/src/vk_struct.cpp b/protocols/VKontakte/src/vk_struct.cpp
index ceaa13c88d..7d04d03ea1 100644
--- a/protocols/VKontakte/src/vk_struct.cpp
+++ b/protocols/VKontakte/src/vk_struct.cpp
@@ -179,7 +179,7 @@ CVKOptions::CVKOptions(PROTO_INTERFACE *proto) :
bPopUpSyncHistory(proto, "PopUpSyncHistory", false),
iMarkMessageReadOn(proto, "MarkMessageReadOn", MarkMsgReadOn::markOnRead),
bStikersAsSmyles(proto, "StikersAsSmyles", false),
- bUserForceOnlineOnActivity(proto, "UserForceOnlineOnActivity", false),
+ bUserForceInvisibleOnActivity(proto, "UserForceOnlineOnActivity", false),
bNewsEnabled(proto, "NewsEnabled", false),
iMaxLoadNewsPhoto(proto, "MaxLoadNewsPhoto", 5),
bNotificationsEnabled(proto, "NotificationsEnabled", false),
diff --git a/protocols/VKontakte/src/vk_struct.h b/protocols/VKontakte/src/vk_struct.h
index 60c25fb5de..f3871c4830 100644
--- a/protocols/VKontakte/src/vk_struct.h
+++ b/protocols/VKontakte/src/vk_struct.h
@@ -278,7 +278,7 @@ struct CVKOptions {
CMOption<BYTE> bPopUpSyncHistory;
CMOption<BYTE> iMarkMessageReadOn;
CMOption<BYTE> bStikersAsSmyles;
- CMOption<BYTE> bUserForceOnlineOnActivity;
+ CMOption<BYTE> bUserForceInvisibleOnActivity;
CMOption<BYTE> iMusicSendMetod;
CMOption<BYTE> iSyncHistoryMetod;
CMOption<BYTE> bNewsEnabled;