summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-06-17 03:57:20 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-06-17 03:57:20 +0000
commit06b7222a8359baa84e2dc185f4397a2fbb40ff58 (patch)
tree311012311eca75a8261d3dde6f4f75937fca2078 /protocols
parentd8b8caf0bfcc4fde668b6011e1f0c8eeac3d6108 (diff)
VKontakte:
add ‘Shorten links for audio attachments’ option version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@14226 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/VKontakte/res/resource.rc8
-rw-r--r--protocols/VKontakte/src/misc.cpp4
-rw-r--r--protocols/VKontakte/src/resource.h1
-rw-r--r--protocols/VKontakte/src/version.h2
-rw-r--r--protocols/VKontakte/src/vk_options.cpp5
-rw-r--r--protocols/VKontakte/src/vk_proto.cpp2
-rw-r--r--protocols/VKontakte/src/vk_proto.h3
7 files changed, 20 insertions, 5 deletions
diff --git a/protocols/VKontakte/res/resource.rc b/protocols/VKontakte/res/resource.rc
index a9a0f8acb8..ee03acfd3a 100644
--- a/protocols/VKontakte/res/resource.rc
+++ b/protocols/VKontakte/res/resource.rc
@@ -51,7 +51,7 @@ BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 298
TOPMARGIN, 7
- BOTTOMMARGIN, 166
+ BOTTOMMARGIN, 177
END
IDD_OPT_FEEDS, DIALOG
@@ -122,7 +122,7 @@ END
// Dialog
//
-IDD_OPT_VIEW DIALOGEX 0, 0, 304, 173
+IDD_OPT_VIEW DIALOGEX 0, 0, 304, 184
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
@@ -139,7 +139,7 @@ BEGIN
"Button",BS_AUTORADIOBUTTON,154,61,129,10
CONTROL "Use this setting also for attachments on news and notifications",IDC_BBC_ATT_NEWS,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,83,278,10
- GROUPBOX "Other",IDC_STATIC,4,138,293,26
+ GROUPBOX "Other",IDC_STATIC,4,138,293,36
GROUPBOX "BBCode support on attachments",IDC_STATIC,4,99,294,38,WS_GROUP
CONTROL "off",IDC_ATTBBC_OFF,"Button",BS_AUTORADIOBUTTON,12,110,129,10
CONTROL "basic ([b], [i], [u], [s])",IDC_ATTBBC_BASIC,"Button",BS_AUTORADIOBUTTON,12,121,129,10
@@ -147,6 +147,8 @@ BEGIN
"Button",BS_AUTORADIOBUTTON,154,110,129,10
CONTROL "Process stickers as smileys",IDC_STICKERS_AS_SMYLES,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,149,278,10
+ CONTROL "Shorten links for audio attachments",IDC_SHOTEN_LINKS_FOR_AUDIO,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,160,278,10
END
IDD_OPT_FEEDS DIALOGEX 0, 0, 304, 232
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 <stdver.h>
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,