summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-01-30 19:00:30 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-01-30 19:00:30 +0300
commitca1b8a4ec3a67600723ce5a4e0836889d6925dbe (patch)
tree7028dea4696d8aaeaa5b0dd6fb7f9be30bb83a43
parentb362935f54084acecfe8f8a1f60a1fa18ac46d66 (diff)
SMS plugin deprecated due to missing sms support in ICQ-WIM
-rw-r--r--bin15/mir_full.sln10
-rw-r--r--plugins/PluginUpdater/src/DlgUpdate.cpp1
-rw-r--r--plugins/SMS/res/SMSNOTSENT.icobin1150 -> 0 bytes
-rw-r--r--plugins/SMS/res/SMSSENT.icobin1150 -> 0 bytes
-rw-r--r--plugins/SMS/res/Version.rc9
-rw-r--r--plugins/SMS/res/halftick.icobin1150 -> 0 bytes
-rw-r--r--plugins/SMS/res/resource.rc239
-rw-r--r--plugins/SMS/sms.vcxproj31
-rw-r--r--plugins/SMS/sms.vcxproj.filters4
-rw-r--r--plugins/SMS/src/AdditionalFunctions/InterlockedFunctions.h119
-rw-r--r--plugins/SMS/src/AdditionalFunctions/ListMT.h288
-rw-r--r--plugins/SMS/src/AdditionalFunctions/MemoryCompare.h32
-rw-r--r--plugins/SMS/src/AdditionalFunctions/MemoryFindByte.h13
-rw-r--r--plugins/SMS/src/SMSConstans.h87
-rw-r--r--plugins/SMS/src/SMS_svc.cpp124
-rw-r--r--plugins/SMS/src/functions.cpp517
-rw-r--r--plugins/SMS/src/main.cpp130
-rw-r--r--plugins/SMS/src/options.cpp101
-rw-r--r--plugins/SMS/src/receive.cpp272
-rw-r--r--plugins/SMS/src/recvdlg.cpp246
-rw-r--r--plugins/SMS/src/recvdlg.h11
-rw-r--r--plugins/SMS/src/resource.h70
-rw-r--r--plugins/SMS/src/send.cpp82
-rw-r--r--plugins/SMS/src/senddlg.cpp1084
-rw-r--r--plugins/SMS/src/senddlg.h36
-rw-r--r--plugins/SMS/src/stdafx.cxx18
-rw-r--r--plugins/SMS/src/stdafx.h127
-rw-r--r--plugins/SMS/src/version.h13
-rw-r--r--src/mir_app/src/newplugins.cpp1
29 files changed, 2 insertions, 3663 deletions
diff --git a/bin15/mir_full.sln b/bin15/mir_full.sln
index 1a372e49e2..3c3bc49d73 100644
--- a/bin15/mir_full.sln
+++ b/bin15/mir_full.sln
@@ -289,8 +289,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_blind", "..\plugins\C
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StartPosition", "..\plugins\StartPosition\StartPosition.vcxproj", "{046C5F80-ABE5-488F-BFC8-B024D4AACC8C}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SMS", "..\plugins\SMS\sms.vcxproj", "{A3EA507E-C77E-4966-9AEE-51442AF96E4D}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HTTPServer", "..\plugins\HTTPServer\HTTPServer_15.vcxproj", "{F7A70398-AFA0-4A58-B645-85268F9517DE}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pu_stub", "..\plugins\PluginUpdater\pu_stub\pu_stub_15.vcxproj", "{121D2EA6-9D3C-43F6-AC5C-44BDBF93E3E0}"
@@ -1461,14 +1459,6 @@ Global
{046C5F80-ABE5-488F-BFC8-B024D4AACC8C}.Release|Win32.Build.0 = Release|Win32
{046C5F80-ABE5-488F-BFC8-B024D4AACC8C}.Release|x64.ActiveCfg = Release|x64
{046C5F80-ABE5-488F-BFC8-B024D4AACC8C}.Release|x64.Build.0 = Release|x64
- {A3EA507E-C77E-4966-9AEE-51442AF96E4D}.Debug|Win32.ActiveCfg = Debug|Win32
- {A3EA507E-C77E-4966-9AEE-51442AF96E4D}.Debug|Win32.Build.0 = Debug|Win32
- {A3EA507E-C77E-4966-9AEE-51442AF96E4D}.Debug|x64.ActiveCfg = Debug|x64
- {A3EA507E-C77E-4966-9AEE-51442AF96E4D}.Debug|x64.Build.0 = Debug|x64
- {A3EA507E-C77E-4966-9AEE-51442AF96E4D}.Release|Win32.ActiveCfg = Release|Win32
- {A3EA507E-C77E-4966-9AEE-51442AF96E4D}.Release|Win32.Build.0 = Release|Win32
- {A3EA507E-C77E-4966-9AEE-51442AF96E4D}.Release|x64.ActiveCfg = Release|x64
- {A3EA507E-C77E-4966-9AEE-51442AF96E4D}.Release|x64.Build.0 = Release|x64
{F7A70398-AFA0-4A58-B645-85268F9517DE}.Debug|Win32.ActiveCfg = Debug|Win32
{F7A70398-AFA0-4A58-B645-85268F9517DE}.Debug|Win32.Build.0 = Debug|Win32
{F7A70398-AFA0-4A58-B645-85268F9517DE}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp
index 8e819ac353..4698402af9 100644
--- a/plugins/PluginUpdater/src/DlgUpdate.cpp
+++ b/plugins/PluginUpdater/src/DlgUpdate.cpp
@@ -575,6 +575,7 @@ static renameTable[] =
{ L"modernopt.dll", nullptr },
{ L"msvcp100.dll", nullptr },
{ L"msvcr100.dll", nullptr },
+ { L"sms.dll", nullptr },
{ L"tlen.dll", nullptr },
{ L"whatsapp.dll", nullptr },
{ L"xfire.dll", nullptr },
diff --git a/plugins/SMS/res/SMSNOTSENT.ico b/plugins/SMS/res/SMSNOTSENT.ico
deleted file mode 100644
index 38cf3561eb..0000000000
--- a/plugins/SMS/res/SMSNOTSENT.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/SMS/res/SMSSENT.ico b/plugins/SMS/res/SMSSENT.ico
deleted file mode 100644
index 2a117b7511..0000000000
--- a/plugins/SMS/res/SMSSENT.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/SMS/res/Version.rc b/plugins/SMS/res/Version.rc
deleted file mode 100644
index 5a5ddd63ed..0000000000
--- a/plugins/SMS/res/Version.rc
+++ /dev/null
@@ -1,9 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#ifdef APSTUDIO_INVOKED
-#error this file is not editable by Microsoft Visual C++
-#endif //APSTUDIO_INVOKED
-
-#include "..\src\version.h"
-
-#include "..\..\build\Version.rc"
diff --git a/plugins/SMS/res/halftick.ico b/plugins/SMS/res/halftick.ico
deleted file mode 100644
index a867aaab87..0000000000
--- a/plugins/SMS/res/halftick.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/SMS/res/resource.rc b/plugins/SMS/res/resource.rc
deleted file mode 100644
index 61bcb6b2b8..0000000000
--- a/plugins/SMS/res/resource.rc
+++ /dev/null
@@ -1,239 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "..\src\resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Neutral resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
-#ifdef _WIN32
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-#pragma code_page(1251)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_SMSNOTSENT ICON "SMSNOTSENT.ico"
-IDI_SMSSENT ICON "SMSSENT.ico"
-IDI_HALFTICK ICON "halftick.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_RECVSMS DIALOGEX 0, 0, 278, 126
-STYLE DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
-CAPTION "Received SMS"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- EDITTEXT IDC_MESSAGE,3,29,271,76,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | ES_WANTRETURN | WS_VSCROLL,WS_EX_CLIENTEDGE
- DEFPUSHBUTTON "&Reply",IDOK,83,108,50,14
- PUSHBUTTON "&Close",IDCANCEL,143,108,50,14
- PUSHBUTTON "Read Next",IDC_READNEXT,217,105,57,17,NOT WS_VISIBLE
- LTEXT "From:",IDC_STATIC,3,6,19,11
- LTEXT "Message received:",IDC_STATIC,3,20,108,8
- LTEXT "",IDC_NAME,24,5,105,11,SS_SUNKEN
- LTEXT "Number:",IDC_ST_NUMBER,133,6,28,11
- LTEXT "",IDC_NUMBER,164,5,110,11,SS_SUNKEN
-END
-
-IDD_SENDSMS DIALOGEX 0, 0, 394, 145
-STYLE DS_SETFONT | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
-CAPTION "Send SMS"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- LTEXT "To:",IDC_ST_TO,2,5,18,8
- COMBOBOX IDC_NAME,20,3,111,12,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
- RTEXT "Number:",IDC_ST_ADDRESS,134,5,30,8
- COMBOBOX IDC_ADDRESS,164,3,113,62,CBS_DROPDOWN | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "Add number to list",IDC_ADDNUMBER,284,3,108,14
- CONTROL "Tree1",IDC_NUMBERSLIST,"SysTreeView32",TVS_HASBUTTONS | TVS_LINESATROOT | TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_TRACKSELECT | TVS_FULLROWSELECT | WS_BORDER | WS_HSCROLL | WS_TABSTOP,284,17,108,109
- PUSHBUTTON "&H",IDC_HISTORY,2,17,15,11,BS_ICON
- COMBOBOX IDC_ACCOUNTS,20,18,72,83,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "Save number",IDC_SAVENUMBER,133,17,46,11
- PUSHBUTTON "Multiple >>",IDC_MULTIPLE,232,17,45,11
- LTEXT "Enter message:",IDC_ST_ENTERMESSAGE,2,32,76,9
- RTEXT "Chars:",IDC_ST_CHARS,207,32,34,8
- RTEXT "",IDC_COUNT,242,32,35,8,SS_NOPREFIX | SS_SUNKEN
- EDITTEXT IDC_MESSAGE,2,42,275,84,ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL,WS_EX_CLIENTEDGE
- DEFPUSHBUTTON "&Send",IDOK,73,130,50,14
- PUSHBUTTON "&Close",IDCANCEL,143,130,50,14
-END
-
-IDD_SENDSMSTIMEDOUT DIALOG 0, 0, 211, 94
-STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION "SMS Message Didn't Send"
-FONT 8, "MS Shell Dlg"
-BEGIN
- DEFPUSHBUTTON "&Try again",IDOK,39,73,62,16
- PUSHBUTTON "&Cancel",IDCANCEL,106,73,62,16
- LTEXT "The SMS message send timed out",IDC_STATUS,5,6,201,61
-END
-
-IDD_OPT_SMSPLUGIN DIALOGEX 0, 0, 255, 161
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- GROUPBOX "SMS Plugin",IDC_STATIC,6,4,244,150
- GROUPBOX "",IDC_SIGNGROUP,12,28,231,74,WS_GROUP
- EDITTEXT IDC_SIGNATURE,17,40,221,44,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
- CONTROL "Beginning",IDC_BEGIN,"Button",BS_AUTORADIOBUTTON | WS_GROUP,115,90,65,8
- CONTROL "End",IDC_END,"Button",BS_AUTORADIOBUTTON,180,90,58,8
- LTEXT "Put signature at the:",IDC_STATIC,18,90,89,10
- CONTROL "Use Signature",IDC_USESIGNATURE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,21,226,10
- CONTROL "Show server notifications",IDC_SHOWACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,108,226,10
- CONTROL "Auto popup on new message",IDC_AUTOPOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,120,226,10
- CONTROL "Save window position per contact",IDC_SAVEWINPOS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,132,226,10
-END
-
-IDD_SENDSMSACCEPT DIALOG 0, 0, 256, 90
-STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-CAPTION "SMS Message Sent"
-FONT 8, "MS Shell Dlg"
-BEGIN
- PUSHBUTTON "&OK",IDOK,91,69,62,16
- LTEXT "",IDC_MESSAGEID,57,6,194,9
- LTEXT "Message ID:",IDC_ST_MESSAGEID,5,6,52,8
- LTEXT "Source:",IDC_ST_SOURCE,5,27,52,8
- LTEXT "",IDC_SOURCE,57,27,194,39
- LTEXT "Network:",IDC_ST_NETWORK,5,17,52,8
- LTEXT "",IDC_NETWORK,57,17,194,10
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_RECVSMS, DIALOG
- BEGIN
- LEFTMARGIN, 3
- RIGHTMARGIN, 274
- TOPMARGIN, 5
- BOTTOMMARGIN, 122
- HORZGUIDE, 16
- HORZGUIDE, 29
- HORZGUIDE, 105
- END
-
- IDD_SENDSMS, DIALOG
- BEGIN
- LEFTMARGIN, 2
- RIGHTMARGIN, 392
- VERTGUIDE, 164
- VERTGUIDE, 277
- VERTGUIDE, 284
- TOPMARGIN, 3
- BOTTOMMARGIN, 144
- HORZGUIDE, 17
- HORZGUIDE, 28
- HORZGUIDE, 32
- HORZGUIDE, 51
- HORZGUIDE, 111
- HORZGUIDE, 126
- HORZGUIDE, 130
- END
-
- IDD_SENDSMSTIMEDOUT, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 206
- TOPMARGIN, 6
- BOTTOMMARGIN, 89
- END
-
- IDD_OPT_SMSPLUGIN, DIALOG
- BEGIN
- RIGHTMARGIN, 250
- VERTGUIDE, 6
- VERTGUIDE, 12
- VERTGUIDE, 18
- VERTGUIDE, 115
- VERTGUIDE, 180
- VERTGUIDE, 238
- VERTGUIDE, 243
- VERTGUIDE, 248
- BOTTOMMARGIN, 150
- HORZGUIDE, 84
- HORZGUIDE, 90
- HORZGUIDE, 95
- HORZGUIDE, 107
- HORZGUIDE, 116
- END
-
- IDD_SENDSMSACCEPT, DIALOG
- BEGIN
- LEFTMARGIN, 5
- RIGHTMARGIN, 251
- VERTGUIDE, 57
- TOPMARGIN, 6
- BOTTOMMARGIN, 85
- HORZGUIDE, 14
- HORZGUIDE, 17
- HORZGUIDE, 27
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "..\\src\\resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // Neutral resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/plugins/SMS/sms.vcxproj b/plugins/SMS/sms.vcxproj
deleted file mode 100644
index 49466f89eb..0000000000
--- a/plugins/SMS/sms.vcxproj
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectName>SMS</ProjectName>
- <ProjectGuid>{A3EA507E-C77E-4966-9AEE-51442AF96E4D}</ProjectGuid>
- </PropertyGroup>
- <ImportGroup Label="PropertySheets">
- <Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" />
- </ImportGroup>
- <ItemGroup>
- <ClInclude Include="src\AdditionalFunctions\*.h" />
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/plugins/SMS/sms.vcxproj.filters b/plugins/SMS/sms.vcxproj.filters
deleted file mode 100644
index de5ad9f66c..0000000000
--- a/plugins/SMS/sms.vcxproj.filters
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(ProjectDir)..\..\build\vc.common\common.filters" />
-</Project> \ No newline at end of file
diff --git a/plugins/SMS/src/AdditionalFunctions/InterlockedFunctions.h b/plugins/SMS/src/AdditionalFunctions/InterlockedFunctions.h
deleted file mode 100644
index d0f0dfcbc5..0000000000
--- a/plugins/SMS/src/AdditionalFunctions/InterlockedFunctions.h
+++ /dev/null
@@ -1,119 +0,0 @@
-#if !defined(AFX_INTERLOCKED_FUNCTIONS__H__INCLUDED_)
-#define AFX_INTERLOCKED_FUNCTIONS__H__INCLUDED_
-
-#ifdef InterlockedCompareExchange
-#ifndef InterlockedAnd
-LONG FORCEINLINE InterlockedAnd(LONG volatile *Destination,LONG Value)
-{
- LONG Old;
-
- do
- {
- Old=*Destination;
- }while(InterlockedCompareExchange(Destination,(Old&Value),Old)!=Old);
-return(Old);
-}
-#endif //InterlockedAnd
-
-
-#ifndef InterlockedOr
-LONG FORCEINLINE InterlockedOr(LONG volatile *Destination,LONG Value)
-{
- LONG Old;
-
- do
- {
- Old=*Destination;
- }while(InterlockedCompareExchange(Destination,(Old|Value),Old)!=Old);
-return(Old);
-}
-#endif //InterlockedOr
-
-
-#ifndef InterlockedXor
-LONG FORCEINLINE InterlockedXor(LONG volatile *Destination,LONG Value)
-{
- LONG Old;
-
- do
- {
- Old=*Destination;
- }while(InterlockedCompareExchange(Destination,(Old^Value),Old)!=Old);
-return(Old);
-}
-#endif //InterlockedXor
-#endif //InterlockedCompareExchange
-
-
-
-
-
-#ifdef InterlockedCompareExchange64
-#ifndef InterlockedAnd64
-LONGLONG FORCEINLINE InterlockedAnd64(LONGLONG volatile *Destination,LONGLONG Value)
-{
- LONGLONG Old;
-
- do
- {
- Old=*Destination;
- }while(InterlockedCompareExchange64(Destination,(Old&Value),Old)!=Old);
-return(Old);
-}
-#endif //InterlockedAnd64
-
-
-#ifndef InterlockedOr64
-LONGLONG FORCEINLINE InterlockedOr64(LONGLONG volatile *Destination,LONGLONG Value)
-{
- LONGLONG Old;
-
- do
- {
- Old=*Destination;
- }while(InterlockedCompareExchange64(Destination,(Old|Value),Old)!=Old);
-return(Old);
-}
-#endif //InterlockedOr64
-
-
-#ifndef InterlockedXor64
-LONGLONG FORCEINLINE InterlockedXor64(LONGLONG volatile *Destination,LONGLONG Value)
-{
- LONGLONG Old;
-
- do
- {
- Old=*Destination;
- }while(InterlockedCompareExchange64(Destination,(Old^Value),Old)!=Old);
-return(Old);
-}
-#endif //InterlockedXor64
-#endif //InterlockedCompareExchange64
-
-
-
-
-
-#ifndef InterlockedIncrementPointer
-#if defined(_WIN64)
-#define InterlockedIncrementPointer(lpAddend) (LPVOID)InterlockedIncrement64((LONGLONG volatile*)lpAddend)
-#else
-#define InterlockedIncrementPointer(lpAddend) (LPVOID)InterlockedIncrement((LONG volatile*)lpAddend)
-#endif
-#endif //InterlockedIncrementPointer
-
-
-#ifndef InterlockedDecrementPointer
-#if defined(_WIN64)
-#define InterlockedDecrementPointer(lpAddend) (LPVOID)InterlockedDecrement64((LONGLONG volatile*)lpAddend)
-#else
-#define InterlockedDecrementPointer(lpAddend) (LPVOID)InterlockedDecrement((LONG volatile*)lpAddend)
-#endif
-#endif //InterlockedDecrementPointer
-
-
-
-
-
-#endif // !defined(AFX_INTERLOCKED_FUNCTIONS__H__INCLUDED_)
diff --git a/plugins/SMS/src/AdditionalFunctions/ListMT.h b/plugins/SMS/src/AdditionalFunctions/ListMT.h
deleted file mode 100644
index 964ea5d09f..0000000000
--- a/plugins/SMS/src/AdditionalFunctions/ListMT.h
+++ /dev/null
@@ -1,288 +0,0 @@
-#if !defined(AFX_LIST_MT__H__INCLUDED_)
-#define AFX_LIST_MT__H__INCLUDED_
-
-// структура для работы со списком, элемент списка
-typedef struct _LIST_MT_ITEM
-{
-#ifdef __cplusplus
- _LIST_MT_ITEM *plmtiPrev; // *предыдущий элемент в списке
- _LIST_MT_ITEM *plmtiNext; // *следующий элемент в списке
-#else
- LPVOID *plmtiPrev; // *предыдущий элемент в списке
- LPVOID *plmtiNext; // *следующий элемент в списке
-#endif
- LPVOID lpData; // указатель на данные, связанные с элементом списка
- LPVOID lpListMT; // указатель на заголовок списка, см структуру ниже
-}LIST_MT_ITEM, *PLIST_MT_ITEM, *LPLIST_MT_ITEM;
-typedef CONST PLIST_MT_ITEM PCLIST_MT_ITEM, LPCLIST_MT_ITEM;
-
-
-// структура для работы со списком, заголовок списка
-typedef struct _LIST_MT
-{
- size_t nCount; // *колличество элементов в списке
- PLIST_MT_ITEM plmtiFirst; // *указывает на первый элемент в списке
- PLIST_MT_ITEM plmtiLast; // *указывает на последний элемент в списке
- CRITICAL_SECTION cs; // *section for exclysive access to List
-}LIST_MT, *PLIST_MT, *LPLIST_MT;
-typedef CONST PLIST_MT PCLIST_MT, LPCLIST_MT;
-
-
-// структура для работы с итератором
-typedef struct _LIST_MT_ITERATOR
-{
- PLIST_MT_ITEM plmtListMTItem;
-}LIST_MT_ITERATOR, *PLIST_MT_ITERATOR, *LPLIST_MT_ITERATOR;
-//typedef LIST_MT_ITEM LIST_MT_ITERATOR, *PLIST_MT_ITERATOR, *LPLIST_MT_ITERATOR;
-typedef CONST PLIST_MT_ITERATOR PCLIST_MT_ITERATOR, LPCLIST_MT_ITERATOR;
-
-
-
-
-__inline DWORD ListMTInitialize(PCLIST_MT pclmtListMT,DWORD dwSpinCount)
-{
- DWORD dwRetErrorCode;
-
- if (InitializeCriticalSectionAndSpinCount(&pclmtListMT->cs,((dwSpinCount)? (dwSpinCount | 0x80000000):0L)))
- {
- InterlockedExchangePointer((volatile PVOID*)&pclmtListMT->nCount,NULL);
- pclmtListMT->plmtiFirst=NULL;
- pclmtListMT->plmtiLast=NULL;
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=GetLastError();
- }
-return(dwRetErrorCode);
-}
-
-
-__inline void ListMTDestroy(PCLIST_MT pclmtListMT)
-{
- InterlockedExchangePointer((volatile PVOID*)&pclmtListMT->nCount,NULL);
- pclmtListMT->plmtiFirst=NULL;
- pclmtListMT->plmtiLast=NULL;
- DeleteCriticalSection(&pclmtListMT->cs);
-}
-
-
-__inline BOOL ListMTTryLock(PCLIST_MT pclmtListMT)
-{
- return(TryEnterCriticalSection(&pclmtListMT->cs));
-}
-
-
-__inline void ListMTLock(PCLIST_MT pclmtListMT)
-{
- EnterCriticalSection(&pclmtListMT->cs);
-}
-
-
-__inline void ListMTUnLock(PCLIST_MT pclmtListMT)
-{
- LeaveCriticalSection(&pclmtListMT->cs);
-}
-
-
-__inline size_t ListMTGetCount(PCLIST_MT pclmtListMT)
-{
- return((size_t)InterlockedCompareExchangePointer((LPVOID*)&pclmtListMT->nCount,NULL,NULL));
-}
-
-
-__inline size_t ListMTItemAdd(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem,LPVOID lpData)
-{
- size_t dwRet=(size_t)InterlockedIncrementPointer(&pclmtListMT->nCount);//pclmtListMT->nCount++;
- pclmtListMTItem->lpData=lpData;
- pclmtListMTItem->lpListMT=pclmtListMT;
-
- if (pclmtListMT->plmtiLast)
- {// add node to end of list
- pclmtListMTItem->plmtiPrev=pclmtListMT->plmtiLast;
- pclmtListMTItem->plmtiNext=NULL;
- pclmtListMT->plmtiLast->plmtiNext=pclmtListMTItem;
- pclmtListMT->plmtiLast=pclmtListMTItem;
- }else{// add the first node to the linked list
- pclmtListMTItem->plmtiPrev=NULL;
- pclmtListMTItem->plmtiNext=NULL;
- pclmtListMT->plmtiFirst=pclmtListMTItem;
- pclmtListMT->plmtiLast=pclmtListMTItem;
- }
-
-return(dwRet);
-}
-
-
-__inline DWORD ListMTItemDelete(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem)
-{
- DWORD dwRetErrorCode;
-
- if (pclmtListMTItem->lpListMT==pclmtListMT && pclmtListMT)
- {// Данный элемент принадлежит к этому списку, можно удалить.
- PLIST_MT_ITEM plmtiPrevNode=pclmtListMTItem->plmtiPrev,plmtiNextNode=pclmtListMTItem->plmtiNext;
-
- if (plmtiPrevNode || plmtiNextNode)
- {
- if (plmtiPrevNode && plmtiNextNode==NULL)
- {// This is the start node in the list to delete
- // отключился последний подключившийся
- plmtiPrevNode->plmtiNext=NULL;
- pclmtListMT->plmtiLast=plmtiPrevNode;
- }else{
- if (plmtiPrevNode==NULL && plmtiNextNode)
- {// This is the end node in the list to delete
- // отключился первый подключившийся
- plmtiNextNode->plmtiPrev=NULL;
- pclmtListMT->plmtiFirst=plmtiNextNode;
- }else{// оключился клиент не первый и не последний
- //if (plmtiPrev && plmtiNext)
- {// Neither start node nor end node in the list
- plmtiPrevNode->plmtiNext=plmtiNextNode;
- plmtiNextNode->plmtiPrev=plmtiPrevNode;
- }
- }
- }
- }else{// This is the only node in the list to delete
- pclmtListMT->plmtiFirst=NULL;
- pclmtListMT->plmtiLast=NULL;
- }
-
- pclmtListMTItem->lpListMT=NULL;
- InterlockedDecrementPointer(&pclmtListMT->nCount);// pclmtListMT->nCount--;
- dwRetErrorCode=NO_ERROR;
- }else{// попытались удалить элемент не относящийся к данному списку
- dwRetErrorCode=ERROR_INVALID_HANDLE;
- }
-return(dwRetErrorCode);
-}
-
-
-__inline LPVOID ListMTItemDataGet(PCLIST_MT_ITEM pclmtListMTItem)
-{
- return(pclmtListMTItem->lpData);
-}
-
-
-__inline void ListMTItemDataSet(PCLIST_MT_ITEM pclmtListMTItem, LPVOID lpData)
-{
- pclmtListMTItem->lpData=lpData;
-}
-
-
-__inline DWORD ListMTItemGetFirst(PCLIST_MT pclmtListMT,PLIST_MT_ITEM *pplmtListMTItem,LPVOID *plpData)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- DWORD dwRetErrorCode;
-
- if (pclmtListMT->plmtiFirst)
- {
- if (pplmtListMTItem) (*pplmtListMTItem)=pclmtListMT->plmtiFirst;
- if (plpData) (*plpData)=pclmtListMT->plmtiFirst->lpData;
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_NO_MORE_ITEMS;
- }
-return(dwRetErrorCode);
-}
-
-
-__inline DWORD ListMTItemGetLast(PCLIST_MT pclmtListMT,PLIST_MT_ITEM *pplmtListMTItem,LPVOID *plpData)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- DWORD dwRetErrorCode;
-
- if (pclmtListMT->plmtiLast)
- {
- if (pplmtListMTItem) (*pplmtListMTItem)=pclmtListMT->plmtiLast;
- if (plpData) (*plpData)=pclmtListMT->plmtiLast->lpData;
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_NO_MORE_ITEMS;
- }
-return(dwRetErrorCode);
-}
-
-
-
-__inline void ListMTItemSwap(PCLIST_MT pclmtListMT,PCLIST_MT_ITEM pclmtListMTItem1,PCLIST_MT_ITEM pclmtListMTItem2)
-{// поменять два элемента списка местами, даже если они из разных списков
-
- if (pclmtListMTItem1!=pclmtListMTItem2)
- {// это разные элементы списка
- PLIST_MT_ITEM lpTemp;
-
- lpTemp=pclmtListMTItem1->plmtiPrev;
- if ((pclmtListMTItem1->plmtiPrev=pclmtListMTItem2->plmtiPrev)==NULL)
- {// pclmtListMTItem2 был первым, обновляем заголвок листа, теперь первый pclmtListMTItem1
- pclmtListMT->plmtiFirst=pclmtListMTItem1;
- }
-
- if ((pclmtListMTItem2->plmtiPrev=lpTemp)==NULL)
- {// pclmtListMTItem1 был первым, обновляем заголвок листа, теперь первый pclmtListMTItem2
- pclmtListMT->plmtiFirst=pclmtListMTItem2;
- }
-
-
- lpTemp=pclmtListMTItem1->plmtiNext;
- if ((pclmtListMTItem1->plmtiNext=pclmtListMTItem2->plmtiNext)==NULL)
- {// pclmtListMTItem2 был последним, обновляем заголвок листа, теперь последний pclmtListMTItem1
- pclmtListMT->plmtiLast=pclmtListMTItem1;
- }
-
- if ((pclmtListMTItem2->plmtiNext=lpTemp)==NULL)
- {// pclmtListMTItem1 был последним, обновляем заголвок листа, теперь последний pclmtListMTItem2
- pclmtListMT->plmtiLast=pclmtListMTItem2;
- }
- }
-}
-
-
-__inline BOOL ListMTIteratorMoveFirst(PCLIST_MT pclmtListMT,PCLIST_MT_ITERATOR pclmtiIterator)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- return((pclmtiIterator->plmtListMTItem=pclmtListMT->plmtiFirst)? TRUE:FALSE);
-}
-
-
-__inline BOOL ListMTIteratorMoveLast(PCLIST_MT pclmtListMT,PCLIST_MT_ITERATOR pclmtiIterator)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- return((pclmtiIterator->plmtListMTItem=pclmtListMT->plmtiLast)? TRUE:FALSE);
-}
-
-
-__inline BOOL ListMTIteratorMovePrev(PCLIST_MT_ITERATOR pclmtiIterator)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- BOOL bRet=FALSE;
-
- if (pclmtiIterator->plmtListMTItem)
- {
- if (pclmtiIterator->plmtListMTItem=pclmtiIterator->plmtListMTItem->plmtiPrev) bRet=TRUE;
- }
-return(bRet);
-}
-
-
-__inline BOOL ListMTIteratorMoveNext(PCLIST_MT_ITERATOR pclmtiIterator)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- BOOL bRet=FALSE;
-
- if (pclmtiIterator->plmtListMTItem)
- {
- if (pclmtiIterator->plmtListMTItem=pclmtiIterator->plmtListMTItem->plmtiNext) bRet=TRUE;
- }
-return(bRet);
-}
-
-
-__inline DWORD ListMTIteratorGet(PCLIST_MT_ITERATOR pclmtiIterator,PLIST_MT_ITEM *pplmtListMTItem,LPVOID *plpData)
-{// если нужно гарантировать эксклюзивный доступ, то есть ListMTLock и ListMTUnLock
- DWORD dwRetErrorCode;
-
- if (pclmtiIterator->plmtListMTItem)
- {
- if (pplmtListMTItem) (*pplmtListMTItem)=pclmtiIterator->plmtListMTItem;
- if (plpData) (*plpData)=pclmtiIterator->plmtListMTItem->lpData;
- dwRetErrorCode=NO_ERROR;
- }else{
- dwRetErrorCode=ERROR_NO_MORE_ITEMS;
- }
-return(dwRetErrorCode);
-}
-
-#endif // !defined(AFX_LIST_MT__H__INCLUDED_)
diff --git a/plugins/SMS/src/AdditionalFunctions/MemoryCompare.h b/plugins/SMS/src/AdditionalFunctions/MemoryCompare.h
deleted file mode 100644
index c9d58a3b6f..0000000000
--- a/plugins/SMS/src/AdditionalFunctions/MemoryCompare.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#if !defined(AFX_MEMORYCOMPARE__H__INCLUDED_)
-#define AFX_MEMORYCOMPARE__H__INCLUDED_
-
-__inline DWORD MemoryCompare(LPCVOID lpcSource1,size_t dwSource1Size,LPCVOID lpcSource2,size_t dwSource2Size)
-{
- if (dwSource1Size == dwSource2Size) {
- if (lpcSource1 == lpcSource2)
- return CSTR_EQUAL;
-
- if (lpcSource1 && lpcSource2) {
-#ifdef _INC_MEMORY
- return 2 + memcmp(lpcSource1,lpcSource2,dwSource1Size));
-#else
- size_t dwDiffPosition;
-
- //dwDiffPosition=RtlCompareMemory(lpcSource1,lpcSource2,dwSource1Size);
- for(dwDiffPosition=0; (dwDiffPosition<dwSource1Size) && (((const BYTE*)lpcSource1)[dwDiffPosition]==((const BYTE*)lpcSource2)[dwDiffPosition]); dwDiffPosition++);
- if (dwDiffPosition==dwSource1Size)
- return CSTR_EQUAL;
-
- if ((*((BYTE*)(((size_t)lpcSource1)+dwDiffPosition)))>(*((BYTE*)(((size_t)lpcSource2)+dwDiffPosition))))
- return CSTR_GREATER_THAN;
-
- return CSTR_LESS_THAN;
-#endif
- }
- return (lpcSource1) ? CSTR_GREATER_THAN : CSTR_LESS_THAN;
- }
- return (dwSource1Size < dwSource2Size) ? CSTR_LESS_THAN : CSTR_GREATER_THAN;
-}
-
-#endif // !defined(AFX_MEMORYCOMPARE__H__INCLUDED_)
diff --git a/plugins/SMS/src/AdditionalFunctions/MemoryFindByte.h b/plugins/SMS/src/AdditionalFunctions/MemoryFindByte.h
deleted file mode 100644
index e2efab157a..0000000000
--- a/plugins/SMS/src/AdditionalFunctions/MemoryFindByte.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#if !defined(AFX_MEMORYFINDBYTE__H__INCLUDED_)
-#define AFX_MEMORYFINDBYTE__H__INCLUDED_
-
-__inline LPVOID MemoryFindByte(size_t dwFrom,LPCVOID lpcSource,size_t dwSourceSize,unsigned char chWhatFind)
-{
- if (lpcSource && dwSourceSize)
- if (dwFrom < dwSourceSize)
- return memchr((BYTE*)lpcSource + dwFrom, chWhatFind, dwSourceSize-dwFrom);
-
- return nullptr;
-}
-
-#endif // !defined(AFX_MEMORYFINDBYTE__H__INCLUDED_)
diff --git a/plugins/SMS/src/SMSConstans.h b/plugins/SMS/src/SMSConstans.h
deleted file mode 100644
index fb40a680b2..0000000000
--- a/plugins/SMS/src/SMSConstans.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#if !defined(AFX_SMS_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
-#define AFX_SMS_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
-
-#define MODULENAME "SMSPlugin"
-#define PROTOCOL_NAMEW L"SMSPlugin"
-#define PROTOCOL_NAME_LEN (sizeof(MODULENAME)-1)
-#define PROTOCOL_NAME_SIZE sizeof(MODULENAME)
-#define PROTOCOL_DISPLAY_NAME_ORIG "SMS"
-
-#define TIMEOUT_MSGSEND 60000 // send sms timeout
-#define MIN_SMS_DBEVENT_LEN 4 // для фильтрации событий авторизации от джабер плагина
-#define MAX_PHONE_LEN MAX_PATH
-#define PHONES_MIN_COUNT 4 //internal // количество элементов обязательно проверяемых при извлечении email адреса из инфы юзера
-
-#define SMS_DEFAULT_
-#define SMS_DEFAULT_SIGNATUREPOS FALSE
-#define SMS_DEFAULT_SHOWACK TRUE
-#define SMS_DEFAULT_USESIGNATURE TRUE
-#define SMS_DEFAULT_AUTOPOP FALSE
-#define SMS_DEFAULT_SAVEWINPOS FALSE
-
-
-
-//
-#define ICQEVENTTYPE_SMSCONFIRMATION 3001
-
-
-//Fonts definitions
-//#define SRMMMOD "SRMM"
-#define SRMMMOD "TabSRMM_Fonts"
-
-#define FONTF_BOLD 1
-#define FONTF_ITALIC 2
-struct FontOptionsList
-{
- COLORREF defColour;
- wchar_t* szDefFace;
- BYTE defStyle;
- char defSize;
-}
-
-static fontOptionsList[] = {
- { RGB(106, 106, 106), L"Arial", 0, -12},
-};
-
-
-#define MSGFONTID_MYMSG 0
-#define MSGFONTID_YOURMSG 2
-#define MSGFONTID_MESSAGEAREA 16
-
-
-#define SRMSGSET_BKGCOLOUR "BkgColour"
-#define SRMSGSET_INPBKGCOLOUR "inputbg"
-#define SRMSGDEFSET_BKGCOLOUR GetSysColor(COLOR_WINDOW)
-#define FONTF_BOLD 1
-#define FONTF_ITALIC 2
-
-
-
-//Decleration of functions that used when user hit miranda for new message/confirmation
-int ReadAckSMS(WPARAM wParam,LPARAM lParam);
-int ReadMsgSMS(WPARAM wParam,LPARAM lParam);
-int SendSMSMenuCommand(WPARAM wParam,LPARAM lParam);
-
-
-
-#define SMS_READ "/ReadSms"
-#define SMS_READ_ACK "/ReadSmsAck"
-#define SMS_SEND "/SendSMS"
-#define SMS_SEND_STR LPGENW("Send &SMS...")
-#define SMS_SEND_CM_STR LPGENW("&SMS Message")
-
-// структура содержащая информацию о сервисах/функциях
-struct SERVICE_ITEM
-{
- LPSTR lpszName; // имя сервиса, оно же имя в иколибе
- LPVOID lpFunc; // функция вызываемая
-};
-
-static const SERVICE_ITEM siPluginServices[] =
-{
- { SMS_READ, ReadMsgSMS },
- { SMS_READ_ACK, ReadAckSMS },
- { SMS_SEND, SendSMSMenuCommand },
-};
-
-#endif // !defined(AFX_SMS_CONSTANS_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp
deleted file mode 100644
index 9bd92063ec..0000000000
--- a/plugins/SMS/src/SMS_svc.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-#include "stdafx.h"
-
-int LoadServices(void)
-{
- char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
-
- memcpy(szServiceFunction, MODULENAME, PROTOCOL_NAME_SIZE);
- pszServiceFunctionName = szServiceFunction + PROTOCOL_NAME_LEN;
-
- // Service creation
- for (auto &it : siPluginServices) {
- memcpy(pszServiceFunctionName, it.lpszName, (mir_strlen(it.lpszName) + 1));
- CreateServiceFunction(szServiceFunction, (MIRANDASERVICE)it.lpFunc);
- }
- return 0;
-}
-
-
-int LoadModules(void)
-{
- char szServiceFunction[MAX_PATH];
- mir_snprintf(szServiceFunction, "%s%s", MODULENAME, SMS_SEND);
-
- CMenuItem mi(&g_plugin);
-
- SET_UID(mi, 0x3ce387db, 0xbaac, 0x490f, 0xac, 0xab, 0x8c, 0xf7, 0xe9, 0xcd, 0x86, 0xa1);
- mi.position = 300050000;
- mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_SMS);
- mi.name.w = SMS_SEND_STR;
- mi.pszService = szServiceFunction;
- mi.flags = CMIF_UNICODE;
- Menu_AddMainMenuItem(&mi);
-
- SET_UID(mi, 0x736e4cff, 0x769e, 0x45dc, 0x8b, 0x78, 0x83, 0xf9, 0xe4, 0xbb, 0x81, 0x9e);
- mi.position = -2000070000;
- mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_SMS);
- mi.name.w = SMS_SEND_CM_STR;
- mi.pszService = szServiceFunction;
- mi.flags = CMIF_UNICODE;
- ssSMSSettings.hContactMenuItems[0] = Menu_AddContactMenuItem(&mi);
-
- g_plugin.addSound("RecvSMSMsg", PROTOCOL_NAMEW, LPGENW("Incoming SMS Message"));
- g_plugin.addSound("RecvSMSConfirmation", PROTOCOL_NAMEW, LPGENW("Incoming SMS Confirmation"));
-
- RefreshAccountList(NULL, NULL);
- return 0;
-}
-
-int SmsRebuildContactMenu(WPARAM wParam, LPARAM)
-{
- Menu_ShowItem(ssSMSSettings.hContactMenuItems[0], GetContactPhonesCount(wParam) != 0);
- return 0;
-}
-
-//This function called when user clicked Menu.
-int SendSMSMenuCommand(WPARAM wParam, LPARAM)
-{
- HWND hwndSendSms;
-
- // user clicked on the "SMS Message" on one of the users
- if (wParam) {
- hwndSendSms = SendSMSWindowIsOtherInstanceHContact(wParam);
- if (hwndSendSms)
- SetFocus(hwndSendSms);
- else
- hwndSendSms = SendSMSWindowAdd(wParam);
- }
- // user clicked on the "SMS Send" in the Main Menu
- else {
- hwndSendSms = SendSMSWindowAdd(NULL);
- EnableWindow(GetDlgItem(hwndSendSms, IDC_NAME), TRUE);
- EnableWindow(GetDlgItem(hwndSendSms, IDC_SAVENUMBER), FALSE);
-
- for (auto &hContact : Contacts()) {
- if (GetContactPhonesCount(hContact)) {
- SendDlgItemMessage(hwndSendSms, IDC_NAME, CB_ADDSTRING, 0, (LPARAM)Clist_GetContactDisplayName(hContact));
- SendSMSWindowSMSContactAdd(hwndSendSms, hContact);
- }
- }
- }
- return 0;
-}
-
-// This function used to popup a read SMS window after the user clicked on the received SMS message.
-int ReadMsgSMS(WPARAM, LPARAM lParam)
-{
- CLISTEVENT *cle = (CLISTEVENT*)lParam;
-
- DBEVENTINFO dbei = {};
- if ((dbei.cbBlob = db_event_getBlobSize(((CLISTEVENT*)lParam)->hDbEvent)) == -1)
- return 1;
- dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob);
-
- if (db_event_get(cle->hDbEvent, &dbei) == 0)
- if (dbei.eventType == ICQEVENTTYPE_SMS || dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION)
- if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) {
- if (RecvSMSWindowAdd(cle->hContact, ICQEVENTTYPE_SMS, nullptr, 0, (LPSTR)dbei.pBlob, dbei.cbBlob)) {
- db_event_markRead(cle->hContact, cle->hDbEvent);
- return 0;
- }
- }
- return 1;
-}
-
-// This function used to popup a read SMS window after the user clicked on the received SMS confirmation.
-int ReadAckSMS(WPARAM, LPARAM lParam)
-{
- CLISTEVENT *cle = (CLISTEVENT*)lParam;
-
- DBEVENTINFO dbei = {};
- if ((dbei.cbBlob = db_event_getBlobSize(cle->hDbEvent)) == -1)
- return 1;
- dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob);
-
- if (db_event_get(cle->hDbEvent, &dbei) == 0)
- if (dbei.eventType == ICQEVENTTYPE_SMS || dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION)
- if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) {
- if (RecvSMSWindowAdd(cle->hContact, ICQEVENTTYPE_SMSCONFIRMATION, nullptr, 0, (LPSTR)dbei.pBlob, dbei.cbBlob)) {
- db_event_delete(cle->hContact, cle->hDbEvent);
- return 0;
- }
- }
- return 1;
-}
diff --git a/plugins/SMS/src/functions.cpp b/plugins/SMS/src/functions.cpp
deleted file mode 100644
index a89dd2a1ce..0000000000
--- a/plugins/SMS/src/functions.cpp
+++ /dev/null
@@ -1,517 +0,0 @@
-#include "stdafx.h"
-
-BOOL DB_GetStaticStringW(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, LPWSTR lpwszRetBuff, size_t dwRetBuffSize, size_t *pdwRetBuffSize)
-{// sizes in wchars
- BOOL bRet = FALSE;
- size_t dwReadedStringLen;
- DBVARIANT dbv = { 0 };
- if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv) == 0) {
- dwReadedStringLen = mir_wstrlen(dbv.pwszVal);
- if (lpwszRetBuff && (dwRetBuffSize > dwReadedStringLen)) {
- memcpy(lpwszRetBuff, dbv.pszVal, (dwReadedStringLen*sizeof(WCHAR)));//include null terminated
- (*((WCHAR*)(lpwszRetBuff + dwReadedStringLen))) = 0;
- bRet = TRUE;
- }
- else {
- if (lpwszRetBuff && dwRetBuffSize >= sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff)) = 0;
- }
- if (pdwRetBuffSize) (*pdwRetBuffSize) = dwReadedStringLen;
-
- db_free(&dbv);
- }
- else {
- if (lpwszRetBuff && dwRetBuffSize >= sizeof(WCHAR)) (*((WCHAR*)lpwszRetBuff)) = 0;
- if (pdwRetBuffSize) (*pdwRetBuffSize) = 0;
- }
- return(bRet);
-}
-
-LPSTR GetModuleName(MCONTACT hContact)
-{
- LPSTR lpszRet;
-
- if (hContact) {
- lpszRet = GetContactProto(hContact);
- if (lpszRet == nullptr)
- lpszRet = MODULENAME;
- }
- else lpszRet = MODULENAME;
-
- return lpszRet;
-}
-
-void EnableControlsArray(HWND hWndDlg, WORD *pwControlsList, size_t dwControlsListCount, BOOL bEnabled)
-{
- for (size_t i = 0; i < dwControlsListCount; i++) EnableWindow(GetDlgItem(hWndDlg, pwControlsList[i]), bEnabled);
-}
-
-//This function gets a Cellular string szPhone and clean it from symbools.
-size_t CopyNumberA(LPSTR lpszOutBuff, LPSTR lpszBuff, size_t dwLen)
-{
- BYTE btChar;
- LPBYTE lpbOutBuff = (LPBYTE)lpszOutBuff, lpbInBuff = (LPBYTE)lpszBuff;
-
- for (size_t i = 0; i < dwLen; i++) {
- btChar = (*lpbInBuff++);
- if (btChar >= '0' && btChar <= '9') (*lpbOutBuff++) = btChar;
- }
- (*lpbOutBuff) = 0;
-
- return((lpbOutBuff - (LPBYTE)lpszOutBuff));
-}
-
-size_t CopyNumberW(LPWSTR lpcOutBuff, LPWSTR lpcBuff, size_t dwLen)
-{
- WCHAR wChar;
- LPWSTR lpwszOutBuff = lpcOutBuff, lpwszInBuff = lpcBuff;
-
- for (size_t i = 0; i < dwLen; i++) {
- wChar = (*lpwszInBuff++);
- if (wChar >= '0' && wChar <= '9') (*lpwszOutBuff++) = wChar;
- }
- (*lpwszOutBuff) = 0;
-
- return((lpwszOutBuff - lpcOutBuff));
-}
-
-
-bool IsPhoneW(LPWSTR lpwszString, size_t dwStringLen)
-{
- if (dwStringLen <= 1)
- return false;
-
- for (size_t i = 0; i < dwStringLen; i++) {
- WCHAR wChar = (*lpwszString++);
- if (wChar<'0' || wChar>'9')
- if (wChar != '+' && wChar != 'S' && wChar != 'M' && wChar != ' ' && wChar != '(' && wChar != ')')
- return false;
- }
- return true;
-}
-
-
-DWORD GetContactPhonesCountParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName)
-{
- DWORD dwRet = 0;
- char szBuff[MAX_PATH];
- WCHAR wszPhone[MAX_PHONE_LEN];
- size_t i, dwPhoneSize;
-
- if (DB_GetStaticStringW(hContact, lpszModule, lpszValueName, wszPhone, _countof(wszPhone), &dwPhoneSize))
- if (IsPhoneW(wszPhone, dwPhoneSize))
- dwRet++;
-
- for (i = 0; i <= PHONES_MIN_COUNT; i++) {
- mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
- if (DB_GetStaticStringW(hContact, lpszModule, szBuff, wszPhone, _countof(wszPhone), &dwPhoneSize))
- if (IsPhoneW(wszPhone, dwPhoneSize))
- dwRet++;
- }
- return dwRet;
-}
-
-
-DWORD GetContactPhonesCount(MCONTACT hContact)
-{
- DWORD dwRet = 0;
- LPSTR lpszProto = GetContactProto(hContact);
- if (lpszProto) {
- dwRet += GetContactPhonesCountParam(hContact, lpszProto, "Phone");
- dwRet += GetContactPhonesCountParam(hContact, lpszProto, "Cellular");
- dwRet += GetContactPhonesCountParam(hContact, lpszProto, "Fax");
- }
- dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "MyPhone");
- dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "Phone");
- dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "Cellular");
- dwRet += GetContactPhonesCountParam(hContact, "UserInfo", "Fax");
- return dwRet;
-}
-
-
-BOOL IsContactPhoneParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, LPWSTR lpwszPhone, size_t dwPhoneSize)
-{
- char szBuff[MAX_PATH];
- WCHAR wszPhoneLocal[MAX_PHONE_LEN];
- size_t i, dwPhoneSizeLocal;
-
- if (DB_GetStaticStringW(hContact, lpszModule, lpszValueName, wszPhoneLocal, _countof(wszPhoneLocal), &dwPhoneSizeLocal))
- if (IsPhoneW(wszPhoneLocal, dwPhoneSizeLocal)) {
- dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal, wszPhoneLocal, dwPhoneSizeLocal);
- if (MemoryCompare(wszPhoneLocal, dwPhoneSizeLocal, lpwszPhone, dwPhoneSize) == CSTR_EQUAL)
- return TRUE;
- }
-
- for (i = 0; i <= PHONES_MIN_COUNT; i++) {
- mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
- if (DB_GetStaticStringW(hContact, lpszModule, szBuff, wszPhoneLocal, _countof(wszPhoneLocal), &dwPhoneSizeLocal)) {
- if (IsPhoneW(wszPhoneLocal, dwPhoneSizeLocal)) {
- dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal, wszPhoneLocal, dwPhoneSizeLocal);
- if (MemoryCompare(wszPhoneLocal, dwPhoneSizeLocal, lpwszPhone, dwPhoneSize) == CSTR_EQUAL)
- return TRUE;
- }
- }
- }
- return FALSE;
-}
-
-
-BOOL IsContactPhone(MCONTACT hContact, LPWSTR lpwszPhone, size_t dwPhoneSize)
-{
- BOOL bRet = FALSE;
- WCHAR wszPhoneLocal[MAX_PHONE_LEN];
-
- size_t dwPhoneSizeLocal = CopyNumberW(wszPhoneLocal, lpwszPhone, dwPhoneSize);
- LPSTR lpszProto = GetContactProto(hContact);
- if (lpszProto) {
- bRet = IsContactPhoneParam(hContact, lpszProto, "Phone", wszPhoneLocal, dwPhoneSizeLocal);
- if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Cellular", wszPhoneLocal, dwPhoneSizeLocal);
- if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, lpszProto, "Fax", wszPhoneLocal, dwPhoneSizeLocal);
- }
- if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "MyPhone", wszPhoneLocal, dwPhoneSizeLocal);
- if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "Phone", wszPhoneLocal, dwPhoneSizeLocal);
- if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "Cellular", wszPhoneLocal, dwPhoneSizeLocal);
- if (bRet == FALSE) bRet = IsContactPhoneParam(hContact, "UserInfo", "Fax", wszPhoneLocal, dwPhoneSizeLocal);
-
- return bRet;
-}
-
-
-//This function get a string cellular number and return the HANDLE of the contact that has this
-//number in the miranda phonebook (and marked as an SMS able) at the User Details.
-//If no one has this number function returns NULL.
-MCONTACT HContactFromPhone(LPWSTR lpwszPhone, size_t dwPhoneSize)
-{
- if (lpwszPhone && dwPhoneSize) {
- //check not already on list
- for (auto &hContact : Contacts())
- if (IsContactPhone(hContact, lpwszPhone, dwPhoneSize))
- return hContact;
- }
-
- return NULL;
-}
-
-
-BOOL GetDataFromMessage(LPSTR lpszMessage, size_t dwMessageSize, DWORD *pdwEventType, LPWSTR lpwszPhone, size_t dwPhoneSize, size_t *pdwPhoneSizeRet, UINT *piIcon)
-{
- BOOL bRet = FALSE;
-
- DWORD dwEventTypeRet = 0;
- size_t dwPhoneSizeRet = 0;
- UINT iIconRet = 0;
-
- if (lpszMessage && dwMessageSize) {
- if (MemoryCompare(lpszMessage, 10, "SMS From: ", 10) == CSTR_EQUAL) {
- LPSTR lpsz = (LPSTR)strstr(lpszMessage + 10, "\r\n");
- if (lpsz) {
- if (lpwszPhone && dwPhoneSize) {
- dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8, 0, (lpszMessage + 10), (int)min((size_t)(lpsz - (lpszMessage + 10)), dwPhoneSize), lpwszPhone, (int)dwPhoneSize);
- dwPhoneSizeRet = CopyNumberW(lpwszPhone, lpwszPhone, dwPhoneSizeRet);
- }
- }
- iIconRet = 0;
- dwEventTypeRet = ICQEVENTTYPE_SMS;
- bRet = TRUE;
- }
- else if (MemoryCompare(lpszMessage, 23, "SMS Confirmation From: ", 23) == CSTR_EQUAL) {
- LPSTR lpsz = (LPSTR)strstr(lpszMessage + 23, "\r\n");
- if (lpsz) {
- if (lpwszPhone && dwPhoneSize) {
- dwPhoneSizeRet = MultiByteToWideChar(CP_UTF8, 0, (lpszMessage + 23), (int)min((size_t)(lpsz - (lpszMessage + 23)), dwPhoneSize), lpwszPhone, (int)dwPhoneSize);
- dwPhoneSizeRet = CopyNumberW(lpwszPhone, lpwszPhone, dwPhoneSizeRet);
- }
-
- lpsz += 2;
- if (MemoryCompare(lpsz, 24, "SMS was sent succesfully", 24) == CSTR_EQUAL)
- iIconRet = IDI_SMSSENT;
- else
- iIconRet = IDI_SMSNOTSENT;
- }
- dwEventTypeRet = ICQEVENTTYPE_SMSCONFIRMATION;
- bRet = TRUE;
- }
- }
-
- if (pdwPhoneSizeRet) *pdwPhoneSizeRet = dwPhoneSizeRet;
- if (pdwEventType) *pdwEventType = dwEventTypeRet;
- if (piIcon) *piIcon = iIconRet;
-
- return bRet;
-}
-
-BOOL GetXMLFieldEx(LPSTR lpszXML, size_t dwXMLSize, LPSTR *plpszData, size_t *pdwDataSize, const char *tag1, ...)
-{
- BOOL bRet = FALSE;
- int thisLevel = 0;
- LPSTR lpszFindTag = (LPSTR)tag1, lpszTagEnd = lpszXML, lpszDataStart = nullptr;
-
- va_list va;
- va_start(va, tag1);
- while (TRUE) {
- LPSTR lpszTagStart = (LPSTR)MemoryFindByte(lpszTagEnd - lpszXML, lpszXML, dwXMLSize, '<');
- if (!lpszTagStart)
- break;
-
- lpszTagEnd = (LPSTR)MemoryFindByte(lpszTagStart - lpszXML, lpszXML, dwXMLSize, '>');
- if (!lpszTagEnd)
- break;
-
- lpszTagStart++;
- lpszTagEnd--;
- if ((*((BYTE*)lpszTagStart)) == '/') {
- if (--thisLevel < 0) {
- if (lpszDataStart) {
- if (plpszData) (*plpszData) = lpszDataStart;
- if (pdwDataSize) (*pdwDataSize) = ((lpszTagStart - 1) - lpszDataStart);
- bRet = TRUE;
- }
- break;
- }
- }
- else {
- if (++thisLevel == 1)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszFindTag, -1, lpszTagStart, ((lpszTagEnd + 1) - lpszTagStart)) == CSTR_EQUAL) {
- lpszFindTag = va_arg(va, LPSTR);
- if (lpszFindTag == nullptr) lpszDataStart = (lpszTagEnd + 2);
- thisLevel = 0;
- }
- }
- }
- va_end(va);
- return bRet;
-}
-
-
-BOOL GetXMLFieldExBuff(LPSTR lpszXML, size_t dwXMLSize, LPSTR lpszBuff, size_t dwBuffSize, size_t *pdwBuffSizeRet, const char *tag1, ...)
-{
- BOOL bRet = FALSE;
- int thisLevel = 0;
- LPSTR lpszFindTag = (LPSTR)tag1, lpszTagStart, lpszTagEnd = lpszXML, lpszDataStart = nullptr;
- va_list va;
-
-
- va_start(va, tag1);
- while (TRUE) {
- lpszTagStart = (LPSTR)MemoryFindByte((lpszTagEnd - lpszXML), lpszXML, dwXMLSize, '<');
- if (lpszTagStart) {
- lpszTagEnd = (LPSTR)MemoryFindByte((lpszTagStart - lpszXML), lpszXML, dwXMLSize, '>');
- if (lpszTagEnd) {
- lpszTagStart++;
- lpszTagEnd--;
- if ((*((BYTE*)lpszTagStart)) == '/') {
- if (--thisLevel < 0) {
- if (lpszDataStart) {
- size_t dwBuffSizeRet = min((dwBuffSize - 2), (size_t)((lpszTagStart - 1) - lpszDataStart));
- if (lpszBuff && dwBuffSize) memcpy(lpszBuff, lpszDataStart, dwBuffSizeRet); (*((WORD*)(lpszBuff + dwBuffSizeRet))) = 0;
- if (pdwBuffSizeRet) (*pdwBuffSizeRet) = dwBuffSizeRet;
- bRet = TRUE;
- }
- break;
- }
- }
- else {
- if (++thisLevel == 1)
- if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszFindTag, -1, lpszTagStart, ((lpszTagEnd + 1) - lpszTagStart)) == CSTR_EQUAL) {
- lpszFindTag = va_arg(va, LPSTR);
- if (lpszFindTag == nullptr) lpszDataStart = (lpszTagEnd + 2);
- thisLevel = 0;
- }
- }
- }
- else {
- break;
- }
- }
- else {
- break;
- }
- }
- va_end(va);
-
-
- if (bRet == FALSE) {
- if (lpszBuff) (*((WORD*)lpszBuff)) = 0;
- if (pdwBuffSizeRet) (*pdwBuffSizeRet) = 0;
- }
-
- return(bRet);
-}
-
-DWORD ReplaceInBuff(LPVOID lpInBuff, size_t dwInBuffSize, size_t dwReplaceItemsCount, LPVOID *plpInReplaceItems, size_t *pdwInReplaceItemsCounts, LPVOID *plpOutReplaceItems, size_t *pdwOutReplaceItemsCounts, LPVOID lpOutBuff, size_t dwOutBuffSize, size_t *pdwOutBuffSize)
-{
- DWORD dwRetErrorCode = NO_ERROR;
- LPBYTE *plpszFound, lpszMessageConvertedCur, lpszMessageCur, lpszMessageCurPrev, lpszMessageConvertedMax;
- size_t i, dwFirstFoundedIndex = 0, dwFoundedCount = 0, dwMemPartToCopy;
-
- plpszFound = (LPBYTE*)MEMALLOC((sizeof(LPBYTE)*dwReplaceItemsCount));
-
- lpszMessageCurPrev = (LPBYTE)lpInBuff;
- lpszMessageConvertedCur = (LPBYTE)lpOutBuff;
- lpszMessageConvertedMax = (((LPBYTE)lpOutBuff) + dwOutBuffSize);
-
- // looking for in first time
- for (i = 0; i < dwReplaceItemsCount; i++) {
- plpszFound[i] = (LPBYTE)strstr((LPCSTR)lpInBuff + (lpszMessageCurPrev - (LPBYTE)lpInBuff), (LPCSTR)plpInReplaceItems[i]);
- if (plpszFound[i])
- dwFoundedCount++;
- }
-
- while (dwFoundedCount) {
- // looking for first to replace
- for (i = 0; i < dwReplaceItemsCount; i++)
- if (plpszFound[i] && (plpszFound[i] < plpszFound[dwFirstFoundedIndex] || plpszFound[dwFirstFoundedIndex] == nullptr))
- dwFirstFoundedIndex = i;
-
- // in founded
- if (plpszFound[dwFirstFoundedIndex]) {
- dwMemPartToCopy = (plpszFound[dwFirstFoundedIndex] - lpszMessageCurPrev);
- if (lpszMessageConvertedMax > (lpszMessageConvertedCur + (dwMemPartToCopy + pdwInReplaceItemsCounts[dwFirstFoundedIndex]))) {
- memcpy(lpszMessageConvertedCur, lpszMessageCurPrev, dwMemPartToCopy); lpszMessageConvertedCur += dwMemPartToCopy;
- memcpy(lpszMessageConvertedCur, plpOutReplaceItems[dwFirstFoundedIndex], pdwOutReplaceItemsCounts[dwFirstFoundedIndex]); lpszMessageConvertedCur += pdwOutReplaceItemsCounts[dwFirstFoundedIndex];
- lpszMessageCurPrev = (plpszFound[dwFirstFoundedIndex] + pdwInReplaceItemsCounts[dwFirstFoundedIndex]);
-
- for (i = 0; i < dwReplaceItemsCount; i++) {// loking for in next time
- if (plpszFound[i] && plpszFound[i] < lpszMessageCurPrev) {
- dwFoundedCount--;
- plpszFound[i] = (LPBYTE)strstr((LPCSTR)lpInBuff + (lpszMessageCurPrev - (LPBYTE)lpInBuff), (LPCSTR)plpInReplaceItems[i]);
- if (plpszFound[i]) dwFoundedCount++;
- }
- }
- }
- else {
- dwRetErrorCode = ERROR_BUFFER_OVERFLOW;
- DebugBreak();
- break;
- }
- }
- else {// сюда по идее никогда не попадём, на всякий случай.
- DebugBreak();
- break;
- }
- }
- lpszMessageCur = (((LPBYTE)lpInBuff) + dwInBuffSize);
- memcpy(lpszMessageConvertedCur, lpszMessageCurPrev, (lpszMessageCur - lpszMessageCurPrev)); lpszMessageConvertedCur += (lpszMessageCur - lpszMessageCurPrev);
- (*((WORD*)lpszMessageConvertedCur)) = 0;
-
- MEMFREE(plpszFound);
-
- if (pdwOutBuffSize) (*pdwOutBuffSize) = (lpszMessageConvertedCur - ((LPBYTE)lpOutBuff));
-
- return(dwRetErrorCode);
-}
-
-
-static const LPTSTR lpszXMLTags[] = { TEXT("&apos;"), TEXT("&quot;"), TEXT("&amp;"), TEXT("&lt;"), TEXT("&gt;") };
-static const size_t dwXMLTagsCount[] = { (6 * sizeof(wchar_t)), (6 * sizeof(wchar_t)), (5 * sizeof(wchar_t)), (4 * sizeof(wchar_t)), (4 * sizeof(wchar_t)) };
-static const LPTSTR lpszXMLSymbols[] = { TEXT("\'"), TEXT("\""), TEXT("&"), TEXT("<"), TEXT(">") };
-static const size_t dwXMLSymbolsCount[] = { sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t), sizeof(wchar_t) };
-
-//Decode XML coded string. The function translate special xml code into standard characters.
-DWORD DecodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
-{
- DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(wchar_t)), _countof(lpszXMLTags), (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(wchar_t)), pdwMessageConvertedSize);
-
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(wchar_t);
- return(dwRet);
-}
-
-//Encode XML coded string. The function translate special saved xml characters into special characters.
-DWORD EncodeXML(LPTSTR lptszMessage, size_t dwMessageSize, LPTSTR lptszMessageConverted, size_t dwMessageConvertedBuffSize, size_t *pdwMessageConvertedSize)
-{
- DWORD dwRet = ReplaceInBuff(lptszMessage, (dwMessageSize*sizeof(wchar_t)), _countof(lpszXMLTags), (LPVOID*)lpszXMLSymbols, (size_t*)dwXMLSymbolsCount, (LPVOID*)lpszXMLTags, (size_t*)dwXMLTagsCount, lptszMessageConverted, (dwMessageConvertedBuffSize*sizeof(wchar_t)), pdwMessageConvertedSize);
-
- if (pdwMessageConvertedSize) (*pdwMessageConvertedSize) /= sizeof(wchar_t);
- return(dwRet);
-}
-
-
-//(Taken from Miranda-IM source code:)
-BYTE MsgDlgGetFontDefaultCharset(const wchar_t*)
-{
- return(DEFAULT_CHARSET);
-}
-
-
-void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
-{
- int style;
- char str[MAX_PATH];
- DBVARIANT dbv;
-
- if (colour) {
- mir_snprintf(str, "Font%dCol", i);
- (*colour) = db_get_dw(0, SRMMMOD, str, fontOptionsList[0].defColour);
- }
-
- if (lf) {
- if (db_get_ws(0, SRMMMOD, str, &dbv)) {
- mir_wstrncpy(lf->lfFaceName, fontOptionsList[0].szDefFace, _countof(lf->lfFaceName));
- }
- else {
- mir_wstrncpy(lf->lfFaceName, dbv.pwszVal, _countof(lf->lfFaceName));
- db_free(&dbv);
- }
-
- mir_snprintf(str, "Font%dSize", i);
- lf->lfHeight = (char)db_get_b(0, SRMMMOD, str, fontOptionsList[0].defSize);
- lf->lfWidth = 0;
- lf->lfEscapement = 0;
- lf->lfOrientation = 0;
- mir_snprintf(str, "Font%dSty", i);
- style = db_get_b(0, SRMMMOD, str, fontOptionsList[0].defStyle);
- lf->lfWeight = style&FONTF_BOLD ? FW_BOLD : FW_NORMAL;
- lf->lfItalic = style&FONTF_ITALIC ? 1 : 0;
- lf->lfUnderline = 0;
- lf->lfStrikeOut = 0;
- mir_snprintf(str, "Font%dSet", i);
- lf->lfCharSet = db_get_b(0, SRMMMOD, str, MsgDlgGetFontDefaultCharset(lf->lfFaceName));
- lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
- lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
- lf->lfQuality = DEFAULT_QUALITY;
- lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, "Font%d", i);
- }
-}
-
-LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- switch (message) {
- case WM_CHAR:
- if (wParam == '\n' && GetKeyState(VK_CONTROL) & 0x8000) {
- PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
- return 0;
- }
- }
-
- return mir_callNextSubclass(hwnd, MessageSubclassProc, message, wParam, lParam);
-}
-
-//This function refresh account list.
-//It called when SMS plugin loaded and upon change in the account list.
-int RefreshAccountList(WPARAM, LPARAM)
-{
- int dwAccCount = 0, dwSMSAccountsCount = 0;
- PROTOACCOUNT **ppaAccounts;
- Proto_EnumAccounts((int*)&dwAccCount, &ppaAccounts);
-
- FreeAccountList();
- ssSMSSettings.ppaSMSAccounts = (PROTOACCOUNT**)MEMALLOC((dwAccCount*sizeof(LPVOID)));
- if (ssSMSSettings.ppaSMSAccounts)
- for (int i = 0; i < dwAccCount; i++)
- if (ppaAccounts[i]->IsEnabled())
- if (ProtoServiceExists(ppaAccounts[i]->szModuleName, MS_ICQ_SENDSMS))
- ssSMSSettings.ppaSMSAccounts[dwSMSAccountsCount++] = ppaAccounts[i];
-
- ssSMSSettings.dwSMSAccountsCount = dwSMSAccountsCount;
- SendSMSWindowsUpdateAllAccountLists();
-
- return 0;
-}
-
-//This function free the global account list.
-//This function should be called before list refresh or when SMS plugin unloaded.
-void FreeAccountList()
-{
- MEMFREE(ssSMSSettings.ppaSMSAccounts);
- ssSMSSettings.dwSMSAccountsCount = 0;
-}
diff --git a/plugins/SMS/src/main.cpp b/plugins/SMS/src/main.cpp
deleted file mode 100644
index 1e55334bfa..0000000000
--- a/plugins/SMS/src/main.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
-Miranda-IM SMS Plugin
-Copyright (C) 2001-2 Richard Hughes
-Copyright (C) 2007-19 Rozhuk Ivan
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
----------------------------------------------------------------------------
-
-This was the original words.
-This plugin was modified by Ariel Shulman (NuKe007).
-For any comments, problems, etc. contact me at Miranda-IM forums or E-Mail or ICQ.
-All the information needed you can find at www.nuke007.tk
-Enjoy the code and use it smartly!
-*/
-
-#include "stdafx.h"
-
-CMPlugin g_plugin;
-
-SMS_SETTINGS ssSMSSettings;
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-PLUGININFOEX pluginInfoEx =
-{
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- __DESCRIPTION,
- __AUTHOR,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- // {CF97FD5D-B911-47A8-AF03-D21968B5B894}
- {0xcf97fd5d, 0xb911, 0x47a8, {0xaf, 0x3, 0xd2, 0x19, 0x68, 0xb5, 0xb8, 0x94}}
-};
-
-CMPlugin::CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
-{}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static void VersionConversions()
-{
- WCHAR wsztm[MAX_PATH];
-
- if (DB_SMS_GetStaticStringW(NULL, "UseSignature", wsztm, _countof(wsztm), nullptr))
- DB_SMS_SetByte(NULL, "UseSignature", (wsztm[0] == '0'));
- else
- DB_SMS_SetByte(NULL, "UseSignature", SMS_DEFAULT_USESIGNATURE);
-
- if (DB_SMS_GetStaticStringW(NULL, "SignaturePos", wsztm, _countof(wsztm), nullptr))
- DB_SMS_SetByte(NULL, "SignaturePos", (wsztm[0] == '0'));
- else
- DB_SMS_SetByte(NULL, "SignaturePos", SMS_DEFAULT_SIGNATUREPOS);
-
- if (DB_SMS_GetStaticStringW(NULL, "ShowACK", wsztm, _countof(wsztm), nullptr))
- DB_SMS_SetByte(NULL, "ShowACK", (wsztm[0] == '0'));
- else
- DB_SMS_SetByte(NULL, "ShowACK", SMS_DEFAULT_SHOWACK);
-}
-
-static int OnModulesLoaded(WPARAM, LPARAM)
-{
- VersionConversions();
- LoadModules();
- return 0;
-}
-
-static int OnPreShutdown(WPARAM, LPARAM)
-{
- RecvSMSWindowDestroy();
- SendSMSWindowDestroy();
- FreeAccountList();
- return 0;
-}
-
-BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID)
-{
- switch(dwReason) {
- case DLL_PROCESS_ATTACH:
- memset(&ssSMSSettings, 0, sizeof(ssSMSSettings));
- ssSMSSettings.hInstance = hInstance;
- ssSMSSettings.hHeap = HeapCreate(0, 0, 0);
- DisableThreadLibraryCalls((HMODULE)hInstance);
- break;
-
- case DLL_PROCESS_DETACH:
- HeapDestroy(ssSMSSettings.hHeap);
- ssSMSSettings.hHeap = nullptr;
-
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- break;
- }
-
- return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-int CMPlugin::Load()
-{
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU, SmsRebuildContactMenu);
- HookEvent(ME_DB_EVENT_ADDED, handleNewMessage);
- HookEvent(ME_OPT_INITIALISE, OptInitialise);
- HookEvent(ME_PROTO_ACK, handleAckSMS);
- HookEvent(ME_PROTO_ACCLISTCHANGED, RefreshAccountList);
- HookEvent(ME_SYSTEM_MODULESLOADED,OnModulesLoaded);
- HookEvent(ME_SYSTEM_PRESHUTDOWN,OnPreShutdown);
-
- SendSMSWindowInitialize();
- RecvSMSWindowInitialize();
-
- LoadServices();
- return 0;
-}
diff --git a/plugins/SMS/src/options.cpp b/plugins/SMS/src/options.cpp
deleted file mode 100644
index cc47652bf5..0000000000
--- a/plugins/SMS/src/options.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
-Miranda-IM SMS Plugin
-Copyright (C) 2001-2002 Richard Hughes
-Copyright (C) 2007-18 Rozhuk Ivan
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
----------------------------------------------------------------------------
-
-This was the original words.
-This plugin was modified by Ariel Shulman (NuKe007).
-For any comments, problems, etc. contact me at Miranda-IM forums or E-Mail or ICQ.
-All the information needed you can find at www.nuke007.tk
-Enjoy the code and use it smartly!
-*/
-
-#include "stdafx.h"
-
-WORD wSMSSignControlsList[] = { IDC_BEGIN, IDC_END, IDC_SIGNATURE, IDC_SIGNGROUP };
-
-INT_PTR CALLBACK DlgProcEditorOptions(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- wchar_t tszSign[1024];
-
- switch(msg){
- case WM_INITDIALOG:
- TranslateDialogDefault(hWndDlg);
-
- if (DB_SMS_GetStaticStringW(NULL,"Signature",tszSign,_countof(tszSign),nullptr)==FALSE)
- mir_snwprintf(tszSign, TranslateT("From %s:\r\n\r\n"), Clist_GetContactDisplayName(0));
-
- SetDlgItemText(hWndDlg,IDC_SIGNATURE,tszSign);
- {
- BOOL bUseSign = DB_SMS_GetByte(NULL,"UseSignature",SMS_DEFAULT_USESIGNATURE);
- CheckDlgButton(hWndDlg, IDC_USESIGNATURE, bUseSign ? BST_CHECKED : BST_UNCHECKED);
- EnableControlsArray(hWndDlg,(WORD*)&wSMSSignControlsList,_countof(wSMSSignControlsList),bUseSign);
-
- BOOL bSignBebefore=DB_SMS_GetByte(NULL,"SignaturePos",SMS_DEFAULT_SIGNATUREPOS);
- CheckDlgButton(hWndDlg, IDC_BEGIN, bSignBebefore ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWndDlg, IDC_END, (!bSignBebefore) ? BST_CHECKED : BST_UNCHECKED);
- }
-
- CheckDlgButton(hWndDlg, IDC_SHOWACK, DB_SMS_GetByte(NULL, "ShowACK", SMS_DEFAULT_SHOWACK) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWndDlg, IDC_AUTOPOP, DB_SMS_GetByte(NULL, "AutoPopup", SMS_DEFAULT_AUTOPOP) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hWndDlg, IDC_SAVEWINPOS, DB_SMS_GetByte(NULL, "SavePerContact", SMS_DEFAULT_SAVEWINPOS) ? BST_CHECKED : BST_UNCHECKED);
- return TRUE;
-
- case WM_COMMAND:
- SendMessage(GetParent(hWndDlg),PSM_CHANGED,0,0);
- switch(LOWORD(wParam)){
- case IDC_USESIGNATURE:
- EnableControlsArray(hWndDlg,(WORD*)&wSMSSignControlsList,_countof(wSMSSignControlsList),IsDlgButtonChecked(hWndDlg,IDC_USESIGNATURE));
- break;
- }
- break;
-
- case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom){
- case 0:
- switch (((LPNMHDR)lParam)->code){
- case PSN_APPLY:
- GetDlgItemText(hWndDlg,IDC_SIGNATURE,tszSign,_countof(tszSign));
- DB_SMS_SetStringW(NULL,"Signature",tszSign);
-
- DB_SMS_SetByte(NULL,"UseSignature",IsDlgButtonChecked(hWndDlg,IDC_USESIGNATURE));
- DB_SMS_SetByte(NULL,"SignaturePos",IsDlgButtonChecked(hWndDlg,IDC_BEGIN));
- DB_SMS_SetByte(NULL,"ShowACK",IsDlgButtonChecked(hWndDlg,IDC_SHOWACK));
- DB_SMS_SetByte(NULL,"AutoPopup",IsDlgButtonChecked(hWndDlg,IDC_AUTOPOP));
- DB_SMS_SetByte(NULL,"SavePerContact",IsDlgButtonChecked(hWndDlg,IDC_SAVEWINPOS));
- return TRUE;
- }
- }
- break;
- }
- return FALSE;
-}
-
-int OptInitialise(WPARAM wParam,LPARAM)
-{
- OPTIONSDIALOGPAGE odp = {};
- odp.position = 910000000;
- odp.szGroup.a = LPGEN("Events");
- odp.flags = ODPF_BOLDGROUPS;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SMSPLUGIN);
- odp.szTitle.a = PROTOCOL_DISPLAY_NAME_ORIG;
- odp.pfnDlgProc = DlgProcEditorOptions;
- g_plugin.addOptions(wParam, &odp);
- return 0;
-}
-
diff --git a/plugins/SMS/src/receive.cpp b/plugins/SMS/src/receive.cpp
deleted file mode 100644
index e696150a6c..0000000000
--- a/plugins/SMS/src/receive.cpp
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
-Miranda-IM SMS Plugin
-Copyright (C) 2001-2 Richard Hughes
-Copyright (C) 2007-19 Rozhuk Ivan
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
----------------------------------------------------------------------------
-
-This was the original words.
-This plugin was modified by Ariel Shulman (NuKe007).
-For any comments, problems, etc. contact me at Miranda-IM forums or E-Mail or ICQ.
-All the information needed you can find at www.nuke007.tk
-Enjoy the code and use it smartly!
-*/
-
-#include "stdafx.h"
-
-// This function handles the ACK received from that hooked.
-int handleAckSMS(WPARAM wParam, LPARAM lParam)
-{
- if (!lParam)
- return 0;
- if (((ACKDATA*)lParam)->type != ICQACKTYPE_SMS)
- return 0;
-
- char szPhone[MAX_PHONE_LEN] = { 0 };
- wchar_t tszPhone[MAX_PHONE_LEN] = { 0 };
- LPSTR lpszXML = (LPSTR)((ACKDATA*)lParam)->lParam, lpszData, lpszPhone;
- size_t dwXMLSize = 0, dwDataSize, dwPhoneSize;
- ACKDATA *ack = ((ACKDATA*)lParam);
-
- if (lpszXML)
- dwXMLSize = mir_strlen(lpszXML);
-
- if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_message", "text", NULL)) {
- if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszPhone, &dwPhoneSize, "sms_message", "sender", NULL)) {
- LPSTR lpszMessageUTF;
- size_t dwBuffLen, dwMessageXMLEncodedSize, dwMessageXMLDecodedSize;
- DBEVENTINFO dbei = {};
-
- dwBuffLen = (dwDataSize + MAX_PATH);
- dbei.pBlob = (LPBYTE)MEMALLOC((dwBuffLen + dwPhoneSize));
- LPWSTR lpwszMessageXMLEncoded = (LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
- LPWSTR lpwszMessageXMLDecoded = (LPWSTR)MEMALLOC((dwBuffLen*sizeof(WCHAR)));
- if (dbei.pBlob && lpwszMessageXMLEncoded && lpwszMessageXMLDecoded) {
- dwMessageXMLEncodedSize = MultiByteToWideChar(CP_UTF8, 0, lpszData, (int)dwDataSize, lpwszMessageXMLEncoded, (int)dwBuffLen);
- DecodeXML(lpwszMessageXMLEncoded, dwMessageXMLEncodedSize, lpwszMessageXMLDecoded, dwBuffLen, &dwMessageXMLDecodedSize);
- lpszMessageUTF = (LPSTR)lpwszMessageXMLEncoded;
- WideCharToMultiByte(CP_UTF8, 0, lpwszMessageXMLDecoded, (int)dwMessageXMLDecodedSize, lpszMessageUTF, (int)dwBuffLen, nullptr, nullptr);
-
- dwPhoneSize = CopyNumberA(szPhone, lpszPhone, dwPhoneSize);
- dwPhoneSize = MultiByteToWideChar(CP_UTF8, 0, szPhone, (int)dwPhoneSize, tszPhone, MAX_PHONE_LEN);
- MCONTACT hContact = HContactFromPhone(tszPhone, dwPhoneSize);
-
- dbei.szModule = GetModuleName(hContact);
- dbei.timestamp = time(0);
- dbei.flags = DBEF_UTF;
- dbei.eventType = ICQEVENTTYPE_SMS;
- dbei.cbBlob = (mir_snprintf((LPSTR)dbei.pBlob, ((dwBuffLen + dwPhoneSize)), "SMS From: +%s\r\n%s", szPhone, lpszMessageUTF) + sizeof(DWORD));
- //dbei.pBlob=(LPBYTE)lpszBuff;
- (*((DWORD*)(dbei.pBlob + (dbei.cbBlob - sizeof(DWORD))))) = 0;
- MEVENT hResult = db_event_add(hContact, &dbei);
- if (hContact == NULL) {
- if (RecvSMSWindowAdd(NULL, ICQEVENTTYPE_SMS, tszPhone, dwPhoneSize, (LPSTR)dbei.pBlob, dbei.cbBlob)) {
- db_event_markRead(hContact, hResult);
- Skin_PlaySound("RecvSMSMsg");
- }
- }
- }
- MEMFREE(lpwszMessageXMLDecoded);
- MEMFREE(lpwszMessageXMLEncoded);
- MEMFREE(dbei.pBlob);
- }
- }
- else
- if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_delivery_receipt", "delivered", NULL)) {
- if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszPhone, &dwPhoneSize, "sms_delivery_receipt", "destination", NULL)) {
- dwPhoneSize = CopyNumberA(szPhone, lpszPhone, dwPhoneSize);
- dwPhoneSize = MultiByteToWideChar(CP_UTF8, 0, szPhone, (int)dwPhoneSize, tszPhone, MAX_PHONE_LEN);
- MCONTACT hContact = HContactFromPhone(tszPhone, dwPhoneSize);
-
- DBEVENTINFO dbei = {};
- dbei.szModule = GetModuleName(hContact);
- dbei.timestamp = time(0);
- dbei.flags = DBEF_UTF;
- dbei.eventType = ICQEVENTTYPE_SMSCONFIRMATION;
- if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "yes", 3) == CSTR_EQUAL) {
- dbei.cbBlob = (MAX_PHONE_LEN + MAX_PATH);
- dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
- if (dbei.pBlob) dbei.cbBlob = (mir_snprintf((LPSTR)dbei.pBlob, dbei.cbBlob, "SMS Confirmation From: +%s\r\nSMS was sent succesfully", szPhone) + 4);
- }
- else {
- if (GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_delivery_receipt", "error", "params", "param", NULL) == FALSE) {
- lpszData = "";
- dwDataSize = 0;
- }
- dbei.cbBlob = (int)(MAX_PHONE_LEN + MAX_PATH + dwDataSize);
- dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
- if (dbei.pBlob) {
- dbei.cbBlob = mir_snprintf((LPSTR)dbei.pBlob, dbei.cbBlob, "SMS Confirmation From: +%s\r\nSMS was not sent succesfully: ", szPhone);
- memcpy((dbei.pBlob + dbei.cbBlob), lpszData, dwDataSize);
- dbei.cbBlob += (int)(dwDataSize + sizeof(DWORD));
- (*((DWORD*)(dbei.pBlob + (dbei.cbBlob - sizeof(DWORD))))) = 0;
- }
- }
-
- if (dbei.pBlob) {
- if (hContact)
- db_event_add(hContact, &dbei);
- else
- RecvSMSWindowAdd(NULL, ICQEVENTTYPE_SMSCONFIRMATION, tszPhone, dwPhoneSize, (LPSTR)dbei.pBlob, dbei.cbBlob);
-
- MEMFREE(dbei.pBlob);
- }
- }
- }
- else
- if ((ack->result == ACKRESULT_FAILED) || GetXMLFieldEx(lpszXML, dwXMLSize, &lpszData, &dwDataSize, "sms_response", "deliverable", NULL)) {
- HWND hWndDlg = SendSMSWindowHwndByHProcessGet(ack->hProcess);
- if (hWndDlg) {
- char szNetwork[MAX_PATH];
-
- KillTimer(hWndDlg, wParam);
- GetXMLFieldExBuff(lpszXML, dwXMLSize, szNetwork, sizeof(szNetwork), nullptr, "sms_response", "network", NULL);
-
- if (ack->result == ACKRESULT_FAILED || CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "no", 2) == CSTR_EQUAL) {
- char szBuff[1024];
- wchar_t tszErrorMessage[1028];
- LPSTR lpszErrorDescription;
-
- if (SendSMSWindowMultipleGet(hWndDlg)) {
- TVITEM tvi;
- tvi.mask = TVIF_TEXT;
- tvi.hItem = SendSMSWindowHItemSendGet(hWndDlg);
- tvi.pszText = tszPhone;
- tvi.cchTextMax = _countof(tszPhone);
- TreeView_GetItem(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), &tvi);
- }
- else GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(szPhone));
-
- if (ack->result == ACKRESULT_FAILED)
- lpszErrorDescription = lpszXML;
- else {
- lpszErrorDescription = szBuff;
- GetXMLFieldExBuff(lpszXML, dwXMLSize, szBuff, sizeof(szBuff), nullptr, "sms_response", "error", "params", "param", NULL);
- }
-
- mir_snwprintf(tszErrorMessage, TranslateT("SMS message didn't send by %S to %s because: %S"), szNetwork, tszPhone, lpszErrorDescription);
- ShowWindow(hWndDlg, SW_SHOWNORMAL);
- EnableWindow(hWndDlg, FALSE);
- HWND hwndTimeOut = CreateDialog(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDD_SENDSMSTIMEDOUT), hWndDlg, SMSTimedOutDlgProc);
- SetDlgItemText(hwndTimeOut, IDC_STATUS, tszErrorMessage);
- }
- else {
- SendSMSWindowDBAdd(hWndDlg);
- if (SendSMSWindowMultipleGet(hWndDlg)) {
- if (SendSMSWindowNextHItemGet(hWndDlg, SendSMSWindowHItemSendGet(hWndDlg))) {
- SendSMSWindowAsSentSet(hWndDlg);
- SendSMSWindowHItemSendSet(hWndDlg, SendSMSWindowNextHItemGet(hWndDlg, SendSMSWindowHItemSendGet(hWndDlg)));
- SendSMSWindowNext(hWndDlg);
- }
- else SendSMSWindowRemove(hWndDlg);
- }
- else {
- if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "yes", 3) == CSTR_EQUAL ||
- CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "smtp", 4) == CSTR_EQUAL) {
- char szSource[MAX_PATH], szMessageID[MAX_PATH];
-
- if (DB_SMS_GetByte(NULL, "ShowACK", SMS_DEFAULT_SHOWACK)) {
- HWND hwndAccepted = CreateDialog(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDD_SENDSMSACCEPT), hWndDlg, SMSAcceptedDlgProc);
- if (CompareStringA(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), NORM_IGNORECASE, lpszData, (int)dwDataSize, "yes", 3) == CSTR_EQUAL) {
- GetXMLFieldExBuff(lpszXML, dwXMLSize, szSource, sizeof(szSource), nullptr, "sms_response", "source", NULL);
- GetXMLFieldExBuff(lpszXML, dwXMLSize, szMessageID, sizeof(szMessageID), nullptr, "sms_response", "message_id", NULL);
- }
- else {
- SetDlgItemText(hwndAccepted, IDC_ST_SOURCE, TranslateT("From:"));
- SetDlgItemText(hwndAccepted, IDC_ST_MESSAGEID, TranslateT("To:"));
- GetXMLFieldExBuff(lpszXML, dwXMLSize, szSource, sizeof(szSource), nullptr, "sms_response", "from", NULL);
- GetXMLFieldExBuff(lpszXML, dwXMLSize, szMessageID, sizeof(szMessageID), nullptr, "sms_response", "to", NULL);
- }
- SetDlgItemTextA(hwndAccepted, IDC_NETWORK, szNetwork);
- SetDlgItemTextA(hwndAccepted, IDC_SOURCE, szSource);
- SetDlgItemTextA(hwndAccepted, IDC_MESSAGEID, szMessageID);
- }
- else SendSMSWindowRemove(hWndDlg);
- }
- else SendSMSWindowRemove(hWndDlg);
- }
- }
- }
- }
- return 0;
-}
-
-//Handles new SMS messages added to the database
-int handleNewMessage(WPARAM hContact, LPARAM hDbEvent)
-{
- char szServiceFunction[MAX_PATH], *pszServiceFunctionName;
- wchar_t szToolTip[MAX_PATH];
- DBEVENTINFO dbei = {};
-
- if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
- return 0;
-
- dbei.pBlob = (PBYTE)MEMALLOC(dbei.cbBlob);
- if (!dbei.pBlob)
- return 0;
- memcpy(szServiceFunction, MODULENAME, PROTOCOL_NAME_SIZE);
- pszServiceFunctionName = szServiceFunction + PROTOCOL_NAME_LEN;
-
- if (db_event_get(hDbEvent, &dbei) == 0)
- if ((dbei.flags & DBEF_SENT) == 0)
- if (dbei.eventType == ICQEVENTTYPE_SMS) {
- if (dbei.cbBlob > MIN_SMS_DBEVENT_LEN) {
- Skin_PlaySound("RecvSMSMsg");
- if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) {
- if (RecvSMSWindowAdd(hContact, ICQEVENTTYPE_SMS, nullptr, 0, (LPSTR)dbei.pBlob, dbei.cbBlob))
- db_event_markRead(hContact, hDbEvent);
- }
- else {
- memcpy(pszServiceFunctionName, SMS_READ, sizeof(SMS_READ));
- mir_snwprintf(szToolTip, TranslateT("SMS Message from %s"), Clist_GetContactDisplayName(hContact));
-
- CLISTEVENT cle = {};
- cle.flags = CLEF_UNICODE;
- cle.hContact = hContact;
- cle.hDbEvent = hDbEvent;
- cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_SMS);
- cle.pszService = szServiceFunction;
- cle.szTooltip.w = szToolTip;
- g_clistApi.pfnAddEvent(&cle);
- }
- }
- }
- else if (dbei.eventType == ICQEVENTTYPE_SMSCONFIRMATION) {
- Skin_PlaySound("RecvSMSConfirmation");
- if (DB_SMS_GetByte(NULL, "AutoPopup", 0)) {
- if (RecvSMSWindowAdd(hContact, ICQEVENTTYPE_SMSCONFIRMATION, nullptr, 0, (LPSTR)dbei.pBlob, dbei.cbBlob))
- db_event_delete(hContact, hDbEvent);
- }
- else {
- UINT iIcon;
- if (GetDataFromMessage((LPSTR)dbei.pBlob, dbei.cbBlob, nullptr, nullptr, 0, nullptr, &iIcon)) {
- memcpy(pszServiceFunctionName, SMS_READ_ACK, sizeof(SMS_READ_ACK));
- mir_snwprintf(szToolTip, TranslateT("SMS Confirmation from %s"), Clist_GetContactDisplayName(hContact));
-
- CLISTEVENT cle = {};
- cle.flags = CLEF_UNICODE;
- cle.hContact = hContact;
- cle.hDbEvent = hDbEvent;
- cle.hIcon = (HICON)LoadImage(ssSMSSettings.hInstance, MAKEINTRESOURCE(iIcon), IMAGE_ICON, 0, 0, LR_SHARED);
- cle.pszService = szServiceFunction;
- cle.szTooltip.w = szToolTip;
- g_clistApi.pfnAddEvent(&cle);
- }
- }
- }
- MEMFREE(dbei.pBlob);
- return 0;
-}
diff --git a/plugins/SMS/src/recvdlg.cpp b/plugins/SMS/src/recvdlg.cpp
deleted file mode 100644
index 9dfa15f10a..0000000000
--- a/plugins/SMS/src/recvdlg.cpp
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
-Miranda-IM SMS Plugin
-Copyright (C) 2001-2 Richard Hughes
-Copyright (C) 2007-19 Rozhuk Ivan
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
----------------------------------------------------------------------------
-
-This was the original words.
-This plugin was modified by Ariel Shulman (NuKe007).
-For any comments, problems, etc. contact me at Miranda-IM forums or E-Mail or ICQ.
-All the information needed you can find at www.nuke007.tk
-Enjoy the code and use it smartly!
-*/
-
-#include "stdafx.h"
-
-//Defnition needed to the SMS window list
-typedef struct
-{
- LIST_MT_ITEM lmtListMTItem;
- HWND hWnd;
- HBRUSH hBkgBrush;
- MCONTACT hContact;
-} RECV_SMS_WINDOW_DATA;
-
-INT_PTR CALLBACK RecvSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM lParam);
-#define GET_WINDOW_DATA(hWndDlg) ((RECV_SMS_WINDOW_DATA*)GetWindowLongPtr(hWndDlg,GWLP_USERDATA))
-
-DWORD RecvSMSWindowInitialize()
-{
- DWORD dwRetErrorCode;
-
- dwRetErrorCode = ListMTInitialize(&ssSMSSettings.lmtRecvSMSWindowsListMT, 0);
- return(dwRetErrorCode);
-}
-
-//This function destroy all SMS receive windows
-void RecvSMSWindowDestroy()
-{
- RECV_SMS_WINDOW_DATA *prswdWindowData;
-
- ListMTLock(&ssSMSSettings.lmtRecvSMSWindowsListMT);
- while (ListMTItemGetFirst(&ssSMSSettings.lmtRecvSMSWindowsListMT, nullptr, (LPVOID*)&prswdWindowData) == NO_ERROR) {// цикл
- RecvSMSWindowRemove(prswdWindowData->hWnd);
- }
- ListMTUnLock(&ssSMSSettings.lmtRecvSMSWindowsListMT);
- ListMTDestroy(&ssSMSSettings.lmtRecvSMSWindowsListMT);
-}
-
-
-INT_PTR CALLBACK RecvSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM lParam)
-{
- RECV_SMS_WINDOW_DATA *prswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- switch (message) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hWndDlg); //Translate intially - bid
-
- prswdWindowData = (RECV_SMS_WINDOW_DATA*)lParam;
- SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
-
- mir_subclassWindow(GetDlgItem(hWndDlg, IDC_MESSAGE), MessageSubclassProc);
- {
- LOGFONT lf;
- HFONT hFont = (HFONT)SendDlgItemMessage(hWndDlg, IDC_MESSAGE, WM_GETFONT, 0, 0);
- if (hFont && hFont != (HFONT)SendDlgItemMessage(hWndDlg, IDOK, WM_GETFONT, 0, 0)) DeleteObject(hFont);
- LoadMsgDlgFont(MSGFONTID_YOURMSG, &lf, nullptr);
- hFont = CreateFontIndirect(&lf);
- SendDlgItemMessage(hWndDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
-
- COLORREF colour = db_get_dw(0, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR);
- prswdWindowData->hBkgBrush = CreateSolidBrush(colour);
- }
-
- // def pos
- if (Utils_RestoreWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? prswdWindowData->hContact : NULL), MODULENAME, "recv"))
- SetWindowPos(hWndDlg, nullptr, 200, 200, 400, 350, SWP_NOZORDER);
-
- InvalidateRect(GetDlgItem(hWndDlg, IDC_MESSAGE), nullptr, FALSE);
- break;
-
- case WM_CTLCOLORSTATIC:
- if ((HWND)lParam == GetDlgItem(hWndDlg, IDC_MESSAGE)) {
- COLORREF colour;
-
- LoadMsgDlgFont(MSGFONTID_YOURMSG, nullptr, &colour);
- SetTextColor((HDC)wParam, colour);
- SetBkColor((HDC)wParam, db_get_dw(0, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR));
- return (INT_PTR)prswdWindowData->hBkgBrush;
- }
- break;
-
- case WM_GETMINMAXINFO:
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.x = 300;
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.y = 230;
- break;
-
- case WM_SIZE:
- RECT rcWin;
- GetWindowRect(hWndDlg, &rcWin);
- {
- int cx = rcWin.right - rcWin.left - 10;
- int cy = rcWin.bottom - rcWin.top - 10;
- SetWindowPos(GetDlgItem(hWndDlg, IDC_MESSAGE), nullptr, 0, 0, cx - 14, cy - 112, SWP_NOZORDER | SWP_NOMOVE);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_NAME), nullptr, 0, 0, (cx * 35) / 100, 20, SWP_NOZORDER | SWP_NOMOVE);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_NUMBER), nullptr, cx - (cx * 35) / 100 - 11, 5, (cx * 35) / 100, 20, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_ST_NUMBER), nullptr, cx - (cx * 35) / 100 - 58, 5, 40, 20, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_READNEXT), nullptr, cx - 87, cy - 60, 80, 25, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDOK), nullptr, cx / 2 - 87, cy - 60, 80, 25, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDCANCEL), nullptr, cx / 2 + 7, cy - 60, 80, 25, SWP_NOZORDER);
- }
- RedrawWindow(hWndDlg, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
- break;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDOK:
- {
- WCHAR wszPhone[MAX_PHONE_LEN];
- MCONTACT hContact = HContactFromPhone(wszPhone, GetDlgItemText(hWndDlg, IDC_NUMBER, wszPhone, _countof(wszPhone)));
- HWND hwndSendSms = SendSMSWindowIsOtherInstanceHContact(hContact);
- if (hwndSendSms)
- SetFocus(hwndSendSms);
- else {
- hwndSendSms = SendSMSWindowAdd(prswdWindowData->hContact);
- SetDlgItemText(hwndSendSms, IDC_ADDRESS, wszPhone);
- }
- } // fallthrough
- case IDCANCEL:
- RecvSMSWindowRemove(hWndDlg);
- break;
- }
- break;
-
- case WM_CLOSE:
- DeleteObject(prswdWindowData->hBkgBrush);
- RecvSMSWindowRemove(hWndDlg);
- break;
- }
-
- return FALSE;
-}
-
-//SMS Receive window list functions
-
-//This function create a new SMS receive window, and insert it to the list.
-//The function gets void and return the window HWND
-HWND RecvSMSWindowAdd(MCONTACT hContact, DWORD dwEventType, LPWSTR lpwszPhone, size_t dwPhoneSize, LPSTR lpszMessage, size_t dwMessageSize)
-{
- HWND hRet = nullptr;
-
- if ((dwPhoneSize + dwMessageSize) <= MIN_SMS_DBEVENT_LEN)
- return nullptr;
-
- LPWSTR lpwszMessage;
- lpwszMessage = (LPWSTR)MEMALLOC(((dwMessageSize + MAX_PATH) * sizeof(WCHAR)));
- if (!lpwszMessage)
- return nullptr;
-
- RECV_SMS_WINDOW_DATA *prswdWindowData;
-
- prswdWindowData = (RECV_SMS_WINDOW_DATA*)MEMALLOC(sizeof(RECV_SMS_WINDOW_DATA));
- if (prswdWindowData) {
- prswdWindowData->hContact = hContact;
- prswdWindowData->hWnd = CreateDialogParam(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDD_RECVSMS), nullptr, RecvSmsDlgProc, (LPARAM)prswdWindowData);
- if (prswdWindowData->hWnd) {
- HICON hIcon;
- WCHAR wszTitle[MAX_PATH] = { 0 }, wszPhoneLocal[MAX_PHONE_LEN] = { 0 };
- UINT iIcon;
- LPWSTR lpwszContactDisplayName, lpwszTitlepart;
-
- ListMTLock(&ssSMSSettings.lmtRecvSMSWindowsListMT);
- ListMTItemAdd(&ssSMSSettings.lmtRecvSMSWindowsListMT, &prswdWindowData->lmtListMTItem, prswdWindowData);
- ListMTUnLock(&ssSMSSettings.lmtRecvSMSWindowsListMT);
-
- switch (dwEventType) {
- case ICQEVENTTYPE_SMS:
- lpwszTitlepart = TranslateT("Received SMS");
- hIcon = Skin_LoadIcon(SKINICON_OTHER_SMS);
- break;
- case ICQEVENTTYPE_SMSCONFIRMATION:
- lpwszTitlepart = TranslateT("Received SMS Confirmation");
- GetDataFromMessage(lpszMessage, dwMessageSize, nullptr, nullptr, 0, nullptr, &iIcon);
- hIcon = (HICON)LoadImage(ssSMSSettings.hInstance, MAKEINTRESOURCE(iIcon), IMAGE_ICON, 0, 0, LR_SHARED);
- break;
- default:
- lpwszTitlepart = L"Unknown event type";
- hIcon = nullptr;
- }
-
- wszPhoneLocal[0] = '+';
- if (dwPhoneSize)
- dwPhoneSize = CopyNumberW((wszPhoneLocal + 1), lpwszPhone, dwPhoneSize);
- else {
- GetDataFromMessage(lpszMessage, dwMessageSize, nullptr, (wszPhoneLocal + 1), (_countof(wszPhoneLocal) - 1), &dwPhoneSize, nullptr);
- dwPhoneSize++;
- }
-
- lpwszContactDisplayName = Clist_GetContactDisplayName(hContact);
- mir_snwprintf(wszTitle, L"%s - %s", lpwszContactDisplayName, lpwszTitlepart);
- MultiByteToWideChar(CP_UTF8, 0, lpszMessage, (int)dwMessageSize, lpwszMessage, (int)dwMessageSize + MAX_PATH);
-
- SetWindowText(prswdWindowData->hWnd, wszTitle);
- SetDlgItemText(prswdWindowData->hWnd, IDC_NAME, lpwszContactDisplayName);
- SetDlgItemText(prswdWindowData->hWnd, IDC_NUMBER, wszPhoneLocal);
- SetDlgItemText(prswdWindowData->hWnd, IDC_MESSAGE, lpwszMessage);
- SendMessage(prswdWindowData->hWnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
-
- SetFocus(GetDlgItem(prswdWindowData->hWnd, IDC_MESSAGE));
- hRet = prswdWindowData->hWnd;
- }
- else MEMFREE(prswdWindowData);
- }
- MEMFREE(lpwszMessage);
- return(hRet);
-}
-
-//This function close the SMS receive window that given, and remove it from the list.
-//The function gets the HWND of the window that should be removed and return void
-void RecvSMSWindowRemove(HWND hWndDlg)
-{
- RECV_SMS_WINDOW_DATA *prswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- if (prswdWindowData) {
- Utils_SaveWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? prswdWindowData->hContact : NULL), MODULENAME, "recv");
-
- ListMTLock(&ssSMSSettings.lmtRecvSMSWindowsListMT);
- ListMTItemDelete(&ssSMSSettings.lmtRecvSMSWindowsListMT, &prswdWindowData->lmtListMTItem);
- ListMTUnLock(&ssSMSSettings.lmtRecvSMSWindowsListMT);
- MEMFREE(prswdWindowData);
- }
- DestroyWindow(hWndDlg);
-}
diff --git a/plugins/SMS/src/recvdlg.h b/plugins/SMS/src/recvdlg.h
deleted file mode 100644
index 26fb6bb47a..0000000000
--- a/plugins/SMS/src/recvdlg.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#if !defined(AFX_SMS_RECVDLG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
-#define AFX_SMS_RECVDLG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
-
-DWORD RecvSMSWindowInitialize ();
-void RecvSMSWindowDestroy ();
-HWND RecvSMSWindowAdd (MCONTACT hContact,DWORD dwEventType,LPWSTR lpwszPhone,size_t dwPhoneSize,LPSTR lpszMessage,size_t dwMessageSize);
-void RecvSMSWindowRemove (HWND hWndDlg);
-
-
-
-#endif // !defined(AFX_SMS_RECVDLG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/plugins/SMS/src/resource.h b/plugins/SMS/src/resource.h
deleted file mode 100644
index 3a7e98455d..0000000000
--- a/plugins/SMS/src/resource.h
+++ /dev/null
@@ -1,70 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by resource.rc
-//
-#define IDD_SENDSMS 102
-#define IDR_CONTEXT 104
-#define IDD_RECVSMS 109
-#define IDI_SMSNOTSENT 110
-#define IDI_SMSSENT 111
-#define IDD_SMSTIMEDOUT 112
-#define IDD_SENDSMSTIMEDOUT 113
-#define IDI_HALFTICK 119
-#define IDD_SENDSMSACCEPT 120
-#define IDD_OPT_SMSPLUGIN 234
-#define IDC_ADDRESS 1000
-#define IDC_EDIT 1001
-#define IDC_ADDRESS2 1001
-#define IDC_ACCOUNTS 1001
-#define IDC_MESSAGE 1002
-#define IDC_STATUS 1003
-#define IDC_NUMBER 1004
-#define IDC_NAME 1005
-#define IDC_ADD 1006
-#define IDC_DELETE 1008
-#define IDC_SIGNATURE 1008
-#define IDC_LIST 1009
-#define IDC_COUNT 1010
-#define IDC_TEXT 1011
-#define IDC_MSGTYPE 1012
-#define IDC_MSGTIME 1013
-#define IDC_BEGIN 1017
-#define IDC_END 1018
-#define IDC_SAVENUMBER 1020
-#define IDC_MULTIPLE 1025
-#define IDC_ADDNUMBER 1029
-#define IDC_ST_CHARS 1033
-#define IDC_ST_ENTERMESSAGE 1034
-#define IDC_ST_TO 1035
-#define IDC_ST_ADDRESS 1036
-#define IDC_ST_NUMBER 1037
-#define IDC_NUMBERSLIST 1038
-#define IDC_MESSAGEID 1039
-#define IDC_SOURCE 1040
-#define IDC_NETWORK 1041
-#define IDC_SHOWACK 1044
-#define IDC_NOSHOWACK 1045
-#define IDC_AUTOPOP 1045
-#define IDC_READNEXT 1046
-#define IDC_SAVEWINPOS 1046
-#define IDC_USESIGNATURE 1047
-#define IDC_SIGNGROUP 1048
-#define IDC_ST_MESSAGEID 1049
-#define IDC_ST_NETWORK 1050
-#define IDC_ST_SOURCE 1051
-#define IDC_HISTORY 1080
-#define IDM_VIEWMSG 40001
-#define IDM_VIEWACK 40002
-#define IDM_VIEWRCPT 40003
-#define IDC_STATIC -1
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 121
-#define _APS_NEXT_COMMAND_VALUE 40004
-#define _APS_NEXT_CONTROL_VALUE 1053
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/plugins/SMS/src/send.cpp b/plugins/SMS/src/send.cpp
deleted file mode 100644
index e563d6cf52..0000000000
--- a/plugins/SMS/src/send.cpp
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
-Miranda-IM SMS Plugin
-Copyright (C) 2001-2 Richard Hughes
-Copyright (C) 2007-19 Rozhuk Ivan
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
----------------------------------------------------------------------------
-
-This was the original words.
-This plugin was modified by Ariel Shulman (NuKe007).
-For any comments, problems, etc. contact me at Miranda-IM forums or E-Mail or ICQ.
-All the information needed you can find at www.nuke007.tk
-Enjoy the code and use it smartly!
-*/
-
-#include "stdafx.h"
-
-//This function gets HWND of the window, the number, and the message.
-void StartSmsSend(HWND hWndDlg,size_t dwModuleIndex,LPWSTR lpwszPhone,size_t dwPhoneSize,LPWSTR lpwszMessage,size_t dwMessageSize)
-{
- if ( !ssSMSSettings.ppaSMSAccounts || dwModuleIndex == -1 || dwModuleIndex >= ssSMSSettings.dwSMSAccountsCount)
- return;
-
- LPSTR lpszMessageUTF;
- LPWSTR lpwszMessageXMLEncoded;
- size_t dwMessageUTFBuffSize, dwMessageXMLEncodedSize, dwBuffSize;
- DBEVENTINFO *pdbei;
-
- dwMessageXMLEncodedSize = ((dwMessageSize + MAX_PATH) * sizeof(WCHAR) * 6);
- lpwszMessageXMLEncoded = (LPWSTR)MEMALLOC(dwMessageXMLEncodedSize);
- if ( !lpwszMessageXMLEncoded)
- return;
-
- EncodeXML(lpwszMessage, dwMessageSize, lpwszMessageXMLEncoded, (dwMessageXMLEncodedSize / sizeof(WCHAR)), &dwMessageXMLEncodedSize);
-
- dwMessageUTFBuffSize = (dwMessageXMLEncodedSize + MAX_PATH);
- lpszMessageUTF = (LPSTR)MEMALLOC(dwMessageUTFBuffSize);
- if (lpszMessageUTF)
- {
- dwBuffSize = (dwPhoneSize + MAX_PATH+WideCharToMultiByte(CP_UTF8, 0, lpwszMessage, (int)dwMessageSize, lpszMessageUTF, (int)dwMessageUTFBuffSize, nullptr, nullptr));
- pdbei = (DBEVENTINFO*)MEMALLOC((sizeof(DBEVENTINFO) + dwBuffSize));
- if (pdbei)
- {
- char szPhone[MAX_PHONE_LEN];
- LPSTR lpszBuff = (LPSTR)(pdbei + 1);
- HANDLE hProcess;
-
- WideCharToMultiByte(CP_UTF8, 0, lpwszPhone, (int)dwPhoneSize, szPhone, MAX_PHONE_LEN, nullptr, nullptr);
- dwPhoneSize=CopyNumberA(szPhone, szPhone, dwPhoneSize);
-
- pdbei->timestamp = time(0);
- pdbei->flags = (DBEF_SENT | DBEF_UTF);
- pdbei->eventType = ICQEVENTTYPE_SMS;
- pdbei->cbBlob = (mir_snprintf(lpszBuff, dwBuffSize, "SMS To: +%s\r\n%s", szPhone, lpszMessageUTF) + 4);
- pdbei->pBlob = (PBYTE)lpszBuff;
- SendSMSWindowDbeiSet(hWndDlg, pdbei);
-
- char *szProto = ssSMSSettings.ppaSMSAccounts[dwModuleIndex]->szModuleName;
- if (ProtoServiceExists(szProto, MS_ICQ_SENDSMS)) {
- WideCharToMultiByte(CP_UTF8, 0, lpwszMessageXMLEncoded, (int)dwMessageXMLEncodedSize, lpszMessageUTF, (int)dwMessageUTFBuffSize, nullptr, nullptr);
- hProcess = (HANDLE)CallProtoService(szProto, MS_ICQ_SENDSMS, (WPARAM)szPhone, (LPARAM)lpszMessageUTF);
- SendSMSWindowHProcessSet(hWndDlg, hProcess);
- }
- else MEMFREE(pdbei);
- }
- MEMFREE(lpszMessageUTF);
- }
- MEMFREE(lpwszMessageXMLEncoded);
-}
-
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp
deleted file mode 100644
index 01b37171e8..0000000000
--- a/plugins/SMS/src/senddlg.cpp
+++ /dev/null
@@ -1,1084 +0,0 @@
-/*
-Miranda-IM SMS Plugin
-Copyright (C) 2001-2 Richard Hughes
-Copyright (C) 2007-19 Rozhuk Ivan
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
----------------------------------------------------------------------------
-
-This was the original words.
-This plugin was modified by Ariel Shulman (NuKe007).
-For any comments, problems, etc. contact me at Miranda-IM forums or E-Mail or ICQ.
-All the information needed you can find at www.nuke007.tk
-Enjoy the code and use it smartly!
-*/
-
-#include "stdafx.h"
-
-#define TIMERID_MSGSEND 0
-#define TIMEDOUT_CANCEL 0
-#define TIMEDOUT_RETRY 1
-#define DM_TIMEOUTDECIDED (WM_USER+18)
-
-
-//Defnition needed to the SMS window list
-typedef struct
-{
- LIST_MT_ITEM lmtListMTItem;
- HWND hWnd;
- HBRUSH hBkgBrush;
- HANDLE hProcess;
- MCONTACT hContact;
- MCONTACT hMyContact;
- HTREEITEM hItemSend;
- BOOL bMultiple;
- size_t dwContactsListCount;
- MCONTACT *phContactsList;
- DBEVENTINFO *pdbei;
-} SEND_SMS_WINDOW_DATA;
-
-void AddContactPhonesToCombo(HWND hWnd, MCONTACT hContact);
-void SendSMSWindowFillTreeView(HWND hWnd);
-size_t GetSMSMessageLenMax(HWND hWndDlg);
-
-#define GET_WINDOW_DATA(hWndDlg) ((SEND_SMS_WINDOW_DATA*)GetWindowLongPtr(hWndDlg,GWLP_USERDATA))
-
-DWORD SendSMSWindowInitialize()
-{
- return ListMTInitialize(&ssSMSSettings.lmtSendSMSWindowsListMT, 0);
-}
-
-void SendSMSWindowDestroy()
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData;
-
- ListMTLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
- while (ListMTItemGetFirst(&ssSMSSettings.lmtSendSMSWindowsListMT, nullptr, (LPVOID*)&psswdWindowData) == NO_ERROR)
- SendSMSWindowRemove(psswdWindowData->hWnd);
-
- ListMTUnLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
- ListMTDestroy(&ssSMSSettings.lmtSendSMSWindowsListMT);
-}
-
-INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LPARAM lParam)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- switch (message) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hWndDlg); //Translate intially - bid
- ////////AddWinHandle(GetDlgItem(hWndDlg,IDC_MESSAGE));
-
- psswdWindowData = (SEND_SMS_WINDOW_DATA*)lParam;
- SetWindowLongPtr(hWndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
-
- mir_subclassWindow(GetDlgItem(hWndDlg, IDC_MESSAGE), MessageSubclassProc);
-
- Window_SetSkinIcon_IcoLib(hWndDlg, SKINICON_OTHER_SMS);
- SendDlgItemMessage(hWndDlg, IDC_HISTORY, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_HISTORY));
- {
- HICON hIcon;
- HIMAGELIST hIml = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 30);
- TreeView_SetImageList(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), hIml, TVSIL_NORMAL);
- hIcon = Skin_LoadIcon(SKINICON_OTHER_NOTICK);
- ImageList_AddIcon(hIml, hIcon);
- hIcon = Skin_LoadIcon(SKINICON_OTHER_TICK);
- ImageList_AddIcon(hIml, hIcon);
- hIcon = (HICON)LoadImage(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDI_HALFTICK), IMAGE_ICON, 0, 0, LR_SHARED);
- ImageList_AddIcon(hIml, hIcon);
- }
- {
- LOGFONT lf;
- HFONT hFont = (HFONT)SendDlgItemMessage(hWndDlg, IDC_MESSAGE, WM_GETFONT, 0, 0);
- if (hFont && hFont != (HFONT)SendDlgItemMessage(hWndDlg, IDOK, WM_GETFONT, 0, 0)) DeleteObject(hFont);
- LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, &lf, nullptr);
- hFont = CreateFontIndirect(&lf);
- SendDlgItemMessage(hWndDlg, IDC_MESSAGE, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
-
- COLORREF colour = db_get_dw(0, SRMMMOD, SRMSGSET_INPBKGCOLOUR, SRMSGDEFSET_BKGCOLOUR);
- psswdWindowData->hBkgBrush = CreateSolidBrush(colour);
- }
- {
- HWND hwndToolTips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, TEXT(""), WS_POPUP, 0, 0, 0, 0, nullptr, nullptr, GetModuleHandle(nullptr), nullptr);
- TOOLINFO ti;
- memset(&ti, 0, sizeof(ti));
- ti.cbSize = sizeof(ti);
- ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
- ti.uId = (UINT_PTR)GetDlgItem(hWndDlg, IDC_HISTORY);
- ti.lpszText = TranslateT("View User's History");
- SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM)&ti);
- ti.uId = (UINT_PTR)GetDlgItem(hWndDlg, IDC_ADDNUMBER);
- ti.lpszText = TranslateT("Add Number To The Multiple List");
- SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM)&ti);
- ti.uId = (UINT_PTR)GetDlgItem(hWndDlg, IDC_SAVENUMBER);
- ti.lpszText = TranslateT("Save Number To The User's Details Phonebook");
- SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM)&ti);
- ti.uId = (UINT_PTR)GetDlgItem(hWndDlg, IDC_MULTIPLE);
- ti.lpszText = TranslateT("Show/Hide Multiple List");
- SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM)&ti);
- ti.uId = (UINT_PTR)GetDlgItem(hWndDlg, IDC_COUNT);
- ti.lpszText = TranslateT("Shows How Much Chars You've Typed");
- SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM)&ti);
- }
- {
- RECT rcWin, rcList;
- GetWindowRect(hWndDlg, &rcWin);
- GetWindowRect(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), &rcList);
- SetWindowPos(hWndDlg, nullptr, rcWin.left, rcWin.top, rcWin.right - rcWin.left - (rcList.right - rcList.left) - 10, rcWin.bottom - rcWin.top, SWP_NOZORDER | SWP_NOMOVE);
- }
-
- SendSMSWindowUpdateAccountList(hWndDlg);
-
- {
- wchar_t tszSign[1024];
- size_t dwSignLen = 0;
-
- if (DB_SMS_GetByte(NULL, "UseSignature", SMS_DEFAULT_USESIGNATURE))
- if (DB_SMS_GetStaticStringW(NULL, "Signature", tszSign, _countof(tszSign), &dwSignLen)) {
- SetDlgItemText(hWndDlg, IDC_MESSAGE, tszSign);
-
- if (DB_SMS_GetByte(NULL, "SignaturePos", SMS_DEFAULT_SIGNATUREPOS))
- SendDlgItemMessage(hWndDlg, IDC_MESSAGE, EM_SETSEL, dwSignLen, dwSignLen);
- EnableWindow(GetDlgItem(hWndDlg, IDOK), dwSignLen != 0);
- }
-
- mir_snwprintf(tszSign, L"%d/%d", dwSignLen, GetSMSMessageLenMax(hWndDlg));
- SetDlgItemText(hWndDlg, IDC_COUNT, tszSign);
- }
-
- if (Utils_RestoreWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? psswdWindowData->hMyContact : NULL), MODULENAME, "send")) {// def pos
- SetWindowPos(hWndDlg, nullptr, 200, 200, 400, 350, SWP_NOZORDER);
- }
- InvalidateRect(GetDlgItem(hWndDlg, IDC_MESSAGE), nullptr, FALSE);
- return TRUE;
- case WM_GETMINMAXINFO:
- if (psswdWindowData->bMultiple) {
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.x = 461;
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.y = 230;
- }
- else {
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.x = 300;
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.y = 230;
- }
- break;
- case WM_SIZE:
- {
- int cx, cy;
- RECT rcWin;
- GetWindowRect(hWndDlg, &rcWin);
- if (psswdWindowData->bMultiple) {
- cx = rcWin.right - rcWin.left - 181;
- cy = rcWin.bottom - rcWin.top;
- }
- else {
- cx = rcWin.right - rcWin.left;
- cy = rcWin.bottom - rcWin.top;
- }
- cx -= 10; /* XXX: fix window sizes for aero. */
- cy -= 10;
- SetWindowPos(GetDlgItem(hWndDlg, IDC_MESSAGE), nullptr, 0, 0, cx - 14, cy - 132, SWP_NOZORDER | SWP_NOMOVE);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_NAME), nullptr, 0, 0, (cx * 35) / 100, 20, SWP_NOZORDER | SWP_NOMOVE);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_ACCOUNTS), nullptr, 0, 0, (cx * 35) / 100, 20, SWP_NOZORDER | SWP_NOMOVE);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_ADDRESS), nullptr, cx - (cx * 35) / 100 - 11, 5, (cx * 35) / 100, 20, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_ST_ADDRESS), nullptr, cx - (cx * 35) / 100 - 68, 5, 50, 20, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_MULTIPLE), nullptr, cx - ((cx * 35) / 100 + 35) / 2 - 11, 30, ((cx * 35) / 100 + 35) / 2, 20, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_SAVENUMBER), nullptr, cx - (cx * 35) / 100 - 58, 30, ((cx * 35) / 100 + 35) / 2, 20, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_HISTORY), nullptr, 0, 0, 20, 20, SWP_NOZORDER | SWP_NOMOVE);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_COUNT), nullptr, cx - 61, 52, 50, 15, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_ST_CHARS), nullptr, cx - 106, 52, 40, 15, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_ADDNUMBER), nullptr, cx, 5, 170, 20, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), nullptr, cx, 25, 170, cy - 90, SWP_NOZORDER);
- //SetWindowPos(GetDlgItem(hWndDlg,IDC_REMOVENUMBER),0,cx,cy - 110 + 25,170,20,SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDOK), nullptr, cx / 2 - 87, cy - 60, 80, 25, SWP_NOZORDER);
- SetWindowPos(GetDlgItem(hWndDlg, IDCANCEL), nullptr, cx / 2 + 7, cy - 60, 80, 25, SWP_NOZORDER);
- RedrawWindow(hWndDlg, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
- }
- break;
- case WM_TIMER:
- if (wParam == TIMERID_MSGSEND) {
- HWND hwndTimeOut;
- wchar_t tszMessage[1028], tszPhone[MAX_PHONE_LEN];
-
- if (psswdWindowData->bMultiple) {
- TVITEM tvi;
- tvi.mask = TVIF_TEXT;
- tvi.hItem = SendSMSWindowHItemSendGet(hWndDlg);
- tvi.pszText = tszPhone;
- tvi.cchTextMax = _countof(tszPhone);
- TreeView_GetItem(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), &tvi);
- }
- else {
- GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone));
- }
- mir_snwprintf(tszMessage, TranslateT("The SMS message send to %s timed out."), tszPhone);
- KillTimer(hWndDlg, wParam);
- ShowWindow(hWndDlg, SW_SHOWNORMAL);
- EnableWindow(hWndDlg, FALSE);
- hwndTimeOut = CreateDialog(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDD_SENDSMSTIMEDOUT), hWndDlg, SMSTimedOutDlgProc);
- SetDlgItemText(hwndTimeOut, IDC_STATUS, tszMessage);
- }
- break;
- case WM_CTLCOLOREDIT:
- if ((HWND)lParam == GetDlgItem(hWndDlg, IDC_MESSAGE)) {
- COLORREF colour;
-
- LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, nullptr, &colour);
- SetTextColor((HDC)wParam, colour);
- SetBkColor((HDC)wParam, db_get_dw(0, SRMMMOD, SRMSGSET_INPBKGCOLOUR, SRMSGDEFSET_BKGCOLOUR));
- return((INT_PTR)psswdWindowData->hBkgBrush);
- }
- break;
- case DM_TIMEOUTDECIDED:
- EnableWindow(hWndDlg, TRUE);
- switch (wParam) {
- case TIMEDOUT_CANCEL:
- if (psswdWindowData->bMultiple) {
- if (SendSMSWindowNextHItemGet(hWndDlg, psswdWindowData->hItemSend)) {
- psswdWindowData->hItemSend = SendSMSWindowNextHItemGet(hWndDlg, psswdWindowData->hItemSend);
- SendSMSWindowNext(hWndDlg);
- }
- else {
- SendSMSWindowRemove(hWndDlg);
- }
- }
- else {
- EnableWindow(GetDlgItem(hWndDlg, IDOK), TRUE);
- SendDlgItemMessage(hWndDlg, IDC_MESSAGE, EM_SETREADONLY, FALSE, 0);
- EnableWindow(GetDlgItem(hWndDlg, IDC_ACCOUNTS), TRUE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_ADDRESS), TRUE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_SAVENUMBER), TRUE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_MULTIPLE), TRUE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), TRUE);
- if (psswdWindowData->hMyContact == NULL) EnableWindow(GetDlgItem(hWndDlg, IDC_NAME), TRUE);
- SetFocus(GetDlgItem(hWndDlg, IDC_MESSAGE));
- psswdWindowData->hItemSend = nullptr;
- }
- break;
- case TIMEDOUT_RETRY:
- {
- wchar_t tszPhone[MAX_PHONE_LEN];
- size_t dwPhoneSize;
-
- size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
- LPTSTR lpwszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(wchar_t)));
- if (lpwszMessage) {
- if (psswdWindowData->bMultiple) {
- TVITEM tvi;
- tvi.mask = TVIF_TEXT;
- tvi.hItem = psswdWindowData->hItemSend;
- tvi.pszText = tszPhone;
- tvi.cchTextMax = _countof(tszPhone);
- TreeView_GetItem(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), &tvi);
- dwPhoneSize = mir_wstrlen(tszPhone);
- }
- else dwPhoneSize = GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone));
-
- dwMessageSize = GetDlgItemText(hWndDlg, IDC_MESSAGE, lpwszMessage, (int)dwMessageSize + 2);
- SendSMSWindowNumberSet(hWndDlg, tszPhone, dwPhoneSize);
- StartSmsSend(hWndDlg, SendDlgItemMessage(hWndDlg, IDC_ACCOUNTS, CB_GETCURSEL, 0, 0), tszPhone, dwPhoneSize, lpwszMessage, dwMessageSize);
- MEMFREE(lpwszMessage);
- }
- }
- SetTimer(hWndDlg, TIMERID_MSGSEND, TIMEOUT_MSGSEND, nullptr);
- break;
- }
- break;
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_MULTIPLE:
- SendSMSWindowMultipleSet(hWndDlg, !psswdWindowData->bMultiple);
- break;
-
- case IDC_ADDNUMBER:
- {
- wchar_t tszPhone[MAX_PHONE_LEN];
- if (IsPhoneW(tszPhone, GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone)))) {
- TVINSERTSTRUCT tvis = {};
- tvis.item.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvis.hInsertAfter = TVI_SORT;
- tvis.item.pszText = tszPhone;
- TreeView_InsertItem(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), &tvis);
- }
- else MessageBox(hWndDlg, TranslateT("The phone number should start with a + and consist of numbers, spaces, brackets and hyphens only."), TranslateT("Invalid Phone Number"), MB_OK);
- }
- break;
-
- case IDC_HISTORY:
- CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)psswdWindowData->hMyContact, 0);
- break;
-
- case IDOK:
- if ((size_t)GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE) > GetSMSMessageLenMax(hWndDlg)) {
- MessageBox(hWndDlg, TranslateT("Message is too long, press OK to continue."), TranslateT("Error - Message too long"), MB_OK);
- }
- else {
- if (psswdWindowData->bMultiple) {
- HTREEITEM hItem = SendSMSWindowNextHItemGet(hWndDlg, TreeView_GetRoot(GetDlgItem(hWndDlg, IDC_NUMBERSLIST)));
- if (hItem) {
- psswdWindowData->hItemSend = hItem;
- EnableWindow(GetDlgItem(hWndDlg, IDOK), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_SAVENUMBER), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_NAME), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_MULTIPLE), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_ADDNUMBER), FALSE);
- //EnableWindow(GetDlgItem(hWndDlg,IDC_REMOVENUMBER),FALSE);
- SendDlgItemMessage(hWndDlg, IDC_MESSAGE, EM_SETREADONLY, TRUE, 0);
- EnableWindow(GetDlgItem(hWndDlg, IDC_ACCOUNTS), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_ADDRESS), FALSE);
- SendSMSWindowNext(hWndDlg);
- }
- else {
- MessageBox(hWndDlg, TranslateT("There must be numbers in the list first."), TranslateT("No Numbers"), MB_OK);
- }
- }
- else {
- wchar_t tszPhone[MAX_PHONE_LEN];
- size_t dwPhoneSize = GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, _countof(tszPhone));
- if (IsPhoneW(tszPhone, dwPhoneSize)) {
- size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
- LPTSTR lpwszMessage = (LPTSTR)MEMALLOC((dwMessageSize + 4)*sizeof(WCHAR));
- if (lpwszMessage) {
- dwMessageSize = GetDlgItemText(hWndDlg, IDC_MESSAGE, lpwszMessage, (int)dwMessageSize + 2);
- SendSMSWindowNumberSet(hWndDlg, tszPhone, dwPhoneSize);
- EnableWindow(GetDlgItem(hWndDlg, IDOK), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_SAVENUMBER), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_NAME), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_MULTIPLE), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_ACCOUNTS), FALSE);
- EnableWindow(GetDlgItem(hWndDlg, IDC_ADDRESS), FALSE);
- SendDlgItemMessage(hWndDlg, IDC_MESSAGE, EM_SETREADONLY, TRUE, 0);
- StartSmsSend(hWndDlg, SendDlgItemMessage(hWndDlg, IDC_ACCOUNTS, CB_GETCURSEL, 0, 0), tszPhone, dwPhoneSize, lpwszMessage, dwMessageSize);
- SetTimer(hWndDlg, TIMERID_MSGSEND, TIMEOUT_MSGSEND, nullptr);
-
- MEMFREE(lpwszMessage);
- }
- }
- else {
- MessageBox(hWndDlg, TranslateT("Valid phone numbers are of the form '+(country code)(phone number)'. The contents of the phone number portion is dependent on the national layout of phone numbers, but often omits the leading zero."), TranslateT("Invalid phone number"), MB_OK);
- SetFocus(GetDlgItem(hWndDlg, IDC_ADDRESS));
- SendDlgItemMessage(hWndDlg, IDC_ADDRESS, CB_SETEDITSEL, 0, MAKELPARAM(0, -1));
- }
- }
- }
- break;
- case IDCANCEL:
- DeleteObject((HFONT)SendDlgItemMessage(hWndDlg, IDC_MESSAGE, WM_GETFONT, 0, 0));
- KillTimer(GetParent(hWndDlg), TIMERID_MSGSEND);
- SendSMSWindowRemove(hWndDlg);
- break;
- case IDC_MESSAGE:
- if (HIWORD(wParam) == EN_CHANGE) {
- wchar_t tszBuff[MAX_PATH];
- size_t dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
-
- EnableWindow(GetDlgItem(hWndDlg, IDOK), dwMessageSize != 0);
- mir_snwprintf(tszBuff, L"%d/%d", dwMessageSize, GetSMSMessageLenMax(hWndDlg));
- SetDlgItemText(hWndDlg, IDC_COUNT, tszBuff);
- }
- break;
- case IDC_SAVENUMBER:
- {
- BOOL bCont = TRUE;
- char szBuff[MAX_PATH];
- wchar_t tszPhone[MAX_PHONE_LEN];
- DBVARIANT dbv;
-
- size_t dwPhoneSize = GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, (_countof(tszPhone) - 4));
- if (IsPhoneW(tszPhone, dwPhoneSize)) {
- if (IsContactPhone(psswdWindowData->hMyContact, tszPhone, dwPhoneSize) == FALSE) {
- mir_wstrcat(tszPhone, L" SMS");
- for (DWORD i = 0; bCont; i++) {
- mir_snprintf(szBuff, "MyPhone%d", i);
- if (db_get(psswdWindowData->hMyContact, "UserInfo", szBuff, &dbv))
- bCont = FALSE;
- db_free(&dbv);
- }
- DB_SetStringW(psswdWindowData->hMyContact, "UserInfo", szBuff, tszPhone);
- }
- }
- else {
- MessageBox(hWndDlg, TranslateT("The phone number should start with a + and consist of numbers, spaces, brackets and hyphens only."), TranslateT("Invalid Phone Number"), MB_OK);
- }
- }
- break;
- case IDC_NAME:
- if (HIWORD(wParam) == CBN_SELCHANGE) {
- SendDlgItemMessage(hWndDlg, IDC_ADDRESS, CB_RESETCONTENT, 0, 0);
- if (SendDlgItemMessage(hWndDlg, IDC_NAME, CB_GETCURSEL, 0, 0)) {
- MCONTACT hContact = SendSMSWindowSMSContactGet(hWndDlg, (SendDlgItemMessage(hWndDlg, IDC_NAME, CB_GETCURSEL, 0, 0) - 1));
- if (hContact) AddContactPhonesToCombo(hWndDlg, hContact);
- }
- }
- break;
- }
- break;
- case WM_NOTIFY:
- switch (((NMHDR*)lParam)->idFrom) {
- case IDC_NUMBERSLIST:
- switch (((NMHDR*)lParam)->code) {
- case NM_CLICK:
- {
- int iImage, iSame = 1;
- HWND hWndTree = GetDlgItem(hWndDlg, IDC_NUMBERSLIST);
- TVITEM tvi = { 0 };
- HTREEITEM hParent;
- TVHITTESTINFO hti = { 0 };
-
- hti.pt.x = (short)LOWORD(GetMessagePos());
- hti.pt.y = (short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
-
- if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti))
- if (hti.flags&TVHT_ONITEMICON) {
- tvi.mask = (TVIF_IMAGE | TVIF_SELECTEDIMAGE);
- tvi.hItem = hti.hItem;
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- iImage = tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
-
- if (TreeView_GetParent(hWndTree, hti.hItem)) {
- hParent = TreeView_GetParent(hWndTree, hti.hItem);
- for (tvi.hItem = TreeView_GetChild(hWndTree, hParent); tvi.hItem; tvi.hItem = TreeView_GetNextSibling(hWndTree, tvi.hItem)) {
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- if (tvi.iImage != iImage) {
- iSame = 0;
- break;
- }
- }
- tvi.hItem = hParent;
- tvi.iImage = tvi.iSelectedImage = ((iSame == 1) ? iImage : 2);
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- }
- else {
- for (tvi.hItem = TreeView_GetChild(hWndTree, hti.hItem); tvi.hItem; tvi.hItem = TreeView_GetNextSibling(hWndTree, tvi.hItem)) {
- TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- tvi.iImage = tvi.iSelectedImage = iImage;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom, &tvi);
- }
- }
- }
- }
- break;
- }
- }
- break;
- case WM_CLOSE:
- DeleteObject((HFONT)SendDlgItemMessage(hWndDlg, IDC_MESSAGE, WM_GETFONT, 0, 0));
- DeleteObject(psswdWindowData->hBkgBrush);
- ////////RemWinHandle(GetDlgItem(hWndDlg,IDC_MESSAGE));
- KillTimer(GetParent(hWndDlg), TIMERID_MSGSEND);
- SendSMSWindowRemove(hWndDlg);
- break;
- }
- return FALSE;
-}
-
-INT_PTR CALLBACK SMSTimedOutDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM)
-{
- switch (msg) {
- case WM_INITDIALOG:
- {
- RECT rc, rcParent;
- TranslateDialogDefault(hWndDlg);
- GetWindowRect(hWndDlg, &rc);
- GetWindowRect(GetParent(hWndDlg), &rcParent);
- SetWindowPos(hWndDlg, nullptr, (rcParent.left + rcParent.right - (rc.right - rc.left)) / 2, (rcParent.top + rcParent.bottom - (rc.bottom - rc.top)) / 2, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
- KillTimer(GetParent(hWndDlg), TIMERID_MSGSEND);
- }
- return TRUE;
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDOK:
- SendMessage(GetParent(hWndDlg), DM_TIMEOUTDECIDED, TIMEDOUT_RETRY, 0);
- DestroyWindow(hWndDlg);
- break;
- case IDCANCEL:
- SendMessage(GetParent(hWndDlg), DM_TIMEOUTDECIDED, TIMEDOUT_CANCEL, 0);
- DestroyWindow(hWndDlg);
- break;
- }
- break;
- }
- return FALSE;
-}
-
-INT_PTR CALLBACK SMSAcceptedDlgProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM)
-{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hWndDlg);
- {
- RECT rc, rcParent;
- GetWindowRect(hWndDlg, &rc);
- GetWindowRect(GetParent(hWndDlg), &rcParent);
- SetWindowPos(hWndDlg, nullptr, (rcParent.left + rcParent.right - (rc.right - rc.left)) / 2, (rcParent.top + rcParent.bottom - (rc.bottom - rc.top)) / 2, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
- }
- return TRUE;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDOK:
- SendSMSWindowRemove(GetParent(hWndDlg));
- DestroyWindow(hWndDlg);
- break;
- }
- break;
- }
- return FALSE;
-}
-
-//SMS Send window list functions
-
-//This function create a new SMS send window, and insert it to the list.
-//The function gets void and return the window HWND
-HWND SendSMSWindowAdd(MCONTACT hContact)
-{
- HWND hRet = nullptr;
- SEND_SMS_WINDOW_DATA *psswdWindowData = (SEND_SMS_WINDOW_DATA*)MEMALLOC(sizeof(SEND_SMS_WINDOW_DATA));
- if (!psswdWindowData)
- return nullptr;
- psswdWindowData->hMyContact = hContact;
- psswdWindowData->hWnd = CreateDialogParam(ssSMSSettings.hInstance, MAKEINTRESOURCE(IDD_SENDSMS), nullptr, SendSmsDlgProc, (LPARAM)psswdWindowData);
- if (psswdWindowData->hWnd) {
- ListMTLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
- ListMTItemAdd(&ssSMSSettings.lmtSendSMSWindowsListMT, &psswdWindowData->lmtListMTItem, psswdWindowData);
- ListMTUnLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
-
- LPTSTR lptszContactDisplayName = Clist_GetContactDisplayName(hContact);
- wchar_t tszTitle[MAX_PATH];
- mir_snwprintf(tszTitle, L"%s - %s", lptszContactDisplayName, TranslateT("Send SMS"));
- SetWindowText(psswdWindowData->hWnd, tszTitle);
- SendDlgItemMessage(psswdWindowData->hWnd, IDC_NAME, CB_ADDSTRING, 0, (LPARAM)lptszContactDisplayName);
- SendDlgItemMessage(psswdWindowData->hWnd, IDC_NAME, CB_SETCURSEL, 0, 0);
- AddContactPhonesToCombo(psswdWindowData->hWnd, hContact);
- SetFocus(GetDlgItem(psswdWindowData->hWnd, IDC_MESSAGE));
- hRet = psswdWindowData->hWnd;
- }
- else MEMFREE(psswdWindowData);
- return hRet;
-}
-
-//This function close the SMS send window that given, and remove it from the list.
-//The function gets the HWND of the window that should be removed and return void
-void SendSMSWindowRemove(HWND hWndDlg)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- if (psswdWindowData) {
- DB_SMS_SetDword(NULL, "LastProto", SendDlgItemMessage(hWndDlg, IDC_ACCOUNTS, CB_GETCURSEL, 0, 0));
- SendSMSWindowMultipleSet(hWndDlg, FALSE);
- Utils_SaveWindowPosition(hWndDlg, (DB_SMS_GetByte(NULL, "SavePerContact", 0) ? psswdWindowData->hMyContact : NULL), MODULENAME, "send");
-
- ListMTLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
- ListMTItemDelete(&ssSMSSettings.lmtSendSMSWindowsListMT, &psswdWindowData->lmtListMTItem);
- ListMTUnLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
- SendSMSWindowSMSContactsRemove(hWndDlg);
- MEMFREE(psswdWindowData->pdbei);
- MEMFREE(psswdWindowData);
- }
- DestroyWindow(hWndDlg);
-}
-
-//This function return the contact HANDLE for the given to the SMS send window.
-//The function gets the HWND of the window and return the HANDLE of the contact.
-MCONTACT SendSMSWindowHContactGet(HWND hWndDlg)
-{
- MCONTACT hRet = NULL;
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- if (psswdWindowData) hRet = psswdWindowData->hMyContact;
- return(hRet);
-}
-
-//This function set the contact info of the person we send him the in the given to the SMS send window.
-//The function gets the HWND of the window and the HANDLE of the contact and return void
-void SendSMSWindowHContactSet(HWND hWndDlg, MCONTACT hContact)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
- if (psswdWindowData) psswdWindowData->hMyContact = hContact;
-}
-
-//This function return the HWND of a SMS send window that have the same process as given.
-//The function gets the HANDLE of a process and return the HWND of the SMS send window that has
-//the same process
-HWND SendSMSWindowHwndByHProcessGet(HANDLE hProcess)
-{
- HWND hRet = nullptr;
- SEND_SMS_WINDOW_DATA *psswdWindowData;
- LIST_MT_ITERATOR lmtiIterator;
-
- ListMTLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
- ListMTIteratorMoveFirst(&ssSMSSettings.lmtSendSMSWindowsListMT, &lmtiIterator);
- do {// цикл
- if (ListMTIteratorGet(&lmtiIterator, nullptr, (LPVOID*)&psswdWindowData) == NO_ERROR)
- if (psswdWindowData->hProcess == hProcess) {
- hRet = psswdWindowData->hWnd;
- break;
- }
- } while (ListMTIteratorMoveNext(&lmtiIterator));
- ListMTUnLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
- return(hRet);
-}
-
-//This function set the process info of the send procedure we sent with the given SMS send window.
-//The function gets the HWND of the window and the HANDLE of the process and return void
-void SendSMSWindowHProcessSet(HWND hWndDlg, HANDLE hProcess)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
- if (psswdWindowData) psswdWindowData->hProcess = hProcess;
-}
-
-//
-BOOL SendSMSWindowMultipleGet(HWND hWndDlg)
-{
- BOOL bRet = FALSE;
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- if (psswdWindowData) bRet = psswdWindowData->bMultiple;
- return(bRet);
-}
-
-//
-void SendSMSWindowMultipleSet(HWND hWndDlg, BOOL bMultiple)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- if (!psswdWindowData)
- return;
- if (psswdWindowData->bMultiple == bMultiple)
- return;
-
- RECT rcWin, rcList;
- WINDOWPLACEMENT wp;
-
- psswdWindowData->bMultiple = bMultiple;
- wp.length = sizeof(WINDOWPLACEMENT);
- GetWindowRect(hWndDlg, &rcWin);
- GetWindowRect(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), &rcList);
- GetWindowPlacement(hWndDlg, &wp);
-
- if (bMultiple) {
- SendSMSWindowFillTreeView(hWndDlg);
-
- EnableWindow(GetDlgItem(hWndDlg, IDC_SAVENUMBER), FALSE);
- SetDlgItemText(hWndDlg, IDC_MULTIPLE, TranslateT("<< Single"));
- if (wp.showCmd == SW_MAXIMIZE) SetWindowPos(hWndDlg, nullptr, 0, 0, rcWin.right - rcWin.left - (rcList.right - rcList.left + 11), rcWin.bottom - rcWin.top, SWP_NOZORDER | SWP_NOMOVE);
- SetWindowPos(hWndDlg, nullptr, rcWin.left, rcWin.top, rcWin.right - rcWin.left + (rcList.right - rcList.left) + 11, rcWin.bottom - rcWin.top, SWP_NOZORDER | SWP_NOMOVE);
- }
- else {
- if (psswdWindowData->hMyContact) AddContactPhonesToCombo(hWndDlg, psswdWindowData->hMyContact);
-
- EnableWindow(GetDlgItem(hWndDlg, IDC_SAVENUMBER), TRUE);
- SetDlgItemText(hWndDlg, IDC_MULTIPLE, TranslateT("Multiple >>"));
- SetWindowPos(hWndDlg, nullptr, rcWin.left, rcWin.top, rcWin.right - rcWin.left - (rcList.right - rcList.left) - 11, rcWin.bottom - rcWin.top, SWP_NOZORDER | SWP_NOMOVE);
- if (wp.showCmd == SW_MAXIMIZE) SetWindowPos(hWndDlg, nullptr, 0, 0, rcWin.right - rcWin.left + (rcList.right - rcList.left + 11), rcWin.bottom - rcWin.top, SWP_NOZORDER | SWP_NOMOVE);
- }
-}
-
-//
-void SendSMSWindowNumberSet(HWND hWndDlg, LPWSTR lpwszPhone, size_t dwPhoneSize)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- if (psswdWindowData)
- if (psswdWindowData->bMultiple) {
- psswdWindowData->hContact = psswdWindowData->hMyContact;
- }
- else {
- psswdWindowData->hContact = HContactFromPhone(lpwszPhone, dwPhoneSize);
- }
-}
-
-//
-void SendSMSWindowAsSentSet(HWND)
-{
- // LVITEM lvi;
- // char szPhone[MAX_PHONE_LEN];
- // lvi.mask=LVIF_TEXT|LVIF_IMAGE;
- // lvi.iItem=GetSendSMSWindowSMSSend(hWndDlg) - 1;
- // lvi.iSubItem=0;
- // ListView_GetItemText(GetDlgItem(hWndDlg,IDC_NUMBERSLIST),GetSendSMSWindowSMSSend(hWndDlg) - 1,0,szPhone,_countof(szPhone));
- // lvi.pszText=szPhone;
- // lvi.iImage=2;
- // ListView_SetItem(GetDlgItem(hWndDlg,IDC_NUMBERSLIST),&lvi);
- // ListView_RedrawItems(GetDlgItem(hWndDlg,IDC_NUMBERSLIST),0,ListView_GetItemCount(GetDlgItem(hWndDlg,IDC_NUMBERSLIST)) - 1);
-}
-
-//This function set the databsae info of the sent message we sent with the SMS send window.
-//The function gets the HWND of the window and the DBEI of the database information of the message
-//and return void
-void SendSMSWindowDbeiSet(HWND hWndDlg, DBEVENTINFO *pdbei)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
- if (psswdWindowData) psswdWindowData->pdbei = pdbei;
-}
-
-//This function get a HWND of SMS send window and add its database information into Miranda-IM database
-//The function gets the HWND of the window and return void
-//and return void
-void SendSMSWindowDBAdd(HWND hWndDlg)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
- if (psswdWindowData) {
- psswdWindowData->pdbei->szModule = GetModuleName(psswdWindowData->hContact);
- db_event_add(psswdWindowData->hContact, psswdWindowData->pdbei);
- MEMFREE(psswdWindowData->pdbei);
- }
-}
-
-//
-void SendSMSWindowHItemSendSet(HWND hWndDlg, HTREEITEM hItemSend)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
- if (psswdWindowData)
- psswdWindowData->hItemSend = hItemSend;
-}
-
-//
-HTREEITEM SendSMSWindowHItemSendGet(HWND hWndDlg)
-{
- HTREEITEM hRet = nullptr;
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- if (psswdWindowData) hRet = psswdWindowData->hItemSend;
- return hRet;
-}
-
-//
-HTREEITEM SendSMSWindowNextHItemGet(HWND hWndDlg, HTREEITEM hItem)
-{
- int isFound = 0;
- HWND hWndTree = GetDlgItem(hWndDlg, IDC_NUMBERSLIST);
- TVITEM tvi;
- HTREEITEM hItemNext, hItemChild;
-
- if (hItem == TreeView_GetRoot(hWndTree)) isFound = 1;
-
- for (hItemNext = TreeView_GetRoot(hWndTree); hItemNext; hItemNext = TreeView_GetNextSibling(hWndTree, hItemNext)) {
- if ((hItem == hItemNext) && (hItem != TreeView_GetRoot(hWndTree))) {
- isFound = 1;
- continue;
- }
-
- tvi.mask = (TVIF_IMAGE | TVIF_SELECTEDIMAGE);
- tvi.hItem = hItemNext;
- tvi.iImage = 0;
- tvi.iSelectedImage = 0;
- TreeView_GetItem(hWndTree, &tvi);
-
- if (tvi.iImage || tvi.iSelectedImage)
- if (TreeView_GetChild(hWndTree, hItemNext)) {
- for (hItemChild = TreeView_GetChild(hWndTree, hItemNext); hItemChild; hItemChild = TreeView_GetNextSibling(hWndTree, hItemChild)) {
- if (hItem == hItemChild) {
- isFound = 1;
- continue;
- }
-
- tvi.mask = (TVIF_IMAGE | TVIF_SELECTEDIMAGE);
- tvi.hItem = hItemChild;
- tvi.iImage = 0;
- tvi.iSelectedImage = 0;
- TreeView_GetItem(hWndTree, &tvi);
-
- if (tvi.iImage || tvi.iSelectedImage)
- if (isFound) {
- return(hItemChild);
- }
- else {
- continue;
- }
- }
- }
- else {
- if (isFound) {
- return(hItemNext);
- }
- else {
- continue;
- }
- }
- }
- return(nullptr);
-}
-
-//This function get the HANDLE of an user. if there is already a SMS send window for this contact
-//it return its HWND else the function return NULL.
-//The function gets the HANDLE of a contact and return HWND
-HWND SendSMSWindowIsOtherInstanceHContact(MCONTACT hContact)
-{
- HWND hRet = nullptr;
- SEND_SMS_WINDOW_DATA *psswdWindowData;
- LIST_MT_ITERATOR lmtiIterator;
-
- ListMTLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
- ListMTIteratorMoveFirst(&ssSMSSettings.lmtSendSMSWindowsListMT, &lmtiIterator);
- do {// цикл
- if (ListMTIteratorGet(&lmtiIterator, nullptr, (LPVOID*)&psswdWindowData) == NO_ERROR)
- if (psswdWindowData->hMyContact == hContact) {
- hRet = psswdWindowData->hWnd;
- break;
- }
- } while (ListMTIteratorMoveNext(&lmtiIterator));
- ListMTUnLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
- return(hRet);
-}
-
-
-//
-void SendSMSWindowNext(HWND hWndDlg)
-{
- wchar_t tszPhone[MAX_PHONE_LEN];
- size_t dwPhoneSize, dwMessageSize;
- TVITEM tvi = { 0 };
-
- dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
- LPTSTR lptszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(wchar_t)));
- if (!lptszMessage)
- return;
-
- dwMessageSize = GetDlgItemText(hWndDlg, IDC_MESSAGE, lptszMessage, (int)dwMessageSize + 2);
-
- // if (SendSMSWindowNextHItemGet(hWndDlg,SendSMSWindowHItemSendGet(hWndDlg))==NULL) SendSMSWindowMultipleSet(hWndDlg,FALSE);
- tvi.mask = TVIF_TEXT;
- tvi.hItem = SendSMSWindowHItemSendGet(hWndDlg);
- tvi.pszText = tszPhone;
- tvi.cchTextMax = _countof(tszPhone);
- TreeView_GetItem(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), &tvi);
- TreeView_SelectItem(GetDlgItem(hWndDlg, IDC_NUMBERSLIST), tvi.hItem);
- dwPhoneSize = mir_wstrlen(tszPhone);
- SendSMSWindowNumberSet(hWndDlg, tszPhone, dwPhoneSize);
- StartSmsSend(hWndDlg, SendDlgItemMessage(hWndDlg, IDC_ACCOUNTS, CB_GETCURSEL, 0, 0), tszPhone, dwPhoneSize, lptszMessage, dwMessageSize);
- SetTimer(hWndDlg, TIMERID_MSGSEND, TIMEOUT_MSGSEND, nullptr);
- MEMFREE(lptszMessage);
-}
-
-
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-//This function gets a HANDLE of a contact and add it to a list.
-void SendSMSWindowSMSContactAdd(HWND hWndDlg, MCONTACT hContact)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- if (!psswdWindowData)
- return;
-
- psswdWindowData->dwContactsListCount++;
- if (psswdWindowData->phContactsList)
- psswdWindowData->phContactsList = (MCONTACT*)MEMREALLOC(psswdWindowData->phContactsList, (sizeof(HANDLE)*psswdWindowData->dwContactsListCount));
- else
- psswdWindowData->phContactsList = (MCONTACT*)MEMALLOC((sizeof(HANDLE)*psswdWindowData->dwContactsListCount));
-
- *(psswdWindowData->phContactsList + psswdWindowData->dwContactsListCount - 1) = hContact;
-}
-
-//This function gets the number of the given contact in the combo list and return its contact.
-MCONTACT SendSMSWindowSMSContactGet(HWND hWndDlg, size_t iNum)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- if (psswdWindowData)
- return (*((psswdWindowData->phContactsList) + iNum));
-
- return NULL;
-}
-
-void SendSMSWindowSMSContactsRemove(HWND hWndDlg)
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData = GET_WINDOW_DATA(hWndDlg);
-
- if (psswdWindowData) {
- MEMFREE(psswdWindowData->phContactsList);
- psswdWindowData->dwContactsListCount = 0;
- }
-}
-
-void SendSMSWindowUpdateAccountList(HWND hWndDlg)
-{
- if (ssSMSSettings.ppaSMSAccounts && ssSMSSettings.dwSMSAccountsCount) {
- size_t i, dwCurSel;
-
- dwCurSel = SendDlgItemMessage(hWndDlg, IDC_ACCOUNTS, CB_GETCURSEL, 0, 0);
- if (dwCurSel == -1) dwCurSel = DB_SMS_GetDword(NULL, "LastProto", 0);
- if (dwCurSel == -1) dwCurSel = 0;
-
- SendDlgItemMessage(hWndDlg, IDC_ACCOUNTS, CB_RESETCONTENT, 0, 0);
- for (i = 0; i < ssSMSSettings.dwSMSAccountsCount; i++) {
- SendDlgItemMessageA(hWndDlg, IDC_ACCOUNTS, CB_ADDSTRING, 0, (LPARAM)ssSMSSettings.ppaSMSAccounts[i]->szModuleName);
- }
- SendDlgItemMessage(hWndDlg, IDC_ACCOUNTS, CB_SETCURSEL, (WPARAM)dwCurSel, 0);
- }
-}
-
-
-void SendSMSWindowsUpdateAllAccountLists()
-{
- SEND_SMS_WINDOW_DATA *psswdWindowData;
- LIST_MT_ITERATOR lmtiIterator;
-
- ListMTLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
- ListMTIteratorMoveFirst(&ssSMSSettings.lmtSendSMSWindowsListMT, &lmtiIterator);
- do {// цикл
- if (ListMTIteratorGet(&lmtiIterator, nullptr, (LPVOID*)&psswdWindowData) == NO_ERROR) {
- SendSMSWindowUpdateAccountList(psswdWindowData->hWnd);
- }
- } while (ListMTIteratorMoveNext(&lmtiIterator));
- ListMTUnLock(&ssSMSSettings.lmtSendSMSWindowsListMT);
-}
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////////////////////////////
-
-
-
-
-void AddContactPhonesToComboToListParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList)
-{
- char szBuff[MAX_PATH];
- wchar_t tszPhone[MAX_PHONE_LEN], tszPhoneRaw[MAX_PHONE_LEN];
- size_t i, dwPhoneSize;
-
- if (DB_GetStaticStringW(hContact, lpszModule, lpszValueName, tszPhoneRaw, _countof(tszPhoneRaw), &dwPhoneSize)) {
- tszPhone[0] = '+';
- dwPhoneSize = CopyNumberW(tszPhone + 1, tszPhoneRaw, dwPhoneSize);
- if (IsPhoneW(tszPhone, dwPhoneSize)) {
- if (SendMessage(hWndList, CB_FINDSTRING, -1, (LPARAM)tszPhone) == CB_ERR) SendMessage(hWndList, CB_ADDSTRING, 0, (LPARAM)tszPhone);
- }
- }
-
- for (i = 0; TRUE; i++) {
- mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
- if (DB_GetStaticStringW(hContact, lpszModule, szBuff, tszPhoneRaw, _countof(tszPhoneRaw), &dwPhoneSize)) {
- tszPhone[0] = '+';
- dwPhoneSize = CopyNumberW(tszPhone + 1, tszPhoneRaw, dwPhoneSize);
- if (IsPhoneW(tszPhone, dwPhoneSize)) {
- if (SendMessage(hWndList, CB_FINDSTRING, -1, (LPARAM)tszPhone) == CB_ERR) SendMessage(hWndList, CB_ADDSTRING, 0, (LPARAM)tszPhone);
- }
- }
- else {
- if (i > PHONES_MIN_COUNT) break;
- }
- }
-}
-
-
-void AddContactPhonesToCombo(HWND hWnd, MCONTACT hContact)
-{
- HWND hWndList = GetDlgItem(hWnd, IDC_ADDRESS);
- SendDlgItemMessage(hWnd, IDC_ADDRESS, CB_RESETCONTENT, 0, 0);
-
- LPSTR lpszProto = GetContactProto(hContact);
- if (lpszProto) {
- AddContactPhonesToComboToListParam(hContact, lpszProto, "Phone", hWndList);
- AddContactPhonesToComboToListParam(hContact, lpszProto, "Cellular", hWndList);
- AddContactPhonesToComboToListParam(hContact, lpszProto, "Fax", hWndList);
- }
- AddContactPhonesToComboToListParam(hContact, "UserInfo", "MyPhone", hWndList);
- AddContactPhonesToComboToListParam(hContact, "UserInfo", "Phone", hWndList);
- AddContactPhonesToComboToListParam(hContact, "UserInfo", "Cellular", hWndList);
- AddContactPhonesToComboToListParam(hContact, "UserInfo", "Fax", hWndList);
-
- SendDlgItemMessage(hWnd, IDC_ADDRESS, CB_SETCURSEL, 0, 0);
-}
-
-
-
-void AddContactPhonesToTreeViewParam(MCONTACT hContact, LPSTR lpszModule, LPSTR lpszValueName, HWND hWndList, HTREEITEM *phParent)
-{
- char szBuff[MAX_PATH];
- wchar_t tszPhone[MAX_PHONE_LEN], tszPhoneRaw[MAX_PHONE_LEN];
- size_t i, dwPhoneSize;
- TVINSERTSTRUCT tvis = {};
-
- if (phParent) tvis.hParent = (*phParent);
- tvis.item.mask = (TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE);
- tvis.hInsertAfter = TVI_SORT;
- tvis.item.iImage = tvis.item.iSelectedImage = 0;
-
- if (DB_GetStaticStringW(hContact, lpszModule, lpszValueName, tszPhoneRaw, _countof(tszPhoneRaw), &dwPhoneSize)) {
- tszPhone[0] = '+';
- dwPhoneSize = CopyNumberW(tszPhone + 1, tszPhoneRaw, dwPhoneSize);
- if (IsPhoneW(tszPhone, dwPhoneSize)) {
- if (tvis.hParent == nullptr) {
- tvis.item.pszText = Clist_GetContactDisplayName(hContact);
- tvis.hParent = TreeView_InsertItem(hWndList, &tvis);
- }
- tvis.item.pszText = tszPhone;
- TreeView_InsertItem(hWndList, &tvis);
- }
- }
-
- for (i = 0; TRUE; i++) {
- mir_snprintf(szBuff, "%s%ld", lpszValueName, i);
- if (DB_GetStaticStringW(hContact, lpszModule, szBuff, tszPhoneRaw, _countof(tszPhoneRaw), &dwPhoneSize)) {
- tszPhone[0] = '+';
- dwPhoneSize = CopyNumberW(tszPhone + 1, tszPhoneRaw, dwPhoneSize);
- if (IsPhoneW(tszPhone, dwPhoneSize)) {
- if (tvis.hParent == nullptr) {
- tvis.item.pszText = Clist_GetContactDisplayName(hContact);
- tvis.hParent = TreeView_InsertItem(hWndList, &tvis);
- }
- tvis.item.pszText = tszPhone;
- TreeView_InsertItem(hWndList, &tvis);
- }
- }
- else {
- if (i > PHONES_MIN_COUNT) break;
- }
- }
- if (phParent) (*phParent) = tvis.hParent;
-}
-
-
-void SendSMSWindowFillTreeView(HWND hWnd)
-{
- HWND hWndTreeView = GetDlgItem(hWnd, IDC_NUMBERSLIST);
- TreeView_DeleteAllItems(hWndTreeView);
-
- for (auto &hContact : Contacts()) {
- HTREEITEM hParent = nullptr;
- LPSTR lpszProto = GetContactProto(hContact);
- if (lpszProto) {
- AddContactPhonesToTreeViewParam(hContact, lpszProto, "Phone", hWndTreeView, &hParent);
- AddContactPhonesToTreeViewParam(hContact, lpszProto, "Cellular", hWndTreeView, &hParent);
- AddContactPhonesToTreeViewParam(hContact, lpszProto, "Fax", hWndTreeView, &hParent);
- }
- AddContactPhonesToTreeViewParam(hContact, "UserInfo", "MyPhone", hWndTreeView, &hParent);
- AddContactPhonesToTreeViewParam(hContact, "UserInfo", "Phone", hWndTreeView, &hParent);
- AddContactPhonesToTreeViewParam(hContact, "UserInfo", "Cellular", hWndTreeView, &hParent);
- AddContactPhonesToTreeViewParam(hContact, "UserInfo", "Fax", hWndTreeView, &hParent);
- }
-}
-
-
-size_t GetSMSMessageLenMax(HWND hWndDlg)
-{
- size_t dwMessageSize, dwLenght = 160;
-
- dwMessageSize = GET_DLG_ITEM_TEXT_LENGTH(hWndDlg, IDC_MESSAGE);
- LPTSTR lptszMessage = (LPTSTR)MEMALLOC(((dwMessageSize + 4)*sizeof(wchar_t)));
- if (lptszMessage) {
- dwMessageSize = GetDlgItemText(hWndDlg, IDC_MESSAGE, lptszMessage, (int)dwMessageSize + 2);
- if (dwMessageSize != WideCharToMultiByte(CP_UTF8, 0, lptszMessage, (int)dwMessageSize, nullptr, 0, nullptr, nullptr))
- dwLenght = 70;
- MEMFREE(lptszMessage);
- }
- return(dwLenght);
-}
diff --git a/plugins/SMS/src/senddlg.h b/plugins/SMS/src/senddlg.h
deleted file mode 100644
index 4a98b9e019..0000000000
--- a/plugins/SMS/src/senddlg.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#if !defined(AFX_SMS_SENDDLG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
-#define AFX_SMS_SENDDLG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_
-
-DWORD SendSMSWindowInitialize();
-void SendSMSWindowDestroy();
-
-//Declaration of SMS send window list
-INT_PTR CALLBACK SMSAcceptedDlgProc(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam);
-INT_PTR CALLBACK SMSTimedOutDlgProc(HWND hWndDlg,UINT msg,WPARAM wParam,LPARAM lParam);
-
-HTREEITEM SendSMSWindowHItemSendGet(HWND hWndDlg);
-HTREEITEM SendSMSWindowNextHItemGet(HWND hWndDlg,HTREEITEM hItem);
-
-HWND SendSMSWindowAdd(MCONTACT hContact);
-void SendSMSWindowRemove(HWND hWndDlg);
-MCONTACT SendSMSWindowHContactGet(HWND hWndDlg);
-void SendSMSWindowHContactSet(HWND hWndDlg,MCONTACT hContact);
-HWND SendSMSWindowHwndByHProcessGet(HANDLE hProcess);
-void SendSMSWindowHProcessSet(HWND hWndDlg,HANDLE hProcess);
-BOOL SendSMSWindowMultipleGet(HWND hWndDlg);
-void SendSMSWindowMultipleSet(HWND hWndDlg,BOOL bMultiple);
-void SendSMSWindowNumberSet(HWND hWndDlg,LPWSTR lpwszPhone,size_t dwPhoneSize);
-void SendSMSWindowAsSentSet(HWND hWndDlg);
-void SendSMSWindowDbeiSet(HWND hWndDlg,DBEVENTINFO *pdbei);
-void SendSMSWindowDBAdd(HWND hWndDlg);
-void SendSMSWindowHItemSendSet(HWND hWndDlg,HTREEITEM hItemSend);
-HWND SendSMSWindowIsOtherInstanceHContact(MCONTACT hContact);
-void SendSMSWindowNext(HWND hWndDlg);
-
-void SendSMSWindowSMSContactAdd(HWND hWndDlg,MCONTACT hContact);
-MCONTACT SendSMSWindowSMSContactGet(HWND hWndDlg,size_t iNum);
-void SendSMSWindowSMSContactsRemove(HWND hWndDlg);
-void SendSMSWindowUpdateAccountList(HWND hWndDlg);
-void SendSMSWindowsUpdateAllAccountLists();
-
-#endif // !defined(AFX_SMS_SENDDLG_H__F58D13FF_F6F2_476C_B8F0_7B9E9357CF48__INCLUDED_)
diff --git a/plugins/SMS/src/stdafx.cxx b/plugins/SMS/src/stdafx.cxx
deleted file mode 100644
index d33e44d684..0000000000
--- a/plugins/SMS/src/stdafx.cxx
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright (C) 2012-19 Miranda NG team (https://miranda-ng.org)
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation version 2
-of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h" \ No newline at end of file
diff --git a/plugins/SMS/src/stdafx.h b/plugins/SMS/src/stdafx.h
deleted file mode 100644
index 87197e6a7b..0000000000
--- a/plugins/SMS/src/stdafx.h
+++ /dev/null
@@ -1,127 +0,0 @@
-#ifndef _COMMON_H
-#define _COMMON_H
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-#define VC_EXTRALEAN
-
-#include <windows.h>
-#include <commctrl.h>
-#include <malloc.h>
-#include <time.h>
-
-#include <newpluginapi.h>
-#include <m_database.h>
-#include <m_clistint.h>
-#include <m_langpack.h>
-#include <m_history.h>
-#include <m_icolib.h>
-#include <m_skin.h>
-#include <m_protosvc.h>
-#include <m_icq.h>
-#include <m_options.h>
-#include <win2k.h>
-
-#include "AdditionalFunctions/InterlockedFunctions.h"
-#include "AdditionalFunctions/ListMT.h"
-#include "AdditionalFunctions/MemoryCompare.h"
-#include "AdditionalFunctions/MemoryFindByte.h"
-#include "resource.h"
-#include "version.h"
-#include "recvdlg.h"
-#include "SMSConstans.h"
-#include "senddlg.h"
-
-struct CMPlugin : public PLUGIN<CMPlugin>
-{
- CMPlugin();
-
- int Load() override;
-};
-
-// структура содержащая информацию по построению меню или расширенных иконок
-struct GUI_DISPLAY_ITEM
-{
- LPSTR lpszName; // имя сервиса, оно же имя в иколибе
- LPWSTR lpwszDescr; // текстовое описание отображаемое юзеру
- LONG defIcon; // иконка из ресурсов
- LPVOID lpFunc; // функция вызываемая меню
-};
-
-#define MAIN_MENU_ITEMS_COUNT 1
-#define CONTACT_MENU_ITEMS_COUNT 1
-
-struct SMS_SETTINGS
-{
- HANDLE hHeap;
- HINSTANCE hInstance;
-
- HGENMENU hMainMenuItems[MAIN_MENU_ITEMS_COUNT+1];
- HGENMENU hContactMenuItems[CONTACT_MENU_ITEMS_COUNT+1];
-
- LIST_MT lmtSendSMSWindowsListMT;
- LIST_MT lmtRecvSMSWindowsListMT;
-
- PROTOACCOUNT **ppaSMSAccounts;
- size_t dwSMSAccountsCount;
-};
-
-extern SMS_SETTINGS ssSMSSettings;
-
-#define MEMALLOC(Size) HeapAlloc(ssSMSSettings.hHeap,HEAP_ZERO_MEMORY,(Size+sizeof(size_t)))
-#define MEMREALLOC(Mem,Size) HeapReAlloc(ssSMSSettings.hHeap,(HEAP_ZERO_MEMORY),(LPVOID)Mem,(Size+sizeof(size_t)))
-#define MEMFREE(Mem) if (Mem) {HeapFree(ssSMSSettings.hHeap,0,(LPVOID)Mem);Mem=NULL;}
-
-#define GET_DLG_ITEM_TEXT_LENGTH(hDlg,nIDDlgItem) SendDlgItemMessage(hDlg,nIDDlgItem,WM_GETTEXTLENGTH,NULL,NULL)
-#define GET_CURRENT_COMBO_DATA(hWndDlg,ControlID) SendDlgItemMessage(hWndDlg,ControlID,CB_GETITEMDATA,SendDlgItemMessage(hWndDlg,ControlID,CB_GETCURSEL,0,0),0)
-
-#define DB_SMS_DeleteValue(Contact,valueName) db_unset(Contact,MODULENAME,valueName)
-#define DB_SMS_GetDword(Contact,valueName,parDefltValue) db_get_dw(Contact,MODULENAME,valueName,parDefltValue)
-#define DB_SMS_SetDword(Contact,valueName,parValue) db_set_dw(Contact,MODULENAME,valueName,parValue)
-#define DB_SMS_GetWord(Contact,valueName,parDefltValue) db_get_w(Contact,MODULENAME,valueName,parDefltValue)
-#define DB_SMS_SetWord(Contact,valueName,parValue) db_set_w(Contact,MODULENAME,valueName,parValue)
-#define DB_SMS_GetByte(Contact,valueName,parDefltValue) db_get_b(Contact,MODULENAME,valueName,parDefltValue)
-#define DB_SMS_SetByte(Contact,valueName,parValue) db_set_b(Contact,MODULENAME,valueName,parValue)
-BOOL DB_GetStaticStringW(MCONTACT hContact,LPSTR lpszModule,LPSTR lpszValueName,LPWSTR lpszRetBuff,size_t dwRetBuffSize,size_t *pdwRetBuffSize);
-#define DB_SMS_GetStaticStringW(Contact,ValueName,Ret,RetBuffSize,pRetBuffSize) DB_GetStaticStringW(Contact,MODULENAME,ValueName,Ret,RetBuffSize,pRetBuffSize)
-#define DB_SetStringW(Contact,Module,valueName,parValue) db_set_ws(Contact,Module,valueName,parValue)
-#define DB_SMS_SetStringW(Contact,valueName,parValue) db_set_ws(Contact,MODULENAME,valueName,parValue)
-
-LRESULT CALLBACK MessageSubclassProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
-
-LPSTR GetModuleName(MCONTACT hContact);
-void EnableControlsArray(HWND hWndDlg,WORD *pwControlsList,size_t dwControlsListCount,BOOL bEnabled);
-
-// Declaration of function that returns received string with only numbers
-size_t CopyNumberA(LPSTR lpszOutBuff,LPSTR lpszBuff,size_t dwLen);
-size_t CopyNumberW(LPWSTR lpcOutBuff,LPWSTR lpcBuff,size_t dwLen);
-bool IsPhoneW(LPWSTR lpwszString,size_t dwStringLen);
-DWORD GetContactPhonesCount(MCONTACT hContact);
-BOOL IsContactPhone(MCONTACT hContact,LPWSTR lpwszPhone,size_t dwPhoneSize);
-
-// Declaration of function that returns HANDLE of contact by his cellular number
-MCONTACT HContactFromPhone(LPWSTR lpwszPhone,size_t dwPhoneSize);
-BOOL GetDataFromMessage(LPSTR lpszMessage,size_t dwMessageSize,DWORD *pdwEventType,LPWSTR lpwszPhone,size_t dwPhoneSize,size_t *pdwPhoneSizeRet,UINT *piIcon);
-
-// Declaration of function that gets a XML string and return the asked tag.
-BOOL GetXMLFieldEx(LPSTR lpszXML,size_t dwXMLSize,LPSTR *plpszData,size_t *pdwDataSize,const char *tag1,...);
-BOOL GetXMLFieldExBuff(LPSTR lpszXML,size_t dwXMLSize,LPSTR lpszBuff,size_t dwBuffSize,size_t *pdwBuffSizeRet,const char *tag1,...);
-DWORD DecodeXML(LPTSTR lptszMessage,size_t dwMessageSize,LPTSTR lptszMessageConverted,size_t dwMessageConvertedBuffSize,size_t *pdwMessageConvertedSize);
-DWORD EncodeXML(LPTSTR lptszMessage,size_t dwMessageSize,LPTSTR lptszMessageConverted,size_t dwMessageConvertedBuffSize,size_t *pdwMessageConvertedSize);
-void LoadMsgDlgFont(int i,LOGFONT *lf,COLORREF *colour);
-int RefreshAccountList(WPARAM eventCode,LPARAM lParam);
-void FreeAccountList();
-
-int OptInitialise(WPARAM wParam,LPARAM lParam);
-
-int LoadServices();
-int LoadModules();
-
-int handleAckSMS(WPARAM wParam,LPARAM lParam);
-int handleNewMessage(WPARAM wParam,LPARAM lParam);
-
-// Declaration of Menu SMS send click function
-int SmsRebuildContactMenu(WPARAM wParam,LPARAM lParam);
-
-void StartSmsSend(HWND hWndDlg,size_t dwModuleIndex,LPWSTR lpwszPhone,size_t dwPhoneSize,LPWSTR lpwszMessage,size_t dwMessageSize);
-
-#endif
diff --git a/plugins/SMS/src/version.h b/plugins/SMS/src/version.h
deleted file mode 100644
index 4269279f7d..0000000000
--- a/plugins/SMS/src/version.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 2
-#define __RELEASE_NUM 5
-#define __BUILD_NUM 3
-
-#include <stdver.h>
-
-#define __PLUGIN_NAME "SMS"
-#define __FILENAME "SMS.dll"
-#define __DESCRIPTION "Send SMS text messages to mobile phones through the IM networks."
-#define __AUTHOR "Richard Hughes, Improved by Ariel Shulman, rewritten by Rozhuk Ivan"
-#define __AUTHORWEB "https://miranda-ng.org/p/SMS/"
-#define __COPYRIGHT "© 2001-02 Richard Hughes, 2003 Ariel Shulman, 2007-19 Rozhuk Ivan"
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp
index 7d9ee63fe1..4ccbf43a4c 100644
--- a/src/mir_app/src/newplugins.cpp
+++ b/src/mir_app/src/newplugins.cpp
@@ -113,6 +113,7 @@ static const MUUID pluginBannedList[] =
{ 0x6f376b33, 0xd3f4, 0x4c4f, { 0xa9, 0x6b, 0x77, 0xda, 0x08, 0x04, 0x3b, 0x06 } }, // importtxt
{ 0xe7c48bab, 0x8ace, 0x4cb3, { 0x84, 0x46, 0xd4, 0xb7, 0x34, 0x81, 0xf4, 0x97 } }, // mra
{ 0x73a9615c, 0x7d4e, 0x4555, { 0xba, 0xdb, 0xee, 0x05, 0xdc, 0x92, 0x8e, 0xff } }, // icqoscar8
+ { 0xcf97fd5d, 0xb911, 0x47a8, { 0xaf, 0x03, 0xd2, 0x19, 0x68, 0xb5, 0xb8, 0x94 } }, // sms
};
bool isPluginBanned(const MUUID &u1)