summaryrefslogtreecommitdiff
path: root/options.cpp
diff options
context:
space:
mode:
authorSergey (Elzor) Bolhovskoy <elzor@foobar2000.ru>2010-04-08 19:46:22 +0600
committerSergey (Elzor) Bolhovskoy <elzor@foobar2000.ru>2010-04-08 19:46:22 +0600
commitc0245a95c2bbe2e83a5514e6652ce483a70122ee (patch)
tree1957eaacd6c0b825dd17759e35514f519b84d8ca /options.cpp
parentb63effd23d033036b6b07c16680d26636289ab53 (diff)
Add more options for ICQ protocol, auto remove useless messages from contact
Diffstat (limited to 'options.cpp')
-rw-r--r--options.cpp60
1 files changed, 58 insertions, 2 deletions
diff --git a/options.cpp b/options.cpp
index fabee4d..1a7c694 100644
--- a/options.cpp
+++ b/options.cpp
@@ -269,13 +269,27 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
SendDlgItemMessage(hwnd, ID_EXCLUDE, BM_SETCHECK, gbExclude ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(hwnd, ID_REMOVE_TMP, BM_SETCHECK, gbDelExcluded ? BST_CHECKED : BST_UNCHECKED, 0);
SendDlgItemMessage(hwnd, ID_IGNOREURL, BM_SETCHECK, gbIgnoreURL ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendDlgItemMessage(hwnd, IDC_AUTOAUTH, BM_SETCHECK, gbAutoAuth ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendDlgItemMessage(hwnd, IDC_ADDTOSRVLST, BM_SETCHECK, gbAutoAddToServerList ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendDlgItemMessage(hwnd, IDC_REQAUTH, BM_SETCHECK, gbAutoReqAuth ? BST_CHECKED : BST_UNCHECKED, 0);
+ SetDlgItemText(hwnd, IDC_AUTOADDGROUP, gbAutoAuthGroup.c_str());
}
return TRUE;
case WM_COMMAND:{
switch (LOWORD(wParam))
{
- case IDC_INVIS_DISABLE: case IDC_CASE_INSENSITIVE: case ID_DOS_INTEGRATION:
- case ID_SPECIALGROUPNAME: case ID_SPECIALGROUP: case ID_EXCLUDE: case ID_REMOVE_TMP: case ID_IGNOREURL:
+ case IDC_INVIS_DISABLE:
+ case IDC_CASE_INSENSITIVE:
+ case ID_DOS_INTEGRATION:
+ case ID_SPECIALGROUPNAME:
+ case ID_SPECIALGROUP:
+ case ID_EXCLUDE:
+ case ID_REMOVE_TMP:
+ case ID_IGNOREURL:
+ case IDC_AUTOAUTH:
+ case IDC_ADDTOSRVLST:
+ case IDC_REQAUTH:
+ case IDC_AUTOADDGROUP:
SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
break;
@@ -337,6 +351,48 @@ INT_PTR CALLBACK AdvancedDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar
BST_CHECKED == SendDlgItemMessage(hwnd, ID_REMOVE_TMP, BM_GETCHECK, 0, 0));
DBWriteContactSettingByte(NULL, pluginName, "IgnoreURL", gbIgnoreURL =
BST_CHECKED == SendDlgItemMessage(hwnd, ID_IGNOREURL, BM_GETCHECK, 0, 0));
+
+ DBWriteContactSettingByte(NULL, pluginName, "AutoAuth", gbAutoAuth =
+ BST_CHECKED == SendDlgItemMessage(hwnd, IDC_AUTOAUTH, BM_GETCHECK, 0, 0));
+ DBWriteContactSettingByte(NULL, pluginName, "AutoAddToServerList", gbAutoAddToServerList =
+ BST_CHECKED == SendDlgItemMessage(hwnd, IDC_ADDTOSRVLST, BM_GETCHECK, 0, 0));
+ DBWriteContactSettingByte(NULL, pluginName, "AutoReqAuth", gbAutoReqAuth =
+ BST_CHECKED == SendDlgItemMessage(hwnd, IDC_REQAUTH, BM_GETCHECK, 0, 0));
+ {
+ static tstring NewAGroupName, CurrentAGroupName;
+ NewAGroupName = GetDlgItemString(hwnd, IDC_AUTOADDGROUP);
+ CurrentAGroupName = gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL, pluginName, "AutoAuthGroup", _T("0"));
+ if(wcscmp(CurrentAGroupName.c_str(), NewAGroupName.c_str()) != 0)
+ {
+ int GroupNumber = 0;
+ BYTE GroupExist = 0;
+ TCHAR szValue[96] = {0};
+ char szNumber[32] = {0};
+ extern int CreateCListGroup(TCHAR* szGroupName);
+ strcpy(szNumber, "0");
+ while(strcmp(DBGetContactSettingStringPAN_A(NULL, "CListGroups", szNumber, "0").c_str(), "0") != 0)
+ {
+#if defined(_MSC_VER) && _MSC_VER >= 1300
+ _itoa_s(GroupNumber, szNumber, sizeof(szNumber), 10);
+#else
+ _itoa(GroupNumber, szNumber, 10);
+
+#endif
+ wcscpy(szValue, DBGetContactSettingStringPAN(NULL, "CListGroups", szNumber, _T("0")).c_str());
+ if(wcscmp(NewAGroupName.c_str(), szValue + 1) == 0)
+ {
+ GroupExist = 1;
+ break;
+ }
+ GroupNumber++;
+ }
+ DBWriteContactSettingTString(NULL,pluginName, "AutoAuthGroup", NewAGroupName.c_str());
+ gbAutoAuthGroup = DBGetContactSettingStringPAN(NULL,pluginName,"AutoAuthGroup", _T("Not Spammers"));
+ if(!GroupExist && gbAutoAddToServerList)
+ CreateCListGroup((TCHAR*)gbAutoAuthGroup.c_str());
+ }
+ }
+
}
return TRUE;
}