diff options
-rw-r--r-- | bin15/mir_full.sln | 20 | ||||
-rw-r--r-- | protocols/ICQCorp/ICQCorp.vcxproj | 33 | ||||
-rw-r--r-- | protocols/ICQCorp/ICQCorp.vcxproj.filters | 4 | ||||
-rw-r--r-- | protocols/ICQCorp/ICQCorp_15.vcxproj | 223 | ||||
-rw-r--r-- | protocols/ICQCorp/ICQCorp_15.vcxproj.filters | 97 | ||||
-rw-r--r-- | protocols/ICQCorp/src/corp.cpp | 4 | ||||
-rw-r--r-- | protocols/ICQCorp/src/event.cpp | 4 | ||||
-rw-r--r-- | protocols/ICQCorp/src/options.cpp | 15 | ||||
-rw-r--r-- | protocols/ICQCorp/src/packet.cpp | 2 | ||||
-rw-r--r-- | protocols/ICQCorp/src/protocol.cpp | 355 | ||||
-rw-r--r-- | protocols/ICQCorp/src/protocol.h | 18 | ||||
-rw-r--r-- | protocols/ICQCorp/src/services.cpp | 4 | ||||
-rw-r--r-- | protocols/ICQCorp/src/socket.cpp | 2 | ||||
-rw-r--r-- | protocols/ICQCorp/src/stdafx.cxx (renamed from protocols/ICQCorp/src/stdafx.cpp) | 36 | ||||
-rw-r--r-- | protocols/ICQCorp/src/stdafx.h (renamed from protocols/ICQCorp/src/corp.h) | 132 | ||||
-rw-r--r-- | protocols/ICQCorp/src/transfer.cpp | 28 | ||||
-rw-r--r-- | protocols/ICQCorp/src/user.cpp | 18 | ||||
-rw-r--r-- | protocols/ICQCorp/src/user.h | 20 | ||||
-rw-r--r-- | protocols/ICQCorp/src/version.h | 4 |
19 files changed, 335 insertions, 684 deletions
diff --git a/bin15/mir_full.sln b/bin15/mir_full.sln index facb8ee5a6..fba7a6429e 100644 --- a/bin15/mir_full.sln +++ b/bin15/mir_full.sln @@ -414,8 +414,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_schedule", "..\plugins\Mi EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "m_toptoolbar", "..\plugins\MirLua\Modules\m_toptoolbar\m_toptoolbar.vcxproj", "{277E433F-7D71-4247-8AAA-CC5FB1AA7A67}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQCorp", "..\protocols\ICQCorp\ICQCorp_15.vcxproj", "{AD0D0500-CE7D-417D-9C36-3620D56CA6D4}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsSingleWindow", "..\plugins\AsSingleWindow\AsSingleWindow.vcxproj", "{CE6A5A24-EA88-4E67-BDF2-22517528E43F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "..\libs\sqlite3\sqlite3.vcxproj", "{0C02E395-E73F-47E3-8B95-B7924C0C7A6A}" @@ -432,6 +430,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EmLanProto", "..\protocols\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Dbx_mdbx", "..\plugins\Dbx_mdbx\dbx_mdbx.vcxproj", "{E0ACDEA0-0AC9-4431-8CA3-6B0CCACB2E18}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQCorp", "..\protocols\ICQCorp\ICQCorp.vcxproj", "{AD0D0500-CE7D-417D-9C36-3620D56CA6D4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -1926,14 +1926,6 @@ Global {277E433F-7D71-4247-8AAA-CC5FB1AA7A67}.Release|Win32.Build.0 = Release|Win32 {277E433F-7D71-4247-8AAA-CC5FB1AA7A67}.Release|x64.ActiveCfg = Release|x64 {277E433F-7D71-4247-8AAA-CC5FB1AA7A67}.Release|x64.Build.0 = Release|x64 - {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Debug|Win32.ActiveCfg = Debug|Win32 - {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Debug|Win32.Build.0 = Debug|Win32 - {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Debug|x64.ActiveCfg = Debug|x64 - {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Debug|x64.Build.0 = Debug|x64 - {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Release|Win32.ActiveCfg = Release|Win32 - {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Release|Win32.Build.0 = Release|Win32 - {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Release|x64.ActiveCfg = Release|x64 - {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Release|x64.Build.0 = Release|x64 {CE6A5A24-EA88-4E67-BDF2-22517528E43F}.Debug|Win32.ActiveCfg = Debug|Win32 {CE6A5A24-EA88-4E67-BDF2-22517528E43F}.Debug|Win32.Build.0 = Debug|Win32 {CE6A5A24-EA88-4E67-BDF2-22517528E43F}.Debug|x64.ActiveCfg = Debug|x64 @@ -1998,6 +1990,14 @@ Global {E0ACDEA0-0AC9-4431-8CA3-6B0CCACB2E18}.Release|Win32.Build.0 = Release|Win32 {E0ACDEA0-0AC9-4431-8CA3-6B0CCACB2E18}.Release|x64.ActiveCfg = Release|x64 {E0ACDEA0-0AC9-4431-8CA3-6B0CCACB2E18}.Release|x64.Build.0 = Release|x64 + {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Debug|Win32.ActiveCfg = Debug|Win32 + {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Debug|Win32.Build.0 = Debug|Win32 + {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Debug|x64.ActiveCfg = Debug|x64 + {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Debug|x64.Build.0 = Debug|x64 + {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Release|Win32.ActiveCfg = Release|Win32 + {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Release|Win32.Build.0 = Release|Win32 + {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Release|x64.ActiveCfg = Release|x64 + {AD0D0500-CE7D-417D-9C36-3620D56CA6D4}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/protocols/ICQCorp/ICQCorp.vcxproj b/protocols/ICQCorp/ICQCorp.vcxproj new file mode 100644 index 0000000000..ee157e019a --- /dev/null +++ b/protocols/ICQCorp/ICQCorp.vcxproj @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="15.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"> + <ProjectGuid>{AD0D0500-CE7D-417D-9C36-3620D56CA6D4}</ProjectGuid> + <ProjectName>ICQCorp</ProjectName> + </PropertyGroup> + <ImportGroup Label="PropertySheets"> + <Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" /> + </ImportGroup> + <ItemDefinitionGroup> + <ClCompile> + <ExceptionHandling>Sync</ExceptionHandling> + </ClCompile> + </ItemDefinitionGroup> +</Project>
\ No newline at end of file diff --git a/protocols/ICQCorp/ICQCorp.vcxproj.filters b/protocols/ICQCorp/ICQCorp.vcxproj.filters new file mode 100644 index 0000000000..fcae13a9d8 --- /dev/null +++ b/protocols/ICQCorp/ICQCorp.vcxproj.filters @@ -0,0 +1,4 @@ +<?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/protocols/ICQCorp/ICQCorp_15.vcxproj b/protocols/ICQCorp/ICQCorp_15.vcxproj deleted file mode 100644 index 2321688a75..0000000000 --- a/protocols/ICQCorp/ICQCorp_15.vcxproj +++ /dev/null @@ -1,223 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="15.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"> - <ProjectGuid>{AD0D0500-CE7D-417D-9C36-3620D56CA6D4}</ProjectGuid> - <ProjectName>ICQCorp</ProjectName> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <PlatformToolset>v141_xp</PlatformToolset> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <PlatformToolset>v141_xp</PlatformToolset> - <CharacterSet>MultiByte</CharacterSet> - <WholeProgramOptimization>true</WholeProgramOptimization> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <PlatformToolset>v141_xp</PlatformToolset> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> - <ConfigurationType>DynamicLibrary</ConfigurationType> - <PlatformToolset>v141_xp</PlatformToolset> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup> - <_ProjectFileVersion>11.0.60610.1</_ProjectFileVersion> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir> - <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\</IntDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Configuration)64\Plugins\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir> - <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir> - <IgnoreImportLibrary>true</IgnoreImportLibrary> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <StringPooling>true</StringPooling> - <MinimalRebuild>false</MinimalRebuild> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeaderFile>corp.h</PrecompiledHeaderFile> - <PrecompiledHeader>Use</PrecompiledHeader> - <AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions> - </ClCompile> - <Link> - <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>true</GenerateDebugInformation> - <SubSystem>Windows</SubSystem> - <AdditionalLibraryDirectories>$(ProfileDir)..\..\libs\win$(PlatformArchitecture)</AdditionalLibraryDirectories> - <RandomizedBaseAddress>false</RandomizedBaseAddress> - <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <Optimization>Disabled</Optimization> - <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <StringPooling>true</StringPooling> - <MinimalRebuild>false</MinimalRebuild> - <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeaderFile>corp.h</PrecompiledHeaderFile> - <PrecompiledHeader>Use</PrecompiledHeader> - <AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions> - </ClCompile> - <Link> - <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> - <GenerateDebugInformation>true</GenerateDebugInformation> - <SubSystem>Windows</SubSystem> - <AdditionalLibraryDirectories>$(ProfileDir)..\..\libs\win$(PlatformArchitecture)</AdditionalLibraryDirectories> - <RandomizedBaseAddress>false</RandomizedBaseAddress> - <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <Optimization>Full</Optimization> - <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> - <FavorSizeOrSpeed>Size</FavorSizeOrSpeed> - <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <EnableEnhancedInstructionSet>NoExtensions</EnableEnhancedInstructionSet> - <StringPooling>true</StringPooling> - <MinimalRebuild>false</MinimalRebuild> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeaderFile>corp.h</PrecompiledHeaderFile> - <PrecompiledHeader>Use</PrecompiledHeader> - <AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions> - </ClCompile> - <Link> - <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> - <SubSystem>Windows</SubSystem> - <AdditionalLibraryDirectories>$(ProfileDir)..\..\libs\win$(PlatformArchitecture)</AdditionalLibraryDirectories> - <GenerateDebugInformation>true</GenerateDebugInformation> - <OptimizeReferences>true</OptimizeReferences> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <RandomizedBaseAddress>false</RandomizedBaseAddress> - <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <Optimization>Full</Optimization> - <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> - <FavorSizeOrSpeed>Size</FavorSizeOrSpeed> - <AdditionalIncludeDirectories>..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> - <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <StringPooling>true</StringPooling> - <MinimalRebuild>false</MinimalRebuild> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeaderFile>corp.h</PrecompiledHeaderFile> - <PrecompiledHeader>Use</PrecompiledHeader> - <AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions> - </ClCompile> - <Link> - <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies> - <SubSystem>Windows</SubSystem> - <AdditionalLibraryDirectories>$(ProfileDir)..\..\libs\win$(PlatformArchitecture)</AdditionalLibraryDirectories> - <GenerateDebugInformation>true</GenerateDebugInformation> - <OptimizeReferences>true</OptimizeReferences> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <RandomizedBaseAddress>false</RandomizedBaseAddress> - <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary> - </Link> - <ResourceCompile> - <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>..\..\include;..\..\include\msapi</AdditionalIncludeDirectories> - </ResourceCompile> - </ItemDefinitionGroup> - <ItemGroup> - <ClInclude Include="src\corp.h" /> - <ClInclude Include="src\event.h" /> - <ClInclude Include="src\options.h" /> - <ClInclude Include="src\packet.h" /> - <ClInclude Include="src\protocol.h" /> - <ClInclude Include="src\resource.h" /> - <ClInclude Include="src\socket.h" /> - <ClInclude Include="src\transfer.h" /> - <ClInclude Include="src\user.h" /> - <ClInclude Include="src\version.h" /> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="res\resource.rc" /> - <ResourceCompile Include="res\version.rc" /> - </ItemGroup> - <ItemGroup> - <Image Include="res\corp.ico" /> - </ItemGroup> - <ItemGroup> - <ClCompile Include="src\corp.cpp" /> - <ClCompile Include="src\event.cpp" /> - <ClCompile Include="src\options.cpp" /> - <ClCompile Include="src\packet.cpp" /> - <ClCompile Include="src\protocol.cpp" /> - <ClCompile Include="src\services.cpp" /> - <ClCompile Include="src\socket.cpp" /> - <ClCompile Include="src\stdafx.cpp"> - <PrecompiledHeader>Create</PrecompiledHeader> - </ClCompile> - <ClCompile Include="src\transfer.cpp" /> - <ClCompile Include="src\user.cpp" /> - </ItemGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project>
\ No newline at end of file diff --git a/protocols/ICQCorp/ICQCorp_15.vcxproj.filters b/protocols/ICQCorp/ICQCorp_15.vcxproj.filters deleted file mode 100644 index 35d6a987c6..0000000000 --- a/protocols/ICQCorp/ICQCorp_15.vcxproj.filters +++ /dev/null @@ -1,97 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="Source Files"> - <UniqueIdentifier>{69c79660-1836-402a-9ec2-3b75f4396bc2}</UniqueIdentifier> - <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions> - </Filter> - <Filter Include="Header Files"> - <UniqueIdentifier>{c2873240-bfbb-49ad-b400-228addec6702}</UniqueIdentifier> - <Extensions>h;hpp;hxx;hm;inl;inc</Extensions> - </Filter> - <Filter Include="Resource Files"> - <UniqueIdentifier>{41cb7826-be3c-4d3a-9f8d-1ba6b379207b}</UniqueIdentifier> - <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;r</Extensions> - </Filter> - <Filter Include="Resource Files\Icons"> - <UniqueIdentifier>{3e399225-12c1-4207-95d1-b5adc3407673}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClInclude Include="src\corp.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\event.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\options.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\packet.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\protocol.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\resource.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\socket.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\transfer.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\user.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="src\version.h"> - <Filter>Header Files</Filter> - </ClInclude> - </ItemGroup> - <ItemGroup> - <ResourceCompile Include="res\resource.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - <ResourceCompile Include="res\version.rc"> - <Filter>Resource Files</Filter> - </ResourceCompile> - </ItemGroup> - <ItemGroup> - <Image Include="res\corp.ico"> - <Filter>Resource Files\Icons</Filter> - </Image> - </ItemGroup> - <ItemGroup> - <ClCompile Include="src\corp.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\event.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\options.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\packet.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\protocol.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\services.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\socket.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\stdafx.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\transfer.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="src\user.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - </ItemGroup> -</Project>
\ No newline at end of file diff --git a/protocols/ICQCorp/src/corp.cpp b/protocols/ICQCorp/src/corp.cpp index 27f4abaf00..2687a3e9fc 100644 --- a/protocols/ICQCorp/src/corp.cpp +++ b/protocols/ICQCorp/src/corp.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "corp.h"
+#include "stdafx.h"
///////////////////////////////////////////////////////////////////////////////
@@ -103,7 +103,7 @@ void T(char *format, ...) static HANDLE hFile = INVALID_HANDLE_VALUE;
if (hFile == INVALID_HANDLE_VALUE) {
- hFile = CreateFile("ICQ Corp.log", GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_ALWAYS, 0, nullptr);
+ hFile = CreateFileW(L"ICQ Corp.log", GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_ALWAYS, 0, nullptr);
SetFilePointer(hFile, 0, nullptr, FILE_END);
}
diff --git a/protocols/ICQCorp/src/event.cpp b/protocols/ICQCorp/src/event.cpp index 6499a1d37b..e73f4c9446 100644 --- a/protocols/ICQCorp/src/event.cpp +++ b/protocols/ICQCorp/src/event.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "corp.h"
+#include "stdafx.h"
std::vector <ICQEvent *> icqEvents;
@@ -95,7 +95,7 @@ void ICQEvent::stop() bool ICQEvent::isEvent(SOCKET hSocket, unsigned long theSequence)
{
- return socket->handleVal == hSocket && sequence == theSequence;
+ return socket->handleVal == hSocket && sequence == (int)theSequence;
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/ICQCorp/src/options.cpp b/protocols/ICQCorp/src/options.cpp index dbe5e9189c..5b1ed9414e 100644 --- a/protocols/ICQCorp/src/options.cpp +++ b/protocols/ICQCorp/src/options.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "corp.h"
+#include "stdafx.h"
///////////////////////////////////////////////////////////////////////////////
@@ -31,11 +31,11 @@ static INT_PTR CALLBACK icqOptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP TranslateDialogDefault(hWnd);
SetDlgItemInt(hWnd, IDC_OPT_UIN, db_get_dw(NULL, protoName, "UIN", 0), FALSE);
if (!db_get(NULL, protoName, "Password", &dbv)) {
- SetDlgItemText(hWnd, IDC_OPT_PASSWORD, dbv.pszVal);
+ SetDlgItemTextA(hWnd, IDC_OPT_PASSWORD, dbv.pszVal);
db_free(&dbv);
}
if (!db_get(NULL, protoName, "Server", &dbv)) {
- SetDlgItemText(hWnd, IDC_OPT_SERVER, dbv.pszVal);
+ SetDlgItemTextA(hWnd, IDC_OPT_SERVER, dbv.pszVal);
db_free(&dbv);
}
SetDlgItemInt(hWnd, IDC_OPT_PORT, db_get_w(NULL, protoName, "Port", 4000), FALSE);
@@ -46,9 +46,9 @@ static INT_PTR CALLBACK icqOptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
db_set_dw(NULL, protoName, "UIN", (DWORD)GetDlgItemInt(hWnd, IDC_OPT_UIN, nullptr, FALSE));
- GetDlgItemText(hWnd, IDC_OPT_PASSWORD, str, sizeof(str));
+ GetDlgItemTextA(hWnd, IDC_OPT_PASSWORD, str, sizeof(str));
db_set_s(NULL, protoName, "Password", str);
- GetDlgItemText(hWnd, IDC_OPT_SERVER, str, sizeof(str));
+ GetDlgItemTextA(hWnd, IDC_OPT_SERVER, str, sizeof(str));
db_set_s(NULL, protoName, "Server", str);
db_set_w(NULL, protoName, "Port", (WORD)GetDlgItemInt(hWnd, IDC_OPT_PORT, nullptr, FALSE));
return TRUE;
@@ -67,12 +67,11 @@ static INT_PTR CALLBACK icqOptionsDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LP int icqOptionsInitialise(WPARAM wParam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = { 0 };
-
+ OPTIONSDIALOGPAGE odp = {};
odp.position = -800000000;
odp.szTitle.a = protoName;
odp.pfnDlgProc = icqOptionsDlgProc;
- odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_ICQCORP);
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ICQCORP);
odp.hInstance = hInstance;
odp.szGroup.a = LPGEN("Network");
odp.flags = ODPF_BOLDGROUPS;
diff --git a/protocols/ICQCorp/src/packet.cpp b/protocols/ICQCorp/src/packet.cpp index 9fe991e557..79dee5d7b4 100644 --- a/protocols/ICQCorp/src/packet.cpp +++ b/protocols/ICQCorp/src/packet.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "corp.h"
+#include "stdafx.h"
///////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index d57ceaaad1..57f683a63b 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "corp.h"
+#include "stdafx.h"
ICQ icq;
@@ -89,7 +89,7 @@ LRESULT WINAPI messageWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) unsigned int i;
for (i = 0; i < icqUsers.size(); i++) {
if (hSocket == icqUsers[i]->socket.handleVal) {
- T("[tcp] user %d is aborted connection\n", icqUsers[i]->uin);
+ T("[tcp] user %d is aborted connection\n", icqUsers[i]->dwUIN);
icqUsers[i]->socket.closeConnection();
break;
}
@@ -140,8 +140,7 @@ void WINAPI pingTimerProc(HWND, UINT, UINT_PTR, DWORD) ICQ::ICQ()
: tcpSocket(WM_NETEVENT_CONNECTION),
udpSocket(WM_NETEVENT_SERVER)
-{
-}
+{}
///////////////////////////////////////////////////////////////////////////////
@@ -150,7 +149,7 @@ bool ICQ::load() WSADATA data;
if (WSAStartup(MAKEWORD(2, 2), &data)) {
- MessageBox(nullptr, Translate("ICQ Corporate plugin used only WinSock v2.2 or later."), protoName, MB_ICONWARNING | MB_OK);
+ MessageBox(nullptr, TranslateT("ICQ Corporate plugin used only WinSock v2.2 or later."), _A2T(protoName), MB_ICONWARNING | MB_OK);
return false;
}
@@ -161,11 +160,13 @@ bool ICQ::load() awayMessage = new char[1];
awayMessage[0] = 0;
- WNDCLASS wc = { 0, messageWndProc, 0, 0, hInstance, nullptr, nullptr, nullptr, nullptr, protoName };
- if (!RegisterClass(&wc)) return false;
+ WNDCLASSA wc = { 0, messageWndProc, 0, 0, hInstance, nullptr, nullptr, nullptr, nullptr, protoName };
+ if (!RegisterClassA(&wc))
+ return false;
- hWnd = CreateWindowEx(0, protoName, nullptr, 0, 0, 0, 0, 0, (unsigned short)GetVersion() >= 5 ? HWND_MESSAGE : nullptr, nullptr, hInstance, nullptr);
- if (hWnd == nullptr) return false;
+ hWnd = CreateWindowExA(0, protoName, nullptr, 0, 0, 0, 0, 0, (unsigned short)GetVersion() >= 5 ? HWND_MESSAGE : nullptr, nullptr, hInstance, nullptr);
+ if (hWnd == nullptr)
+ return false;
return true;
}
@@ -184,7 +185,7 @@ void ICQ::unload() WSACleanup();
DestroyWindow(hWnd);
- UnregisterClass(protoName, hInstance);
+ UnregisterClassA(protoName, hInstance);
}
///////////////////////////////////////////////////////////////////////////////
@@ -195,17 +196,17 @@ bool ICQ::logon(unsigned short logonStatus) char str[128];
if (!db_get(NULL, protoName, "Server", &dbv)) {
- lstrcpy(str, dbv.pszVal);
+ lstrcpyA(str, dbv.pszVal);
db_free(&dbv);
}
else {
- MessageBox(nullptr, Translate("You need specify ICQ Corporate login server."), protoName, MB_ICONWARNING | MB_OK);
+ MessageBox(nullptr, TranslateT("You need specify ICQ Corporate login server."), _A2T(protoName), MB_ICONWARNING | MB_OK);
return false;
}
if (!tcpSocket.connected() && !tcpSocket.startServer())
return false;
-
+
if (!udpSocket.connected()) {
if (!udpSocket.setDestination(str, db_get_w(NULL, protoName, "Port", 4000)))
return false;
@@ -217,9 +218,9 @@ bool ICQ::logon(unsigned short logonStatus) updateContactList();
- uin = db_get_dw(NULL, protoName, "UIN", 0);
+ dwUIN = db_get_dw(NULL, protoName, "UIN", 0);
if (!db_get(NULL, protoName, "Password", &dbv)) {
- lstrcpy(str, dbv.pszVal);
+ lstrcpyA(str, dbv.pszVal);
db_free(&dbv);
}
@@ -232,7 +233,7 @@ bool ICQ::logon(unsigned short logonStatus) << ICQ_CMDxSND_LOGON
<< sequenceVal
<< sequenceVal
- << uin
+ << dwUIN
<< (unsigned int)0x00
<< tcpSocket.localPortVal
<< str
@@ -269,7 +270,7 @@ void ICQ::logoff(bool reconnect) logoffPacket << ICQ_VERSION
<< ICQ_CMDxSND_LOGOFF
<< (unsigned int)0x00
- << uin
+ << dwUIN
<< (unsigned int)0x00
<< "B_USER_DISCONNECTED"
<< (unsigned short)0x0005;
@@ -305,7 +306,7 @@ void ICQ::ping() << ICQ_CMDxSND_PING
<< sequenceVal
<< (unsigned short)0x00
- << uin
+ << dwUIN
<< (unsigned int)0x00;
T("[udp] keep alive (%d)\n", sequenceVal);
@@ -318,7 +319,7 @@ void ICQ::ping() ///////////////////////////////////////////////////////////////////////////////
ICQEvent *ICQ::sendICQ(Socket &socket, Packet &packet, unsigned short cmd, unsigned long sequence,
- unsigned long uin, unsigned short subCmd, int reply)
+ unsigned long _uin, unsigned short subCmd, int reply)
{
ICQEvent *result;
@@ -328,7 +329,7 @@ ICQEvent *ICQ::sendICQ(Socket &socket, Packet &packet, unsigned short cmd, unsig if (cmd != ICQ_CMDxTCP_START)
sequenceVal++;
- icqEvents.push_back(result = new ICQEvent(cmd, subCmd, sequence, uin, &socket, &packet, reply));
+ icqEvents.push_back(result = new ICQEvent(cmd, subCmd, sequence, _uin, &socket, &packet, reply));
if (!result->start()) {
cancelEvent(result);
return nullptr;
@@ -341,7 +342,7 @@ ICQEvent *ICQ::sendICQ(Socket &socket, Packet &packet, unsigned short cmd, unsig void ICQ::doneEvent(bool gotAck, int hSocket, int sequence)
{
unsigned int i;
- ICQEvent *e;
+ ICQEvent *e = nullptr;
for (i = 0; i < icqEvents.size(); i++) {
e = icqEvents[i];
@@ -386,8 +387,7 @@ void ICQ::doneEvent(bool gotAck, int hSocket, int sequence) //emit doneOwnerFcn(gotAck, cmd);
break;
case ICQ_CMDxSND_LOGON:
- if (!gotAck)
- {
+ if (!gotAck) {
logoff(false);
//emit doneOwnerFcn(false, cmd);
}
@@ -467,7 +467,7 @@ unsigned short ICQ::processUdpPacket(Packet &packet) packet >> message;
T("%s\n", message);
- MessageBox(nullptr, message, protoName, MB_ICONERROR | MB_OK);
+ MessageBoxA(nullptr, message, protoName, MB_ICONERROR | MB_OK);
delete[] message;
break;
@@ -703,8 +703,7 @@ unsigned short ICQ::processUdpPacket(Packet &packet) T("[udp] end of system messages.\n");
ackUDP(theSequence);
- if (timeStampLastMessage)
- {
+ if (timeStampLastMessage) {
ackSYS(timeStampLastMessage);
timeStampLastMessage = 0;
}
@@ -823,7 +822,7 @@ unsigned short ICQ::processUdpPacket(Packet &packet) case ICQ_CMDxRCV_WRONGxPASSWD: // incorrect password sent in logon
T("[udp] incorrect password.\n");
ProtoBroadcastAck(protoName, NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_WRONGPASSWORD);
- MessageBox(nullptr, Translate("Your ICQ Corp number and password combination was rejected by the ICQ Corporate server. Please go to Options -> Network -> ICQCorp and try again."), protoName, MB_ICONERROR | MB_OK);
+ MessageBox(nullptr, TranslateT("Your ICQ Corp number and password combination was rejected by the ICQ Corporate server. Please go to Options -> Network -> ICQCorp and try again."), _A2T(protoName), MB_ICONERROR | MB_OK);
break;
case ICQ_CMDxRCV_BUSY: // server too busy to respond
@@ -855,21 +854,23 @@ void ICQ::processSystemMessage(Packet &packet, unsigned long checkUin, unsigned switch (newCommand) {
case ICQ_CMDxRCV_SYSxMSG:
T("message through server from %d\n", checkUin);
- addMessage(u, message, ICQ_CMDxRCV_SYSxMSGxONLINE, ICQ_CMDxTCP_MSG, 0, timeSent);
+ addMessage(u, message, timeSent);
break;
case ICQ_CMDxRCV_SYSxURL:
T("url through server from %d\n", checkUin);
- addUrl(u, message, ICQ_CMDxRCV_SYSxMSGxONLINE, ICQ_CMDxTCP_URL, 0, timeSent);
+ addUrl(u, message, timeSent);
break;
case ICQ_CMDxRCV_SYSxBROADCAST:
T("broadcast message from %d\n", checkUin);
messageLen = (unsigned int)mir_strlen(message);
- for (i = 0; i < messageLen; i++) if (message[i] == (char)0xFE) message[i] = '\n';
+ for (i = 0; i < messageLen; i++)
+ if (message[i] == -2) // 0xFE
+ message[i] = '\n';
- addMessage(u, message, ICQ_CMDxRCV_SYSxMSGxONLINE, ICQ_CMDxTCP_MSG, 0, timeSent);
+ addMessage(u, message, timeSent);
break;
/*
case ICQ_CMDxRCV_SYSxAUTHxREQ: // system message: authorisation request
@@ -883,12 +884,13 @@ void ICQ::processSystemMessage(Packet &packet, unsigned long checkUin, unsigned for (i=0; i<=messageLen; i++)
{
packet >> message[i];
- if (message[i] == (char)0xFE) message[i] = '\n';
+ if (message[i] == -2)
+ message[i] = '\n';
}
sysMsg = new char[messageLen + 128];
sprintf(sysMsg, "(%s) Authorization request from %ld:\n%s", sm.timeRec(), checkUin, message);
- icqOwner.addMessage(sysMsg, ICQ_CMDxRCV_SYSxMSGxONLINE, ICQ_CMDxRCV_SMxREQxAUTH, 0, timeSent);
+ icqOwner.addMessage(sysMsg, timeSent);
sprintf(sysMsg, "Authorization request from %ld:\n%s", checkUin, message);
addToSystemMessageHistory(sysMsg);
playSound(soundSysMsg);
@@ -904,12 +906,12 @@ void ICQ::processSystemMessage(Packet &packet, unsigned long checkUin, unsigned for (i = 0; i <= messageLen; i++)
{
packet >> message[i];
- if (message[i] == (char)0xFE) message[i] = '\n';
+ if (message[i] == -2) message[i] = '\n';
}
sysMsg = new char[messageLen + 128];
sprintf(sysMsg, "(%s) Authorization granted from %ld:\n%s", sm.timeRec(), checkUin, message);
- icqOwner.addMessage(sysMsg, ICQ_CMDxRCV_SYSxMSGxONLINE, ICQ_CMDxRCV_SMxREQxAUTH, 0, timeSent);
+ icqOwner.addMessage(sysMsg, timeSent);
sprintf(sysMsg, "Authorization granted from %ld:\n%s", checkUin, message);
addToSystemMessageHistory(sysMsg);
playSound(soundSysMsg);
@@ -918,49 +920,49 @@ void ICQ::processSystemMessage(Packet &packet, unsigned long checkUin, unsigned delete message;
break;
*/
- /*
- case ICQ_CMDxRCV_SYSxADDED: // system message: added to a contact list
- outputWindow->wprintf(" %C(%s) user %C%ld%C added you to their contact list.", COLOR_RECEIVE, sm.timeRec(), COLOR_DATA, checkUin, COLOR_RECEIVE);
- sysMsg = new char[128];
- sprintf(sysMsg, "(%s) User %ld added you to their contact list.", sm.timeRec(), checkUin);
- icqOwner.addMessage(sysMsg, ICQ_CMDxRCV_SYSxMSGxONLINE, ICQ_CMDxRCV_SMxADDED, 0, timeSent);
- sprintf(sysMsg, "User %ld added you to their contact list.", checkUin);
- addToSystemMessageHistory(sysMsg);
- delete sysMsg;
- playSound(soundSysMsg);
- */
- /* there is a bunch of info about the given user in the packet but the read routine to get
- at it is totally broken right now
- int infoLen, j;
- packet >> infoLen;
-
- // declare all the strings we will need for reading in the user data
- char *userInfo, *aliasField, *firstNameField, *lastNameField, *emailField;
- userInfo = new char[infoLen];
- aliasField = new char[infoLen];
- firstNameField = new char[infoLen];
- lastNameField = new char[infoLen];
- emailField = new char[infoLen];
-
- // read in the user data from the packet
- for (i = 0; i < infoLen; i++) packet >> userInfo[i];
-
- // parse the user info string for the four fields
- i = j = 0;
- do { aliasField[j] = userInfo[i]; i++; j++;} while (userInfo[i] != (char)0xFE);
- aliasField[j] = '\0'; j = 0;
- do { firstNameField[j] = userInfo[i]; i++; j++;} while (userInfo[i] != (char)0xFE);
- firstNameField[j] = '\0'; j = 0;
- do { lastNameField[j] = userInfo[i]; i++; j++;} while (userInfo[i] != (char)0xFE);
- lastNameField[j] = '\0'; j = 0;
- do { emailField[j] = userInfo[i]; i++; j++;} while (i < infoLen);
- emailField[j] = '\0';
-
- *outputWindow << " " << aliasField << " (" << firstNameField << " " << lastNameField << "), " << emailField << ".";
-
- delete userInfo; delete aliasField; delete firstNameField; delete lastNameField; delete emailField;
- break;
- */
+ /*
+ case ICQ_CMDxRCV_SYSxADDED: // system message: added to a contact list
+ outputWindow->wprintf(" %C(%s) user %C%ld%C added you to their contact list.", COLOR_RECEIVE, sm.timeRec(), COLOR_DATA, checkUin, COLOR_RECEIVE);
+ sysMsg = new char[128];
+ sprintf(sysMsg, "(%s) User %ld added you to their contact list.", sm.timeRec(), checkUin);
+ icqOwner.addMessage(sysMsg, timeSent);
+ sprintf(sysMsg, "User %ld added you to their contact list.", checkUin);
+ addToSystemMessageHistory(sysMsg);
+ delete sysMsg;
+ playSound(soundSysMsg);
+ */
+ /* there is a bunch of info about the given user in the packet but the read routine to get
+ at it is totally broken right now
+ int infoLen, j;
+ packet >> infoLen;
+
+ // declare all the strings we will need for reading in the user data
+ char *userInfo, *aliasField, *firstNameField, *lastNameField, *emailField;
+ userInfo = new char[infoLen];
+ aliasField = new char[infoLen];
+ firstNameField = new char[infoLen];
+ lastNameField = new char[infoLen];
+ emailField = new char[infoLen];
+
+ // read in the user data from the packet
+ for (i = 0; i < infoLen; i++) packet >> userInfo[i];
+
+ // parse the user info string for the four fields
+ i = j = 0;
+ do { aliasField[j] = userInfo[i]; i++; j++;} while (userInfo[i] != -2);
+ aliasField[j] = '\0'; j = 0;
+ do { firstNameField[j] = userInfo[i]; i++; j++;} while (userInfo[i] != -2);
+ firstNameField[j] = '\0'; j = 0;
+ do { lastNameField[j] = userInfo[i]; i++; j++;} while (userInfo[i] != -2);
+ lastNameField[j] = '\0'; j = 0;
+ do { emailField[j] = userInfo[i]; i++; j++;} while (i < infoLen);
+ emailField[j] = '\0';
+
+ *outputWindow << " " << aliasField << " (" << firstNameField << " " << lastNameField << "), " << emailField << ".";
+
+ delete userInfo; delete aliasField; delete firstNameField; delete lastNameField; delete emailField;
+ break;
+ */
default:
T("[udp] unknown system packet:\n%s", packet.print());
@@ -979,7 +981,7 @@ void ICQ::ackUDP(unsigned short theSequence) << ICQ_CMDxSND_ACK
<< theSequence
<< (unsigned short)0x00
- << uin
+ << dwUIN
<< (unsigned int)0x00;
T("[udp] sending ack (%d)\n", theSequence);
@@ -995,7 +997,7 @@ void ICQ::ackSYS(unsigned int timeStamp) << ICQ_CMDxSND_SYSxMSGxDONExACK
<< sequenceVal
<< sequenceVal
- << uin
+ << dwUIN
<< (unsigned int)0x00
<< timeStamp;
@@ -1005,24 +1007,23 @@ void ICQ::ackSYS(unsigned int timeStamp) ///////////////////////////////////////////////////////////////////////////////
-ICQUser *ICQ::getUserByUIN(unsigned long uin, bool allowAdd)
+ICQUser *ICQ::getUserByUIN(unsigned long _uin, bool allowAdd)
{
unsigned long i;
ICQUser *u;
- for (i = 0; i < icqUsers.size(); i++)
- {
+ for (i = 0; i < icqUsers.size(); i++) {
u = icqUsers[i];
- if (u->uin == uin) return u;
+ if (u->dwUIN == _uin)
+ return u;
}
- if (allowAdd)
- {
- T("unknown user %d, adding them to your list\n", uin);
- return addUser(uin, false);
+ if (allowAdd) {
+ T("unknown user %d, adding them to your list\n", _uin);
+ return addUser(_uin, false);
}
- T("ICQ sent unknown user %d\n", uin);
+ T("ICQ sent unknown user %d\n", _uin);
return nullptr;
}
@@ -1030,15 +1031,10 @@ ICQUser *ICQ::getUserByUIN(unsigned long uin, bool allowAdd) ICQUser *ICQ::getUserByContact(MCONTACT hContact)
{
- unsigned long i;
- ICQUser *u;
-
- // uin = db_get_dw(ccs->hContact, protoName, "UIN", 0);
-
- for (i = 0; i < icqUsers.size(); i++)
- {
- u = icqUsers[i];
- if (u->hContact == hContact) return u;
+ for (size_t i = 0; i < icqUsers.size(); i++) {
+ ICQUser *u = icqUsers[i];
+ if (u->hContact == hContact)
+ return u;
}
return nullptr;
}
@@ -1055,7 +1051,7 @@ void ICQ::requestSystemMsg() << ICQ_CMDxSND_SYSxMSGxREQ
<< sequenceVal
<< sequenceVal
- << uin
+ << dwUIN
<< (unsigned int)0x00;
T("[udp] sending offline system messages request (%d)...\n", sequenceVal);
@@ -1073,7 +1069,7 @@ void ICQ::requestBroadcastMsg() << ICQ_CMDxSND_BROADCASTxREQ
<< sequenceVal
<< sequenceVal
- << uin
+ << dwUIN
<< (unsigned int)0x00
<< timeStamp
<< (unsigned int)0x00;
@@ -1094,7 +1090,7 @@ bool ICQ::setStatus(unsigned short newStatus) << ICQ_CMDxSND_SETxSTATUS
<< sequenceVal
<< sequenceVal
- << uin
+ << dwUIN
<< (unsigned int)0x00
<< toIcqStatus(newStatus);
@@ -1121,7 +1117,7 @@ void ICQ::updateContactList() if ((u = getUserByContact(hContact)) == nullptr) {
u = new ICQUser();
u->hContact = hContact;
- u->uin = db_get_dw(hContact, protoName, "UIN", 0);
+ u->dwUIN = db_get_dw(hContact, protoName, "UIN", 0);
icqUsers.push_back(u);
}
if (statusVal <= ID_STATUS_OFFLINE)
@@ -1136,8 +1132,7 @@ void ICQ::updateContactList() // create user info packet
Packet userPacket;
- for (i = 0; i < icqUsers.size();)
- {
+ for (i = 0; i < icqUsers.size();) {
userCount = (unsigned int)icqUsers.size() - i;
if (userCount > 100) userCount = 100;
@@ -1146,11 +1141,11 @@ void ICQ::updateContactList() << ICQ_CMDxSND_USERxLIST
<< sequenceVal
<< sequenceVal
- << uin
+ << dwUIN
<< (unsigned int)0x00
<< (unsigned char)userCount;
- for (; userCount > 0; userCount--) userPacket << icqUsers[i++]->uin;
+ for (; userCount > 0; userCount--) userPacket << icqUsers[i++]->dwUIN;
// send user info packet
T("[udp] sending contact list (%d)...\n", sequenceVal);
@@ -1235,7 +1230,7 @@ void ICQ::sendInvisibleList() ///////////////////////////////////////////////////////////////////////////////
-void ICQ::updateUserList(ICQUser *u, char list, char add)
+void ICQ::updateUserList(ICQUser* /*u*/, char /*list*/, char /*add*/)
{
/*
Packet userPacket;
@@ -1256,14 +1251,14 @@ void ICQ::updateUserList(ICQUser *u, char list, char add) ///////////////////////////////////////////////////////////////////////////////
-ICQUser *ICQ::addUser(unsigned int uin, bool persistent)
+ICQUser* ICQ::addUser(unsigned int uin, bool persistent)
{
unsigned int i;
ICQUser *u;
for (i = 0; i < icqUsers.size(); i++) {
u = icqUsers[i];
- if (u->uin == uin) {
+ if (u->dwUIN == uin) {
if (persistent) {
db_unset(u->hContact, "CList", "NotOnList");
db_unset(u->hContact, "CList", "Hidden");
@@ -1273,7 +1268,7 @@ ICQUser *ICQ::addUser(unsigned int uin, bool persistent) }
u = new ICQUser();
- u->uin = uin;
+ u->dwUIN = uin;
u->hContact = db_add_contact();
icqUsers.push_back(u);
@@ -1293,7 +1288,7 @@ ICQUser *ICQ::addUser(unsigned int uin, bool persistent) ///////////////////////////////////////////////////////////////////////////////
-void ICQ::addNewUser(ICQUser *u)
+void ICQ::addNewUser(ICQUser*)
{
/*
// update the users info from the server
@@ -1343,7 +1338,7 @@ void ICQ::startSearch(unsigned char skrit, unsigned char smode, char *sstring, u << sequenceVal
<< (unsigned short)s
// << (unsigned short)(icqOwner.sequence1())
- << uin
+ << dwUIN
<< (unsigned int)0x00
<< (unsigned char)0xFF
<< skrit
@@ -1372,8 +1367,7 @@ bool ICQ::openConnection(TCPSocket &socket) T("[tcp] connecting to %s on port %d...\n", inet_ntoa(*(in_addr*)&socket.remoteIPVal), socket.remotePortVal);
socket.openConnection();
- if (!socket.connected())
- {
+ if (!socket.connected()) {
T("[tcp] connect failed\n");
return false;
}
@@ -1386,7 +1380,7 @@ bool ICQ::openConnection(TCPSocket &socket) << (unsigned int)0x02
<< (unsigned int)0x00
// << (unsigned long)tcpSocket.localPortVal
- << uin
+ << dwUIN
<< socket.localIPVal
<< socket.localIPVal
<< (unsigned char)0x04
@@ -1423,11 +1417,11 @@ ICQEvent *ICQ::sendTCP(ICQUser *u, unsigned short cmd, char *cmdStr, char *m) }
Packet packet;
- packet << uin
+ packet << dwUIN
<< (unsigned short)0x02 // ICQ_VERSION
<< ICQ_CMDxTCP_START // ICQ_CMDxTCP_ACK, ICQ_CMDxTCP_START, ICQ_CMDxTCP_CANCEL
<< (unsigned short)0x00
- << uin
+ << dwUIN
<< cmd
<< m
<< udpSocket.localIPVal
@@ -1438,7 +1432,7 @@ ICQEvent *ICQ::sendTCP(ICQUser *u, unsigned short cmd, char *cmdStr, char *m) << tcpSequenceVal--;
T("[tcp] sending %s (%d)\n", cmdStr, tcpSequenceVal + 1);
- return sendICQ(u->socket, packet, ICQ_CMDxTCP_START, tcpSequenceVal + 1, u->uin, cmd);
+ return sendICQ(u->socket, packet, ICQ_CMDxTCP_START, tcpSequenceVal + 1, u->dwUIN, cmd);
}
///////////////////////////////////////////////////////////////////////////////
@@ -1450,9 +1444,9 @@ ICQEvent *ICQ::sendUDP(ICQUser *u, unsigned short cmd, char *cmdStr, char *m) << ICQ_CMDxSND_THRUxSERVER
<< sequenceVal
<< sequenceVal
- << uin
+ << dwUIN
<< (unsigned int)0x00
- << u->uin
+ << u->dwUIN
<< cmd
<< m;
@@ -1494,7 +1488,7 @@ ICQEvent *ICQ::sendUDP(ICQUser *u, unsigned short cmd, char *cmdStr, char *m) */
{
T("[udp] sending %s through server (%d)\n", cmdStr, sequenceVal);
- return sendICQ(udpSocket, packet, ICQ_CMDxSND_THRUxSERVER, sequenceVal, u->uin, cmd);
+ return sendICQ(udpSocket, packet, ICQ_CMDxSND_THRUxSERVER, sequenceVal, u->dwUIN, cmd);
}
}
@@ -1520,7 +1514,7 @@ ICQEvent *ICQ::sendUrl(ICQUser *u, char *url) m = new char[nameLen + descriptionLen + 2];
mir_strcpy(m, description);
mir_strcpy(m + descriptionLen + 1, url);
- m[descriptionLen] = (char)0xFE;
+ m[descriptionLen] = -2; // 0xFE;
result = send(u, ICQ_CMDxTCP_URL, "url", m);
delete[] m;
@@ -1590,11 +1584,11 @@ ICQTransfer *ICQ::sendFile(ICQUser *u, char *description, char *filename, unsign }
Packet packet;
- packet << uin
+ packet << dwUIN
<< (unsigned short)0x02 // ICQ_VERSION
<< ICQ_CMDxTCP_START // ICQ_CMDxTCP_ACK, ICQ_CMDxTCP_START, ICQ_CMDxTCP_CANCEL
<< (unsigned short)0x00
- << uin
+ << dwUIN
<< cmd
<< m
<< udpSocket.localIPVal
@@ -1612,13 +1606,13 @@ ICQTransfer *ICQ::sendFile(ICQUser *u, char *description, char *filename, unsign packet << tcpSequenceVal--;
T("[tcp] sending file request (%d)\n", tcpSequenceVal + 1);
- sendICQ(u->socket, packet, ICQ_CMDxTCP_START, tcpSequenceVal + 1, u->uin, cmd);
+ sendICQ(u->socket, packet, ICQ_CMDxTCP_START, tcpSequenceVal + 1, u->dwUIN, cmd);
return transfer;
}
///////////////////////////////////////////////////////////////////////////////
-void ICQ::acceptFile(ICQUser *u, unsigned long hTransfer, char *path)
+void ICQ::acceptFile(ICQUser *u, unsigned long hTransfer, char*)
{
unsigned int theSequence = hTransfer;
unsigned short cmd = ICQ_CMDxTCP_FILE;
@@ -1637,11 +1631,11 @@ void ICQ::acceptFile(ICQUser *u, unsigned long hTransfer, char *path) }
Packet packet;
- packet << uin
+ packet << dwUIN
<< (unsigned short)0x02 // ICQ_VERSION
<< ICQ_CMDxTCP_ACK // ICQ_CMDxTCP_ACK, ICQ_CMDxTCP_START, ICQ_CMDxTCP_CANCEL
<< (unsigned short)0x00
- << uin
+ << dwUIN
<< cmd
<< m
<< udpSocket.localIPVal
@@ -1682,11 +1676,11 @@ void ICQ::refuseFile(ICQUser *u, unsigned long hTransfer, char *reason) }
Packet packet;
- packet << uin
+ packet << dwUIN
<< (unsigned short)0x02 // ICQ_VERSION
<< ICQ_CMDxTCP_ACK // ICQ_CMDxTCP_ACK, ICQ_CMDxTCP_START, ICQ_CMDxTCP_CANCEL
<< (unsigned short)0x00
- << uin
+ << dwUIN
<< cmd
<< reason
<< udpSocket.localIPVal
@@ -1717,12 +1711,12 @@ bool ICQ::getUserInfo(ICQUser *u, bool basicInfo) << cmd
<< sequenceVal
<< sequenceVal
- << uin
+ << dwUIN
<< (unsigned int)0x00
- << u->uin;
+ << u->dwUIN;
T("[udp] sending user %s info request (%d)...\n", basicInfo ? "basic" : "details", sequenceVal);
- sendICQ(udpSocket, request, cmd, sequenceVal, u->uin, 0, basicInfo ? 1 : 5);
+ sendICQ(udpSocket, request, cmd, sequenceVal, u->dwUIN, 0, basicInfo ? 1 : 5);
return true;
}
@@ -1735,7 +1729,7 @@ void ICQ::authorize(unsigned int uinToAuthorize) << ICQ_CMDxSND_AUTHORIZE
<< sequenceVal
<< sequenceVal
- << uin
+ << dwUIN
<< (unsigned int)0x00
<< uinToAuthorize
<< (unsigned int)0x00010008 // who knows, seems to be constant
@@ -1772,14 +1766,14 @@ void ICQ::processTcpPacket(Packet &packet, unsigned int hSocket) u = getUserByUIN(checkUin);
switch (command) {
case ICQ_CMDxTCP_START: // incoming tcp packet containing one of many possible things
- switch (newCommand) { // do a switch on what it could be
+ switch (newCommand) { // do a switch on what it could be
case ICQ_CMDxTCP_MSG: // straight message from a user
T("[tcp] message from %d.\n", checkUin);
packet >> theTCPSequence;
ackTCP(packet, u, newCommand, theTCPSequence);
- addMessage(u, message, ICQ_CMDxTCP_START, ICQ_CMDxTCP_MSG, theTCPSequence, time(nullptr));
+ addMessage(u, message, time(nullptr));
break;
case ICQ_CMDxTCP_CHAT:
@@ -1800,7 +1794,7 @@ void ICQ::processTcpPacket(Packet &packet, unsigned int hSocket) packet >> theTCPSequence;
ackTCP(packet, u, newCommand, theTCPSequence);
- addUrl(u, message, ICQ_CMDxTCP_START, ICQ_CMDxTCP_URL, theTCPSequence, time(nullptr));
+ addUrl(u, message, time(nullptr));
break;
case ICQ_CMDxTCP_FILE:
@@ -1816,7 +1810,7 @@ void ICQ::processTcpPacket(Packet &packet, unsigned int hSocket) T("[tcp] file transfer request from %d (%d)\n", checkUin, theTCPSequence);
- addFileReq(u, message, fileName, size, ICQ_CMDxTCP_START, ICQ_CMDxTCP_FILE, theTCPSequence, time(nullptr));
+ addFileReq(u, message, fileName, size, theTCPSequence, time(nullptr));
delete[] fileName;
break;
@@ -1834,8 +1828,7 @@ void ICQ::processTcpPacket(Packet &packet, unsigned int hSocket) break;
case ICQ_CMDxTCP_ACK: // message received packet
- switch (newCommand)
- {
+ switch (newCommand) {
case ICQ_CMDxTCP_MSG:
packet >> theTCPSequence;
break;
@@ -1866,7 +1859,7 @@ void ICQ::processTcpPacket(Packet &packet, unsigned int hSocket) >> thePort
>> theTCPSequence;
- T("[tcp] file transfer ack from %d (%d)\n", u->uin, theTCPSequence);
+ T("[tcp] file transfer ack from %d (%d)\n", u->dwUIN, theTCPSequence);
ICQTransfer *t;
for (i = 0; i < icqTransfers.size(); i++) {
@@ -1901,18 +1894,18 @@ void ICQ::processTcpPacket(Packet &packet, unsigned int hSocket) case ICQ_CMDxTCP_READxDNDxMSG:
case ICQ_CMDxTCP_READxFREECHATxMSG:
packet >> theTCPSequence;
- addAwayMsg(u, message, ICQ_CMDxTCP_START, ICQ_CMDxTCP_READxAWAYxMSG, theTCPSequence, time(nullptr));
+ addAwayMsg(u, message, theTCPSequence, time(nullptr));
break;
}
// output the away message if there is one (ie if user status is not online)
if (userStatus == 0x0000)
- T("[tcp] ack from %d (%d).\n", u->uin, theTCPSequence);
+ T("[tcp] ack from %d (%d).\n", u->dwUIN, theTCPSequence);
else if (userStatus == 0x0001)
- T("[tcp] refusal from %d (%d): %s\n", u->uin, theTCPSequence, message);
+ T("[tcp] refusal from %d (%d): %s\n", u->dwUIN, theTCPSequence, message);
else {
// u->setAwayMessage(message);
- T("[tcp] ack from %d (%d).\n", u->uin, theTCPSequence);
+ T("[tcp] ack from %d (%d).\n", u->dwUIN, theTCPSequence);
// T("[tcp] ack from %d (%ld): %s\n", u->uin, theTCPSequence, message);
}
@@ -1923,12 +1916,12 @@ void ICQ::processTcpPacket(Packet &packet, unsigned int hSocket) switch (newCommand) {
case ICQ_CMDxTCP_CHAT:
T("[tcp] chat request from %d (%d) cancelled.\n", checkUin, theTCPSequence);
- // u->addMessage(chatReq, ICQ_CMDxTCP_CANCEL, ICQ_CMDxTCP_CHAT, 0);
+ // u->addMessage(chatReq, 0);
break;
case ICQ_CMDxTCP_FILE:
- T("[tcp] file transfer request from %d (%d) cancelled.\n", u->uin, theTCPSequence);
- // u->addMessage(fileReq, ICQ_CMDxTCP_CANCEL, ICQ_CMDxTCP_FILE, 0);
+ T("[tcp] file transfer request from %d (%d) cancelled.\n", u->dwUIN, theTCPSequence);
+ // u->addMessage(fileReq, 0);
break;
}
break;
@@ -1958,11 +1951,11 @@ void ICQ::ackTCP(Packet &packet, ICQUser *u, unsigned short newCommand, unsigned }
packet.clearPacket();
- packet << uin
+ packet << dwUIN
<< (unsigned short)0x02
<< (unsigned short)ICQ_CMDxTCP_ACK // ICQ_CMDxTCP_ACK, ICQ_CMDxTCP_START, ICQ_CMDxTCP_CANCEL
<< (unsigned short)0x00
- << uin
+ << dwUIN
<< newCommand
<< awayMessage
<< u->socket.localIPVal
@@ -2046,7 +2039,7 @@ void ICQ::recvTCP(SOCKET hSocket) if (u->socket.handleVal == hSocket) {
Packet packet;
if (!u->socket.receivePacket(packet)) {
- T("[tcp] connection to %d lost.\n", u->uin);
+ T("[tcp] connection to %d lost.\n", u->dwUIN);
return;
}
processTcpPacket(packet, hSocket);
@@ -2075,7 +2068,7 @@ void ICQ::recvTransferTCP(SOCKET hSocket) ///////////////////////////////////////////////////////////////////////////////
-void ICQ::addMessage(ICQUser *u, char *m, unsigned short theCmd, unsigned short theSubCmd, unsigned long theSequence, time_t t)
+void ICQ::addMessage(ICQUser *u, char *m, time_t t)
{
T("message: %s\n", m);
@@ -2095,19 +2088,19 @@ void ICQ::addMessage(ICQUser *u, char *m, unsigned short theCmd, unsigned short ///////////////////////////////////////////////////////////////////////////////
-void ICQ::addUrl(ICQUser *u, char *m, unsigned short theCmd, unsigned short theSubCmd, unsigned long theSequence, time_t t)
+void ICQ::addUrl(ICQUser *u, char *m, time_t t)
{
unsigned int i, messageLen;
char *url;
messageLen = (int)mir_strlen(m);
for (i = 0; i < messageLen; i++)
- if (m[i] == (char)0xFE)
+ if (m[i] == -2) // 0xFE
m[i] = 0;
url = new char[messageLen + 1];
- lstrcpy(url, m + mir_strlen(m) + 1);
- lstrcpy(url + mir_strlen(url) + 1, m);
+ lstrcpyA(url, m + mir_strlen(m) + 1);
+ lstrcpyA(url + mir_strlen(url) + 1, m);
PROTORECVEVENT pre;
pre.flags = 0;
@@ -2127,7 +2120,7 @@ void ICQ::addUrl(ICQUser *u, char *m, unsigned short theCmd, unsigned short theS ///////////////////////////////////////////////////////////////////////////////
-void ICQ::addAwayMsg(ICQUser *u, char *m, unsigned short theCmd, unsigned short theSubCmd, unsigned long theSequence, time_t t)
+void ICQ::addAwayMsg(ICQUser *u, char *m, unsigned long theSequence, time_t t)
{
T("away msg: %s\n", m);
@@ -2146,61 +2139,17 @@ void ICQ::addAwayMsg(ICQUser *u, char *m, unsigned short theCmd, unsigned short }
///////////////////////////////////////////////////////////////////////////////
-/*
-void ICQ::addAdded(ICQUser *u, char *m, unsigned short theCmd, unsigned short theSubCmd, unsigned long theSequence, time_t t)
-{
- DBEVENTINFO dbei;
- PBYTE pCurBlob;
-
- //blob is: uin(DWORD), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ)
- ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize=sizeof(dbei);
- dbei.szModule="ICQ";
- dbei.timestamp=TimestampLocalToGMT(YMDHMSToTime(year,month,day,hour,minute,0));
- dbei.flags=0;
- dbei.eventType=EVENTTYPE_ADDED;
- dbei.cbBlob=sizeof(DWORD)+mir_strlen(nick)+mir_strlen(first)+mir_strlen(last)+mir_strlen(email)+4;
- pCurBlob=dbei.pBlob=(PBYTE)malloc(dbei.cbBlob);
- CopyMemory(pCurBlob,&uin,sizeof(DWORD)); pCurBlob+=sizeof(DWORD);
- CopyMemory(pCurBlob,nick,mir_strlen(nick)+1); pCurBlob+=mir_strlen(nick)+1;
- CopyMemory(pCurBlob,first,mir_strlen(first)+1); pCurBlob+=mir_strlen(first)+1;
- CopyMemory(pCurBlob,last,mir_strlen(last)+1); pCurBlob+=mir_strlen(last)+1;
- CopyMemory(pCurBlob,email,mir_strlen(email)+1); pCurBlob+=mir_strlen(email)+1;
- CallService(MS_DB_EVENT_ADD,(WPARAM)(HANDLE)NULL,(LPARAM)&dbei);
-}
-*/
-///////////////////////////////////////////////////////////////////////////////
-void ICQ::addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, unsigned short theCmd, unsigned short theSubCmd, unsigned long theSequence, time_t t)
+void ICQ::addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, unsigned long theSequence, time_t t)
{
- char *szBlob;
- /*
- filetransfer *ft;
-
- // Initialize a filetransfer struct
- ft = new filetransfer;
- memset(ft, 0, sizeof(filetransfer));
- ft->status = 0;
- ft->wCookie = wCookie;
- ft->szFilename = _strdup(fileName);
- ft->szDescription = _strdup(m);
- ft->dwUin = u->uin;
- ft->fileId = -1;
- ft->dwTotalSize = size;
- ft->nVersion = nVersion;
- ft->TS1 = dwID1;
- ft->TS2 = dwID2;
- */
ICQTransfer *transfer = new ICQTransfer(u, theSequence);
transfer->description = _strdup(m);
transfer->totalSize = size;
icqTransfers.push_back(transfer);
-
-
// Send chain event
- szBlob = new char[sizeof(DWORD) + mir_strlen(filename) + mir_strlen(m) + 2];
+ char *szBlob = new char[sizeof(DWORD) + mir_strlen(filename) + mir_strlen(m) + 2];
*(PDWORD)szBlob = (UINT_PTR)transfer;
mir_strcpy(szBlob + sizeof(DWORD), filename);
diff --git a/protocols/ICQCorp/src/protocol.h b/protocols/ICQCorp/src/protocol.h index 185e7ce097..9374f77d01 100644 --- a/protocols/ICQCorp/src/protocol.h +++ b/protocols/ICQCorp/src/protocol.h @@ -175,7 +175,6 @@ public: void removeUser(ICQUser *u);
void startSearch(unsigned char skrit, unsigned char smode, char *sstring, unsigned int s);
-
bool getUserInfo(ICQUser *u, bool basicInfo);
void authorize(unsigned int uinToAuthorize);
void processTcpPacket(Packet &packet, unsigned int hSocket);
@@ -185,10 +184,10 @@ public: void recvTCP(SOCKET hSocket);
void recvTransferTCP(SOCKET hSocket);
- void addMessage(ICQUser *u, char *m, unsigned short theCmd, unsigned short theSubCmd, unsigned long theSequence, time_t t = 0);
- void addUrl(ICQUser *u, char *m, unsigned short theCmd, unsigned short theSubCmd, unsigned long theSequence, time_t t = 0);
- void addAwayMsg(ICQUser *u, char *m, unsigned short theCmd, unsigned short theSubCmd, unsigned long theSequence, time_t t = 0);
- void addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, unsigned short theCmd, unsigned short theSubCmd, unsigned long theSequence, time_t t = 0);
+ void addMessage(ICQUser *u, char *m, time_t t);
+ void addUrl(ICQUser *u, char *m, time_t t);
+ void addAwayMsg(ICQUser *u, char *m, unsigned long theSequence, time_t t);
+ void addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, unsigned long theSequence, time_t t);
void doneUserFcn(bool ack, ICQEvent *icqEvent);
void acceptFile(ICQUser *u, unsigned long hTransfer, char *path);
@@ -197,23 +196,22 @@ public: TCPSocket tcpSocket;
UDPSocket udpSocket;
unsigned short sequenceVal, searchSequenceVal;
- unsigned int uin, tcpSequenceVal;
+ unsigned int dwUIN, tcpSequenceVal;
unsigned short desiredStatus;
unsigned short statusVal;
unsigned int pingTimer;
-// int eventThread;
- HWND hWnd;
+
+ HWND hWnd;
char *awayMessage;
unsigned int timeStampLastMessage;
+
private:
ICQEvent *send(ICQUser *u, unsigned short cmd, char *cmdStr, char *m);
bool openConnection(TCPSocket &socket);
ICQEvent *sendTCP(ICQUser *u, unsigned short cmd, char *cmdStr, char *m);
-
ICQEvent *sendUDP(ICQUser *u, unsigned short cmd, char *cmdStr, char *m);
-
};
///////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp index 638c7e2e33..baa649f307 100644 --- a/protocols/ICQCorp/src/services.cpp +++ b/protocols/ICQCorp/src/services.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "corp.h"
+#include "stdafx.h"
///////////////////////////////////////////////////////////////////////////////
@@ -148,7 +148,7 @@ static INT_PTR icqAddToList(WPARAM wParam, LPARAM lParam) T("[ ] add user to list\n");
ICQSEARCHRESULT *isr = (ICQSEARCHRESULT *)lParam;
- if (isr->hdr.cbSize != sizeof(ICQSEARCHRESULT) || isr->uin == icq.uin)
+ if (isr->hdr.cbSize != sizeof(ICQSEARCHRESULT) || isr->uin == icq.dwUIN)
return NULL;
bool persistent = (wParam & PALF_TEMPORARY) == 0;
diff --git a/protocols/ICQCorp/src/socket.cpp b/protocols/ICQCorp/src/socket.cpp index 7b32969a38..75098763d1 100644 --- a/protocols/ICQCorp/src/socket.cpp +++ b/protocols/ICQCorp/src/socket.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "corp.h"
+#include "stdafx.h"
///////////////////////////////////////////////////////////////////////////////
// Socket
diff --git a/protocols/ICQCorp/src/stdafx.cpp b/protocols/ICQCorp/src/stdafx.cxx index 22f8eb6c2c..19b8af7089 100644 --- a/protocols/ICQCorp/src/stdafx.cpp +++ b/protocols/ICQCorp/src/stdafx.cxx @@ -1,18 +1,18 @@ -/*
-Copyright (c) 2014-18 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 "corp.h"
+/* +Copyright (c) 2014-18 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" diff --git a/protocols/ICQCorp/src/corp.h b/protocols/ICQCorp/src/stdafx.h index 999ccaed64..20d37536f2 100644 --- a/protocols/ICQCorp/src/corp.h +++ b/protocols/ICQCorp/src/stdafx.h @@ -1,71 +1,61 @@ -/*
- ICQ Corporate protocol plugin for Miranda IM.
- Copyright (C) 2003-2005 Eugene Tarasenko <zlyden13@inbox.ru>
-
- 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.
-*/
-
-#ifndef corp_h
-#define corp_h
-
-#define _CRT_SECURE_NO_WARNINGS
-
-#include <stdio.h>
-#include <winsock2.h>
-#include <windows.h>
-#include <string.h>
-#include <process.h>
-#include <vector>
-#include <time.h>
-
-#include <newpluginapi.h>
-#include <m_system.h>
-#include <m_protosvc.h>
-#include <m_langpack.h>
-#include <m_database.h>
-#include <m_options.h>
-#include <statusmodes.h>
-#include <m_clist.h>
-#include <m_userinfo.h>
-#include <m_timezones.h>
-
-#include "user.h"
-#include "transfer.h"
-#include "packet.h"
-#include "socket.h"
-#include "event.h"
-#include "protocol.h"
-#include "options.h"
-#include "resource.h"
-#include "version.h"
-
-
-///////////////////////////////////////////////////////////////////////////////
-
-extern HINSTANCE hInstance;
-extern char protoName[64];
-
-extern int LoadServices();
-extern int UnloadServices();
-
-#ifdef _DEBUG
-extern void T(char *format, ...);
-#else
-inline void T(char *format, ...) {};
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-
-#endif
\ No newline at end of file +/* + ICQ Corporate protocol plugin for Miranda IM. + Copyright (C) 2003-2005 Eugene Tarasenko <zlyden13@inbox.ru> + + 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. +*/ + +#include <stdio.h> +#include <winsock2.h> +#include <windows.h> +#include <string.h> +#include <process.h> +#include <vector> +#include <time.h> + +#include <newpluginapi.h> +#include <m_system.h> +#include <m_protosvc.h> +#include <m_langpack.h> +#include <m_database.h> +#include <m_options.h> +#include <statusmodes.h> +#include <m_clist.h> +#include <m_userinfo.h> +#include <m_timezones.h> + +#include "user.h" +#include "transfer.h" +#include "packet.h" +#include "socket.h" +#include "event.h" +#include "protocol.h" +#include "options.h" +#include "resource.h" +#include "version.h" + +/////////////////////////////////////////////////////////////////////////////// + +extern HINSTANCE hInstance; +extern char protoName[64]; + +extern int LoadServices(); +extern int UnloadServices(); + +#ifdef _DEBUG +extern void T(char *, ...); +#else +inline void T(char *, ...) {}; +#endif diff --git a/protocols/ICQCorp/src/transfer.cpp b/protocols/ICQCorp/src/transfer.cpp index 1bbfd9c14e..f17f5616de 100644 --- a/protocols/ICQCorp/src/transfer.cpp +++ b/protocols/ICQCorp/src/transfer.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "corp.h"
+#include "stdafx.h"
std::vector <ICQTransfer *> icqTransfers;
@@ -37,7 +37,7 @@ void WINAPI transferTimerProc(HWND, UINT, UINT_PTR hTimer, DWORD) ICQTransfer::ICQTransfer(ICQUser *u, unsigned int theSequence) :
socket(WM_NETEVENT_TRANSFER)
{
- uin = u->uin;
+ uin = u->dwUIN;
hContact = u->hContact;
sequence = theSequence;
files = nullptr;
@@ -70,7 +70,7 @@ void ICQTransfer::processTcpPacket(Packet &packet) {
unsigned int /*i,*/ status, junkLong;
unsigned char cmd/*, junkChar*/;
- char *name = nullptr, *directoryName = nullptr, *fileName = nullptr;
+ char *name = nullptr, *directoryName = nullptr, *szFileName = nullptr;
packet >> cmd;
switch (cmd) {
@@ -100,7 +100,7 @@ void ICQTransfer::processTcpPacket(Packet &packet) case 0x02:
T("[tcp] recieve next file\n");
packet >> directory
- >> fileName
+ >> szFileName
>> directoryName
>> fileSize
>> fileDate
@@ -108,9 +108,9 @@ void ICQTransfer::processTcpPacket(Packet &packet) ++current;
if (directoryName[0])
- files[current] = CMStringW(FORMAT, L"%S\\%S", directoryName, fileName).Detach();
+ files[current] = CMStringW(FORMAT, L"%S\\%S", directoryName, szFileName).Detach();
else
- files[current] = mir_a2u(fileName);
+ files[current] = mir_a2u(szFileName);
if (directory)
createDirectory();
@@ -126,9 +126,7 @@ void ICQTransfer::processTcpPacket(Packet &packet) case 0x03:
T("[tcp] ack next file\n");
- packet >> fileProgress
- >> status
- >> speed;
+ packet >> fileProgress >> status >> speed;
totalProgress += fileProgress;
setFilePosition();
@@ -364,7 +362,7 @@ void ICQTransfer::process() ///////////////////////////////////////////////////////////////////////////////
-void ICQTransfer::resume(int action, const wchar_t *newName)
+void ICQTransfer::resume(int action, const wchar_t*)
{
switch (action) {
case FILERESUME_OVERWRITE:
@@ -428,14 +426,14 @@ void ICQTransfer::openFile() hFile = CreateFileW(fileName, sending ? GENERIC_READ : GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, nullptr, OPEN_ALWAYS, 0, nullptr);
if (hFile == INVALID_HANDLE_VALUE) {
- char msg[2048];
+ wchar_t msg[2048];
T("can't open file %S\n", fileName);
- sprintf(msg, "%s\n%S", sending ?
- Translate("Your file transfer has been aborted because one of the files that you selected to send is no longer readable from the disk. You may have deleted or moved it.") :
- Translate("Your file receive has been aborted because Miranda could not open the destination file in order to write to it. You may be trying to save to a read-only folder."),
+ mir_snwprintf(msg, L"%s\n%s", sending ?
+ TranslateT("Your file transfer has been aborted because one of the files that you selected to send is no longer readable from the disk. You may have deleted or moved it.") :
+ TranslateT("Your file receive has been aborted because Miranda could not open the destination file in order to write to it. You may be trying to save to a read-only folder."),
fileName);
- MessageBox(nullptr, msg, Translate(protoName), MB_ICONWARNING | MB_OK);
+ MessageBox(nullptr, msg, _A2T(protoName), MB_ICONWARNING | MB_OK);
return;
}
diff --git a/protocols/ICQCorp/src/user.cpp b/protocols/ICQCorp/src/user.cpp index 576210c16a..97ad5becb7 100644 --- a/protocols/ICQCorp/src/user.cpp +++ b/protocols/ICQCorp/src/user.cpp @@ -17,7 +17,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include "corp.h"
+#include "stdafx.h"
std::vector <ICQUser *> icqUsers;
@@ -90,12 +90,12 @@ static char* iptoa(unsigned int ip) ///////////////////////////////////////////////////////////////////////////////
-static void setTextValue(HWND hWnd, int id, char *value)
+static void setTextValue(HWND hWnd, int id, const wchar_t *value)
{
bool unspecified = value == nullptr;
EnableWindow(GetDlgItem(hWnd, id), !unspecified);
- SetDlgItemText(hWnd, id, unspecified ? Translate("<not specified>") : value);
+ SetDlgItemText(hWnd, id, unspecified ? TranslateT("<not specified>") : value);
}
///////////////////////////////////////////////////////////////////////////////
@@ -112,21 +112,21 @@ static INT_PTR CALLBACK icqUserInfoDlgProc(HWND hWnd, UINT msg, WPARAM wParam, L case WM_NOTIFY:
hdr = (LPNMHDR)lParam;
if (hdr->idFrom == 0 && hdr->code == PSN_INFOCHANGED) {
- char buffer[64];
+ wchar_t buffer[64];
unsigned long ip, port;
MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam;
- _itoa(db_get_dw(hContact, protoName, "UIN", 0), buffer, 10);
+ _itow(db_get_dw(hContact, protoName, "UIN", 0), buffer, 10);
setTextValue(hWnd, IDC_INFO_UIN, buffer);
ip = db_get_dw(hContact, protoName, "IP", 0);
- setTextValue(hWnd, IDC_INFO_IP, ip ? iptoa(ip) : nullptr);
+ setTextValue(hWnd, IDC_INFO_IP, ip ? _A2T(iptoa(ip)) : nullptr);
ip = db_get_dw(hContact, protoName, "RealIP", 0);
- setTextValue(hWnd, IDC_INFO_REALIP, ip ? iptoa(ip) : nullptr);
+ setTextValue(hWnd, IDC_INFO_REALIP, ip ? _A2T(iptoa(ip)) : nullptr);
port = db_get_w(hContact, protoName, "Port", 0);
- _itoa(port, buffer, 10);
+ _itow(port, buffer, 10);
setTextValue(hWnd, IDC_INFO_PORT, port ? buffer : nullptr);
setTextValue(hWnd, IDC_INFO_VERSION, nullptr);
@@ -154,7 +154,7 @@ int icqUserInfoInitialise(WPARAM wParam, LPARAM lParam) odp.position = -1900000000;
odp.szTitle.a = protoName;
odp.pfnDlgProc = icqUserInfoDlgProc;
- odp.pszTemplate = MAKEINTRESOURCE(IDD_INFO_ICQCORP);
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_ICQCORP);
odp.hInstance = hInstance;
UserInfo_AddPage(wParam, &odp);
return 0;
diff --git a/protocols/ICQCorp/src/user.h b/protocols/ICQCorp/src/user.h index 9c13867237..ef42d67c51 100644 --- a/protocols/ICQCorp/src/user.h +++ b/protocols/ICQCorp/src/user.h @@ -28,17 +28,17 @@ class ICQUser
{
public:
- unsigned int uin;
+ unsigned int dwUIN;
MCONTACT hContact;
- TCPSocket socket;
- unsigned short statusVal;
-
- ICQUser();
- void setStatus(unsigned short newStatus);
- void setInfo(char *name, unsigned int data);
- void setInfo(char *name, unsigned short data);
- void setInfo(char *name, unsigned char data);
- void setInfo(char *name, char *data);
+ TCPSocket socket;
+ unsigned short statusVal;
+
+ ICQUser();
+ void setStatus(unsigned short newStatus);
+ void setInfo(char *name, unsigned int data);
+ void setInfo(char *name, unsigned short data);
+ void setInfo(char *name, unsigned char data);
+ void setInfo(char *name, char *data);
};
///////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/ICQCorp/src/version.h b/protocols/ICQCorp/src/version.h index 56f4f29843..a23a9bf9dd 100644 --- a/protocols/ICQCorp/src/version.h +++ b/protocols/ICQCorp/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0
-#define __MINOR_VERSION 1
+#define __MINOR_VERSION 2
#define __RELEASE_NUM 0
-#define __BUILD_NUM 2
+#define __BUILD_NUM 1
#include <stdver.h>
|