diff options
-rw-r--r-- | protocols/VKontakte/res/resource.rc | 159 | ||||
-rw-r--r-- | protocols/VKontakte/src/resource.h | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_options.cpp | 136 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.cpp | 1 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_proto.h | 2 | ||||
-rw-r--r-- | protocols/VKontakte/src/vk_thread.cpp | 31 |
6 files changed, 217 insertions, 114 deletions
diff --git a/protocols/VKontakte/res/resource.rc b/protocols/VKontakte/res/resource.rc index c671bc5c95..9db394c0d6 100644 --- a/protocols/VKontakte/res/resource.rc +++ b/protocols/VKontakte/res/resource.rc @@ -47,6 +47,55 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US /////////////////////////////////////////////////////////////////////////////
//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_ACCMGRUI, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ TOPMARGIN, 7
+ END
+
+ IDD_OPT_ADV, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 297
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 132
+ END
+
+ IDD_OPT_MAIN, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 297
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 188
+ END
+
+ IDD_INVITE, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 184
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 58
+ END
+
+ IDD_GC_CREATE, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 210
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 225
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
// Dialog
//
@@ -62,46 +111,55 @@ BEGIN CONTROL "Open VKontakte site",IDC_URL,"Hyperlink",WS_TABSTOP,0,49,174,12
END
-IDD_OPT_MAIN DIALOGEX 0, 0, 304, 261
+IDD_OPT_ADV DIALOGEX 0, 0, 304, 143
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Advanced",IDC_STATIC,4,8,293,77
+ CONTROL "Hide chats on startup",IDC_HIDECHATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,19,278,10
+ CONTROL "Always notify as unread for all incoming message",IDC_MESASUREAD,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,30,278,10
+ CONTROL "Add [img] bbc for graphical attachments",IDC_ADD_IMG_BBC,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,41,278,10
+ CONTROL "Force online status upon user activity",IDC_FORCE_ONLINE_ON_ACT,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,63,278,10
+ GROUPBOX "When I ban user...",IDC_STATIC,4,91,293,33
+ CONTROL "Report abuse",IDC_REPORT_ABUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,101,129,10
+ CONTROL "Clear server history",IDC_CLEAR_SERVER_HISTORY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,112,129,10
+ CONTROL "Remove from friend list",IDC_REMOVE_FROM_FRENDLIST,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,101,129,10
+ CONTROL "Remove from contact list",IDC_REMOVE_FROM_CLIST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,112,129,10
+ CONTROL "Process stickers as smiles",IDC_STICKERS_AS_SMYLES,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,52,278,10
+END
+
+IDD_OPT_MAIN DIALOGEX 0, 0, 304, 199
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- GROUPBOX "Login settings",IDC_STATIC,4,7,293,50
+ GROUPBOX "Login settings",IDC_STATIC,4,8,293,50
LTEXT "E-mail or phone number:",IDC_STATIC,35,16,108,10
EDITTEXT IDC_LOGIN,147,15,89,12,ES_AUTOHSCROLL
LTEXT "Password:",IDC_STATIC,35,28,108,10
EDITTEXT IDC_PASSWORD,147,28,90,12,ES_PASSWORD | ES_AUTOHSCROLL
CONTROL "Open VKontakte site",IDC_URL,"Hyperlink",WS_TABSTOP,59,43,174,11
- GROUPBOX "Local settings",IDC_STATIC,4,57,293,27
- LTEXT "Contact list group:",IDC_STATIC,12,69,146,8
- EDITTEXT IDC_GROUPNAME,167,67,121,12,ES_AUTOHSCROLL
- GROUPBOX "Advanced",IDC_STATIC,4,84,293,97
- CONTROL "Server-side delivery confirmation",IDC_DELIVERY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,93,278,10
- CONTROL "Hide chats on startup",IDC_HIDECHATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,104,278,10
- CONTROL "Automatically wipe local contacts missing in your friend list",IDC_AUTOCLEAN,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,115,278,10
- CONTROL "Always notify as unread for all incoming message",IDC_MESASUREAD,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,126,278,10
- CONTROL "Automatically sync last messages",IDC_SYNCHISTOTYONONLINE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,137,278,10
+ GROUPBOX "Local settings",IDC_STATIC,4,59,293,83
+ LTEXT "Contact list group:",IDC_STATIC,12,71,146,8
+ EDITTEXT IDC_GROUPNAME,167,69,121,12,ES_AUTOHSCROLL
+ CONTROL "Server-side delivery confirmation",IDC_DELIVERY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,88,278,10
CONTROL "Use local time for received messages",IDC_USE_LOCAL_TIME,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,148,278,10
- CONTROL "Add [img] bbc for graphical attachments",IDC_ADD_IMG_BBC,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,159,278,10
- CONTROL "Force online status upon user activity",IDC_FORCE_ONLINE_ON_ACT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,170,278,10
- GROUPBOX "When I ban user...",IDC_STATIC,4,182,293,33
- CONTROL "Report abuse",IDC_REPORT_ABUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,192,129,10
- CONTROL "Clear server history",IDC_CLEAR_SERVER_HISTORY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,203,129,10
- CONTROL "Remove from friend list",IDC_REMOVE_FROM_FRENDLIST,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,192,129,10
- CONTROL "Remove from contact list",IDC_REMOVE_FROM_CLIST,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,155,203,129,10
- GROUPBOX "Mark message as read...",IDC_STATIC_MARK_AS_READ,4,216,293,33,WS_GROUP
- CONTROL "on read",IDC_ONREAD,"Button",BS_AUTORADIOBUTTON,12,226,129,10
- CONTROL "on receive",IDC_ONRECEIVE,"Button",BS_AUTORADIOBUTTON,12,237,129,10
- CONTROL "on reply",IDC_ONREPLY,"Button",BS_AUTORADIOBUTTON,155,226,129,10
- CONTROL "on typing",IDC_ONTYPING,"Button",BS_AUTORADIOBUTTON,155,237,129,10
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,99,278,10
+ CONTROL "Automatically sync last messages",IDC_SYNCHISTOTYONONLINE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,110,278,10
+ CONTROL "Automatically wipe local contacts missing in your friend list",IDC_AUTOCLEAN,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,121,278,10
+ GROUPBOX "Mark message as read...",IDC_STATIC_MARK_AS_READ,4,146,293,33,WS_GROUP
+ CONTROL "on read",IDC_ONREAD,"Button",BS_AUTORADIOBUTTON,12,156,129,10
+ CONTROL "on receive",IDC_ONRECEIVE,"Button",BS_AUTORADIOBUTTON,12,167,129,10
+ CONTROL "on reply",IDC_ONREPLY,"Button",BS_AUTORADIOBUTTON,155,156,129,10
+ CONTROL "on typing",IDC_ONTYPING,"Button",BS_AUTORADIOBUTTON,155,167,129,10
END
IDD_CAPTCHAFORM DIALOGEX 0, 0, 258, 224
@@ -145,47 +203,6 @@ BEGIN END
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_ACCMGRUI, DIALOG
- BEGIN
- LEFTMARGIN, 7
- TOPMARGIN, 7
- END
-
- IDD_OPT_MAIN, DIALOG
- BEGIN
- LEFTMARGIN, 4
- RIGHTMARGIN, 297
- TOPMARGIN, 7
- BOTTOMMARGIN, 253
- END
-
- IDD_INVITE, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 184
- TOPMARGIN, 7
- BOTTOMMARGIN, 58
- END
-
- IDD_GC_CREATE, DIALOG
- BEGIN
- LEFTMARGIN, 4
- RIGHTMARGIN, 210
- TOPMARGIN, 7
- BOTTOMMARGIN, 225
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/protocols/VKontakte/src/resource.h b/protocols/VKontakte/src/resource.h index 27e79c4b4c..83b0ee499d 100644 --- a/protocols/VKontakte/src/resource.h +++ b/protocols/VKontakte/src/resource.h @@ -7,6 +7,7 @@ #define IDD_OPT_MAIN 103
#define IDD_INVITE 104
#define IDD_GC_CREATE 105
+#define IDD_OPT_ADV 106
#define IDI_NOTIFICATION 109
#define IDI_FRIENDADD 110
#define IDI_BAN 111
@@ -43,6 +44,7 @@ #define IDC_REMOVE_FROM_CLIST 1033
#define IDC_ADD_IMG_BBC 1034
#define IDC_FORCE_ONLINE_ON_ACT 1035
+#define IDC_STICKERS_AS_SMYLES 1036
#define IDC_ONREAD 1039
#define IDC_ONRECEIVE 1040
#define IDC_ONREPLY 1041
diff --git a/protocols/VKontakte/src/vk_options.cpp b/protocols/VKontakte/src/vk_options.cpp index f415020918..084ca326ff 100644 --- a/protocols/VKontakte/src/vk_options.cpp +++ b/protocols/VKontakte/src/vk_options.cpp @@ -118,18 +118,12 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SetDlgItemText(hwndDlg, IDC_GROUPNAME, ppro->getGroup());
}
+
CheckDlgButton(hwndDlg, IDC_DELIVERY, ppro->m_bServerDelivery);
- CheckDlgButton(hwndDlg, IDC_HIDECHATS, ppro->m_bHideChats);
- CheckDlgButton(hwndDlg, IDC_AUTOCLEAN, ppro->getByte("AutoClean", 0));
- CheckDlgButton(hwndDlg, IDC_MESASUREAD, ppro->m_bMesAsUnread);
- CheckDlgButton(hwndDlg, IDC_SYNCHISTOTYONONLINE, ppro->m_bAutoSyncHistory);
CheckDlgButton(hwndDlg, IDC_USE_LOCAL_TIME, ppro->m_bUseLocalTime);
- CheckDlgButton(hwndDlg, IDC_ADD_IMG_BBC, ppro->m_bAddImgBbc);
- CheckDlgButton(hwndDlg, IDC_FORCE_ONLINE_ON_ACT, ppro->m_bUserForceOnlineOnActivity);
- CheckDlgButton(hwndDlg, IDC_REPORT_ABUSE, ppro->m_bReportAbuse);
- CheckDlgButton(hwndDlg, IDC_CLEAR_SERVER_HISTORY, ppro->m_bClearServerHistory);
- CheckDlgButton(hwndDlg, IDC_REMOVE_FROM_FRENDLIST, ppro->m_bRemoveFromFrendlist);
- CheckDlgButton(hwndDlg, IDC_REMOVE_FROM_CLIST, ppro->m_bRemoveFromClist);
+ CheckDlgButton(hwndDlg, IDC_SYNCHISTOTYONONLINE, ppro->m_bAutoSyncHistory);
+ CheckDlgButton(hwndDlg, IDC_AUTOCLEAN, ppro->getByte("AutoClean", 0));
+
CheckDlgButton(hwndDlg, IDC_ONREAD, (ppro->m_iMarkMessageReadOn == markOnRead));
CheckDlgButton(hwndDlg, IDC_ONRECEIVE, (ppro->m_iMarkMessageReadOn == markOnReceive));
CheckDlgButton(hwndDlg, IDC_ONREPLY, (ppro->m_iMarkMessageReadOn == markOnReply));
@@ -149,18 +143,10 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- case IDC_DELIVERY:
- case IDC_HIDECHATS:
- case IDC_AUTOCLEAN:
- case IDC_MESASUREAD:
- case IDC_SYNCHISTOTYONONLINE:
+ case IDC_DELIVERY:
case IDC_USE_LOCAL_TIME:
- case IDC_ADD_IMG_BBC:
- case IDC_FORCE_ONLINE_ON_ACT:
- case IDC_REPORT_ABUSE:
- case IDC_CLEAR_SERVER_HISTORY:
- case IDC_REMOVE_FROM_FRENDLIST:
- case IDC_REMOVE_FROM_CLIST:
+ case IDC_SYNCHISTOTYONONLINE:
+ case IDC_AUTOCLEAN:
case IDC_ONREAD:
case IDC_ONRECEIVE:
case IDC_ONREPLY:
@@ -190,14 +176,8 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L ppro->m_bServerDelivery = IsDlgButtonChecked(hwndDlg, IDC_DELIVERY) == BST_CHECKED;
ppro->setByte("ServerDelivery", ppro->m_bServerDelivery);
-
- ppro->m_bHideChats = IsDlgButtonChecked(hwndDlg, IDC_HIDECHATS) == BST_CHECKED;
- ppro->setByte("HideChats", ppro->m_bHideChats);
-
+
ppro->setByte("AutoClean", IsDlgButtonChecked(hwndDlg, IDC_AUTOCLEAN) == BST_CHECKED);
-
- ppro->m_bMesAsUnread = IsDlgButtonChecked(hwndDlg, IDC_MESASUREAD) == BST_CHECKED;
- ppro->setByte("MesAsUnread", ppro->m_bMesAsUnread);
ppro->m_bAutoSyncHistory = IsDlgButtonChecked(hwndDlg, IDC_SYNCHISTOTYONONLINE) == BST_CHECKED;
ppro->setByte("AutoSyncHistory", ppro->m_bAutoSyncHistory);
@@ -205,9 +185,89 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L ppro->m_bUseLocalTime = IsDlgButtonChecked(hwndDlg, IDC_USE_LOCAL_TIME) == BST_CHECKED;
ppro->setByte("UseLocalTime", ppro->m_bUseLocalTime);
+ if (IsDlgButtonChecked(hwndDlg, IDC_ONREAD) == BST_CHECKED)
+ ppro->m_iMarkMessageReadOn = markOnRead;
+ if (IsDlgButtonChecked(hwndDlg, IDC_ONRECEIVE) == BST_CHECKED)
+ ppro->m_iMarkMessageReadOn = markOnReceive;
+ if (IsDlgButtonChecked(hwndDlg, IDC_ONREPLY) == BST_CHECKED)
+ ppro->m_iMarkMessageReadOn = markOnReply;
+ if (IsDlgButtonChecked(hwndDlg, IDC_ONTYPING) == BST_CHECKED)
+ ppro->m_iMarkMessageReadOn = markOnTyping;
+ ppro->setByte("MarkMessageReadOn", ppro->m_iMarkMessageReadOn);
+ }
+ break;
+
+ case WM_CLOSE:
+ EndDialog(hwndDlg, 0);
+ break;
+
+ case WM_DESTROY:
+ Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_BIG, 0));
+ Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0));
+ break;
+ }
+
+ return FALSE;
+}
+
+INT_PTR CALLBACK CVkProto::OptionsAdvProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ CVkProto *ppro = (CVkProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+
+ switch (uMsg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+
+ ppro = (CVkProto*)lParam;
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon, true));
+ SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon));
+
+ CheckDlgButton(hwndDlg, IDC_HIDECHATS, ppro->m_bHideChats);
+ CheckDlgButton(hwndDlg, IDC_MESASUREAD, ppro->m_bMesAsUnread);
+ CheckDlgButton(hwndDlg, IDC_ADD_IMG_BBC, ppro->m_bAddImgBbc);
+ CheckDlgButton(hwndDlg, IDC_STICKERS_AS_SMYLES, ppro->m_bStikersAsSmyles);
+ CheckDlgButton(hwndDlg, IDC_FORCE_ONLINE_ON_ACT, ppro->m_bUserForceOnlineOnActivity);
+
+ CheckDlgButton(hwndDlg, IDC_REPORT_ABUSE, ppro->m_bReportAbuse);
+ CheckDlgButton(hwndDlg, IDC_CLEAR_SERVER_HISTORY, ppro->m_bClearServerHistory);
+ CheckDlgButton(hwndDlg, IDC_REMOVE_FROM_FRENDLIST, ppro->m_bRemoveFromFrendlist);
+ CheckDlgButton(hwndDlg, IDC_REMOVE_FROM_CLIST, ppro->m_bRemoveFromClist);
+
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_HIDECHATS:
+ case IDC_MESASUREAD:
+ case IDC_ADD_IMG_BBC:
+ case IDC_FORCE_ONLINE_ON_ACT:
+ case IDC_STICKERS_AS_SMYLES:
+ case IDC_REPORT_ABUSE:
+ case IDC_CLEAR_SERVER_HISTORY:
+ case IDC_REMOVE_FROM_FRENDLIST:
+ case IDC_REMOVE_FROM_CLIST:
+ if (HIWORD(wParam) == BN_CLICKED && (HWND)lParam == GetFocus())
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ }
+ break;
+
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->code == PSN_APPLY) {
+ ppro->m_bHideChats = IsDlgButtonChecked(hwndDlg, IDC_HIDECHATS) == BST_CHECKED;
+ ppro->setByte("HideChats", ppro->m_bHideChats);
+
+ ppro->m_bMesAsUnread = IsDlgButtonChecked(hwndDlg, IDC_MESASUREAD) == BST_CHECKED;
+ ppro->setByte("MesAsUnread", ppro->m_bMesAsUnread);
+
ppro->m_bAddImgBbc = IsDlgButtonChecked(hwndDlg, IDC_ADD_IMG_BBC) == BST_CHECKED;
ppro->setByte("AddImgBbc", ppro->m_bAddImgBbc);
+ ppro->m_bStikersAsSmyles = IsDlgButtonChecked(hwndDlg, IDC_STICKERS_AS_SMYLES) == BST_CHECKED;
+ ppro->setByte("StikersAsSmyles", ppro->m_bStikersAsSmyles);
+
ppro->m_bUserForceOnlineOnActivity = IsDlgButtonChecked(hwndDlg, IDC_FORCE_ONLINE_ON_ACT) == BST_CHECKED;
ppro->setByte("UserForceOnlineOnActivity", ppro->m_bUserForceOnlineOnActivity);
@@ -221,17 +281,8 @@ INT_PTR CALLBACK CVkProto::OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L ppro->setByte("RemoveFromFrendlistOnBanUser", ppro->m_bRemoveFromFrendlist);
ppro->m_bRemoveFromClist = IsDlgButtonChecked(hwndDlg, IDC_REMOVE_FROM_CLIST) == BST_CHECKED;
- ppro->setByte("RemoveFromClistOnBanUser", ppro->m_bRemoveFromClist);
+ ppro->setByte("RemoveFromClistOnBanUser", ppro->m_bRemoveFromClist);
- if (IsDlgButtonChecked(hwndDlg, IDC_ONREAD) == BST_CHECKED)
- ppro->m_iMarkMessageReadOn = markOnRead;
- if (IsDlgButtonChecked(hwndDlg, IDC_ONRECEIVE) == BST_CHECKED)
- ppro->m_iMarkMessageReadOn = markOnReceive;
- if (IsDlgButtonChecked(hwndDlg, IDC_ONREPLY) == BST_CHECKED)
- ppro->m_iMarkMessageReadOn = markOnReply;
- if (IsDlgButtonChecked(hwndDlg, IDC_ONTYPING) == BST_CHECKED)
- ppro->m_iMarkMessageReadOn = markOnTyping;
- ppro->setByte("MarkMessageReadOn", ppro->m_iMarkMessageReadOn);
}
break;
@@ -255,11 +306,18 @@ int CVkProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) odp.ptszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.position = 1;
odp.ptszGroup = LPGENT("Network");
+
odp.ptszTab = LPGENT("Account");
+ odp.position = 1;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAIN);
odp.pfnDlgProc = &CVkProto::OptionsProc;
Options_AddPage(wParam, &odp);
+
+ odp.ptszTab = LPGENT("Advanced");
+ odp.position = 2;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ADV);
+ odp.pfnDlgProc = &CVkProto::OptionsAdvProc;
+ Options_AddPage(wParam, &odp);
return 0;
}
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 1f5fe02cbf..47edff6722 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -74,6 +74,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : m_bPopUpSyncHistory = getBool("PopUpSyncHistory", false);
m_iMarkMessageReadOn = getByte("MarkMessageReadOn", 0);
m_bAddImgBbc = getBool("AddImgBbc", false);
+ m_bStikersAsSmyles = getBool("StikersAsSmyles", false);
m_bUserForceOnlineOnActivity = getBool("UserForceOnlineOnActivity", false);
// Set all contacts offline -- in case we crashed
diff --git a/protocols/VKontakte/src/vk_proto.h b/protocols/VKontakte/src/vk_proto.h index 5381a7b37d..df52642791 100644 --- a/protocols/VKontakte/src/vk_proto.h +++ b/protocols/VKontakte/src/vk_proto.h @@ -408,6 +408,7 @@ private: m_bRemoveFromClist,
m_bPopUpSyncHistory,
m_bAddImgBbc,
+ m_bStikersAsSmyles,
m_bUserForceOnlineOnActivity;
enum MarkMsgReadOn{ markOnRead, markOnReceive, markOnReply, markOnTyping };
@@ -434,6 +435,7 @@ private: bool CheckMid(int guid);
static INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
+ static INT_PTR CALLBACK OptionsAdvProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
OBJLIST<CVkChatInfo> m_chats;
CVkChatInfo* AppendChat(int id, JSONNODE *pNode);
diff --git a/protocols/VKontakte/src/vk_thread.cpp b/protocols/VKontakte/src/vk_thread.cpp index 5d36024b34..7fea5b8ab6 100644 --- a/protocols/VKontakte/src/vk_thread.cpp +++ b/protocols/VKontakte/src/vk_thread.cpp @@ -1213,8 +1213,8 @@ CMString CVkProto::GetAttachmentDescr(JSONNODE *pAttachments) for (int k = 0; (pAttach = json_at(pAttachments, k)) != NULL; k++) {
res.AppendChar('\t');
ptrT ptszType(json_as_string(json_get(pAttach, "type")));
- if (!lstrcmp(ptszType, _T("photo")) || !lstrcmp(ptszType, _T("sticker"))) {
- JSONNODE *pPhoto = json_get(pAttach, mir_t2a(ptszType));
+ if (!lstrcmp(ptszType, _T("photo"))) {
+ JSONNODE *pPhoto = json_get(pAttach, "photo");
if (pPhoto == NULL) continue;
ptrT ptszLink;
@@ -1228,8 +1228,7 @@ CMString CVkProto::GetAttachmentDescr(JSONNODE *pAttachments) int iWidth = json_as_int(json_get(pPhoto, "width"));
int iHeight = json_as_int(json_get(pPhoto, "height"));
- ptrT ptszTypeTranslate((lstrcmp(ptszType, _T("photo")) == 0) ? TranslateT("Photo") : TranslateT("Sticker"));
- res.AppendFormat(_T("%s: %s (%dx%d)"), ptszTypeTranslate, ptszLink, iWidth, iHeight);
+ res.AppendFormat(_T("%s: %s (%dx%d)"), TranslateT("Photo"), ptszLink, iWidth, iHeight);
if (m_bAddImgBbc)
res.AppendFormat(L"\n\t[img]%s[/img]", ptszLink);
}
@@ -1272,6 +1271,30 @@ CMString CVkProto::GetAttachmentDescr(JSONNODE *pAttachments) int fromID = json_as_int(json_get(pWall, "from_id"));
res.AppendFormat(_T("%s: %s - http://vk.com/wall%d_%d"), TranslateT("Wall post"), ptszText ? ptszText : L" ", fromID, id);
}
+ else if (!lstrcmp(ptszType, _T("sticker"))) {
+ JSONNODE *pSticker = json_get(pAttach, "sticker");
+ if (pSticker == NULL) continue;
+ res.Empty(); // sticker is not really an attachment, so we don't want all that heading info
+
+ if (m_bStikersAsSmyles){
+ int id = json_as_int(json_get(pSticker, "id"));
+ res.AppendFormat(L"[sticker:%d]", id);
+ }
+ else {
+ ptrT ptszLink;
+ for (int i = 0; i < SIZEOF(szImageTypes); i++) {
+ JSONNODE *n = json_get(pSticker, szImageTypes[i]);
+ if (n != NULL) {
+ ptszLink = json_as_string(n);
+ break;
+ }
+ }
+ res.AppendFormat(L"%s", ptszLink);
+
+ if (m_bAddImgBbc)
+ res.AppendFormat(L"[img]%s[/img]", ptszLink);
+ }
+ }
else res.AppendFormat(TranslateT("Unsupported or unknown attachment type: %s"), ptszType);
res.AppendChar('\n');
|