From 63f7ce43702041ddd8fff7fad46ebc2cc707e3f4 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 17 May 2012 17:55:09 +0000 Subject: add NewXstatusNotify mod git-svn-id: http://svn.miranda-ng.org/main/trunk@22 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewXstatusNotify/NewXstatusNotify.vcproj | 306 ----------------- plugins/NewXstatusNotify/NewXstatusNotify_10.sln | 26 -- .../NewXstatusNotify/NewXstatusNotify_10.vcxproj | 22 +- plugins/NewXstatusNotify/NewXstatusNotify_9.vcproj | 365 --------------------- plugins/NewXstatusNotify/common.h | 18 +- plugins/NewXstatusNotify/options.cpp | 46 +-- plugins/NewXstatusNotify/xstatus.h | 6 +- 7 files changed, 51 insertions(+), 738 deletions(-) delete mode 100644 plugins/NewXstatusNotify/NewXstatusNotify.vcproj delete mode 100644 plugins/NewXstatusNotify/NewXstatusNotify_10.sln delete mode 100644 plugins/NewXstatusNotify/NewXstatusNotify_9.vcproj (limited to 'plugins') diff --git a/plugins/NewXstatusNotify/NewXstatusNotify.vcproj b/plugins/NewXstatusNotify/NewXstatusNotify.vcproj deleted file mode 100644 index 4349e3c71e..0000000000 --- a/plugins/NewXstatusNotify/NewXstatusNotify.vcproj +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/NewXstatusNotify/NewXstatusNotify_10.sln b/plugins/NewXstatusNotify/NewXstatusNotify_10.sln deleted file mode 100644 index 7a420272c0..0000000000 --- a/plugins/NewXstatusNotify/NewXstatusNotify_10.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NewXstatusNotify", "NewXstatusNotify_10.vcxproj", "{78E0E6B0-2D7E-4B4D-899A-DA244FBBEC73}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug Unicode|x64 = Debug Unicode|x64 - Release Unicode|Win32 = Release Unicode|Win32 - Release Unicode|x64 = Release Unicode|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {78E0E6B0-2D7E-4B4D-899A-DA244FBBEC73}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {78E0E6B0-2D7E-4B4D-899A-DA244FBBEC73}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {78E0E6B0-2D7E-4B4D-899A-DA244FBBEC73}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {78E0E6B0-2D7E-4B4D-899A-DA244FBBEC73}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {78E0E6B0-2D7E-4B4D-899A-DA244FBBEC73}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {78E0E6B0-2D7E-4B4D-899A-DA244FBBEC73}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {78E0E6B0-2D7E-4B4D-899A-DA244FBBEC73}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {78E0E6B0-2D7E-4B4D-899A-DA244FBBEC73}.Release Unicode|x64.Build.0 = Release Unicode|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/plugins/NewXstatusNotify/NewXstatusNotify_10.vcxproj b/plugins/NewXstatusNotify/NewXstatusNotify_10.vcxproj index 37ef8fe327..e1f847cf07 100644 --- a/plugins/NewXstatusNotify/NewXstatusNotify_10.vcxproj +++ b/plugins/NewXstatusNotify/NewXstatusNotify_10.vcxproj @@ -20,7 +20,7 @@ NewXstatusNotify - {78E0E6B0-2D7E-4B4D-899A-DA244FBBEC73} + {D726A7E5-CF4C-4CF2-A2D3-073DECEC0260} NewStatusNotify @@ -68,16 +68,16 @@ <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)64/Plugins\ + ../../../Files/Release/Plugins\ + $(SolutionDir)$(Configuration)64\ $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + $(Configuration)64\ true true - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)64/Plugins\ + ../../../Files/Debug/Plugins\ + $(SolutionDir)$(Configuration)64\ $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + $(Configuration)64\ AllRules.ruleset AllRules.ruleset @@ -91,6 +91,7 @@ newxstatusnotify + newxstatusnotify @@ -114,7 +115,7 @@ ../../include;../../ExternalAPI true Sync - MultiThreadedDLL + MultiThreaded true @@ -145,7 +146,6 @@ $(IntDir)$(TargetName).lib MachineX86 - true @@ -169,7 +169,7 @@ ..\..\include\;%(AdditionalIncludeDirectories) true Sync - MultiThreadedDLL + MultiThreaded true @@ -192,6 +192,7 @@ /release %(AdditionalOptions) winmm.lib;comctl32.lib;%(AdditionalDependencies) NotSet + $(OutDir)$(TargetFileName) true %(AdditionalLibraryDirectories) @@ -289,6 +290,7 @@ comctl32.lib;winmm.lib;%(AdditionalDependencies) + $(OutDir)$(TargetFileName) true diff --git a/plugins/NewXstatusNotify/NewXstatusNotify_9.vcproj b/plugins/NewXstatusNotify/NewXstatusNotify_9.vcproj deleted file mode 100644 index ae4a1ddb88..0000000000 --- a/plugins/NewXstatusNotify/NewXstatusNotify_9.vcproj +++ /dev/null @@ -1,365 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/NewXstatusNotify/common.h b/plugins/NewXstatusNotify/common.h index 070bd2a15c..67892f1d72 100644 --- a/plugins/NewXstatusNotify/common.h +++ b/plugins/NewXstatusNotify/common.h @@ -92,15 +92,12 @@ #define GENDER_MALE 1 #define GENDER_FEMALE 2 -#define NOTIFY_INTERVAL_JABBER 2000 -#define NOTIFY_INTERVAL_ICQ 5000 - #define ID_STATUS_FROMOFFLINE 1 #define ID_STATUS_EXTRASTATUS 40081 #define ID_STATUS_MIN ID_STATUS_OFFLINE #define ID_STATUS_MAX ID_STATUS_OUTTOLUNCH -#define ID_STATUS_MAX2 ID_STATUS_EXTRASTATUS -#define STATUS_COUNT ID_STATUS_MAX2 - ID_STATUS_MIN + 1 +#define ID_STATUS_MAX2 ID_STATUS_EXTRASTATUS + 1 +#define STATUS_COUNT ID_STATUS_MAX2 - ID_STATUS_MIN #define Index(ID_STATUS) ID_STATUS - ID_STATUS_OFFLINE #define COLOR_BG_AVAILDEFAULT RGB(173,206,247) @@ -137,6 +134,15 @@ typedef struct tagPLUGINDATA HANDLE hAwayMsgHook; } PLUGINDATA; +typedef struct { + HANDLE hContact; + TCHAR *cust; + TCHAR *oldstatusmsg; + TCHAR *newstatusmsg; + char *proto; + int compare; +} STATUSMSGINFO; + /* HANDLE hContact = (HANDLE)wParam; WORD oldStatus = LOWORD(lParam); @@ -149,4 +155,6 @@ Cast them to (int) if you need them that way. #define MS_STATUSCHANGE_MENUCOMMAND "NewStatusNotify/EnableDisableMenuCommand" +#define TMR_CONNECTIONTIMEOUT 10000 + #endif //COMMON_H diff --git a/plugins/NewXstatusNotify/options.cpp b/plugins/NewXstatusNotify/options.cpp index 1c05e976a4..51cc48e432 100644 --- a/plugins/NewXstatusNotify/options.cpp +++ b/plugins/NewXstatusNotify/options.cpp @@ -29,7 +29,7 @@ OPTIONS opt = {0}; TEMPLATES templates = {0}; BOOL UpdateListFlag = FALSE; -SortedList *ProtoTamplates; +SortedList *ProtoTemplates; int LastItem = 0; extern HINSTANCE hInst; @@ -114,13 +114,13 @@ void SaveTemplates() DBWriteContactSettingTString(0, MODULE, "TLogOpening", templates.LogOpening); DBWriteContactSettingByte(0, MODULE, "TPopupFlags", templates.PopupFlags); DBWriteContactSettingByte(0, MODULE, "TLogFlags", templates.LogFlags); - for (int i = 0; i < ProtoTamplates->realCount; i++) + for (int i = 0; i < ProtoTemplates->realCount; i++) { - PROTOTAMPLATE *prototamplate = (PROTOTAMPLATE *)ProtoTamplates->items[i]; + PROTOTEMPLATE *prototemplate = (PROTOTEMPLATE *)ProtoTemplates->items[i]; TCHAR str[MAX_PATH]; - mir_sntprintf(str, SIZEOF(str), _T("%s_TSMChange"), prototamplate->ProtoName); + mir_sntprintf(str, SIZEOF(str), _T("%s_TSMChange"), prototemplate->ProtoName); char *szstr = mir_t2a(str); - DBWriteContactSettingTString(0, MODULE, szstr, prototamplate->ProtoTamplate); + DBWriteContactSettingTString(0, MODULE, szstr, prototemplate->ProtoTemplate); } } @@ -745,7 +745,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int count; PROTOACCOUNT** protos; ProtoEnumAccounts( &count, &protos ); - ProtoTamplates = li.List_Create(0, 10); + ProtoTemplates = li.List_Create(0, 10); for(int i=0;itszAccountName; lvItem.lParam = (LPARAM)protos[i]->szModuleName; - PROTOTAMPLATE *prototamplate = (PROTOTAMPLATE *)mir_alloc(sizeof(PROTOTAMPLATE)); - prototamplate->ProtoName = protos[i]->tszAccountName; + PROTOTEMPLATE *prototemplate = (PROTOTEMPLATE *)mir_alloc(sizeof(PROTOTEMPLATE)); + prototemplate->ProtoName = protos[i]->tszAccountName; TCHAR protoname[MAX_PATH] = {0}; mir_sntprintf(protoname, SIZEOF(protoname), _T("%s_TSMChange"), protos[i]->tszAccountName); char *szprotoname = mir_t2a(protoname); @@ -764,15 +764,15 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (lstrcmp(dbVar.ptszVal, NULL) == 0) { DBFreeVariant(&dbVar); - _tcsncpy(prototamplate->ProtoTamplate, TranslateT(DEFAULT_POPUP_STATUSMESSAGE), SIZEOF(prototamplate->ProtoTamplate)); + _tcsncpy(prototemplate->ProtoTemplate, TranslateT(DEFAULT_POPUP_STATUSMESSAGE), SIZEOF(prototemplate->ProtoTemplate)); } else { - _tcsncpy(prototamplate->ProtoTamplate, dbVar.ptszVal, SIZEOF(prototamplate->ProtoTamplate)); + _tcsncpy(prototemplate->ProtoTemplate, dbVar.ptszVal, SIZEOF(prototemplate->ProtoTemplate)); } mir_free(szprotoname); ListView_InsertItem(hList,&lvItem); - li.List_Insert(ProtoTamplates, prototamplate, ProtoTamplates->realCount); + li.List_Insert(ProtoTemplates, prototemplate, ProtoTemplates->realCount); char dbSetting[128]; mir_snprintf(dbSetting, SIZEOF(dbSetting), "%s_enabled", protos[i]->szModuleName); @@ -824,18 +824,18 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA if (nmlv->uNewState == 3 && !UpdateListFlag) { HWND hList = GetDlgItem(hwndDlg,IDC_PROTOCOLLIST); - PROTOTAMPLATE *prototamplate; + PROTOTEMPLATE *prototemplate; if (ListView_GetHotItem(hList) != ListView_GetSelectionMark(hList)) { - prototamplate = (PROTOTAMPLATE *)ProtoTamplates->items[ListView_GetSelectionMark(hList)]; - GetDlgItemText(hwndDlg, IDC_POPUPTEXT, prototamplate->ProtoTamplate, MAX_PATH); - li.List_Remove(ProtoTamplates, ListView_GetSelectionMark(hList)); - li.List_Insert(ProtoTamplates, prototamplate, ListView_GetSelectionMark(hList)); + prototemplate = (PROTOTEMPLATE *)ProtoTemplates->items[ListView_GetSelectionMark(hList)]; + GetDlgItemText(hwndDlg, IDC_POPUPTEXT, prototemplate->ProtoTemplate, MAX_PATH); + li.List_Remove(ProtoTemplates, ListView_GetSelectionMark(hList)); + li.List_Insert(ProtoTemplates, prototemplate, ListView_GetSelectionMark(hList)); } LastItem = ListView_GetHotItem(hList); - prototamplate = (PROTOTAMPLATE *)ProtoTamplates->items[LastItem]; - SetDlgItemText(hwndDlg, IDC_POPUPTEXT, prototamplate->ProtoTamplate); + prototemplate = (PROTOTEMPLATE *)ProtoTemplates->items[LastItem]; + SetDlgItemText(hwndDlg, IDC_POPUPTEXT, prototemplate->ProtoTemplate); } if ((nmlv->uNewState^nmlv->uOldState)&LVIS_STATEIMAGEMASK && !UpdateListFlag) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); @@ -849,10 +849,10 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA opt.PopupOnConnect = IsDlgButtonChecked(hwndDlg, IDC_ONCONNECT); // Templates - PROTOTAMPLATE *prototamplate = (PROTOTAMPLATE *)ProtoTamplates->items[LastItem]; - GetDlgItemText(hwndDlg, IDC_POPUPTEXT, prototamplate->ProtoTamplate, MAX_PATH); - li.List_Remove(ProtoTamplates, LastItem); - li.List_Insert(ProtoTamplates, prototamplate, LastItem); + PROTOTEMPLATE *prototemplate = (PROTOTEMPLATE *)ProtoTemplates->items[LastItem]; + GetDlgItemText(hwndDlg, IDC_POPUPTEXT, prototemplate->ProtoTemplate, MAX_PATH); + li.List_Remove(ProtoTemplates, LastItem); + li.List_Insert(ProtoTemplates, prototemplate, LastItem); // Save options to db SaveOptions(); @@ -876,7 +876,7 @@ INT_PTR CALLBACK DlgProcSMPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_DESTROY: { - li.List_Destroy(ProtoTamplates); + li.List_Destroy(ProtoTemplates); break; } diff --git a/plugins/NewXstatusNotify/xstatus.h b/plugins/NewXstatusNotify/xstatus.h index a26b5fbc60..d5a76acb52 100644 --- a/plugins/NewXstatusNotify/xstatus.h +++ b/plugins/NewXstatusNotify/xstatus.h @@ -90,11 +90,11 @@ typedef struct tagDBEVENT HANDLE hDBEvent; } DBEVENT; -typedef struct tagPROTOTAMPLATE +typedef struct tagPROTOTEMPLATE { TCHAR *ProtoName; - TCHAR ProtoTamplate[MAX_PATH]; -} PROTOTAMPLATE; + TCHAR ProtoTemplate[MAX_PATH]; +} PROTOTEMPLATE; TCHAR *GetDefaultXstatusName(int statusID, char *szProto, TCHAR *buff, int bufflen); XSTATUSCHANGE *NewXSC(HANDLE hContact, char *szProto, int xstatusType, int action, TCHAR *stzTitle, TCHAR *stzText); -- cgit v1.2.3