diff options
author | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-12-31 04:44:21 +0000 |
---|---|---|
committer | Sergey Bolhovskoy <elzorfox@ya.ru> | 2014-12-31 04:44:21 +0000 |
commit | 5de1b2c939a26695aaab99540fe3d37527512cb3 (patch) | |
tree | a27e4c60a26c0f28d5b6321fce6564c3c8cb9239 | |
parent | 4f357958b94ad9e0637fcfd7c9b83cf24803c4cb (diff) |
VKontakte:
code cleanup
add hidden option for max photo count on loading news
git-svn-id: http://svn.miranda-ng.org/main/trunk@11690 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/VKontakte/src/misc.cpp | 4 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_feed.cpp | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 11 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.h | 20 |
4 files changed, 20 insertions, 17 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 9ce568f154..27fab75f2e 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -647,14 +647,14 @@ int CVkProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam) CMStringA szListeningTo(m_szModuleName);
szListeningTo += "Enabled";
if (!strcmp(cws->szSetting, szListeningTo.GetBuffer())) {
- int iOldMusicSendMetod = getByte("OldMusicSendMetod", 3);
+ MusicSendMetod iOldMusicSendMetod = (MusicSendMetod)getByte("OldMusicSendMetod", sendBroadcastAndStatus);
if (cws->value.bVal == 0)
setByte("OldMusicSendMetod", m_iMusicSendMetod);
else
db_unset(0, m_szModuleName, "OldMusicSendMetod");
- m_iMusicSendMetod = cws->value.bVal == 0 ? 0 : iOldMusicSendMetod;
+ m_iMusicSendMetod = cws->value.bVal == 0 ? sendNone : iOldMusicSendMetod;
setByte("MusicSendMetod", m_iMusicSendMetod);
}
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp index 16740d9efc..9d3bcc3570 100644 --- a/protocols/VKontakte/src/vk_feed.cpp +++ b/protocols/VKontakte/src/vk_feed.cpp @@ -470,7 +470,7 @@ void CVkProto::RetrieveUnreadNews(time_t tLastNewsTime) Push(new AsyncHttpRequest(this, REQUEST_GET, "/method/newsfeed.get.json", true, &CVkProto::OnReceiveUnreadNews)
<< INT_PARAM("count", 100)
<< INT_PARAM("return_banned", m_bNewsSourceIncludeBanned ? 1 : 0)
- << INT_PARAM("max_photos", 5)
+ << INT_PARAM("max_photos", m_iMaxLoadNewsPhoto)
<< INT_PARAM("start_time", tLastNewsTime + 1)
<< CHAR_PARAM("filters", szFilter.GetBuffer())
<< CHAR_PARAM("source_ids", szSource.GetBuffer())
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index c2a266eac5..cdba6b95a4 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -69,20 +69,22 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : m_bRemoveFromFrendlist = getBool("RemoveFromFrendlistOnBanUser", false);
m_bRemoveFromClist = getBool("RemoveFromClistOnBanUser", false);
m_bPopUpSyncHistory = getBool("PopUpSyncHistory", false);
- m_iMarkMessageReadOn = getByte("MarkMessageReadOn", 0);
+ m_iMarkMessageReadOn = (MarkMsgReadOn)getByte("MarkMessageReadOn", markOnRead);
m_bStikersAsSmyles = getBool("StikersAsSmyles", false);
m_bUserForceOnlineOnActivity = getBool("UserForceOnlineOnActivity", false);
- m_iMusicSendMetod = getByte("MusicSendMetod", sendBroadcastOnly);
- m_iSyncHistoryMetod = getByte("SyncHistoryMetod", syncOff);
+ m_iMusicSendMetod = (MusicSendMetod)getByte("MusicSendMetod", sendBroadcastOnly);
+ m_iSyncHistoryMetod = (SyncHistoryMetod)getByte("SyncHistoryMetod", syncOff);
CMStringA szListeningTo(m_szModuleName);
szListeningTo += "Enabled";
db_set_b(NULL, "ListeningTo", szListeningTo.GetBuffer(), m_iMusicSendMetod == 0 ? 0 : 1);
+
m_bNewsEnabled = getBool("NewsEnabled", false);
+ m_iMaxLoadNewsPhoto = getByte("MaxLoadNewsPhoto", 5);
m_bNotificationsEnabled = getBool("NotificationsEnabled", false);
m_bSpecialContactAlwaysEnabled = getBool("SpecialContactAlwaysEnabled", false);
m_iNewsInterval = getDword("NewsInterval", 15);
m_iNotificationsInterval = getDword("NotificationsInterval", 1);
- m_iIMGBBCSupport = getByte("IMGBBCSupport", 0);
+ m_iIMGBBCSupport = (IMGBBCSypport)getByte("IMGBBCSupport", 0);
m_iBBCForNews = (BBCSupport)getByte("BBCForNews", 1);
m_iBBCForAttachments = (BBCSupport)getByte("BBCForAttachments", 1);
m_bUseBBCOnAttacmentsAsNews = getBool("UseBBCOnAttacmentsAsNews", true);
@@ -308,7 +310,6 @@ void CVkProto::InitMenus() mi.ptszName = LPGENT("for all time");
mi.pszService = szService;
g_hContactHistoryMenuItems[CHMI_GETALLSERVERHISTORY] = Menu_AddContactMenuItem(&mi);
-
}
int CVkProto::OnPreBuildContactMenu(WPARAM hContact, LPARAM)
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index cd3bf38d10..80bb853e52 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -430,7 +430,6 @@ struct CVkProto : public PROTO<CVkProto> void RetrieveUnreadMessages();
void OnReceiveMessages(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
void OnReceiveDlgs(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
-
void OnSendMessage(NETLIBHTTPREQUEST*, AsyncHttpRequest*);
@@ -572,23 +571,26 @@ private: m_bNotificationFilterReposts,
m_bNotificationFilterMentions,
m_bUseBBCOnAttacmentsAsNews;
-
- int m_iNewsInterval, m_iNotificationsInterval, m_iNewsAutoClearHistoryInterval;
+ int m_iNewsInterval,
+ m_iNotificationsInterval,
+ m_iNewsAutoClearHistoryInterval,
+ m_iMaxLoadNewsPhoto;
enum MarkMsgReadOn { markOnRead, markOnReceive, markOnReply, markOnTyping };
- int m_iMarkMessageReadOn;
+ MarkMsgReadOn m_iMarkMessageReadOn;
enum SyncHistoryMetod { syncOff, syncAuto, sync1Days, sync3Days };
- int m_iSyncHistoryMetod;
+ SyncHistoryMetod m_iSyncHistoryMetod;
enum MusicSendMetod { sendNone, sendStatusOnly, sendBroadcastOnly, sendBroadcastAndStatus };
- int m_iMusicSendMetod;
+ MusicSendMetod m_iMusicSendMetod;
enum IMGBBCSypport { imgNo, imgFullSize, imgPreview130, imgPreview604 };
- int m_iIMGBBCSupport;
- BBCSupport m_iBBCForNews;
- BBCSupport m_iBBCForAttachments;
+ IMGBBCSypport m_iIMGBBCSupport;
+
+ BBCSupport m_iBBCForNews,
+ m_iBBCForAttachments;
LONG m_myUserId;
ptrT m_defaultGroup;
|