From 3ad88a09a37f840fc883f7a62e42b7049b316000 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 29 Apr 2015 21:18:46 +0000 Subject: unified project for Jabber protocol git-svn-id: http://svn.miranda-ng.org/main/trunk@13258 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- bin10/mir_dev.sln | 2 +- bin10/mir_full.sln | 2 +- bin10/mir_full_pro.sln | 2 +- bin10/miranda32.sln | 2 +- bin12/mir_dev.sln | 2 +- bin12/mir_full.sln | 2 +- bin12/miranda32.sln | 2 +- protocols/JabberG/jabber.vcxproj | 38 ++ protocols/JabberG/jabber.vcxproj.filters | 4 + protocols/JabberG/jabber_10.vcxproj | 300 --------- protocols/JabberG/jabber_10.vcxproj.filters | 263 -------- protocols/JabberG/jabber_12.vcxproj | 302 --------- protocols/JabberG/jabber_12.vcxproj.filters | 263 -------- protocols/JabberG/src/jabber.cpp | 5 +- protocols/JabberG/src/jabber.h | 779 ---------------------- protocols/JabberG/src/jabber_adhoc.cpp | 2 +- protocols/JabberG/src/jabber_agent.cpp | 2 +- protocols/JabberG/src/jabber_api.cpp | 2 +- protocols/JabberG/src/jabber_archive.cpp | 2 +- protocols/JabberG/src/jabber_bookmarks.cpp | 2 +- protocols/JabberG/src/jabber_byte.cpp | 2 +- protocols/JabberG/src/jabber_caps.cpp | 2 +- protocols/JabberG/src/jabber_captcha.cpp | 2 +- protocols/JabberG/src/jabber_chat.cpp | 2 +- protocols/JabberG/src/jabber_console.cpp | 2 +- protocols/JabberG/src/jabber_disco.cpp | 2 +- protocols/JabberG/src/jabber_events.cpp | 2 +- protocols/JabberG/src/jabber_file.cpp | 2 +- protocols/JabberG/src/jabber_filterlist.cpp | 2 +- protocols/JabberG/src/jabber_form.cpp | 2 +- protocols/JabberG/src/jabber_frame.cpp | 2 +- protocols/JabberG/src/jabber_ft.cpp | 2 +- protocols/JabberG/src/jabber_groupchat.cpp | 2 +- protocols/JabberG/src/jabber_ibb.cpp | 2 +- protocols/JabberG/src/jabber_icolib.cpp | 2 +- protocols/JabberG/src/jabber_iq.cpp | 2 +- protocols/JabberG/src/jabber_iq_handlers.cpp | 2 +- protocols/JabberG/src/jabber_iqid.cpp | 2 +- protocols/JabberG/src/jabber_iqid_muc.cpp | 2 +- protocols/JabberG/src/jabber_libstr.cpp | 2 +- protocols/JabberG/src/jabber_list.cpp | 2 +- protocols/JabberG/src/jabber_menu.cpp | 2 +- protocols/JabberG/src/jabber_message_handlers.cpp | 2 +- protocols/JabberG/src/jabber_message_manager.cpp | 2 +- protocols/JabberG/src/jabber_misc.cpp | 2 +- protocols/JabberG/src/jabber_notes.cpp | 2 +- protocols/JabberG/src/jabber_opt.cpp | 2 +- protocols/JabberG/src/jabber_opttree.cpp | 2 +- protocols/JabberG/src/jabber_password.cpp | 2 +- protocols/JabberG/src/jabber_presence_manager.cpp | 2 +- protocols/JabberG/src/jabber_privacy.cpp | 2 +- protocols/JabberG/src/jabber_proto.cpp | 2 +- protocols/JabberG/src/jabber_rc.cpp | 2 +- protocols/JabberG/src/jabber_search.cpp | 2 +- protocols/JabberG/src/jabber_secur.cpp | 2 +- protocols/JabberG/src/jabber_secur.h | 2 +- protocols/JabberG/src/jabber_send_manager.cpp | 2 +- protocols/JabberG/src/jabber_std.cpp | 2 +- protocols/JabberG/src/jabber_svc.cpp | 2 +- protocols/JabberG/src/jabber_thread.cpp | 2 +- protocols/JabberG/src/jabber_treelist.cpp | 2 +- protocols/JabberG/src/jabber_userinfo.cpp | 2 +- protocols/JabberG/src/jabber_util.cpp | 2 +- protocols/JabberG/src/jabber_vcard.cpp | 2 +- protocols/JabberG/src/jabber_ws.cpp | 2 +- protocols/JabberG/src/jabber_xml.cpp | 2 +- protocols/JabberG/src/jabber_xstatus.cpp | 2 +- protocols/JabberG/src/jabber_zstream.cpp | 2 +- protocols/JabberG/src/stdafx.cpp | 18 - protocols/JabberG/src/stdafx.cxx | 18 + protocols/JabberG/src/stdafx.h | 779 ++++++++++++++++++++++ 71 files changed, 903 insertions(+), 1986 deletions(-) create mode 100644 protocols/JabberG/jabber.vcxproj create mode 100644 protocols/JabberG/jabber.vcxproj.filters delete mode 100644 protocols/JabberG/jabber_10.vcxproj delete mode 100644 protocols/JabberG/jabber_10.vcxproj.filters delete mode 100644 protocols/JabberG/jabber_12.vcxproj delete mode 100644 protocols/JabberG/jabber_12.vcxproj.filters delete mode 100644 protocols/JabberG/src/jabber.h delete mode 100644 protocols/JabberG/src/stdafx.cpp create mode 100644 protocols/JabberG/src/stdafx.cxx create mode 100644 protocols/JabberG/src/stdafx.h diff --git a/bin10/mir_dev.sln b/bin10/mir_dev.sln index 5d574a8dba..2d23e696be 100644 --- a/bin10/mir_dev.sln +++ b/bin10/mir_dev.sln @@ -33,7 +33,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber_10.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn_10.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}" EndProject diff --git a/bin10/mir_full.sln b/bin10/mir_full.sln index 6e2a33059b..f9fd2f1c46 100644 --- a/bin10/mir_full.sln +++ b/bin10/mir_full.sln @@ -33,7 +33,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber_10.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn_10.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}" EndProject diff --git a/bin10/mir_full_pro.sln b/bin10/mir_full_pro.sln index 74b5a06c7c..7318667ba9 100644 --- a/bin10/mir_full_pro.sln +++ b/bin10/mir_full_pro.sln @@ -33,7 +33,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber_10.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn_10.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}" EndProject diff --git a/bin10/miranda32.sln b/bin10/miranda32.sln index b95e0a515e..85ee781ca7 100644 --- a/bin10/miranda32.sln +++ b/bin10/miranda32.sln @@ -31,7 +31,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber_10.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn_10.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}" EndProject diff --git a/bin12/mir_dev.sln b/bin12/mir_dev.sln index 714c7f58d5..dd8afa5637 100644 --- a/bin12/mir_dev.sln +++ b/bin12/mir_dev.sln @@ -35,7 +35,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber_12.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn_12.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}" EndProject diff --git a/bin12/mir_full.sln b/bin12/mir_full.sln index 5c766d8639..6b266226c0 100644 --- a/bin12/mir_full.sln +++ b/bin12/mir_full.sln @@ -35,7 +35,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber_12.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn_12.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}" EndProject diff --git a/bin12/miranda32.sln b/bin12/miranda32.sln index f02dc95970..5ef7e41048 100644 --- a/bin12/miranda32.sln +++ b/bin12/miranda32.sln @@ -33,7 +33,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber_12.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn_12.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}" EndProject diff --git a/protocols/JabberG/jabber.vcxproj b/protocols/JabberG/jabber.vcxproj new file mode 100644 index 0000000000..588adb1e9a --- /dev/null +++ b/protocols/JabberG/jabber.vcxproj @@ -0,0 +1,38 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + Jabber + {33276462-8313-4192-8306-13717ECCA60A} + + + + + + + {e2a369cd-eda3-414f-8ad0-e732cd7ee68c} + false + + + {e2a369cd-eda3-414f-8ad0-e732cd7ee68c} + false + + + \ No newline at end of file diff --git a/protocols/JabberG/jabber.vcxproj.filters b/protocols/JabberG/jabber.vcxproj.filters new file mode 100644 index 0000000000..de5ad9f66c --- /dev/null +++ b/protocols/JabberG/jabber.vcxproj.filters @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/protocols/JabberG/jabber_10.vcxproj b/protocols/JabberG/jabber_10.vcxproj deleted file mode 100644 index cacdf64001..0000000000 --- a/protocols/JabberG/jabber_10.vcxproj +++ /dev/null @@ -1,300 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Jabber - {33276462-8313-4192-8306-13717ECCA60A} - - - - DynamicLibrary - Unicode - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - DynamicLibrary - Unicode - true - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30128.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Full - OnlyExplicitInline - Size - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;JABBER_EXPORTS;%(PreprocessorDefinitions) - true - false - false - true - Fast - Use - jabber.h - Level3 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi - - - /PDBALTPATH:%_PDB% - ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies) - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - true - true - true - 0x32500000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\bin10\lib - - - - - Full - OnlyExplicitInline - Size - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;JABBER_EXPORTS;%(PreprocessorDefinitions) - true - false - false - true - Fast - Use - jabber.h - Level3 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi - - - /PDBALTPATH:%_PDB% - ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies) - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - true - true - true - 0x32500000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\bin10\lib - - - - - Disabled - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;JABBER_EXPORTS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - true - Use - jabber.h - Level3 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi - - - ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies) - true - 0x32500000 - false - $(IntDir)$(TargetName).lib - Windows - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - $(ProfileDir)..\..\bin10\lib - - - - - Disabled - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;JABBER_EXPORTS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - true - Use - jabber.h - Level3 - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi - - - ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies) - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - true - 0x32500000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\bin10\lib - - - - - - - - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {e2a369cd-eda3-414f-8ad0-e732cd7ee68c} - false - - - - - - \ No newline at end of file diff --git a/protocols/JabberG/jabber_10.vcxproj.filters b/protocols/JabberG/jabber_10.vcxproj.filters deleted file mode 100644 index 91fba5ae78..0000000000 --- a/protocols/JabberG/jabber_10.vcxproj.filters +++ /dev/null @@ -1,263 +0,0 @@ - - - - - {ee3e0a62-d4c0-41c5-87f4-fc5d64b971e3} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {dc3d1fc7-bdc9-48e3-9c63-5fb017a6db96} - h;hpp;hxx;hm;inl - - - {9b408743-a629-4fd3-b59c-a46910ddb9ef} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/protocols/JabberG/jabber_12.vcxproj b/protocols/JabberG/jabber_12.vcxproj deleted file mode 100644 index ce3eac016e..0000000000 --- a/protocols/JabberG/jabber_12.vcxproj +++ /dev/null @@ -1,302 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - Jabber - {33276462-8313-4192-8306-13717ECCA60A} - - - - DynamicLibrary - Unicode - v120_xp - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - DynamicLibrary - Unicode - true - v120_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30128.1 - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - - - - Full - OnlyExplicitInline - Size - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;JABBER_EXPORTS;%(PreprocessorDefinitions) - true - false - false - true - Fast - Use - jabber.h - Level4 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi - - - ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies) - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - true - true - true - 0x32500000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\bin12\lib - - - - - Full - OnlyExplicitInline - Size - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;JABBER_EXPORTS;%(PreprocessorDefinitions) - true - false - false - true - Fast - Use - jabber.h - Level4 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi - - - ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies) - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - true - true - true - 0x32500000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\bin12\lib - - - - - Disabled - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;JABBER_EXPORTS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - true - Use - jabber.h - Level4 - EditAndContinue - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi - - - ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies) - true - 0x32500000 - false - $(IntDir)$(TargetName).lib - Windows - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27X86%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - $(ProfileDir)..\..\bin12\lib - false - - - - - Disabled - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;JABBER_EXPORTS;%(PreprocessorDefinitions) - false - EnableFastChecks - MultiThreadedDebugDLL - true - Use - jabber.h - Level4 - 4996;%(DisableSpecificWarnings) - false - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi - - - ws2_32.lib;comctl32.lib;UxTheme.lib;Secur32.lib;Dnsapi.lib;%(AdditionalDependencies) - type=%27Win32%27 name=%27Microsoft.Windows.Common-Controls%27 version=%276.0.0.0%27 processorArchitecture=%27*%27 publicKeyToken=%276595b64144ccf1df%27 language=%27*%27;%(AdditionalManifestDependencies) - true - 0x32500000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\bin12\lib - - - - - - - - Create - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {e2a369cd-eda3-414f-8ad0-e732cd7ee68c} - - - - - - \ No newline at end of file diff --git a/protocols/JabberG/jabber_12.vcxproj.filters b/protocols/JabberG/jabber_12.vcxproj.filters deleted file mode 100644 index 91fba5ae78..0000000000 --- a/protocols/JabberG/jabber_12.vcxproj.filters +++ /dev/null @@ -1,263 +0,0 @@ - - - - - {ee3e0a62-d4c0-41c5-87f4-fc5d64b971e3} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {dc3d1fc7-bdc9-48e3-9c63-5fb017a6db96} - h;hpp;hxx;hm;inl - - - {9b408743-a629-4fd3-b59c-a46910ddb9ef} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index ecd8cc77b3..ef3b25aac1 100644 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" #include "jabber_rc.h" @@ -32,6 +32,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m_folders.h" #include "m_toptoolbar.h" +#pragma comment(lib, "Dnsapi.lib") +#pragma comment(lib, "Secur32.lib") + HINSTANCE hInst; int hLangpack; diff --git a/protocols/JabberG/src/jabber.h b/protocols/JabberG/src/jabber.h deleted file mode 100644 index 2c28b7e3aa..0000000000 --- a/protocols/JabberG/src/jabber.h +++ /dev/null @@ -1,779 +0,0 @@ -/* - -Jabber Protocol Plugin for Miranda NG - -Copyright (c) 2002-04 Santithorn Bunchua -Copyright (c) 2005-12 George Hazan -Copyright (c) 2007 Maxim Mluhov -Copyright (ñ) 2012-15 Miranda NG project - -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 _JABBER_H_ -#define _JABBER_H_ - -#pragma warning(disable:4706 4121 4127) - -#define LISTFOREACH(var__, obj__, list__) \ - for (int var__ = 0; (var__ = obj__->ListFindNext(list__, var__)) >= 0; ++var__) -#define LISTFOREACH_NODEF(var__, obj__, list__) \ - for (var__ = 0; (var__ = obj__->ListFindNext(list__, var__)) >= 0; ++var__) - -/******************************************************************* - * Global header files - *******************************************************************/ -#include -#include -#include -#include -#define SECURITY_WIN32 -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../../plugins/zlib/src/zlib.h" - -#include "resource.h" -#include "version.h" - -#include "jabber_xml.h" -#include "jabber_byte.h" -#include "jabber_ibb.h" -#include "jabber_db_utils.h" - -struct CJabberProto; - -class CJabberDlgBase : public CProtoDlgBase -{ - typedef CProtoDlgBase CSuper; -protected: - __inline CJabberDlgBase(CJabberProto *proto, int idDialog, bool show_label=true) : - CSuper(proto, idDialog, show_label) - { - } - - int Resizer(UTILRESIZECONTROL *urc) - { - switch (urc->wId) { - case IDC_HEADERBAR: - urc->rcItem.right = urc->dlgNewSize.cx; - return 0; - } - - return CSuper::Resizer(urc); - } -}; - -struct CFilterData; -class CCtrlFilterListView : public CCtrlListView -{ - typedef CCtrlListView CSuper; - -public: - CCtrlFilterListView(CDlgBase* dlg, int ctrlId, bool trackFilter, bool keepHiglight); - ~CCtrlFilterListView(); - - TCHAR *GetFilterText(); - CCallback OnFilterChanged; - -protected: - CFilterData *fdat; - bool m_trackFilter; - bool m_keepHiglight; - - void OnInit(); - LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam); - void FilterHighlight(TCHAR *filter); -}; - -#if !defined(OPENFILENAME_SIZE_VERSION_400) - #define OPENFILENAME_SIZE_VERSION_400 sizeof(OPENFILENAME) -#endif - -/******************************************************************* - * Global constants - *******************************************************************/ - -#define GLOBAL_SETTING_PREFIX "JABBER" -#define GLOBAL_SETTING_MODULE "JABBER" - -#define JABBER_DEFAULT_PORT 5222 -#define JABBER_IQID "mir_" -#define JABBER_MAX_JID_LEN 1024 - -#define JABBER_GC_MSG_QUIT LPGENT("I'm happy Miranda NG user. Get it at http://miranda-ng.org/.") -#define JABBER_GC_MSG_SLAP LPGENT("/me slaps %s around a bit with a large trout") - -// registered db event types -#define EVENTTYPE_JABBER_CHATSTATES 2000 -#define JS_DB_GETEVENTTEXT_CHATSTATES "/GetEventText2000" -#define JABBER_DB_EVENT_CHATSTATES_GONE 1 -#define EVENTTYPE_JABBER_PRESENCE 2001 -#define JS_DB_GETEVENTTEXT_PRESENCE "/GetEventText2001" -#define JABBER_DB_EVENT_PRESENCE_SUBSCRIBE 1 -#define JABBER_DB_EVENT_PRESENCE_SUBSCRIBED 2 -#define JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBE 3 -#define JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBED 4 -#define JABBER_DB_EVENT_PRESENCE_ERROR 5 - -// User-defined message -#define WM_JABBER_REGDLG_UPDATE (WM_PROTO_LAST + 100) -#define WM_JABBER_AGENT_REFRESH (WM_PROTO_LAST + 101) -#define WM_JABBER_TRANSPORT_REFRESH (WM_PROTO_LAST + 102) -#define WM_JABBER_REGINPUT_ACTIVATE (WM_PROTO_LAST + 103) -#define WM_JABBER_REFRESH WM_PROTO_REFRESH -#define WM_JABBER_CHECK_ONLINE WM_PROTO_CHECK_ONLINE -#define WM_JABBER_ACTIVATE WM_PROTO_ACTIVATE -#define WM_JABBER_CHANGED (WM_PROTO_LAST + 106) -#define WM_JABBER_SET_FONT (WM_PROTO_LAST + 108) -#define WM_JABBER_FLASHWND (WM_PROTO_LAST + 109) -#define WM_JABBER_GC_MEMBER_ADD (WM_PROTO_LAST + 110) -#define WM_JABBER_GC_FORCE_QUIT (WM_PROTO_LAST + 111) -#define WM_JABBER_SHUTDOWN (WM_PROTO_LAST + 112) -#define WM_JABBER_SMILEY (WM_PROTO_LAST + 113) -#define WM_JABBER_JOIN (WM_PROTO_LAST + 114) -#define WM_JABBER_ADD_TO_ROSTER (WM_PROTO_LAST + 115) -#define WM_JABBER_ADD_TO_BOOKMARKS (WM_PROTO_LAST + 116) -#define WM_JABBER_REFRESH_VCARD (WM_PROTO_LAST + 117) - -#define STATUS_TITLE_MAX 16 -#define STATUS_DESC_MAX 64 - -// Error code -#define JABBER_ERROR_REDIRECT 302 -#define JABBER_ERROR_BAD_REQUEST 400 -#define JABBER_ERROR_UNAUTHORIZED 401 -#define JABBER_ERROR_PAYMENT_REQUIRED 402 -#define JABBER_ERROR_FORBIDDEN 403 -#define JABBER_ERROR_NOT_FOUND 404 -#define JABBER_ERROR_NOT_ALLOWED 405 -#define JABBER_ERROR_NOT_ACCEPTABLE 406 -#define JABBER_ERROR_REGISTRATION_REQUIRED 407 -#define JABBER_ERROR_REQUEST_TIMEOUT 408 -#define JABBER_ERROR_CONFLICT 409 -#define JABBER_ERROR_INTERNAL_SERVER_ERROR 500 -#define JABBER_ERROR_NOT_IMPLEMENTED 501 -#define JABBER_ERROR_REMOTE_SERVER_ERROR 502 -#define JABBER_ERROR_SERVICE_UNAVAILABLE 503 -#define JABBER_ERROR_REMOTE_SERVER_TIMEOUT 504 - -// Vcard flags -#define JABBER_VCEMAIL_HOME 1 -#define JABBER_VCEMAIL_WORK 2 -#define JABBER_VCEMAIL_INTERNET 4 -#define JABBER_VCEMAIL_X400 8 - -#define JABBER_VCTEL_HOME 0x0001 -#define JABBER_VCTEL_WORK 0x0002 -#define JABBER_VCTEL_VOICE 0x0004 -#define JABBER_VCTEL_FAX 0x0008 -#define JABBER_VCTEL_PAGER 0x0010 -#define JABBER_VCTEL_MSG 0x0020 -#define JABBER_VCTEL_CELL 0x0040 -#define JABBER_VCTEL_VIDEO 0x0080 -#define JABBER_VCTEL_BBS 0x0100 -#define JABBER_VCTEL_MODEM 0x0200 -#define JABBER_VCTEL_ISDN 0x0400 -#define JABBER_VCTEL_PCS 0x0800 - -// File transfer setting -#define JABBER_OPTION_FT_DIRECT 0 // Direct connection -#define JABBER_OPTION_FT_PASS 1 // Use PASS server -#define JABBER_OPTION_FT_PROXY 2 // Use proxy with local port forwarding - -// Font style saved in DB -#define JABBER_FONT_BOLD 1 -#define JABBER_FONT_ITALIC 2 - -// Font for groupchat log dialog -#define JABBER_GCLOG_NUM_FONT 6 // 6 fonts (0:send, 1:msg, 2:time, 3:nick, 4:sys, 5:/me) - -// Icon list -enum { - JABBER_IDI_GCOWNER = 0, - JABBER_IDI_GCADMIN, - JABBER_IDI_GCMODERATOR, - JABBER_IDI_GCVOICE, - JABBER_ICON_TOTAL -}; - -// Services and Events -#define JS_PARSE_XMPP_URI "/ParseXmppURI" - -// Called when contact changes custom status and extra icon is set to clist_mw -//wParam = hContact // contact changing status -//lParam = hIcon // HANDLE to clist extra icon set as custom status -#define JE_CUSTOMSTATUS_EXTRAICON_CHANGED "/XStatusExtraIconChanged" -#define JE_CUSTOMSTATUS_CHANGED "/XStatusChanged" - -#define LR_BIGICON 0x40 - -#define JS_SENDXML "/SendXML" // Warning: This service is obsolete. Use IJabberNetInterface::SendXmlNode() instead. - -#define JS_HTTP_AUTH "/HttpAuthRequest" -#define JS_INCOMING_NOTE_EVENT "/IncomingNoteEvent" - -#define DBSETTING_DISPLAY_UID "display_uid" -#define DBSETTING_XSTATUSID "XStatusId" -#define DBSETTING_XSTATUSNAME "XStatusName" -#define DBSETTING_XSTATUSMSG "XStatusMsg" - -#define ADVSTATUS_MOOD "mood" -#define ADVSTATUS_ACTIVITY "activity" -#define ADVSTATUS_TUNE "tune" - -#define ADVSTATUS_VAL_ID "id" -#define ADVSTATUS_VAL_ICON "icon" -#define ADVSTATUS_VAL_TITLE "title" -#define ADVSTATUS_VAL_TEXT "text" - -struct CJabberHttpAuthParams -{ - enum {IQ = 1, MSG = 2} m_nType; - TCHAR *m_szFrom; - TCHAR *m_szIqId; - TCHAR *m_szThreadId; - TCHAR *m_szId; - TCHAR *m_szMethod; - TCHAR *m_szUrl; - CJabberHttpAuthParams() - { - memset(this, 0, sizeof(CJabberHttpAuthParams)); - } - ~CJabberHttpAuthParams() - { - Free(); - } - void Free() - { - mir_free(m_szFrom); - mir_free(m_szIqId); - mir_free(m_szThreadId); - mir_free(m_szId); - mir_free(m_szMethod); - mir_free(m_szUrl); - memset(this, 0, sizeof(CJabberHttpAuthParams)); - } -}; - -/******************************************************************* - * Global data structures and data type definitions - *******************************************************************/ -typedef HANDLE JABBER_SOCKET; - -#define CAPS_BOOKMARK 0x0001 -#define CAPS_BOOKMARKS_LOADED 0x8000 - -#define ZLIB_CHUNK_SIZE 2048 - -#include "jabber_caps.h" - -#define JABBER_LOGIN_ROSTER 0x0001 -#define JABBER_LOGIN_BOOKMARKS 0x0002 -#define JABBER_LOGIN_SERVERINFO 0x0004 -#define JABBER_LOGIN_BOOKMARKS_AJ 0x0008 - -struct JABBER_CONN_DATA : public MZeroedObject -{ - TCHAR username[512]; - TCHAR password[512]; - char server[128]; - char manualHost[128]; - int port; - BOOL useSSL; - - HWND reg_hwndDlg; -}; - -struct ThreadData -{ - ThreadData(CJabberProto *_pro, JABBER_CONN_DATA *_connData); - ~ThreadData(); - - ptrA szStreamId; - char* buffer; - - // network support - JABBER_SOCKET s; - HANDLE iomutex; // protects i/o operations - CJabberProto *proto; - - // XEP-0138 (Compression support) - BOOL useZlib; - z_stream zStreamIn,zStreamOut; - bool zRecvReady; - int zRecvDatalen; - char* zRecvData; - - void xmpp_client_query(void); - - BOOL zlibInit(void); - void zlibUninit(); - int zlibSend(char* data, int datalen); - int zlibRecv(char* data, long datalen); - - // for nick names resolving - int resolveID; - MCONTACT resolveContact; - - // features & registration - bool bIsReg; - bool reg_done, bIsSessionAvailable; - bool bBookmarksLoaded; - DWORD dwLoginRqs; - - // connection & login data - JABBER_CONN_DATA conn; - TCHAR resource[128]; - TCHAR fullJID[JABBER_MAX_JID_LEN]; - ptrT tszNewPassword; - - class TJabberAuth *auth; - JabberCapsBits jabberServerCaps; - - void close(void); - void shutdown(void); - int recv(char* buf, size_t len); - int send(char* buffer, int bufsize = -1); - int send(HXML node); - - int recvws(char* buffer, size_t bufsize, int flags); - int sendws(char* buffer, size_t bufsize, int flags); -}; - -struct JABBER_MODEMSGS -{ - TCHAR *szOnline; - TCHAR *szAway; - TCHAR *szNa; - TCHAR *szDnd; - TCHAR *szFreechat; -}; - -typedef enum { FT_SI, FT_OOB, FT_BYTESTREAM, FT_IBB } JABBER_FT_TYPE; -typedef enum { FT_CONNECTING, FT_INITIALIZING, FT_RECEIVING, FT_DONE, FT_ERROR, FT_DENIED } JABBER_FILE_STATE; - -struct filetransfer -{ - filetransfer(CJabberProto* proto); - ~filetransfer(); - - void close(); - void complete(); - int create(); - - PROTOFILETRANSFERSTATUS std; - - JABBER_FT_TYPE type; - JABBER_SOCKET s; - JABBER_FILE_STATE state; - TCHAR *jid; - int fileId; - TCHAR* szId; - TCHAR *sid; - int bCompleted; - HANDLE hWaitEvent; - - // For type == FT_BYTESTREAM - JABBER_BYTE_TRANSFER *jbt; - - JABBER_IBB_TRANSFER *jibb; - - // Used by file receiving only - char* httpHostName; - WORD httpPort; - TCHAR *httpPath; - unsigned __int64 dwExpectedRecvFileSize; - - // Used by file sending only - HANDLE hFileEvent; - unsigned __int64 *fileSize; - TCHAR *szDescription; - - CJabberProto *ppro; -}; - -struct JABBER_SEARCH_RESULT -{ - PROTOSEARCHRESULT hdr; - TCHAR jid[JABBER_MAX_JID_LEN]; -}; - -struct JABBER_GCLOG_FONT -{ - char face[LF_FACESIZE]; // LF_FACESIZE is from LOGFONT struct - BYTE style; - char size; // signed - BYTE charset; - COLORREF color; -}; - -struct JABBER_FIELD_MAP -{ - int id; - char* name; -}; - -enum JABBER_MUC_JIDLIST_TYPE -{ - MUC_VOICELIST, - MUC_MEMBERLIST, - MUC_MODERATORLIST, - MUC_BANLIST, - MUC_ADMINLIST, - MUC_OWNERLIST -}; - -struct JABBER_MUC_JIDLIST_INFO -{ - ~JABBER_MUC_JIDLIST_INFO(); - - JABBER_MUC_JIDLIST_TYPE type; - TCHAR *roomJid; // filled-in by the WM_JABBER_REFRESH code - HXML iqNode; - CJabberProto *ppro; - - TCHAR *type2str(void) const; -}; - -typedef void (CJabberProto::*JABBER_FORM_SUBMIT_FUNC)(HXML values, void *userdata); - -//---- jabber_treelist.c ------------------------------------------------ - -typedef struct TTreeList_ItemInfo *HTREELISTITEM; -enum { TLM_TREE, TLM_REPORT }; - -//---- proto frame ------------------------------------------------ - -class CJabberInfoFrameItem; - -struct CJabberInfoFrame_Event -{ - enum { CLICK, DESTROY } m_event; - const char *m_pszName; - LPARAM m_pUserData; -}; - -class CJabberInfoFrame : public MZeroedObject -{ -public: - CJabberInfoFrame(CJabberProto *proto); - ~CJabberInfoFrame(); - - void CreateInfoItem(char *pszName, bool bCompact=false, LPARAM pUserData=0); - void SetInfoItemCallback(char *pszName, void (CJabberProto::*onEvent)(CJabberInfoFrame_Event *)); - void UpdateInfoItem(char *pszName, HANDLE hIcolibItem, TCHAR *pszText); - void ShowInfoItem(char *pszName, bool bShow); - void RemoveInfoItem(char *pszName); - - void LockUpdates(); - void Update(); - -private: - CJabberProto *m_proto; - HWND m_hwnd; - int m_frameId; - bool m_compact; - OBJLIST m_pItems; - int m_hiddenItemCount; - int m_clickedItem; - bool m_bLocked; - int m_nextTooltipId; - HWND m_hwndToolTip; - - HANDLE m_hhkFontsChanged; - HFONT m_hfntTitle, m_hfntText; - COLORREF m_clTitle, m_clText, m_clBack; - - static void InitClass(); - static LRESULT CALLBACK GlobalWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); - LRESULT WndProc(UINT msg, WPARAM wParam, LPARAM lParam); - - void ReloadFonts(); - void UpdateSize(); - - void RemoveTooltip(int id); - void SetToolTip(int id, RECT *rc, TCHAR *pszText); - - void PaintSkinGlyph(HDC hdc, RECT *rc, char **glyphs, COLORREF fallback); - void PaintCompact(HDC hdc); - void PaintNormal(HDC hdc); - - enum - { - SZ_FRAMEPADDING = 2, // padding inside frame - SZ_LINEPADDING = 0, // line height will be incremented by this value - SZ_LINESPACING = 0, // between lines - SZ_ICONSPACING = 2, // between icon and text - }; -}; - -#include "jabber_list.h" -#include "jabber_proto.h" - -/******************************************************************* - * Global variables - *******************************************************************/ -extern HINSTANCE hInst; - -extern HANDLE hExtraMood; -extern HANDLE hExtraActivity; - -extern TCHAR szCoreVersion[]; - -extern int g_cbCountries; -extern struct CountryListEntry* g_countries; - -extern FI_INTERFACE *FIP; - -extern HANDLE hExtListInit, hDiscoInfoResult; -extern int bSecureIM, bMirOTR, bNewGPG, bPlatform; - -/******************************************************************* - * Function declarations - *******************************************************************/ - -//---- jabber_treelist.c ------------------------------------------------ - -void TreeList_Create(HWND hwnd); -void TreeList_Destroy(HWND hwnd); -void TreeList_Reset(HWND hwnd); -void TreeList_SetMode(HWND hwnd, int mode); -HTREELISTITEM TreeList_GetActiveItem(HWND hwnd); -void TreeList_SetSortMode(HWND hwnd, int col, BOOL descending); -void TreeList_SetFilter(HWND hwnd, TCHAR *filter); -HTREELISTITEM TreeList_AddItem(HWND hwnd, HTREELISTITEM hParent, TCHAR *text, LPARAM data); -void TreeList_ResetItem(HWND hwnd, HTREELISTITEM hParent); -void TreeList_MakeFakeParent(HTREELISTITEM hItem, BOOL flag); -void TreeList_AppendColumn(HTREELISTITEM hItem, TCHAR *text); -int TreeList_AddIcon(HWND hwnd, HICON hIcon, int iOverlay); -void TreeList_SetIcon(HTREELISTITEM hItem, int iIcon, int iOverlay); -LPARAM TreeList_GetData(HTREELISTITEM hItem); -HTREELISTITEM TreeList_GetRoot(HWND hwnd); -int TreeList_GetChildrenCount(HTREELISTITEM hItem); -HTREELISTITEM TreeList_GetChild(HTREELISTITEM hItem, int i); -void sttTreeList_RecursiveApply(HTREELISTITEM hItem, void (*func)(HTREELISTITEM, LPARAM), LPARAM data); -void TreeList_Update(HWND hwnd); -BOOL TreeList_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, UINT idc, BOOL *result); - -//---- jabber_form.c ------------------------------------------------ - -enum TJabberFormControlType -{ - JFORM_CTYPE_NONE, JFORM_CTYPE_TEXT_PRIVATE, JFORM_CTYPE_TEXT_MULTI, - JFORM_CTYPE_BOOLEAN, JFORM_CTYPE_LIST_SINGLE, JFORM_CTYPE_LIST_MULTI, - JFORM_CTYPE_FIXED, JFORM_CTYPE_HIDDEN, JFORM_CTYPE_TEXT_SINGLE -}; - -typedef struct TJabberFormControlInfo *HJFORMCTRL; -typedef struct TJabberFormLayoutInfo *HJFORMLAYOUT; - -void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bCompact = FALSE); -void JabberFormDestroyUI(HWND hwndStatic); -void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text); -HJFORMLAYOUT JabberFormCreateLayout(HWND hwndStatic); // use mir_free to destroy -HJFORMCTRL JabberFormAppendControl(HWND hwndStatic, HJFORMLAYOUT layout_info, TJabberFormControlType type, const TCHAR *labelStr, const TCHAR *valueStr); -void JabberFormAddListItem(HJFORMCTRL item, const TCHAR *text, bool selected); -void JabberFormLayoutControls(HWND hwndStatic, HJFORMLAYOUT layout_info, int *formHeight); - -void JabberFormCreateDialog(HXML xNode, TCHAR* defTitle, JABBER_FORM_SUBMIT_FUNC pfnSubmit, void *userdata); - -HXML JabberFormGetData(HWND hwndStatic, HXML xNode); - -//---- jabber_icolib.c ---------------------------------------------- - -void g_IconsInit(); -void g_XstatusIconsInit(); -HANDLE g_GetIconHandle(int iconId); -HICON g_LoadIconEx(const char* name, bool big = false); -void g_ReleaseIcon(HICON hIcon); - -void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon); -void WindowSetIcon(HWND hWnd, CJabberProto *proto, const char* name); -void WindowFreeIcon(HWND hWnd); - -int ReloadIconsEventHook(WPARAM wParam, LPARAM lParam); - -//---- jabber_libstr.c ---------------------------------------------- - -int lstrcmp_null(const TCHAR *s1, const TCHAR *s2); - -//---- jabber_menu.c ------------------------------------------------ - -void g_MenuInit(); -void g_MenuUninit(); -int g_OnToolbarInit(WPARAM, LPARAM); - -//---- jabber_misc.c ------------------------------------------------ - -void JabberChatDllError(void); -int JabberCompareJids(const TCHAR *jid1, const TCHAR *jid2); -TCHAR* UnEscapeChatTags(TCHAR* str_in); - -//---- jabber_adhoc.cpp --------------------------------------------- - -struct CJabberAdhocStartupParams -{ - TCHAR *m_szJid; - TCHAR *m_szNode; - CJabberProto *m_pProto; - - CJabberAdhocStartupParams(CJabberProto* proto, TCHAR* szJid, TCHAR* szNode = NULL) - { - m_pProto = proto; - m_szJid = mir_tstrdup(szJid); - m_szNode = szNode ? mir_tstrdup(szNode) : NULL; - } - ~CJabberAdhocStartupParams() - { - mir_free(m_szJid); - mir_free(m_szNode); - } -}; - -struct JabberAdHocData -{ - CJabberProto* proto; - int CurrentHeight; - int curPos; - int frameHeight; - RECT frameRect; - HXML AdHocNode; - HXML CommandsNode; - TCHAR *ResponderJID; -}; - -//---- jabber_util.cpp ------------------------------------------------------------------ - -struct TStringPairsElem -{ - const char *name, *value; -}; - -struct TStringPairs -{ - TStringPairs(char*); - ~TStringPairs(); - - const char* operator[](const char* name) const; - - int numElems; - TStringPairsElem* elems; -}; - -typedef char JabberShaStrBuf[2*MIR_SHA1_HASH_SIZE + 1]; - -TCHAR* __stdcall JabberNickFromJID(const TCHAR *jid); -TCHAR* JabberPrepareJid(LPCTSTR jid); -void __stdcall JabberUrlDecodeW(WCHAR *str); -char* __stdcall JabberSha1(const char *str, JabberShaStrBuf buf); -TCHAR* __stdcall JabberStrFixLines(const TCHAR *str); -void __stdcall JabberHttpUrlDecode(TCHAR *str); -int __stdcall JabberCombineStatus(int status1, int status2); -TCHAR* __stdcall JabberErrorStr(int errorCode); -TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int *errorCode = NULL); -time_t __stdcall JabberIsoToUnixTime(const TCHAR *stamp); -TCHAR* __stdcall JabberStripJid(const TCHAR *jid, TCHAR *dest, size_t destLen); -int __stdcall JabberGetPacketID(HXML n); -TCHAR* __stdcall JabberId2string(int id); - -LPCTSTR __stdcall JabberGetPictureType(HXML node, const char *picBuf); - -TCHAR* time2str(time_t _time, TCHAR *buf, size_t bufLen); -time_t str2time(const TCHAR*); - -const TCHAR *JabberStrIStr(const TCHAR *str, const TCHAR *substr); -void JabberCopyText(HWND hwnd, const TCHAR *text); -CJabberProto *JabberChooseInstance(bool bIsLink=false); - -bool JabberReadXep203delay(HXML node, time_t &msgTime); - -int UIEmulateBtnClick(HWND hwndDlg, UINT idcButton); -void UIShowControls(HWND hwndDlg, int *idList, int nCmdShow); - -//---- jabber_xml.cpp ------------------------------------------------------------------- - -void strdel(char* parBuffer, int len); - -//---- jabber_userinfo.cpp -------------------------------------------------------------- - -void JabberUserInfoUpdate(MCONTACT hContact); - -//---- jabber_iq_handlers.cpp -BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE); - -#endif diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index 1896805a56..d052278a92 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_agent.cpp b/protocols/JabberG/src/jabber_agent.cpp index 88487f68ba..fde3e1c0ba 100644 --- a/protocols/JabberG/src/jabber_agent.cpp +++ b/protocols/JabberG/src/jabber_agent.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_api.cpp b/protocols/JabberG/src/jabber_api.cpp index f12d7f363c..0738e33233 100644 --- a/protocols/JabberG/src/jabber_api.cpp +++ b/protocols/JabberG/src/jabber_api.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" // Jabber API functions INT_PTR __cdecl CJabberProto::JabberGetApi(WPARAM, LPARAM lParam) diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index 91185d924a..8b23af83a5 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp index 0f28a49023..b6664bcb71 100644 --- a/protocols/JabberG/src/jabber_bookmarks.cpp +++ b/protocols/JabberG/src/jabber_bookmarks.cpp @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index 0e86f62a08..40545f9203 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_byte.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index bb56c8271e..aaab23b6f8 100644 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" #include "version.h" diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp index 6941b9f55a..37fa7e3460 100644 --- a/protocols/JabberG/src/jabber_captcha.cpp +++ b/protocols/JabberG/src/jabber_captcha.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" struct CAPTCHA_FORM_PARAMS { diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index f70003e9f8..e8ab75ca54 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index ccc4844a5e..2d9a44c235 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #define JCPF_IN 0x01UL #define JCPF_OUT 0x02UL diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index f9090db6e6..f4a7dbfad8 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_disco.h" diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp index 0fc4dfa70d..927fb6c405 100644 --- a/protocols/JabberG/src/jabber_events.cpp +++ b/protocols/JabberG/src/jabber_events.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" #include "jabber_disco.h" diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index cfa0000bcc..0a45ead7b0 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_caps.h" #define JABBER_NETWORK_BUFFER_SIZE 2048 diff --git a/protocols/JabberG/src/jabber_filterlist.cpp b/protocols/JabberG/src/jabber_filterlist.cpp index 68753e974a..b9161fae54 100644 --- a/protocols/JabberG/src/jabber_filterlist.cpp +++ b/protocols/JabberG/src/jabber_filterlist.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" ///////////////////////////////////////////////////////////////////////////////////////// // CCtrlFilterListView diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp index e56643ce38..7d1fc2de63 100644 --- a/protocols/JabberG/src/jabber_form.cpp +++ b/protocols/JabberG/src/jabber_form.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_caps.h" static LRESULT CALLBACK JabberFormMultiLineWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp index 224bae3337..457b0bbde9 100644 --- a/protocols/JabberG/src/jabber_frame.cpp +++ b/protocols/JabberG/src/jabber_frame.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_caps.h" ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/JabberG/src/jabber_ft.cpp b/protocols/JabberG/src/jabber_ft.cpp index ad917543bf..d138c4d4fc 100644 --- a/protocols/JabberG/src/jabber_ft.cpp +++ b/protocols/JabberG/src/jabber_ft.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_byte.h" #include "jabber_ibb.h" diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 6eb131ddd9..db120aa0de 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_ibb.cpp b/protocols/JabberG/src/jabber_ibb.cpp index 2fadb2a018..78d952daf7 100644 --- a/protocols/JabberG/src/jabber_ibb.cpp +++ b/protocols/JabberG/src/jabber_ibb.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_ibb.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 10eb6b23dc..855afa5eeb 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #define IDI_ONLINE 104 #define IDI_OFFLINE 105 diff --git a/protocols/JabberG/src/jabber_iq.cpp b/protocols/JabberG/src/jabber_iq.cpp index d1cff5c24a..9217a01871 100644 --- a/protocols/JabberG/src/jabber_iq.cpp +++ b/protocols/JabberG/src/jabber_iq.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" #include "jabber_privacy.h" diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 60460591a1..675b0cefbb 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_rc.h" #include "version.h" diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 977da1b1e0..0000b7b6d1 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_list.h" #include "jabber_iq.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index e4c7879ccd..24f77738ca 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_list.h" #include "jabber_iq.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_libstr.cpp b/protocols/JabberG/src/jabber_libstr.cpp index 3f7fe118b9..4949f2f2c0 100644 --- a/protocols/JabberG/src/jabber_libstr.cpp +++ b/protocols/JabberG/src/jabber_libstr.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" int lstrcmp_null(const TCHAR *s1, const TCHAR *s2) { diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp index c615ca97dd..ff447fb832 100644 --- a/protocols/JabberG/src/jabber_list.cpp +++ b/protocols/JabberG/src/jabber_list.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_list.h" void MenuUpdateSrmmIcon(JABBER_LIST_ITEM *item); diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 445335093e..d2923a76d1 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_list.h" #include "jabber_caps.h" #include "jabber_privacy.h" diff --git a/protocols/JabberG/src/jabber_message_handlers.cpp b/protocols/JabberG/src/jabber_message_handlers.cpp index c4fd92f42e..aabdec3b57 100644 --- a/protocols/JabberG/src/jabber_message_handlers.cpp +++ b/protocols/JabberG/src/jabber_message_handlers.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pInfo) { diff --git a/protocols/JabberG/src/jabber_message_manager.cpp b/protocols/JabberG/src/jabber_message_manager.cpp index 2d466fd538..a1411bcac0 100644 --- a/protocols/JabberG/src/jabber_message_manager.cpp +++ b/protocols/JabberG/src/jabber_message_manager.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" static int CompareItems(const CJabberMessagePermanentInfo *p1, const CJabberMessagePermanentInfo *p2) { diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 976b275a9c..36156ae559 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_list.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 8fc18bf3f5..c993dc746b 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_list.h" #include "jabber_iq.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index c36fd611c3..0ceeb12340 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_list.h" #include "jabber_caps.h" #include "jabber_opttree.h" diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp index 046800ef81..6395bdca3b 100644 --- a/protocols/JabberG/src/jabber_opttree.cpp +++ b/protocols/JabberG/src/jabber_opttree.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_opttree.h" enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, IMG_GRPCLOSED }; diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp index c6a7bec6ca..08248147a0 100644 --- a/protocols/JabberG/src/jabber_password.cpp +++ b/protocols/JabberG/src/jabber_password.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_presence_manager.cpp b/protocols/JabberG/src/jabber_presence_manager.cpp index 4fd64fff55..719dd8c82a 100644 --- a/protocols/JabberG/src/jabber_presence_manager.cpp +++ b/protocols/JabberG/src/jabber_presence_manager.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" static int CompareItems(const CJabberPresencePermanentInfo *p1, const CJabberPresencePermanentInfo *p2) { diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index ffcf2945ef..f40f94429f 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_privacy.h" diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index fc6e0612b7..58e48abc36 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_caps.h" #include "jabber_disco.h" diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index f1d6cca287..154db21e39 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_iq.h" #include "jabber_rc.h" diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index f6029926a9..e2646e29ac 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include #include "jabber_iq.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index 54f783b2bc..d840ddcd89 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_secur.h" ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/JabberG/src/jabber_secur.h b/protocols/JabberG/src/jabber_secur.h index c69e130ac6..30b5e42805 100644 --- a/protocols/JabberG/src/jabber_secur.h +++ b/protocols/JabberG/src/jabber_secur.h @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" // basic class - provides interface for various Jabber auth diff --git a/protocols/JabberG/src/jabber_send_manager.cpp b/protocols/JabberG/src/jabber_send_manager.cpp index efe35c1849..af2767d88b 100644 --- a/protocols/JabberG/src/jabber_send_manager.cpp +++ b/protocols/JabberG/src/jabber_send_manager.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" static int CompareItems(const CJabberSendPermanentInfo *p1, const CJabberSendPermanentInfo *p2) { diff --git a/protocols/JabberG/src/jabber_std.cpp b/protocols/JabberG/src/jabber_std.cpp index ecda372e98..84745e30d5 100644 --- a/protocols/JabberG/src/jabber_std.cpp +++ b/protocols/JabberG/src/jabber_std.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 19d6d8c154..f78b97abe9 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include #include diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 5440ad8122..0c5f428ff2 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include // requires Windows Platform SDK diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp index 1c3059e9d7..5a406e23a2 100644 --- a/protocols/JabberG/src/jabber_treelist.cpp +++ b/protocols/JabberG/src/jabber_treelist.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #define TLIF_VISIBLE 0x01 #define TLIF_EXPANDED 0x02 diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 8f480a3075..fd26224e29 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include #include diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 61522beadd..2c7da1dafe 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_caps.h" diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index 40afc18c2a..2fd95e9f14 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include #include #include diff --git a/protocols/JabberG/src/jabber_ws.cpp b/protocols/JabberG/src/jabber_ws.cpp index bb4d5a2d20..2abed513d4 100644 --- a/protocols/JabberG/src/jabber_ws.cpp +++ b/protocols/JabberG/src/jabber_ws.cpp @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" BOOL CJabberProto::WsInit(void) { diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp index 9faed3e170..813a6c5cea 100644 --- a/protocols/JabberG/src/jabber_xml.cpp +++ b/protocols/JabberG/src/jabber_xml.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #define TAG_MAX_LEN 128 #define ATTR_MAX_LEN 8192 diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 2f128c7720..f110240a91 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" #include "jabber_caps.h" static CIconPool g_MoodIcons, g_ActivityIcons; diff --git a/protocols/JabberG/src/jabber_zstream.cpp b/protocols/JabberG/src/jabber_zstream.cpp index 722592c6bc..34645a16fb 100644 --- a/protocols/JabberG/src/jabber_zstream.cpp +++ b/protocols/JabberG/src/jabber_zstream.cpp @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "jabber.h" +#include "stdafx.h" BOOL ThreadData::zlibInit(void) { diff --git a/protocols/JabberG/src/stdafx.cpp b/protocols/JabberG/src/stdafx.cpp deleted file mode 100644 index b1263810b2..0000000000 --- a/protocols/JabberG/src/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright (ñ) 2012-15 Miranda NG project (http://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 . -*/ - -#include "jabber.h" \ No newline at end of file diff --git a/protocols/JabberG/src/stdafx.cxx b/protocols/JabberG/src/stdafx.cxx new file mode 100644 index 0000000000..56d03a7660 --- /dev/null +++ b/protocols/JabberG/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (ñ) 2012-15 Miranda NG project (http://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 . +*/ + +#include "stdafx.h" \ No newline at end of file diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h new file mode 100644 index 0000000000..2c28b7e3aa --- /dev/null +++ b/protocols/JabberG/src/stdafx.h @@ -0,0 +1,779 @@ +/* + +Jabber Protocol Plugin for Miranda NG + +Copyright (c) 2002-04 Santithorn Bunchua +Copyright (c) 2005-12 George Hazan +Copyright (c) 2007 Maxim Mluhov +Copyright (ñ) 2012-15 Miranda NG project + +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 _JABBER_H_ +#define _JABBER_H_ + +#pragma warning(disable:4706 4121 4127) + +#define LISTFOREACH(var__, obj__, list__) \ + for (int var__ = 0; (var__ = obj__->ListFindNext(list__, var__)) >= 0; ++var__) +#define LISTFOREACH_NODEF(var__, obj__, list__) \ + for (var__ = 0; (var__ = obj__->ListFindNext(list__, var__)) >= 0; ++var__) + +/******************************************************************* + * Global header files + *******************************************************************/ +#include +#include +#include +#include +#define SECURITY_WIN32 +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../plugins/zlib/src/zlib.h" + +#include "resource.h" +#include "version.h" + +#include "jabber_xml.h" +#include "jabber_byte.h" +#include "jabber_ibb.h" +#include "jabber_db_utils.h" + +struct CJabberProto; + +class CJabberDlgBase : public CProtoDlgBase +{ + typedef CProtoDlgBase CSuper; +protected: + __inline CJabberDlgBase(CJabberProto *proto, int idDialog, bool show_label=true) : + CSuper(proto, idDialog, show_label) + { + } + + int Resizer(UTILRESIZECONTROL *urc) + { + switch (urc->wId) { + case IDC_HEADERBAR: + urc->rcItem.right = urc->dlgNewSize.cx; + return 0; + } + + return CSuper::Resizer(urc); + } +}; + +struct CFilterData; +class CCtrlFilterListView : public CCtrlListView +{ + typedef CCtrlListView CSuper; + +public: + CCtrlFilterListView(CDlgBase* dlg, int ctrlId, bool trackFilter, bool keepHiglight); + ~CCtrlFilterListView(); + + TCHAR *GetFilterText(); + CCallback OnFilterChanged; + +protected: + CFilterData *fdat; + bool m_trackFilter; + bool m_keepHiglight; + + void OnInit(); + LRESULT CustomWndProc(UINT msg, WPARAM wParam, LPARAM lParam); + void FilterHighlight(TCHAR *filter); +}; + +#if !defined(OPENFILENAME_SIZE_VERSION_400) + #define OPENFILENAME_SIZE_VERSION_400 sizeof(OPENFILENAME) +#endif + +/******************************************************************* + * Global constants + *******************************************************************/ + +#define GLOBAL_SETTING_PREFIX "JABBER" +#define GLOBAL_SETTING_MODULE "JABBER" + +#define JABBER_DEFAULT_PORT 5222 +#define JABBER_IQID "mir_" +#define JABBER_MAX_JID_LEN 1024 + +#define JABBER_GC_MSG_QUIT LPGENT("I'm happy Miranda NG user. Get it at http://miranda-ng.org/.") +#define JABBER_GC_MSG_SLAP LPGENT("/me slaps %s around a bit with a large trout") + +// registered db event types +#define EVENTTYPE_JABBER_CHATSTATES 2000 +#define JS_DB_GETEVENTTEXT_CHATSTATES "/GetEventText2000" +#define JABBER_DB_EVENT_CHATSTATES_GONE 1 +#define EVENTTYPE_JABBER_PRESENCE 2001 +#define JS_DB_GETEVENTTEXT_PRESENCE "/GetEventText2001" +#define JABBER_DB_EVENT_PRESENCE_SUBSCRIBE 1 +#define JABBER_DB_EVENT_PRESENCE_SUBSCRIBED 2 +#define JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBE 3 +#define JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBED 4 +#define JABBER_DB_EVENT_PRESENCE_ERROR 5 + +// User-defined message +#define WM_JABBER_REGDLG_UPDATE (WM_PROTO_LAST + 100) +#define WM_JABBER_AGENT_REFRESH (WM_PROTO_LAST + 101) +#define WM_JABBER_TRANSPORT_REFRESH (WM_PROTO_LAST + 102) +#define WM_JABBER_REGINPUT_ACTIVATE (WM_PROTO_LAST + 103) +#define WM_JABBER_REFRESH WM_PROTO_REFRESH +#define WM_JABBER_CHECK_ONLINE WM_PROTO_CHECK_ONLINE +#define WM_JABBER_ACTIVATE WM_PROTO_ACTIVATE +#define WM_JABBER_CHANGED (WM_PROTO_LAST + 106) +#define WM_JABBER_SET_FONT (WM_PROTO_LAST + 108) +#define WM_JABBER_FLASHWND (WM_PROTO_LAST + 109) +#define WM_JABBER_GC_MEMBER_ADD (WM_PROTO_LAST + 110) +#define WM_JABBER_GC_FORCE_QUIT (WM_PROTO_LAST + 111) +#define WM_JABBER_SHUTDOWN (WM_PROTO_LAST + 112) +#define WM_JABBER_SMILEY (WM_PROTO_LAST + 113) +#define WM_JABBER_JOIN (WM_PROTO_LAST + 114) +#define WM_JABBER_ADD_TO_ROSTER (WM_PROTO_LAST + 115) +#define WM_JABBER_ADD_TO_BOOKMARKS (WM_PROTO_LAST + 116) +#define WM_JABBER_REFRESH_VCARD (WM_PROTO_LAST + 117) + +#define STATUS_TITLE_MAX 16 +#define STATUS_DESC_MAX 64 + +// Error code +#define JABBER_ERROR_REDIRECT 302 +#define JABBER_ERROR_BAD_REQUEST 400 +#define JABBER_ERROR_UNAUTHORIZED 401 +#define JABBER_ERROR_PAYMENT_REQUIRED 402 +#define JABBER_ERROR_FORBIDDEN 403 +#define JABBER_ERROR_NOT_FOUND 404 +#define JABBER_ERROR_NOT_ALLOWED 405 +#define JABBER_ERROR_NOT_ACCEPTABLE 406 +#define JABBER_ERROR_REGISTRATION_REQUIRED 407 +#define JABBER_ERROR_REQUEST_TIMEOUT 408 +#define JABBER_ERROR_CONFLICT 409 +#define JABBER_ERROR_INTERNAL_SERVER_ERROR 500 +#define JABBER_ERROR_NOT_IMPLEMENTED 501 +#define JABBER_ERROR_REMOTE_SERVER_ERROR 502 +#define JABBER_ERROR_SERVICE_UNAVAILABLE 503 +#define JABBER_ERROR_REMOTE_SERVER_TIMEOUT 504 + +// Vcard flags +#define JABBER_VCEMAIL_HOME 1 +#define JABBER_VCEMAIL_WORK 2 +#define JABBER_VCEMAIL_INTERNET 4 +#define JABBER_VCEMAIL_X400 8 + +#define JABBER_VCTEL_HOME 0x0001 +#define JABBER_VCTEL_WORK 0x0002 +#define JABBER_VCTEL_VOICE 0x0004 +#define JABBER_VCTEL_FAX 0x0008 +#define JABBER_VCTEL_PAGER 0x0010 +#define JABBER_VCTEL_MSG 0x0020 +#define JABBER_VCTEL_CELL 0x0040 +#define JABBER_VCTEL_VIDEO 0x0080 +#define JABBER_VCTEL_BBS 0x0100 +#define JABBER_VCTEL_MODEM 0x0200 +#define JABBER_VCTEL_ISDN 0x0400 +#define JABBER_VCTEL_PCS 0x0800 + +// File transfer setting +#define JABBER_OPTION_FT_DIRECT 0 // Direct connection +#define JABBER_OPTION_FT_PASS 1 // Use PASS server +#define JABBER_OPTION_FT_PROXY 2 // Use proxy with local port forwarding + +// Font style saved in DB +#define JABBER_FONT_BOLD 1 +#define JABBER_FONT_ITALIC 2 + +// Font for groupchat log dialog +#define JABBER_GCLOG_NUM_FONT 6 // 6 fonts (0:send, 1:msg, 2:time, 3:nick, 4:sys, 5:/me) + +// Icon list +enum { + JABBER_IDI_GCOWNER = 0, + JABBER_IDI_GCADMIN, + JABBER_IDI_GCMODERATOR, + JABBER_IDI_GCVOICE, + JABBER_ICON_TOTAL +}; + +// Services and Events +#define JS_PARSE_XMPP_URI "/ParseXmppURI" + +// Called when contact changes custom status and extra icon is set to clist_mw +//wParam = hContact // contact changing status +//lParam = hIcon // HANDLE to clist extra icon set as custom status +#define JE_CUSTOMSTATUS_EXTRAICON_CHANGED "/XStatusExtraIconChanged" +#define JE_CUSTOMSTATUS_CHANGED "/XStatusChanged" + +#define LR_BIGICON 0x40 + +#define JS_SENDXML "/SendXML" // Warning: This service is obsolete. Use IJabberNetInterface::SendXmlNode() instead. + +#define JS_HTTP_AUTH "/HttpAuthRequest" +#define JS_INCOMING_NOTE_EVENT "/IncomingNoteEvent" + +#define DBSETTING_DISPLAY_UID "display_uid" +#define DBSETTING_XSTATUSID "XStatusId" +#define DBSETTING_XSTATUSNAME "XStatusName" +#define DBSETTING_XSTATUSMSG "XStatusMsg" + +#define ADVSTATUS_MOOD "mood" +#define ADVSTATUS_ACTIVITY "activity" +#define ADVSTATUS_TUNE "tune" + +#define ADVSTATUS_VAL_ID "id" +#define ADVSTATUS_VAL_ICON "icon" +#define ADVSTATUS_VAL_TITLE "title" +#define ADVSTATUS_VAL_TEXT "text" + +struct CJabberHttpAuthParams +{ + enum {IQ = 1, MSG = 2} m_nType; + TCHAR *m_szFrom; + TCHAR *m_szIqId; + TCHAR *m_szThreadId; + TCHAR *m_szId; + TCHAR *m_szMethod; + TCHAR *m_szUrl; + CJabberHttpAuthParams() + { + memset(this, 0, sizeof(CJabberHttpAuthParams)); + } + ~CJabberHttpAuthParams() + { + Free(); + } + void Free() + { + mir_free(m_szFrom); + mir_free(m_szIqId); + mir_free(m_szThreadId); + mir_free(m_szId); + mir_free(m_szMethod); + mir_free(m_szUrl); + memset(this, 0, sizeof(CJabberHttpAuthParams)); + } +}; + +/******************************************************************* + * Global data structures and data type definitions + *******************************************************************/ +typedef HANDLE JABBER_SOCKET; + +#define CAPS_BOOKMARK 0x0001 +#define CAPS_BOOKMARKS_LOADED 0x8000 + +#define ZLIB_CHUNK_SIZE 2048 + +#include "jabber_caps.h" + +#define JABBER_LOGIN_ROSTER 0x0001 +#define JABBER_LOGIN_BOOKMARKS 0x0002 +#define JABBER_LOGIN_SERVERINFO 0x0004 +#define JABBER_LOGIN_BOOKMARKS_AJ 0x0008 + +struct JABBER_CONN_DATA : public MZeroedObject +{ + TCHAR username[512]; + TCHAR password[512]; + char server[128]; + char manualHost[128]; + int port; + BOOL useSSL; + + HWND reg_hwndDlg; +}; + +struct ThreadData +{ + ThreadData(CJabberProto *_pro, JABBER_CONN_DATA *_connData); + ~ThreadData(); + + ptrA szStreamId; + char* buffer; + + // network support + JABBER_SOCKET s; + HANDLE iomutex; // protects i/o operations + CJabberProto *proto; + + // XEP-0138 (Compression support) + BOOL useZlib; + z_stream zStreamIn,zStreamOut; + bool zRecvReady; + int zRecvDatalen; + char* zRecvData; + + void xmpp_client_query(void); + + BOOL zlibInit(void); + void zlibUninit(); + int zlibSend(char* data, int datalen); + int zlibRecv(char* data, long datalen); + + // for nick names resolving + int resolveID; + MCONTACT resolveContact; + + // features & registration + bool bIsReg; + bool reg_done, bIsSessionAvailable; + bool bBookmarksLoaded; + DWORD dwLoginRqs; + + // connection & login data + JABBER_CONN_DATA conn; + TCHAR resource[128]; + TCHAR fullJID[JABBER_MAX_JID_LEN]; + ptrT tszNewPassword; + + class TJabberAuth *auth; + JabberCapsBits jabberServerCaps; + + void close(void); + void shutdown(void); + int recv(char* buf, size_t len); + int send(char* buffer, int bufsize = -1); + int send(HXML node); + + int recvws(char* buffer, size_t bufsize, int flags); + int sendws(char* buffer, size_t bufsize, int flags); +}; + +struct JABBER_MODEMSGS +{ + TCHAR *szOnline; + TCHAR *szAway; + TCHAR *szNa; + TCHAR *szDnd; + TCHAR *szFreechat; +}; + +typedef enum { FT_SI, FT_OOB, FT_BYTESTREAM, FT_IBB } JABBER_FT_TYPE; +typedef enum { FT_CONNECTING, FT_INITIALIZING, FT_RECEIVING, FT_DONE, FT_ERROR, FT_DENIED } JABBER_FILE_STATE; + +struct filetransfer +{ + filetransfer(CJabberProto* proto); + ~filetransfer(); + + void close(); + void complete(); + int create(); + + PROTOFILETRANSFERSTATUS std; + + JABBER_FT_TYPE type; + JABBER_SOCKET s; + JABBER_FILE_STATE state; + TCHAR *jid; + int fileId; + TCHAR* szId; + TCHAR *sid; + int bCompleted; + HANDLE hWaitEvent; + + // For type == FT_BYTESTREAM + JABBER_BYTE_TRANSFER *jbt; + + JABBER_IBB_TRANSFER *jibb; + + // Used by file receiving only + char* httpHostName; + WORD httpPort; + TCHAR *httpPath; + unsigned __int64 dwExpectedRecvFileSize; + + // Used by file sending only + HANDLE hFileEvent; + unsigned __int64 *fileSize; + TCHAR *szDescription; + + CJabberProto *ppro; +}; + +struct JABBER_SEARCH_RESULT +{ + PROTOSEARCHRESULT hdr; + TCHAR jid[JABBER_MAX_JID_LEN]; +}; + +struct JABBER_GCLOG_FONT +{ + char face[LF_FACESIZE]; // LF_FACESIZE is from LOGFONT struct + BYTE style; + char size; // signed + BYTE charset; + COLORREF color; +}; + +struct JABBER_FIELD_MAP +{ + int id; + char* name; +}; + +enum JABBER_MUC_JIDLIST_TYPE +{ + MUC_VOICELIST, + MUC_MEMBERLIST, + MUC_MODERATORLIST, + MUC_BANLIST, + MUC_ADMINLIST, + MUC_OWNERLIST +}; + +struct JABBER_MUC_JIDLIST_INFO +{ + ~JABBER_MUC_JIDLIST_INFO(); + + JABBER_MUC_JIDLIST_TYPE type; + TCHAR *roomJid; // filled-in by the WM_JABBER_REFRESH code + HXML iqNode; + CJabberProto *ppro; + + TCHAR *type2str(void) const; +}; + +typedef void (CJabberProto::*JABBER_FORM_SUBMIT_FUNC)(HXML values, void *userdata); + +//---- jabber_treelist.c ------------------------------------------------ + +typedef struct TTreeList_ItemInfo *HTREELISTITEM; +enum { TLM_TREE, TLM_REPORT }; + +//---- proto frame ------------------------------------------------ + +class CJabberInfoFrameItem; + +struct CJabberInfoFrame_Event +{ + enum { CLICK, DESTROY } m_event; + const char *m_pszName; + LPARAM m_pUserData; +}; + +class CJabberInfoFrame : public MZeroedObject +{ +public: + CJabberInfoFrame(CJabberProto *proto); + ~CJabberInfoFrame(); + + void CreateInfoItem(char *pszName, bool bCompact=false, LPARAM pUserData=0); + void SetInfoItemCallback(char *pszName, void (CJabberProto::*onEvent)(CJabberInfoFrame_Event *)); + void UpdateInfoItem(char *pszName, HANDLE hIcolibItem, TCHAR *pszText); + void ShowInfoItem(char *pszName, bool bShow); + void RemoveInfoItem(char *pszName); + + void LockUpdates(); + void Update(); + +private: + CJabberProto *m_proto; + HWND m_hwnd; + int m_frameId; + bool m_compact; + OBJLIST m_pItems; + int m_hiddenItemCount; + int m_clickedItem; + bool m_bLocked; + int m_nextTooltipId; + HWND m_hwndToolTip; + + HANDLE m_hhkFontsChanged; + HFONT m_hfntTitle, m_hfntText; + COLORREF m_clTitle, m_clText, m_clBack; + + static void InitClass(); + static LRESULT CALLBACK GlobalWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); + LRESULT WndProc(UINT msg, WPARAM wParam, LPARAM lParam); + + void ReloadFonts(); + void UpdateSize(); + + void RemoveTooltip(int id); + void SetToolTip(int id, RECT *rc, TCHAR *pszText); + + void PaintSkinGlyph(HDC hdc, RECT *rc, char **glyphs, COLORREF fallback); + void PaintCompact(HDC hdc); + void PaintNormal(HDC hdc); + + enum + { + SZ_FRAMEPADDING = 2, // padding inside frame + SZ_LINEPADDING = 0, // line height will be incremented by this value + SZ_LINESPACING = 0, // between lines + SZ_ICONSPACING = 2, // between icon and text + }; +}; + +#include "jabber_list.h" +#include "jabber_proto.h" + +/******************************************************************* + * Global variables + *******************************************************************/ +extern HINSTANCE hInst; + +extern HANDLE hExtraMood; +extern HANDLE hExtraActivity; + +extern TCHAR szCoreVersion[]; + +extern int g_cbCountries; +extern struct CountryListEntry* g_countries; + +extern FI_INTERFACE *FIP; + +extern HANDLE hExtListInit, hDiscoInfoResult; +extern int bSecureIM, bMirOTR, bNewGPG, bPlatform; + +/******************************************************************* + * Function declarations + *******************************************************************/ + +//---- jabber_treelist.c ------------------------------------------------ + +void TreeList_Create(HWND hwnd); +void TreeList_Destroy(HWND hwnd); +void TreeList_Reset(HWND hwnd); +void TreeList_SetMode(HWND hwnd, int mode); +HTREELISTITEM TreeList_GetActiveItem(HWND hwnd); +void TreeList_SetSortMode(HWND hwnd, int col, BOOL descending); +void TreeList_SetFilter(HWND hwnd, TCHAR *filter); +HTREELISTITEM TreeList_AddItem(HWND hwnd, HTREELISTITEM hParent, TCHAR *text, LPARAM data); +void TreeList_ResetItem(HWND hwnd, HTREELISTITEM hParent); +void TreeList_MakeFakeParent(HTREELISTITEM hItem, BOOL flag); +void TreeList_AppendColumn(HTREELISTITEM hItem, TCHAR *text); +int TreeList_AddIcon(HWND hwnd, HICON hIcon, int iOverlay); +void TreeList_SetIcon(HTREELISTITEM hItem, int iIcon, int iOverlay); +LPARAM TreeList_GetData(HTREELISTITEM hItem); +HTREELISTITEM TreeList_GetRoot(HWND hwnd); +int TreeList_GetChildrenCount(HTREELISTITEM hItem); +HTREELISTITEM TreeList_GetChild(HTREELISTITEM hItem, int i); +void sttTreeList_RecursiveApply(HTREELISTITEM hItem, void (*func)(HTREELISTITEM, LPARAM), LPARAM data); +void TreeList_Update(HWND hwnd); +BOOL TreeList_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, UINT idc, BOOL *result); + +//---- jabber_form.c ------------------------------------------------ + +enum TJabberFormControlType +{ + JFORM_CTYPE_NONE, JFORM_CTYPE_TEXT_PRIVATE, JFORM_CTYPE_TEXT_MULTI, + JFORM_CTYPE_BOOLEAN, JFORM_CTYPE_LIST_SINGLE, JFORM_CTYPE_LIST_MULTI, + JFORM_CTYPE_FIXED, JFORM_CTYPE_HIDDEN, JFORM_CTYPE_TEXT_SINGLE +}; + +typedef struct TJabberFormControlInfo *HJFORMCTRL; +typedef struct TJabberFormLayoutInfo *HJFORMLAYOUT; + +void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bCompact = FALSE); +void JabberFormDestroyUI(HWND hwndStatic); +void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text); +HJFORMLAYOUT JabberFormCreateLayout(HWND hwndStatic); // use mir_free to destroy +HJFORMCTRL JabberFormAppendControl(HWND hwndStatic, HJFORMLAYOUT layout_info, TJabberFormControlType type, const TCHAR *labelStr, const TCHAR *valueStr); +void JabberFormAddListItem(HJFORMCTRL item, const TCHAR *text, bool selected); +void JabberFormLayoutControls(HWND hwndStatic, HJFORMLAYOUT layout_info, int *formHeight); + +void JabberFormCreateDialog(HXML xNode, TCHAR* defTitle, JABBER_FORM_SUBMIT_FUNC pfnSubmit, void *userdata); + +HXML JabberFormGetData(HWND hwndStatic, HXML xNode); + +//---- jabber_icolib.c ---------------------------------------------- + +void g_IconsInit(); +void g_XstatusIconsInit(); +HANDLE g_GetIconHandle(int iconId); +HICON g_LoadIconEx(const char* name, bool big = false); +void g_ReleaseIcon(HICON hIcon); + +void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon); +void WindowSetIcon(HWND hWnd, CJabberProto *proto, const char* name); +void WindowFreeIcon(HWND hWnd); + +int ReloadIconsEventHook(WPARAM wParam, LPARAM lParam); + +//---- jabber_libstr.c ---------------------------------------------- + +int lstrcmp_null(const TCHAR *s1, const TCHAR *s2); + +//---- jabber_menu.c ------------------------------------------------ + +void g_MenuInit(); +void g_MenuUninit(); +int g_OnToolbarInit(WPARAM, LPARAM); + +//---- jabber_misc.c ------------------------------------------------ + +void JabberChatDllError(void); +int JabberCompareJids(const TCHAR *jid1, const TCHAR *jid2); +TCHAR* UnEscapeChatTags(TCHAR* str_in); + +//---- jabber_adhoc.cpp --------------------------------------------- + +struct CJabberAdhocStartupParams +{ + TCHAR *m_szJid; + TCHAR *m_szNode; + CJabberProto *m_pProto; + + CJabberAdhocStartupParams(CJabberProto* proto, TCHAR* szJid, TCHAR* szNode = NULL) + { + m_pProto = proto; + m_szJid = mir_tstrdup(szJid); + m_szNode = szNode ? mir_tstrdup(szNode) : NULL; + } + ~CJabberAdhocStartupParams() + { + mir_free(m_szJid); + mir_free(m_szNode); + } +}; + +struct JabberAdHocData +{ + CJabberProto* proto; + int CurrentHeight; + int curPos; + int frameHeight; + RECT frameRect; + HXML AdHocNode; + HXML CommandsNode; + TCHAR *ResponderJID; +}; + +//---- jabber_util.cpp ------------------------------------------------------------------ + +struct TStringPairsElem +{ + const char *name, *value; +}; + +struct TStringPairs +{ + TStringPairs(char*); + ~TStringPairs(); + + const char* operator[](const char* name) const; + + int numElems; + TStringPairsElem* elems; +}; + +typedef char JabberShaStrBuf[2*MIR_SHA1_HASH_SIZE + 1]; + +TCHAR* __stdcall JabberNickFromJID(const TCHAR *jid); +TCHAR* JabberPrepareJid(LPCTSTR jid); +void __stdcall JabberUrlDecodeW(WCHAR *str); +char* __stdcall JabberSha1(const char *str, JabberShaStrBuf buf); +TCHAR* __stdcall JabberStrFixLines(const TCHAR *str); +void __stdcall JabberHttpUrlDecode(TCHAR *str); +int __stdcall JabberCombineStatus(int status1, int status2); +TCHAR* __stdcall JabberErrorStr(int errorCode); +TCHAR* __stdcall JabberErrorMsg(HXML errorNode, int *errorCode = NULL); +time_t __stdcall JabberIsoToUnixTime(const TCHAR *stamp); +TCHAR* __stdcall JabberStripJid(const TCHAR *jid, TCHAR *dest, size_t destLen); +int __stdcall JabberGetPacketID(HXML n); +TCHAR* __stdcall JabberId2string(int id); + +LPCTSTR __stdcall JabberGetPictureType(HXML node, const char *picBuf); + +TCHAR* time2str(time_t _time, TCHAR *buf, size_t bufLen); +time_t str2time(const TCHAR*); + +const TCHAR *JabberStrIStr(const TCHAR *str, const TCHAR *substr); +void JabberCopyText(HWND hwnd, const TCHAR *text); +CJabberProto *JabberChooseInstance(bool bIsLink=false); + +bool JabberReadXep203delay(HXML node, time_t &msgTime); + +int UIEmulateBtnClick(HWND hwndDlg, UINT idcButton); +void UIShowControls(HWND hwndDlg, int *idList, int nCmdShow); + +//---- jabber_xml.cpp ------------------------------------------------------------------- + +void strdel(char* parBuffer, int len); + +//---- jabber_userinfo.cpp -------------------------------------------------------------- + +void JabberUserInfoUpdate(MCONTACT hContact); + +//---- jabber_iq_handlers.cpp +BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE); + +#endif -- cgit v1.2.3