From 06b7222a8359baa84e2dc185f4397a2fbb40ff58 Mon Sep 17 00:00:00 2001 From: Sergey Bolhovskoy Date: Wed, 17 Jun 2015 03:57:20 +0000 Subject: =?UTF-8?q?VKontakte:=20add=20=E2=80=98Shorten=20links=20for=20aud?= =?UTF-8?q?io=20attachments=E2=80=99=20option=20version=20bump?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.miranda-ng.org/main/trunk@14226 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/misc.cpp | 4 ++++ protocols/VKontakte/src/resource.h | 1 + protocols/VKontakte/src/version.h | 2 +- protocols/VKontakte/src/vk_options.cpp | 5 +++++ protocols/VKontakte/src/vk_proto.cpp | 2 ++ protocols/VKontakte/src/vk_proto.h | 3 ++- 6 files changed, 15 insertions(+), 2 deletions(-) (limited to 'protocols/VKontakte/src') diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index b92c72c83d..79ab9356e8 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -989,6 +989,10 @@ CMString CVkProto::GetAttachmentDescr(const JSONNode &jnAttachments, BBCSupport CMString tszAudio; tszAudio.AppendFormat(_T("%s - %s"), tszArtist, tszTitle); + int iParamPos = tszUrl.Find(_T("?")); + if (m_bShortenLinksForAudio && iParamPos != -1) + tszUrl = tszUrl.Left(iParamPos); + res.AppendFormat(_T("%s: %s"), SetBBCString(TranslateT("Audio"), iBBC, vkbbcB), SetBBCString(tszAudio, iBBC, vkbbcUrl, tszUrl)); diff --git a/protocols/VKontakte/src/resource.h b/protocols/VKontakte/src/resource.h index a9029746e6..cf4bbc365a 100644 --- a/protocols/VKontakte/src/resource.h +++ b/protocols/VKontakte/src/resource.h @@ -47,6 +47,7 @@ #define IDC_REMOVE_FROM_CLIST 1033 #define IDC_FORCE_ONLINE_ON_ACT 1035 #define IDC_STICKERS_AS_SMYLES 1036 +#define IDC_SHOTEN_LINKS_FOR_AUDIO 1037 #define IDC_ONREAD 1039 #define IDC_ONRECEIVE 1040 #define IDC_ONREPLY 1041 diff --git a/protocols/VKontakte/src/version.h b/protocols/VKontakte/src/version.h index 7ae0564876..a004a2c4e0 100644 --- a/protocols/VKontakte/src/version.h +++ b/protocols/VKontakte/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 1 #define __RELEASE_NUM 1 -#define __BUILD_NUM 5 +#define __BUILD_NUM 6 #include diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp index fcbaf37254..960dfe70d5 100644 --- a/protocols/VKontakte/src/vk_options.cpp +++ b/protocols/VKontakte/src/vk_options.cpp @@ -546,6 +546,7 @@ INT_PTR CALLBACK CVkProto::OptionsViewProc(HWND hwndDlg, UINT uMsg, WPARAM wPara CheckDlgButton(hwndDlg, IDC_ATTBBC_ADV, (ppro->m_iBBCForAttachments == bbcAdvanced) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_STICKERS_AS_SMYLES, ppro->m_bStikersAsSmyles ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SHOTEN_LINKS_FOR_AUDIO, ppro->m_bShortenLinksForAudio ? BST_CHECKED : BST_UNCHECKED); return TRUE; @@ -563,6 +564,7 @@ INT_PTR CALLBACK CVkProto::OptionsViewProc(HWND hwndDlg, UINT uMsg, WPARAM wPara case IDC_ATTBBC_BASIC: case IDC_ATTBBC_ADV: case IDC_STICKERS_AS_SMYLES: + case IDC_SHOTEN_LINKS_FOR_AUDIO: if (HIWORD(wParam) == BN_CLICKED && (HWND)lParam == GetFocus()) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; @@ -602,6 +604,9 @@ INT_PTR CALLBACK CVkProto::OptionsViewProc(HWND hwndDlg, UINT uMsg, WPARAM wPara ppro->m_bStikersAsSmyles = IsDlgButtonChecked(hwndDlg, IDC_STICKERS_AS_SMYLES) == BST_CHECKED; ppro->setByte("StikersAsSmyles", ppro->m_bStikersAsSmyles); + + ppro->m_bShortenLinksForAudio = IsDlgButtonChecked(hwndDlg, IDC_SHOTEN_LINKS_FOR_AUDIO) == BST_CHECKED; + ppro->setByte("ShortenLinksForAudio", ppro->m_bShortenLinksForAudio); } break; diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 5d4316e996..e0143d6f53 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -119,6 +119,8 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : m_bUseNonStandardUrlEncode = getBool("UseNonStandardUrlEncode", true); m_iInvisibleInterval = getDword("InvisibleInterval", 10); + m_bShortenLinksForAudio = getBool("ShortenLinksForAudio", true); + m_bSetBroadcast = false; m_bNeedSendOnline = false; delSetting("InviteGroupIds"); diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 615026ebaa..57b78f4d2a 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -589,7 +589,8 @@ private: m_bNotificationFilterInvites, m_bUseBBCOnAttacmentsAsNews, m_bUseNonStandardUrlEncode, - m_bSetBroadcast; + m_bSetBroadcast, + m_bShortenLinksForAudio; int m_iNewsInterval, m_iNotificationsInterval, -- cgit v1.2.3