From b4b636802237461d78dd0b8d33d5bedfd72a1025 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 29 Apr 2015 20:52:29 +0000 Subject: unified project for ICQ protocol git-svn-id: http://svn.miranda-ng.org/main/trunk@13256 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/IcqOscarJ/icqoscar8.vcxproj | 28 ++ protocols/IcqOscarJ/icqoscar8.vcxproj.filters | 4 + protocols/IcqOscarJ/icqoscar8_10.vcxproj | 297 ------------- protocols/IcqOscarJ/icqoscar8_10.vcxproj.filters | 262 ----------- protocols/IcqOscarJ/icqoscar8_12.vcxproj | 300 ------------- protocols/IcqOscarJ/icqoscar8_12.vcxproj.filters | 262 ----------- protocols/IcqOscarJ/src/UI/askauthentication.cpp | 92 ---- protocols/IcqOscarJ/src/UI/icqoscar.h | 2 - protocols/IcqOscarJ/src/UI/loginpassword.cpp | 90 ---- protocols/IcqOscarJ/src/UI/userinfotab.cpp | 291 ------------ protocols/IcqOscarJ/src/askauthentication.cpp | 92 ++++ protocols/IcqOscarJ/src/capabilities.cpp | 2 +- protocols/IcqOscarJ/src/chan_01login.cpp | 2 +- protocols/IcqOscarJ/src/chan_02data.cpp | 2 +- protocols/IcqOscarJ/src/chan_03error.cpp | 2 +- protocols/IcqOscarJ/src/chan_04close.cpp | 2 +- protocols/IcqOscarJ/src/chan_05ping.cpp | 2 +- protocols/IcqOscarJ/src/changeinfo.h | 121 +++++ protocols/IcqOscarJ/src/changeinfo/changeinfo.h | 121 ----- protocols/IcqOscarJ/src/changeinfo/constants.cpp | 131 ------ protocols/IcqOscarJ/src/changeinfo/db.cpp | 220 --------- protocols/IcqOscarJ/src/changeinfo/dlgproc.cpp | 516 ---------------------- protocols/IcqOscarJ/src/changeinfo/editlist.cpp | 196 -------- protocols/IcqOscarJ/src/changeinfo/editstring.cpp | 352 --------------- protocols/IcqOscarJ/src/changeinfo/icqoscar.h | 2 - protocols/IcqOscarJ/src/changeinfo/upload.cpp | 86 ---- protocols/IcqOscarJ/src/constants.cpp | 131 ++++++ protocols/IcqOscarJ/src/cookies.cpp | 2 +- protocols/IcqOscarJ/src/db.cpp | 220 +++++++++ protocols/IcqOscarJ/src/directpackets.cpp | 2 +- protocols/IcqOscarJ/src/dlgproc.cpp | 516 ++++++++++++++++++++++ protocols/IcqOscarJ/src/editlist.cpp | 196 ++++++++ protocols/IcqOscarJ/src/editstring.cpp | 352 +++++++++++++++ protocols/IcqOscarJ/src/fam_01service.cpp | 2 +- protocols/IcqOscarJ/src/fam_02location.cpp | 2 +- protocols/IcqOscarJ/src/fam_03buddy.cpp | 2 +- protocols/IcqOscarJ/src/fam_04message.cpp | 2 +- protocols/IcqOscarJ/src/fam_09bos.cpp | 2 +- protocols/IcqOscarJ/src/fam_0alookup.cpp | 2 +- protocols/IcqOscarJ/src/fam_0bstatus.cpp | 2 +- protocols/IcqOscarJ/src/fam_13servclist.cpp | 2 +- protocols/IcqOscarJ/src/fam_15icqserver.cpp | 2 +- protocols/IcqOscarJ/src/fam_17signon.cpp | 2 +- protocols/IcqOscarJ/src/i18n.cpp | 2 +- protocols/IcqOscarJ/src/icq_advsearch.cpp | 2 +- protocols/IcqOscarJ/src/icq_avatar.cpp | 2 +- protocols/IcqOscarJ/src/icq_clients.cpp | 2 +- protocols/IcqOscarJ/src/icq_db.cpp | 2 +- protocols/IcqOscarJ/src/icq_direct.cpp | 2 +- protocols/IcqOscarJ/src/icq_directmsg.cpp | 2 +- protocols/IcqOscarJ/src/icq_fieldnames.cpp | 2 +- protocols/IcqOscarJ/src/icq_filerequests.cpp | 2 +- protocols/IcqOscarJ/src/icq_filetransfer.cpp | 2 +- protocols/IcqOscarJ/src/icq_firstrun.cpp | 2 +- protocols/IcqOscarJ/src/icq_http.cpp | 2 +- protocols/IcqOscarJ/src/icq_infoupdate.cpp | 2 +- protocols/IcqOscarJ/src/icq_menu.cpp | 2 +- protocols/IcqOscarJ/src/icq_opts.cpp | 2 +- protocols/IcqOscarJ/src/icq_packet.cpp | 2 +- protocols/IcqOscarJ/src/icq_popups.cpp | 2 +- protocols/IcqOscarJ/src/icq_proto.cpp | 2 +- protocols/IcqOscarJ/src/icq_rates.cpp | 2 +- protocols/IcqOscarJ/src/icq_server.cpp | 2 +- protocols/IcqOscarJ/src/icq_servlist.cpp | 2 +- protocols/IcqOscarJ/src/icq_uploadui.cpp | 2 +- protocols/IcqOscarJ/src/icq_xstatus.cpp | 2 +- protocols/IcqOscarJ/src/icq_xtraz.cpp | 2 +- protocols/IcqOscarJ/src/icqosc_svcs.cpp | 2 +- protocols/IcqOscarJ/src/icqoscar.h | 122 ----- protocols/IcqOscarJ/src/init.cpp | 2 +- protocols/IcqOscarJ/src/log.cpp | 2 +- protocols/IcqOscarJ/src/loginpassword.cpp | 90 ++++ protocols/IcqOscarJ/src/oscar_filetransfer.cpp | 2 +- protocols/IcqOscarJ/src/stdafx.cpp | 18 - protocols/IcqOscarJ/src/stdafx.cxx | 18 + protocols/IcqOscarJ/src/stdafx.h | 122 +++++ protocols/IcqOscarJ/src/stdpackets.cpp | 2 +- protocols/IcqOscarJ/src/tlv.cpp | 2 +- protocols/IcqOscarJ/src/upload.cpp | 86 ++++ protocols/IcqOscarJ/src/userinfotab.cpp | 291 ++++++++++++ protocols/IcqOscarJ/src/utilities.cpp | 2 +- 88 files changed, 2323 insertions(+), 3416 deletions(-) create mode 100644 protocols/IcqOscarJ/icqoscar8.vcxproj create mode 100644 protocols/IcqOscarJ/icqoscar8.vcxproj.filters delete mode 100644 protocols/IcqOscarJ/icqoscar8_10.vcxproj delete mode 100644 protocols/IcqOscarJ/icqoscar8_10.vcxproj.filters delete mode 100644 protocols/IcqOscarJ/icqoscar8_12.vcxproj delete mode 100644 protocols/IcqOscarJ/icqoscar8_12.vcxproj.filters delete mode 100644 protocols/IcqOscarJ/src/UI/askauthentication.cpp delete mode 100644 protocols/IcqOscarJ/src/UI/icqoscar.h delete mode 100644 protocols/IcqOscarJ/src/UI/loginpassword.cpp delete mode 100644 protocols/IcqOscarJ/src/UI/userinfotab.cpp create mode 100644 protocols/IcqOscarJ/src/askauthentication.cpp create mode 100644 protocols/IcqOscarJ/src/changeinfo.h delete mode 100644 protocols/IcqOscarJ/src/changeinfo/changeinfo.h delete mode 100644 protocols/IcqOscarJ/src/changeinfo/constants.cpp delete mode 100644 protocols/IcqOscarJ/src/changeinfo/db.cpp delete mode 100644 protocols/IcqOscarJ/src/changeinfo/dlgproc.cpp delete mode 100644 protocols/IcqOscarJ/src/changeinfo/editlist.cpp delete mode 100644 protocols/IcqOscarJ/src/changeinfo/editstring.cpp delete mode 100644 protocols/IcqOscarJ/src/changeinfo/icqoscar.h delete mode 100644 protocols/IcqOscarJ/src/changeinfo/upload.cpp create mode 100644 protocols/IcqOscarJ/src/constants.cpp create mode 100644 protocols/IcqOscarJ/src/db.cpp create mode 100644 protocols/IcqOscarJ/src/dlgproc.cpp create mode 100644 protocols/IcqOscarJ/src/editlist.cpp create mode 100644 protocols/IcqOscarJ/src/editstring.cpp delete mode 100644 protocols/IcqOscarJ/src/icqoscar.h create mode 100644 protocols/IcqOscarJ/src/loginpassword.cpp delete mode 100644 protocols/IcqOscarJ/src/stdafx.cpp create mode 100644 protocols/IcqOscarJ/src/stdafx.cxx create mode 100644 protocols/IcqOscarJ/src/stdafx.h create mode 100644 protocols/IcqOscarJ/src/upload.cpp create mode 100644 protocols/IcqOscarJ/src/userinfotab.cpp diff --git a/bin10/mir_dev.sln b/bin10/mir_dev.sln index 1757c1e9a7..9ae377091a 100644 --- a/bin10/mir_dev.sln +++ b/bin10/mir_dev.sln @@ -31,7 +31,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo\Yahoo_10.vcxproj", "{E42870DB-9FED-44E7-9C93-4E64D0C87F51}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8_10.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" +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}" EndProject diff --git a/bin10/mir_full.sln b/bin10/mir_full.sln index ed07153747..ca48bea963 100644 --- a/bin10/mir_full.sln +++ b/bin10/mir_full.sln @@ -31,7 +31,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo\Yahoo_10.vcxproj", "{E42870DB-9FED-44E7-9C93-4E64D0C87F51}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8_10.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" +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}" EndProject diff --git a/bin10/mir_full_pro.sln b/bin10/mir_full_pro.sln index 2262638348..095d5a9231 100644 --- a/bin10/mir_full_pro.sln +++ b/bin10/mir_full_pro.sln @@ -31,7 +31,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo\Yahoo_10.vcxproj", "{E42870DB-9FED-44E7-9C93-4E64D0C87F51}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8_10.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" +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}" EndProject diff --git a/bin10/miranda32.sln b/bin10/miranda32.sln index 40c84cfe82..bd065b71cb 100644 --- a/bin10/miranda32.sln +++ b/bin10/miranda32.sln @@ -29,7 +29,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo\Yahoo_10.vcxproj", "{E42870DB-9FED-44E7-9C93-4E64D0C87F51}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8_10.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" +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}" EndProject diff --git a/bin12/mir_dev.sln b/bin12/mir_dev.sln index a3ff3d06d9..1e694add8e 100644 --- a/bin12/mir_dev.sln +++ b/bin12/mir_dev.sln @@ -33,7 +33,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo\Yahoo_12.vcxproj", "{E42870DB-9FED-44E7-9C93-4E64D0C87F51}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8_12.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" +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}" EndProject diff --git a/bin12/mir_full.sln b/bin12/mir_full.sln index 25f2408d06..4450e61428 100644 --- a/bin12/mir_full.sln +++ b/bin12/mir_full.sln @@ -33,7 +33,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo\Yahoo_12.vcxproj", "{E42870DB-9FED-44E7-9C93-4E64D0C87F51}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8_12.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" +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}" EndProject diff --git a/bin12/miranda32.sln b/bin12/miranda32.sln index f960d79228..0d89dff00f 100644 --- a/bin12/miranda32.sln +++ b/bin12/miranda32.sln @@ -31,7 +31,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yahoo", "..\protocols\Yahoo\Yahoo_12.vcxproj", "{E42870DB-9FED-44E7-9C93-4E64D0C87F51}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ICQ", "..\protocols\IcqOscarJ\icqoscar8_12.vcxproj", "{01DDCB36-4DE2-405D-BC36-2C8BDEB86659}" +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}" EndProject diff --git a/protocols/IcqOscarJ/icqoscar8.vcxproj b/protocols/IcqOscarJ/icqoscar8.vcxproj new file mode 100644 index 0000000000..f74b4ee12a --- /dev/null +++ b/protocols/IcqOscarJ/icqoscar8.vcxproj @@ -0,0 +1,28 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + ICQ + {01DDCB36-4DE2-405D-BC36-2C8BDEB86659} + + + + + \ No newline at end of file diff --git a/protocols/IcqOscarJ/icqoscar8.vcxproj.filters b/protocols/IcqOscarJ/icqoscar8.vcxproj.filters new file mode 100644 index 0000000000..de5ad9f66c --- /dev/null +++ b/protocols/IcqOscarJ/icqoscar8.vcxproj.filters @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/protocols/IcqOscarJ/icqoscar8_10.vcxproj b/protocols/IcqOscarJ/icqoscar8_10.vcxproj deleted file mode 100644 index 072f7077a3..0000000000 --- a/protocols/IcqOscarJ/icqoscar8_10.vcxproj +++ /dev/null @@ -1,297 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - ICQ - {01DDCB36-4DE2-405D-BC36-2C8BDEB86659} - - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30128.1 - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Plugins\ - true - - - - Disabled - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - Use - icqoscar.h - Level3 - EditAndContinue - 4996;%(DisableSpecificWarnings) - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi;..\..\..\include\msapi - - - ws2_32.lib;comctl32.lib;%(AdditionalDependencies) - true - 0x25000000 - 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;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - Use - icqoscar.h - Level3 - 4996;%(DisableSpecificWarnings) - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi;..\..\..\include\msapi - - - ws2_32.lib;comctl32.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 - 0x25000000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\bin10\lib - - - - - Full - OnlyExplicitInline - Size - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Sync - false - true - Fast - Use - icqoscar.h - Level3 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi;..\..\..\include\msapi - - - /PDBALTPATH:%_PDB% - ws2_32.lib;comctl32.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 - false - $(IntDir)$(TargetName).lib - Windows - 0x25000000 - $(ProfileDir)..\..\bin10\lib - - - - - Full - OnlyExplicitInline - Size - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDL;%(PreprocessorDefinitions) - true - Sync - false - true - Fast - Use - icqoscar.h - Level3 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi;..\..\..\include\msapi - - - /PDBALTPATH:%_PDB% - ws2_32.lib;comctl32.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 - false - $(IntDir)$(TargetName).lib - Windows - 0x25000000 - $(ProfileDir)..\..\bin10\lib - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - - - - - - - - - \ No newline at end of file diff --git a/protocols/IcqOscarJ/icqoscar8_10.vcxproj.filters b/protocols/IcqOscarJ/icqoscar8_10.vcxproj.filters deleted file mode 100644 index fbf0c89c29..0000000000 --- a/protocols/IcqOscarJ/icqoscar8_10.vcxproj.filters +++ /dev/null @@ -1,262 +0,0 @@ - - - - - {d8db2ef5-99b1-4927-b9dc-b915eeda857f} - h;hpp;hxx;hm;inl - - - {bd7e4337-1d6c-4e87-9406-2f853fb4bf7f} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - {0bc28603-23fc-4a7b-8b14-c96119903bdb} - - - {e643d1b0-d2ef-4f24-b536-8f3b7bcb4cab} - - - {731741ea-7d07-4c09-aa88-641a254b5f48} - - - {33754d1e-5911-4ebf-bbb2-f7f9ac930bb5} - - - {b50a315e-0455-4a42-8aa6-e73618237ff3} - - - {8380b888-17be-4a22-a3f2-36f8fd65b730} - - - - - 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 - - - Header Files - - - Header Files - - - Changeinfo - - - - - Resource Files - - - - - FLAP Channels - - - FLAP Channels - - - FLAP Channels - - - FLAP Channels - - - FLAP Channels - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - Direct Connection - - - Direct Connection - - - Direct Connection - - - Direct Connection - - - Direct Connection - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - UI - - - UI - - - UI - - - UI - - - UI - - - UI - - - Changeinfo - - - Changeinfo - - - Changeinfo - - - Changeinfo - - - Changeinfo - - - Changeinfo - - - - - - - - - - - - - - - - - - - - Miranda Bits - - - - \ No newline at end of file diff --git a/protocols/IcqOscarJ/icqoscar8_12.vcxproj b/protocols/IcqOscarJ/icqoscar8_12.vcxproj deleted file mode 100644 index df91bcdaa0..0000000000 --- a/protocols/IcqOscarJ/icqoscar8_12.vcxproj +++ /dev/null @@ -1,300 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - ICQ - {01DDCB36-4DE2-405D-BC36-2C8BDEB86659} - - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - DynamicLibrary - Unicode - true - v120_xp - - - DynamicLibrary - Unicode - v120_xp - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30128.1 - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)64\Plugins\ - $(SolutionDir)$(Configuration)\Plugins\ - $(SolutionDir)$(Configuration)\Plugins\ - true - - - - Disabled - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - _DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - Use - icqoscar.h - Level4 - EditAndContinue - 4996;%(DisableSpecificWarnings) - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi;..\..\..\include\msapi - - - ws2_32.lib;comctl32.lib;%(AdditionalDependencies) - true - 0x25000000 - 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;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - true - Use - icqoscar.h - Level4 - 4996;%(DisableSpecificWarnings) - - - _DEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi;..\..\..\include\msapi - - - ws2_32.lib;comctl32.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 - 0x25000000 - false - $(IntDir)$(TargetName).lib - Windows - $(ProfileDir)..\..\bin12\lib - - - - - Full - OnlyExplicitInline - Size - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Sync - false - true - Fast - Use - icqoscar.h - Level4 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi;..\..\..\include\msapi - - - ws2_32.lib;comctl32.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 - false - $(IntDir)$(TargetName).lib - Windows - 0x25000000 - $(ProfileDir)..\..\bin12\lib - - - - - Full - OnlyExplicitInline - Size - ..\..\include;..\..\plugins\ExternalAPI;%(AdditionalIncludeDirectories) - NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Sync - false - true - Fast - Use - icqoscar.h - Level4 - 4996;%(DisableSpecificWarnings) - - - NDEBUG;%(PreprocessorDefinitions) - ..\..\include;..\..\include\msapi;..\..\..\include\msapi - - - ws2_32.lib;comctl32.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 - false - $(IntDir)$(TargetName).lib - Windows - 0x25000000 - $(ProfileDir)..\..\bin12\lib - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Create - - - - - - - - - \ No newline at end of file diff --git a/protocols/IcqOscarJ/icqoscar8_12.vcxproj.filters b/protocols/IcqOscarJ/icqoscar8_12.vcxproj.filters deleted file mode 100644 index fbf0c89c29..0000000000 --- a/protocols/IcqOscarJ/icqoscar8_12.vcxproj.filters +++ /dev/null @@ -1,262 +0,0 @@ - - - - - {d8db2ef5-99b1-4927-b9dc-b915eeda857f} - h;hpp;hxx;hm;inl - - - {bd7e4337-1d6c-4e87-9406-2f853fb4bf7f} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - {0bc28603-23fc-4a7b-8b14-c96119903bdb} - - - {e643d1b0-d2ef-4f24-b536-8f3b7bcb4cab} - - - {731741ea-7d07-4c09-aa88-641a254b5f48} - - - {33754d1e-5911-4ebf-bbb2-f7f9ac930bb5} - - - {b50a315e-0455-4a42-8aa6-e73618237ff3} - - - {8380b888-17be-4a22-a3f2-36f8fd65b730} - - - - - 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 - - - Header Files - - - Header Files - - - Changeinfo - - - - - Resource Files - - - - - FLAP Channels - - - FLAP Channels - - - FLAP Channels - - - FLAP Channels - - - FLAP Channels - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - SNAC Families - - - Direct Connection - - - Direct Connection - - - Direct Connection - - - Direct Connection - - - Direct Connection - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - Miranda Bits - - - UI - - - UI - - - UI - - - UI - - - UI - - - UI - - - Changeinfo - - - Changeinfo - - - Changeinfo - - - Changeinfo - - - Changeinfo - - - Changeinfo - - - - - - - - - - - - - - - - - - - - Miranda Bits - - - - \ No newline at end of file diff --git a/protocols/IcqOscarJ/src/UI/askauthentication.cpp b/protocols/IcqOscarJ/src/UI/askauthentication.cpp deleted file mode 100644 index 508478801f..0000000000 --- a/protocols/IcqOscarJ/src/UI/askauthentication.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede -// Copyright © 2001-2002 Jon Keating, Richard Hughes -// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater -// Copyright © 2004-2008 Joe Kucera -// Copyright © 2012-2014 Miranda NG Team -// -// 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 "icqoscar.h" - -struct AskAuthParam -{ - CIcqProto* ppro; - MCONTACT hContact; -}; - -static INT_PTR CALLBACK AskAuthProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - AskAuthParam* dat = (AskAuthParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - - switch (msg) { - case WM_INITDIALOG: - dat = (AskAuthParam*)lParam; - if (!dat->hContact || !dat->ppro->icqOnline()) - EndDialog(hwndDlg, 0); - - TranslateDialogDefault(hwndDlg); - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); - SendDlgItemMessage(hwndDlg, IDC_EDITAUTH, EM_LIMITTEXT, (WPARAM)255, 0); - SetDlgItemText(hwndDlg, IDC_EDITAUTH, TranslateT("Please authorize me to add you to my contact list.")); - return TRUE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - if (dat->ppro->icqOnline()) - { - DWORD dwUin; - uid_str szUid; - if ( dat->ppro->getContactUid(dat->hContact, &dwUin, &szUid)) - return TRUE; // Invalid contact - - char* szReason = GetDlgItemTextUtf(hwndDlg, IDC_EDITAUTH); - dat->ppro->icq_sendAuthReqServ(dwUin, szUid, szReason); - SAFE_FREE((void**)&szReason); - - // auth bug fix (thx Bio) - if (dat->ppro->m_bSsiEnabled && dwUin) - dat->ppro->resetServContactAuthState(dat->hContact); - - EndDialog(hwndDlg, 0); - } - return TRUE; - - case IDCANCEL: - EndDialog(hwndDlg, 0); - return TRUE; - } - - break; - - case WM_CLOSE: - EndDialog(hwndDlg,0); - return TRUE; - } - - return FALSE; -} - -INT_PTR CIcqProto::RequestAuthorization(WPARAM wParam, LPARAM) -{ - AskAuthParam param = { this, wParam }; - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ASKAUTH), NULL, AskAuthProc, (LPARAM)¶m); - return 0; -} diff --git a/protocols/IcqOscarJ/src/UI/icqoscar.h b/protocols/IcqOscarJ/src/UI/icqoscar.h deleted file mode 100644 index 77283f6f7f..0000000000 --- a/protocols/IcqOscarJ/src/UI/icqoscar.h +++ /dev/null @@ -1,2 +0,0 @@ -/* For MinGW sake */ -#include "../icqoscar.h" diff --git a/protocols/IcqOscarJ/src/UI/loginpassword.cpp b/protocols/IcqOscarJ/src/UI/loginpassword.cpp deleted file mode 100644 index 0d21873878..0000000000 --- a/protocols/IcqOscarJ/src/UI/loginpassword.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede -// Copyright © 2001-2002 Jon Keating, Richard Hughes -// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater -// Copyright © 2004-2009 Joe Kucera -// Copyright © 2012-2014 Miranda NG Team -// -// 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 "icqoscar.h" - -INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - CIcqProto* ppro = (CIcqProto*)GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); - - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - - ppro = (CIcqProto*)lParam; - SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam ); - - SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon, true)); - SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon)); - { - DWORD dwUin = ppro->getContactUin(NULL); - - TCHAR pszUIN[MAX_PATH]; - mir_sntprintf(pszUIN, SIZEOF(pszUIN), TranslateT("Enter a password for UIN %u:"), dwUin); - SetDlgItemText(hwndDlg, IDC_INSTRUCTION, pszUIN); - - SendDlgItemMessage(hwndDlg, IDC_LOGINPW, EM_LIMITTEXT, PASSWORDMAXLEN - 1, 0); - - CheckDlgButton(hwndDlg, IDC_SAVEPASS, ppro->getByte("RememberPass", 0) ? BST_CHECKED : BST_UNCHECKED); - } - break; - - case WM_DESTROY: - Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_BIG, 0)); - Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0)); - break; - - case WM_CLOSE: - EndDialog(hwndDlg, 0); - break; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - ppro->m_bRememberPwd = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SAVEPASS); - ppro->setByte("RememberPass", ppro->m_bRememberPwd); - - GetDlgItemTextA(hwndDlg, IDC_LOGINPW, ppro->m_szPassword, SIZEOF(ppro->m_szPassword)); - - ppro->icq_login(ppro->m_szPassword); - - EndDialog(hwndDlg, IDOK); - break; - - case IDCANCEL: - ppro->SetCurrentStatus(ID_STATUS_OFFLINE); - EndDialog(hwndDlg, IDCANCEL); - break; - } - break; - } - - return FALSE; -} - -void CIcqProto::RequestPassword() -{ - DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_LOGINPW), NULL, LoginPasswdDlgProc, LPARAM(this)); -} diff --git a/protocols/IcqOscarJ/src/UI/userinfotab.cpp b/protocols/IcqOscarJ/src/UI/userinfotab.cpp deleted file mode 100644 index 322019553f..0000000000 --- a/protocols/IcqOscarJ/src/UI/userinfotab.cpp +++ /dev/null @@ -1,291 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede -// Copyright © 2001-2002 Jon Keating, Richard Hughes -// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater -// Copyright © 2004-2010 Joe Kucera -// Copyright © 2012-2014 Miranda NG Team -// -// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// ----------------------------------------------------------------------------- -// DESCRIPTION: -// -// Code for User details ICQ specific pages -// ----------------------------------------------------------------------------- - -#include "icqoscar.h" - -#define SVS_NORMAL 0 -#define SVS_ZEROISUNSPEC 2 -#define SVS_IP 3 -#define SVS_SIGNED 6 -#define SVS_ICQVERSION 8 -#define SVS_TIMESTAMP 9 -#define SVS_STATUSID 10 - -extern const char *nameXStatus[]; - -///////////////////////////////////////////////////////////////////////////////////////// - -static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContact, char* szModule, char* szSetting, int special) -{ - DBVARIANT dbv = { 0 }; - char str[MAX_PATH]; - char* pstr = NULL; - int unspecified = 0; - int bUtf = 0, bDbv = 0, bAlloc = 0; - - dbv.type = DBVT_DELETED; - - if ((hContact == NULL) && ((int)szModule < 0x100)) { - dbv.type = (BYTE)szModule; - - switch ((int)szModule) { - case DBVT_BYTE: - dbv.cVal = (BYTE)szSetting; - break; - case DBVT_WORD: - dbv.wVal = (WORD)szSetting; - break; - case DBVT_DWORD: - dbv.dVal = (DWORD)szSetting; - break; - case DBVT_ASCIIZ: - dbv.pszVal = pstr = szSetting; - break; - default: - unspecified = 1; - dbv.type = DBVT_DELETED; - } - } - else { - if (szModule == NULL) - unspecified = 1; - else { - unspecified = db_get(hContact, szModule, szSetting, &dbv); - bDbv = 1; - } - } - - if (!unspecified) { - switch (dbv.type) { - case DBVT_BYTE: - unspecified = (special == SVS_ZEROISUNSPEC && dbv.bVal == 0); - pstr = _itoa(special == SVS_SIGNED ? dbv.cVal : dbv.bVal, str, 10); - break; - - case DBVT_WORD: - if (special == SVS_ICQVERSION) { - if (dbv.wVal != 0) { - char szExtra[80]; - - mir_snprintf(str, SIZEOF(str), "%d", dbv.wVal); - pstr = str; - - if (hContact && ppro->IsDirectConnectionOpen(hContact, DIRECTCONN_STANDARD, 1)) { - ICQTranslateUtfStatic(LPGEN(" (DC Established)"), szExtra, SIZEOF(szExtra)); - strcat(str, (char*)szExtra); - bUtf = 1; - } - } - else - unspecified = 1; - } - else if (special == SVS_STATUSID) { - char *pszStatus = MirandaStatusToStringUtf(dbv.wVal); - BYTE bXStatus = ppro->getContactXStatus(hContact); - - if (bXStatus) { - char *pXName = ppro->getSettingStringUtf(hContact, DBSETTING_XSTATUS_NAME, NULL); - if (pXName == NULL) // give default name - pXName = ICQTranslateUtf(nameXStatus[bXStatus - 1]); - - mir_snprintf(str, SIZEOF(str), "%s (%s)", pszStatus, pXName); - SAFE_FREE((void**)&pXName); - } - else strncpy_s(str, pszStatus, _TRUNCATE); - - bUtf = 1; - SAFE_FREE(&pszStatus); - pstr = str; - unspecified = 0; - } - else { - unspecified = (special == SVS_ZEROISUNSPEC && dbv.wVal == 0); - pstr = _itoa(special == SVS_SIGNED ? dbv.sVal : dbv.wVal, str, 10); - } - break; - - case DBVT_DWORD: - unspecified = (special == SVS_ZEROISUNSPEC && dbv.dVal == 0); - if (special == SVS_IP) { - struct in_addr ia; - ia.S_un.S_addr = htonl(dbv.dVal); - pstr = inet_ntoa(ia); - if (dbv.dVal == 0) - unspecified = 1; - } - else if (special == SVS_TIMESTAMP) { - if (dbv.dVal == 0) - unspecified = 1; - else - pstr = time2text(dbv.dVal); - } - else - pstr = _itoa(special == SVS_SIGNED ? dbv.lVal : dbv.dVal, str, 10); - break; - - case DBVT_ASCIIZ: - case DBVT_WCHAR: - unspecified = (special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0'); - if (!unspecified && pstr != szSetting) { - pstr = ppro->getSettingStringUtf(hContact, szModule, szSetting, NULL); - bUtf = 1; - bAlloc = 1; - } - if (idCtrl == IDC_UIN) - SetDlgItemText(hwndDlg, IDC_UINSTATIC, TranslateT("ScreenName:")); - break; - - default: - pstr = str; - strcpy(str, "???"); - break; - } - } - - EnableDlgItem(hwndDlg, idCtrl, !unspecified); - if (unspecified) - SetDlgItemText(hwndDlg, idCtrl, TranslateT("")); - else if (bUtf) - SetDlgItemTextUtf(hwndDlg, idCtrl, pstr); - else - SetDlgItemTextA(hwndDlg, idCtrl, pstr); - - if (bDbv) - db_free(&dbv); - - if (bAlloc) - SAFE_FREE(&pstr); -} - -///////////////////////////////////////////////////////////////////////////////////////// - -static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - break; - - case WM_NOTIFY: - switch (((LPNMHDR)lParam)->idFrom) { - case 0: - switch (((LPNMHDR)lParam)->code) { - case PSN_PARAMCHANGED: - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, ((PSHNOTIFY*)lParam)->lParam); - break; - - case PSN_INFOCHANGED: - CIcqProto* ppro = (CIcqProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - if (!ppro) - break; - - char* szProto; - MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam; - - if (hContact == NULL) - szProto = ppro->m_szModuleName; - else - szProto = GetContactProto(hContact); - - if (!szProto) - break; - - SetValue(ppro, hwndDlg, IDC_UIN, hContact, szProto, UNIQUEIDSETTING, SVS_NORMAL); - SetValue(ppro, hwndDlg, IDC_ONLINESINCE, hContact, szProto, "LogonTS", SVS_TIMESTAMP); - SetValue(ppro, hwndDlg, IDC_IDLETIME, hContact, szProto, "IdleTS", SVS_TIMESTAMP); - SetValue(ppro, hwndDlg, IDC_IP, hContact, szProto, "IP", SVS_IP); - SetValue(ppro, hwndDlg, IDC_REALIP, hContact, szProto, "RealIP", SVS_IP); - - if (hContact) { - SetValue(ppro, hwndDlg, IDC_PORT, hContact, szProto, "UserPort", SVS_ZEROISUNSPEC); - SetValue(ppro, hwndDlg, IDC_VERSION, hContact, szProto, "Version", SVS_ICQVERSION); - SetValue(ppro, hwndDlg, IDC_MIRVER, hContact, szProto, "MirVer", SVS_ZEROISUNSPEC); - if (ppro->getByte(hContact, "ClientID", 0)) - ppro->setDword(hContact, "TickTS", 0); - SetValue(ppro, hwndDlg, IDC_SYSTEMUPTIME, hContact, szProto, "TickTS", SVS_TIMESTAMP); - SetValue(ppro, hwndDlg, IDC_STATUS, hContact, szProto, "Status", SVS_STATUSID); - } - else { - char str[MAX_PATH]; - WORD v[4]; - CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v); - mir_snprintf(str, SIZEOF(str), "Miranda NG %d.%d.%d.%d (ICQ %s)", v[0], v[1], v[2], v[3], __VERSION_STRING_DOTS); - - SetValue(ppro, hwndDlg, IDC_PORT, hContact, (char*)DBVT_WORD, (char*)ppro->wListenPort, SVS_ZEROISUNSPEC); - SetValue(ppro, hwndDlg, IDC_VERSION, hContact, (char*)DBVT_WORD, (char*)ICQ_VERSION, SVS_ICQVERSION); - SetValue(ppro, hwndDlg, IDC_MIRVER, hContact, (char*)DBVT_ASCIIZ, str, SVS_ZEROISUNSPEC); - SetDlgItemText(hwndDlg, IDC_SUPTIME, TranslateT("Member since:")); - SetValue(ppro, hwndDlg, IDC_SYSTEMUPTIME, hContact, szProto, "MemberTS", SVS_TIMESTAMP); - SetValue(ppro, hwndDlg, IDC_STATUS, hContact, (char*)DBVT_WORD, (char*)ppro->m_iStatus, SVS_STATUSID); - } - } - } - break; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDCANCEL: - SendMessage(GetParent(hwndDlg), msg, wParam, lParam); - break; - } - break; - } - - return FALSE; -} - -///////////////////////////////////////////////////////////////////////////////////////// - -int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) -{ - if ((!IsICQContact(lParam)) && lParam) - return 0; - - OPTIONSDIALOGPAGE odp = { 0 }; - odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE; - odp.hInstance = hInst; - odp.dwInitParam = LPARAM(this); - odp.pfnDlgProc = IcqDlgProc; - odp.position = -1900000000; - odp.ptszTitle = m_tszUserName; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_ICQ); - UserInfo_AddPage(wParam, &odp); - - if (!lParam) { - TCHAR buf[200]; - mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s Details"), m_tszUserName); - odp.ptszTitle = buf; - - odp.position = -1899999999; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_CHANGEINFO); - odp.pfnDlgProc = ChangeInfoDlgProc; - UserInfo_AddPage(wParam, &odp); - } - return 0; -} diff --git a/protocols/IcqOscarJ/src/askauthentication.cpp b/protocols/IcqOscarJ/src/askauthentication.cpp new file mode 100644 index 0000000000..1e8927ae12 --- /dev/null +++ b/protocols/IcqOscarJ/src/askauthentication.cpp @@ -0,0 +1,92 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede +// Copyright © 2001-2002 Jon Keating, Richard Hughes +// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater +// Copyright © 2004-2008 Joe Kucera +// Copyright © 2012-2014 Miranda NG Team +// +// 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 "stdafx.h" + +struct AskAuthParam +{ + CIcqProto* ppro; + MCONTACT hContact; +}; + +static INT_PTR CALLBACK AskAuthProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + AskAuthParam* dat = (AskAuthParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + + switch (msg) { + case WM_INITDIALOG: + dat = (AskAuthParam*)lParam; + if (!dat->hContact || !dat->ppro->icqOnline()) + EndDialog(hwndDlg, 0); + + TranslateDialogDefault(hwndDlg); + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); + SendDlgItemMessage(hwndDlg, IDC_EDITAUTH, EM_LIMITTEXT, (WPARAM)255, 0); + SetDlgItemText(hwndDlg, IDC_EDITAUTH, TranslateT("Please authorize me to add you to my contact list.")); + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + if (dat->ppro->icqOnline()) + { + DWORD dwUin; + uid_str szUid; + if ( dat->ppro->getContactUid(dat->hContact, &dwUin, &szUid)) + return TRUE; // Invalid contact + + char* szReason = GetDlgItemTextUtf(hwndDlg, IDC_EDITAUTH); + dat->ppro->icq_sendAuthReqServ(dwUin, szUid, szReason); + SAFE_FREE((void**)&szReason); + + // auth bug fix (thx Bio) + if (dat->ppro->m_bSsiEnabled && dwUin) + dat->ppro->resetServContactAuthState(dat->hContact); + + EndDialog(hwndDlg, 0); + } + return TRUE; + + case IDCANCEL: + EndDialog(hwndDlg, 0); + return TRUE; + } + + break; + + case WM_CLOSE: + EndDialog(hwndDlg,0); + return TRUE; + } + + return FALSE; +} + +INT_PTR CIcqProto::RequestAuthorization(WPARAM wParam, LPARAM) +{ + AskAuthParam param = { this, wParam }; + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_ASKAUTH), NULL, AskAuthProc, (LPARAM)¶m); + return 0; +} diff --git a/protocols/IcqOscarJ/src/capabilities.cpp b/protocols/IcqOscarJ/src/capabilities.cpp index 814b531582..06abb24da0 100644 --- a/protocols/IcqOscarJ/src/capabilities.cpp +++ b/protocols/IcqOscarJ/src/capabilities.cpp @@ -32,7 +32,7 @@ // adding process too much. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" struct icq_capability { diff --git a/protocols/IcqOscarJ/src/chan_01login.cpp b/protocols/IcqOscarJ/src/chan_01login.cpp index fe221e93a1..a4fc4cbced 100644 --- a/protocols/IcqOscarJ/src/chan_01login.cpp +++ b/protocols/IcqOscarJ/src/chan_01login.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleLoginChannel(BYTE*, size_t, serverthread_info *info) { diff --git a/protocols/IcqOscarJ/src/chan_02data.cpp b/protocols/IcqOscarJ/src/chan_02data.cpp index 3a14ef1efd..47ebe5c819 100644 --- a/protocols/IcqOscarJ/src/chan_02data.cpp +++ b/protocols/IcqOscarJ/src/chan_02data.cpp @@ -27,7 +27,7 @@ // Handle channel 2 (Data) packets // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleDataChannel(BYTE *pBuffer, size_t wBufferLength, serverthread_info *info) { diff --git a/protocols/IcqOscarJ/src/chan_03error.cpp b/protocols/IcqOscarJ/src/chan_03error.cpp index 1c2d4d62eb..5b9aa26429 100644 --- a/protocols/IcqOscarJ/src/chan_03error.cpp +++ b/protocols/IcqOscarJ/src/chan_03error.cpp @@ -22,7 +22,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleErrorChannel(unsigned char*, size_t) { diff --git a/protocols/IcqOscarJ/src/chan_04close.cpp b/protocols/IcqOscarJ/src/chan_04close.cpp index 3c774e5ce0..c9d4157f8e 100644 --- a/protocols/IcqOscarJ/src/chan_04close.cpp +++ b/protocols/IcqOscarJ/src/chan_04close.cpp @@ -22,7 +22,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleCloseChannel(BYTE *buf, size_t datalen, serverthread_info *info) { diff --git a/protocols/IcqOscarJ/src/chan_05ping.cpp b/protocols/IcqOscarJ/src/chan_05ping.cpp index 61aaf61138..9fbd97414d 100644 --- a/protocols/IcqOscarJ/src/chan_05ping.cpp +++ b/protocols/IcqOscarJ/src/chan_05ping.cpp @@ -22,7 +22,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handlePingChannel(BYTE*, size_t) { diff --git a/protocols/IcqOscarJ/src/changeinfo.h b/protocols/IcqOscarJ/src/changeinfo.h new file mode 100644 index 0000000000..0497f288fd --- /dev/null +++ b/protocols/IcqOscarJ/src/changeinfo.h @@ -0,0 +1,121 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2001-2004 Richard Hughes, Martin Öberg +// Copyright © 2004-2010 Joe Kucera, Bio +// Copyright © 2012-2014 Miranda NG Team +// +// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// ----------------------------------------------------------------------------- +// DESCRIPTION: +// +// ChangeInfo Plugin stuff +// ----------------------------------------------------------------------------- + +#ifndef __CHANGEINFO_H +#define __CHANGEINFO_H + + +#ifndef AW_SLIDE +#define SPI_GETCOMBOBOXANIMATION 0x1004 +#define AW_SLIDE 0x40000 +#define AW_ACTIVATE 0x20000 +#define AW_VER_POSITIVE 0x4 +#define UDM_SETPOS32 (WM_USER+113) +#define UDM_GETPOS32 (WM_USER+114) +#endif + + +#define LI_DIVIDER 0 +#define LI_STRING 1 +#define LI_LIST 2 +#define LI_LONGSTRING 3 +#define LI_NUMBER 4 +#define LIM_TYPE 0x0000FFFF +#define LIF_ZEROISVALID 0x80000000 +#define LIF_SIGNED 0x40000000 +#define LIF_PASSWORD 0x20000000 +#define LIF_CHANGEONLY 0x10000000 + +struct SettingItem +{ + const char *szDescription; + unsigned displayType; //LI_ constant + int dbType; //DBVT_ constant + const char *szDbSetting; + const void *pList; +}; + +struct SettingItemData +{ + LPARAM value; + int changed; +}; + +// contants.c +extern const SettingItem setting[]; +extern const int settingCount; + +//dlgproc.c +struct ChangeInfoData : public MZeroedObject +{ + HWND hwndDlg; + CIcqProto *ppro; + HFONT hListFont; + HWND hwndList; + int editTopIndex; + int iEditItem; + char Password[PASSWORDMAXLEN]; + + SettingItemData *settingData; + + HANDLE hAckHook; + HANDLE hUpload[2]; + + ChangeInfoData() { settingData = (SettingItemData*)SAFE_MALLOC(sizeof(SettingItemData) * settingCount); hAckHook = NULL; hUpload[0] = NULL; hUpload[1] = NULL;} + ~ChangeInfoData() { SAFE_FREE((void**)&settingData); } + + char* GetItemSettingText(int i, char *buf, size_t buf_size); + void PaintItemSetting(HDC hdc, RECT *rc, int i, UINT itemState); + + //db.cpp + void LoadSettingsFromDb(int keepChanged); + void FreeStoredDbSettings(void); + int ChangesMade(void); + void ClearChangeFlags(void); + int SaveSettingsToDb(HWND hwndDlg); + + //upload.cpp + int UploadSettings(void); + + //editstring.cpp + void BeginStringEdit(int iItem,RECT *rc,int i,WORD wVKey); + void EndStringEdit(int save); + //editlist.cpp + void BeginListEdit(int iItem, RECT *rc, int iSetting, WORD wVKey); + void EndListEdit(int save); +}; + +INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + +//editstring.c +int IsStringEditWindow(HWND hwnd); +char* BinaryToEscapes(char *str); + +//editlist.c +int IsListEditWindow(HWND hwnd); + +#endif /* __CHANGEINFO_H */ diff --git a/protocols/IcqOscarJ/src/changeinfo/changeinfo.h b/protocols/IcqOscarJ/src/changeinfo/changeinfo.h deleted file mode 100644 index 0497f288fd..0000000000 --- a/protocols/IcqOscarJ/src/changeinfo/changeinfo.h +++ /dev/null @@ -1,121 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2001-2004 Richard Hughes, Martin Öberg -// Copyright © 2004-2010 Joe Kucera, Bio -// Copyright © 2012-2014 Miranda NG Team -// -// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// ----------------------------------------------------------------------------- -// DESCRIPTION: -// -// ChangeInfo Plugin stuff -// ----------------------------------------------------------------------------- - -#ifndef __CHANGEINFO_H -#define __CHANGEINFO_H - - -#ifndef AW_SLIDE -#define SPI_GETCOMBOBOXANIMATION 0x1004 -#define AW_SLIDE 0x40000 -#define AW_ACTIVATE 0x20000 -#define AW_VER_POSITIVE 0x4 -#define UDM_SETPOS32 (WM_USER+113) -#define UDM_GETPOS32 (WM_USER+114) -#endif - - -#define LI_DIVIDER 0 -#define LI_STRING 1 -#define LI_LIST 2 -#define LI_LONGSTRING 3 -#define LI_NUMBER 4 -#define LIM_TYPE 0x0000FFFF -#define LIF_ZEROISVALID 0x80000000 -#define LIF_SIGNED 0x40000000 -#define LIF_PASSWORD 0x20000000 -#define LIF_CHANGEONLY 0x10000000 - -struct SettingItem -{ - const char *szDescription; - unsigned displayType; //LI_ constant - int dbType; //DBVT_ constant - const char *szDbSetting; - const void *pList; -}; - -struct SettingItemData -{ - LPARAM value; - int changed; -}; - -// contants.c -extern const SettingItem setting[]; -extern const int settingCount; - -//dlgproc.c -struct ChangeInfoData : public MZeroedObject -{ - HWND hwndDlg; - CIcqProto *ppro; - HFONT hListFont; - HWND hwndList; - int editTopIndex; - int iEditItem; - char Password[PASSWORDMAXLEN]; - - SettingItemData *settingData; - - HANDLE hAckHook; - HANDLE hUpload[2]; - - ChangeInfoData() { settingData = (SettingItemData*)SAFE_MALLOC(sizeof(SettingItemData) * settingCount); hAckHook = NULL; hUpload[0] = NULL; hUpload[1] = NULL;} - ~ChangeInfoData() { SAFE_FREE((void**)&settingData); } - - char* GetItemSettingText(int i, char *buf, size_t buf_size); - void PaintItemSetting(HDC hdc, RECT *rc, int i, UINT itemState); - - //db.cpp - void LoadSettingsFromDb(int keepChanged); - void FreeStoredDbSettings(void); - int ChangesMade(void); - void ClearChangeFlags(void); - int SaveSettingsToDb(HWND hwndDlg); - - //upload.cpp - int UploadSettings(void); - - //editstring.cpp - void BeginStringEdit(int iItem,RECT *rc,int i,WORD wVKey); - void EndStringEdit(int save); - //editlist.cpp - void BeginListEdit(int iItem, RECT *rc, int iSetting, WORD wVKey); - void EndListEdit(int save); -}; - -INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); - -//editstring.c -int IsStringEditWindow(HWND hwnd); -char* BinaryToEscapes(char *str); - -//editlist.c -int IsListEditWindow(HWND hwnd); - -#endif /* __CHANGEINFO_H */ diff --git a/protocols/IcqOscarJ/src/changeinfo/constants.cpp b/protocols/IcqOscarJ/src/changeinfo/constants.cpp deleted file mode 100644 index 1d908307ee..0000000000 --- a/protocols/IcqOscarJ/src/changeinfo/constants.cpp +++ /dev/null @@ -1,131 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2001-2004 Richard Hughes, Martin Öberg -// Copyright © 2004-2009 Joe Kucera, Bio -// Copyright © 2012-2014 Miranda NG Team -// -// 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. -// ----------------------------------------------------------------------------- -// DESCRIPTION: -// -// ChangeInfo Plugin stuff -// ----------------------------------------------------------------------------- - -#include "icqoscar.h" - -static FieldNamesItem months[] = { - { 1, LPGEN("January") }, - { 2, LPGEN("February") }, - { 3, LPGEN("March") }, - { 4, LPGEN("April") }, - { 5, LPGEN("May") }, - { 6, LPGEN("June") }, - { 7, LPGEN("July") }, - { 8, LPGEN("August") }, - { 9, LPGEN("September") }, - { 10, LPGEN("October") }, - { 11, LPGEN("November") }, - { 12, LPGEN("December") }, - { 0, NULL } -}; - -const int ageRange[] = { 13, 0x7FFF }; // 14, 130 -const int yearRange[] = { 1753, 0x7FFF }; // 1880, 2000 -const int dayRange[] = { 1, 31 }; - -const SettingItem setting[] = -{ - // personal - { LPGEN("Personal"), LI_DIVIDER }, - { LPGEN("Nickname"), LI_STRING, DBVT_UTF8, "Nick" }, - { LPGEN("First name"), LI_STRING, DBVT_UTF8, "FirstName" }, - { LPGEN("Last name"), LI_STRING, DBVT_UTF8, "LastName" }, - { LPGEN("Gender"), LI_LIST, DBVT_BYTE, "Gender", genderField }, - { LPGEN("About"), LI_LONGSTRING, DBVT_UTF8, "About" }, - - // password - { LPGEN("Password"), LI_DIVIDER }, - { LPGEN("Password"), LI_STRING | LIF_PASSWORD, DBVT_UTF8, "Password" }, - - // contact - { LPGEN("Contact"), LI_DIVIDER }, - { LPGEN("Primary e-mail"), LI_STRING, DBVT_UTF8, "e-mail0" }, - { LPGEN("Secondary e-mail"), LI_STRING, DBVT_UTF8, "e-mail1" }, - { LPGEN("Tertiary e-mail"), LI_STRING, DBVT_UTF8, "e-mail2" }, - { LPGEN("Homepage"), LI_STRING, DBVT_UTF8, "Homepage" }, - { LPGEN("Street"), LI_STRING, DBVT_UTF8, "Street" }, - { LPGEN("City"), LI_STRING, DBVT_UTF8, "City" }, - { LPGEN("State"), LI_STRING, DBVT_UTF8, "State" }, - { LPGEN("ZIP/postcode"), LI_STRING, DBVT_UTF8, "ZIP" }, - { LPGEN("Country"), LI_LIST, DBVT_WORD, "Country", countryField }, - { LPGEN("Phone number"), LI_STRING, DBVT_UTF8, "Phone" }, - { LPGEN("Fax number"), LI_STRING, DBVT_UTF8, "Fax" }, - { LPGEN("Cellular number"), LI_STRING, DBVT_UTF8, "Cellular" }, - - // more - { LPGEN("Personal Detail"), LI_DIVIDER }, - { LPGEN("Timezone"), LI_LIST | LIF_ZEROISVALID | LIF_SIGNED, DBVT_BYTE, "Timezone", timezonesField }, - { LPGEN("Year of birth"), LI_NUMBER, DBVT_WORD, "BirthYear", yearRange }, - { LPGEN("Month of birth"), LI_LIST, DBVT_BYTE, "BirthMonth", months }, - { LPGEN("Day of birth"), LI_NUMBER, DBVT_BYTE, "BirthDay", dayRange }, - { LPGEN("Marital Status"), LI_LIST, DBVT_BYTE, "MaritalStatus", maritalField }, - { LPGEN("Spoken language 1"), LI_LIST, DBVT_BYTE, "Language1", languageField }, - { LPGEN("Spoken language 2"), LI_LIST, DBVT_BYTE, "Language2", languageField }, - { LPGEN("Spoken language 3"), LI_LIST, DBVT_BYTE, "Language3", languageField }, - - // more - { LPGEN("Originally from"), LI_DIVIDER }, - { LPGEN("Street"), LI_STRING, DBVT_UTF8, "OriginStreet" }, - { LPGEN("City"), LI_STRING, DBVT_UTF8, "OriginCity" }, - { LPGEN("State"), LI_STRING, DBVT_UTF8, "OriginState" }, - { LPGEN("Country"), LI_LIST, DBVT_WORD, "OriginCountry", countryField }, - - // study - { LPGEN("Education"), LI_DIVIDER }, - { LPGEN("Level"), LI_LIST, DBVT_WORD, "StudyLevel", studyLevelField }, - { LPGEN("Institute"), LI_STRING, DBVT_UTF8, "StudyInstitute" }, - { LPGEN("Degree"), LI_STRING, DBVT_UTF8, "StudyDegree" }, - { LPGEN("Graduation Year"), LI_NUMBER, DBVT_WORD, "StudyYear", yearRange }, - - // work - { LPGEN("Work"), LI_DIVIDER }, - { LPGEN("Company name"), LI_STRING, DBVT_UTF8, "Company" }, - { LPGEN("Company homepage"), LI_STRING, DBVT_UTF8, "CompanyHomepage" }, - { LPGEN("Company street"), LI_STRING, DBVT_UTF8, "CompanyStreet" }, - { LPGEN("Company city"), LI_STRING, DBVT_UTF8, "CompanyCity" }, - { LPGEN("Company state"), LI_STRING, DBVT_UTF8, "CompanyState" }, - { LPGEN("Company phone"), LI_STRING, DBVT_UTF8, "CompanyPhone" }, - { LPGEN("Company fax"), LI_STRING, DBVT_UTF8, "CompanyFax" }, - { LPGEN("Company ZIP/postcode"), LI_STRING, DBVT_UTF8, "CompanyZIP" }, - { LPGEN("Company country"), LI_LIST, DBVT_WORD, "CompanyCountry", countryField }, - { LPGEN("Company department"), LI_STRING, DBVT_UTF8, "CompanyDepartment" }, - { LPGEN("Company position"), LI_STRING, DBVT_UTF8, "CompanyPosition" }, - { LPGEN("Company industry"), LI_LIST, DBVT_WORD, "CompanyIndustry", industryField }, - - //interests - { LPGEN("Personal Interests"), LI_DIVIDER }, - { LPGEN("Interest category 1"), LI_LIST, DBVT_WORD, "Interest0Cat", interestsField }, - { LPGEN("Interest areas 1"), LI_STRING, DBVT_UTF8, "Interest0Text" }, - { LPGEN("Interest category 2"), LI_LIST, DBVT_WORD, "Interest1Cat", interestsField }, - { LPGEN("Interest areas 2"), LI_STRING, DBVT_UTF8, "Interest1Text" }, - { LPGEN("Interest category 3"), LI_LIST, DBVT_WORD, "Interest2Cat", interestsField }, - { LPGEN("Interest areas 3"), LI_STRING, DBVT_UTF8, "Interest2Text" }, - { LPGEN("Interest category 4"), LI_LIST, DBVT_WORD, "Interest3Cat", interestsField }, - { LPGEN("Interest areas 4"), LI_STRING, DBVT_UTF8, "Interest3Text" }, -}; - -const int settingCount = SIZEOF(setting); diff --git a/protocols/IcqOscarJ/src/changeinfo/db.cpp b/protocols/IcqOscarJ/src/changeinfo/db.cpp deleted file mode 100644 index 963ed4eb4c..0000000000 --- a/protocols/IcqOscarJ/src/changeinfo/db.cpp +++ /dev/null @@ -1,220 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2001-2004 Richard Hughes, Martin Öberg -// Copyright © 2004-2009 Joe Kucera, Bio -// Copyright © 2012-2014 Miranda NG Team -// -// 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. -// ----------------------------------------------------------------------------- -// DESCRIPTION: -// -// ChangeInfo Plugin stuff -// ----------------------------------------------------------------------------- - -#include "icqoscar.h" - -void ChangeInfoData::LoadSettingsFromDb(int keepChanged) -{ - for (int i = 0; i < settingCount; i++) { - const SettingItem &si = setting[i]; - if (si.displayType == LI_DIVIDER) - continue; - - SettingItemData &sid = settingData[i]; - if (keepChanged && sid.changed) - continue; - - if (si.dbType == DBVT_ASCIIZ || si.dbType == DBVT_UTF8) - SAFE_FREE((void**)(char**)&sid.value); - else if (!keepChanged) - sid.value = 0; - - sid.changed = 0; - - if (si.displayType & LIF_PASSWORD) - continue; - - DBVARIANT dbv = { DBVT_DELETED }; - if (!ppro->getSetting(NULL, si.szDbSetting, &dbv)) { - switch (dbv.type) { - case DBVT_ASCIIZ: - sid.value = (LPARAM)ppro->getSettingStringUtf(NULL, si.szDbSetting, NULL); - break; - - case DBVT_UTF8: - sid.value = (LPARAM)null_strdup(dbv.pszVal); - break; - - case DBVT_WORD: - if (si.displayType & LIF_SIGNED) - sid.value = dbv.sVal; - else - sid.value = dbv.wVal; - break; - - case DBVT_BYTE: - if (si.displayType & LIF_SIGNED) - sid.value = dbv.cVal; - else - sid.value = dbv.bVal; - break; - -#ifdef _DEBUG - default: - MessageBoxA(NULL, "That's not supposed to happen either", "Huh?", MB_OK); - break; -#endif - } - db_free(&dbv); - } - - char buf[MAX_PATH]; - TCHAR tbuf[MAX_PATH]; - - if (utf8_to_tchar_static(GetItemSettingText(i, buf, SIZEOF(buf)), tbuf, SIZEOF(tbuf))) - ListView_SetItemText(hwndList, i, 1, tbuf); - } -} - -void ChangeInfoData::FreeStoredDbSettings(void) -{ - for (int i = 0; i < settingCount; i++) - if (setting[i].dbType == DBVT_ASCIIZ || setting[i].dbType == DBVT_UTF8) - SAFE_FREE((void**)&settingData[i].value); -} - -int ChangeInfoData::ChangesMade(void) -{ - for (int i = 0; i < settingCount; i++) - if (settingData[i].changed) - return 1; - return 0; -} - -void ChangeInfoData::ClearChangeFlags(void) -{ - for (int i = 0; i < settingCount; i++) - settingData[i].changed = 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// - -struct PwConfirmDlgParam -{ - CIcqProto* ppro; - char* Pass; -}; - -static INT_PTR CALLBACK PwConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - PwConfirmDlgParam* dat = (PwConfirmDlgParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); - SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_LIMITTEXT, 15, 0); - return TRUE; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDOK: - { - char szTest[16]; - - GetDlgItemTextA(hwndDlg, IDC_OLDPASS, szTest, SIZEOF(szTest)); - - if (strcmpnull(szTest, dat->ppro->GetUserPassword(TRUE))) { - MessageBox(hwndDlg, TranslateT("The password does not match your current password. Check Caps Lock and try again."), TranslateT("Change ICQ Details"), MB_OK); - SendDlgItemMessage(hwndDlg, IDC_OLDPASS, EM_SETSEL, 0, (LPARAM)-1); - SetFocus(GetDlgItem(hwndDlg, IDC_OLDPASS)); - break; - } - - GetDlgItemTextA(hwndDlg, IDC_PASSWORD, szTest, SIZEOF(szTest)); - if (strcmpnull(szTest, dat->Pass)) { - MessageBox(hwndDlg, TranslateT("The password does not match the password you originally entered. Check Caps Lock and try again."), TranslateT("Change ICQ Details"), MB_OK); - SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_SETSEL, 0, (LPARAM)-1); - SetFocus(GetDlgItem(hwndDlg, IDC_PASSWORD)); - break; - } - } - case IDCANCEL: - EndDialog(hwndDlg, wParam); - break; - } - break; - } - return FALSE; -} - -int ChangeInfoData::SaveSettingsToDb(HWND hwndDlg) -{ - int ret = 1; - - for (int i = 0; i < settingCount; i++) { - SettingItemData &sid = settingData[i]; - if (!sid.changed) - continue; - - const SettingItem &si = setting[i]; - if (!(si.displayType & LIF_ZEROISVALID) && sid.value == 0) { - ppro->delSetting(si.szDbSetting); - continue; - } - switch (si.dbType) { - case DBVT_ASCIIZ: - if (si.displayType & LIF_PASSWORD) { - size_t nSettingLen = mir_strlen((char*)sid.value); - if (nSettingLen > 8 || nSettingLen < 1) { - MessageBox(hwndDlg, TranslateT("The ICQ server does not support passwords longer than 8 characters. Please use a shorter password."), TranslateT("Change ICQ Details"), MB_OK); - ret = 0; - break; - } - PwConfirmDlgParam param = { ppro, (char*)sid.value }; - if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_PWCONFIRM), hwndDlg, PwConfirmDlgProc, (LPARAM)¶m)) { - ret = 0; - break; - } - strcpy(ppro->m_szPassword, (char*)sid.value); - } - else { - if (*(char*)sid.value) - db_set_utf(NULL, ppro->m_szModuleName, si.szDbSetting, (char*)sid.value); - else - ppro->delSetting(si.szDbSetting); - } - break; - - case DBVT_UTF8: - if (*(char*)sid.value) - db_set_utf(NULL, ppro->m_szModuleName, si.szDbSetting, (char*)sid.value); - else - ppro->delSetting(si.szDbSetting); - break; - - case DBVT_WORD: - ppro->setWord(si.szDbSetting, (WORD)sid.value); - break; - - case DBVT_BYTE: - ppro->setByte(si.szDbSetting, (BYTE)sid.value); - break; - } - } - return ret; -} diff --git a/protocols/IcqOscarJ/src/changeinfo/dlgproc.cpp b/protocols/IcqOscarJ/src/changeinfo/dlgproc.cpp deleted file mode 100644 index ae11819142..0000000000 --- a/protocols/IcqOscarJ/src/changeinfo/dlgproc.cpp +++ /dev/null @@ -1,516 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2001-2004 Richard Hughes, Martin Öberg -// Copyright © 2004-2010 Joe Kucera, Bio -// Copyright © 2012-2014 Miranda NG Team -// -// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// ----------------------------------------------------------------------------- -// DESCRIPTION: -// -// ChangeInfo Plugin stuff -// ----------------------------------------------------------------------------- - -#include "icqoscar.h" - -#define DM_PROTOACK (WM_USER+10) - -static int DrawTextUtf(HDC hDC, char *text, LPRECT lpRect, UINT uFormat, LPSIZE lpSize) -{ - int res; - - WCHAR *tmp = make_unicode_string(text); - res = DrawTextW(hDC, tmp, -1, lpRect, uFormat); - if (lpSize) - GetTextExtentPoint32W(hDC, tmp, (int)mir_wstrlen(tmp), lpSize); - SAFE_FREE((void**)&tmp); - - return res; -} - -char* ChangeInfoData::GetItemSettingText(int i, char *buf, size_t bufsize) -{ - char *text = buf; - int alloced = 0; - - buf[0] = '\0'; - - const SettingItem &si = setting[i]; - SettingItemData &sid = settingData[i]; - if (sid.value == 0 && !(si.displayType & LIF_ZEROISVALID)) { - if (si.displayType & LIF_CHANGEONLY) - text = ICQTranslateUtfStatic(LPGEN(""), buf, bufsize); - else - text = ICQTranslateUtfStatic(LPGEN(""), buf, bufsize); - } - else { - switch (si.displayType & LIM_TYPE) { - case LI_STRING: - case LI_LONGSTRING: - text = BinaryToEscapes((char*)sid.value); - alloced = 1; - break; - - case LI_NUMBER: - _itoa(sid.value, text, 10); - break; - - case LI_LIST: - if (si.dbType == DBVT_ASCIIZ) - text = ICQTranslateUtfStatic((char*)sid.value, buf, bufsize); - else { - text = ICQTranslateUtfStatic(LPGEN("Unknown value"), buf, bufsize); - - FieldNamesItem *list = (FieldNamesItem*)si.pList; - if (list == timezonesField) { - HANDLE tz = tmi.createByContact(NULL, ppro->m_szModuleName, 0); - text = make_utf8_string_static(tmi.getTzDescription(tmi.getTzName(tz)), buf, bufsize); - break; - } - - for (int j = 0;; j++) { - if (list[j].code == sid.value) { - text = ICQTranslateUtfStatic(list[j].text, buf, bufsize); - break; - } - else if (!list[j].text) { - if (list[j].code == sid.value) - text = ICQTranslateUtfStatic("Unspecified", buf, bufsize); - break; - } - } - } - break; - } - } - - if (si.displayType & LIF_PASSWORD) { - if (sid.changed) { - for (int j = 0; text[j]; j++) - text[j] = '*'; - } - else { - if (alloced) { - SAFE_FREE(&text); - alloced = 0; - } - text = "********"; - } - } - if (text != buf) { - char *tmp = text; - - text = null_strcpy(buf, text, bufsize - 1); - if (alloced) - SAFE_FREE(&tmp); - } - - return text; -} - -void ChangeInfoData::PaintItemSetting(HDC hdc, RECT *rc, int i, UINT itemState) -{ - char str[MAX_PATH]; - char *text = GetItemSettingText(i, str, SIZEOF(str)); - - const SettingItem &si = setting[i]; - SettingItemData &sid = settingData[i]; - if (sid.value == 0 && !(si.displayType & LIF_ZEROISVALID)) - SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT)); - - if ((si.displayType & LIM_TYPE) == LI_LIST && (itemState & CDIS_SELECTED || iEditItem == i)) { - RECT rcBtn = *rc; - rcBtn.left = rcBtn.right - rc->bottom + rc->top; - InflateRect(&rcBtn, -2, -2); - rc->right = rcBtn.left; - DrawFrameControl(hdc, &rcBtn, DFC_SCROLL, iEditItem == i ? DFCS_SCROLLDOWN | DFCS_PUSHED : DFCS_SCROLLDOWN); - } - DrawTextUtf(hdc, text, rc, DT_END_ELLIPSIS | DT_LEFT | DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER, NULL); -} - -static int ChangeInfoDlg_Resize(HWND, LPARAM, UTILRESIZECONTROL *urc) -{ - switch (urc->wId) { - case IDC_LIST: - return RD_ANCHORX_WIDTH | RD_ANCHORY_HEIGHT; - - case IDC_SAVE: - return RD_ANCHORX_RIGHT | RD_ANCHORY_BOTTOM; - - case IDC_UPLOADING: - return RD_ANCHORX_WIDTH | RD_ANCHORY_BOTTOM; - } - - return RD_ANCHORX_LEFT | RD_ANCHORY_TOP; // default -} - - -INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - ChangeInfoData* dat = (ChangeInfoData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); - - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - - dat = new ChangeInfoData(); - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); - - dat->hwndDlg = hwndDlg; - dat->ppro = (CIcqProto*)lParam; - dat->hwndList = GetDlgItem(hwndDlg, IDC_LIST); - - ListView_SetExtendedListViewStyle(dat->hwndList, LVS_EX_FULLROWSELECT); - dat->iEditItem = -1; - { - dat->hListFont = (HFONT)SendMessage(dat->hwndList, WM_GETFONT, 0, 0); - - LOGFONT lf; - GetObject(dat->hListFont, sizeof(lf), &lf); - lf.lfHeight -= 5; - HFONT hFont = CreateFontIndirect(&lf); - SendMessage(dat->hwndList, WM_SETFONT, (WPARAM)hFont, 0); - - // Prepare ListView Columns - RECT rc; - GetClientRect(dat->hwndList, &rc); - rc.right -= GetSystemMetrics(SM_CXVSCROLL); - - LV_COLUMN lvc = { 0 }; - lvc.mask = LVCF_WIDTH; - lvc.cx = rc.right / 3; - ListView_InsertColumn(dat->hwndList, 0, &lvc); - lvc.cx = rc.right - lvc.cx; - ListView_InsertColumn(dat->hwndList, 1, &lvc); - - // Prepare Setting Items - LV_ITEM lvi = { 0 }; - lvi.mask = LVIF_PARAM | LVIF_TEXT; - for (lvi.iItem = 0; lvi.iItem < settingCount; lvi.iItem++) { - TCHAR text[MAX_PATH]; - lvi.lParam = lvi.iItem; - lvi.pszText = text; - utf8_to_tchar_static(setting[lvi.iItem].szDescription, text, SIZEOF(text)); - ListView_InsertItem(dat->hwndList, &lvi); - } - } - - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - return TRUE; - - case WM_NOTIFY: - switch (((LPNMHDR)lParam)->idFrom) { - case 0: - switch (((LPNMHDR)lParam)->code) { - case PSN_PARAMCHANGED: - dat->ppro = (CIcqProto*)((PSHNOTIFY*)lParam)->lParam; - dat->LoadSettingsFromDb(0); - { - char *pwd = dat->ppro->GetUserPassword(TRUE); - strcpy(dat->Password, (pwd) ? pwd : ""); /// FIXME - } - break; - - case PSN_INFOCHANGED: - dat->LoadSettingsFromDb(1); - break; - - case PSN_KILLACTIVE: - dat->EndStringEdit(1); - dat->EndListEdit(1); - break; - - case PSN_APPLY: - if (dat->ChangesMade()) { - if (MessageBox(hwndDlg, TranslateT("You've made some changes to your ICQ details but it has not been saved to the server. Are you sure you want to close this dialog?"), TranslateT("Change ICQ Details"), MB_YESNOCANCEL) != IDYES) { - SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); - return TRUE; - } - } - } - break; - - case IDC_LIST: - switch (((LPNMHDR)lParam)->code) { - case LVN_GETDISPINFO: - if (dat->iEditItem != -1) { - if (dat->editTopIndex != ListView_GetTopIndex(dat->hwndList)) { - dat->EndStringEdit(1); - dat->EndListEdit(1); - } - } - break; - - case NM_CUSTOMDRAW: - { - LPNMLVCUSTOMDRAW cd = (LPNMLVCUSTOMDRAW)lParam; - - switch (cd->nmcd.dwDrawStage) { - case CDDS_PREPAINT: - SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_NOTIFYITEMDRAW); - return TRUE; - - case CDDS_ITEMPREPAINT: - if (dat->iEditItem != -1) { - if (dat->editTopIndex != ListView_GetTopIndex(dat->hwndList)) { - dat->EndStringEdit(1); - dat->EndListEdit(1); - } - } - { - RECT rcItem; - ListView_GetItemRect(dat->hwndList, cd->nmcd.dwItemSpec, &rcItem, LVIR_BOUNDS); - - if (GetWindowLongPtr(dat->hwndList, GWL_STYLE) & WS_DISABLED) { // Disabled List - SetTextColor(cd->nmcd.hdc, cd->clrText); - FillRect(cd->nmcd.hdc, &rcItem, GetSysColorBrush(COLOR_3DFACE)); - } - else if ((cd->nmcd.uItemState & CDIS_SELECTED || dat->iEditItem == (int)cd->nmcd.dwItemSpec) - && setting[cd->nmcd.lItemlParam].displayType != LI_DIVIDER) { // Selected item - SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); - FillRect(cd->nmcd.hdc, &rcItem, GetSysColorBrush(COLOR_HIGHLIGHT)); - } - else { // Unselected item - SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_WINDOWTEXT)); - FillRect(cd->nmcd.hdc, &rcItem, GetSysColorBrush(COLOR_WINDOW)); - } - - HFONT hoFont = (HFONT)SelectObject(cd->nmcd.hdc, dat->hListFont); - - if (setting[cd->nmcd.lItemlParam].displayType == LI_DIVIDER) { - RECT rcLine; - SIZE textSize; - char str[MAX_PATH]; - char *szText = ICQTranslateUtfStatic(setting[cd->nmcd.lItemlParam].szDescription, str, MAX_PATH); - - SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_3DSHADOW)); - DrawTextUtf(cd->nmcd.hdc, szText, &rcItem, DT_CENTER | DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER, &textSize); - rcLine.top = (rcItem.top + rcItem.bottom) / 2 - 1; - rcLine.bottom = rcLine.top + 2; - rcLine.left = rcItem.left + 3; - rcLine.right = (rcItem.left + rcItem.right - textSize.cx) / 2 - 3; - DrawEdge(cd->nmcd.hdc, &rcLine, BDR_SUNKENOUTER, BF_RECT); - rcLine.left = (rcItem.left + rcItem.right + textSize.cx) / 2 + 3; - rcLine.right = rcItem.right - 3; - DrawEdge(cd->nmcd.hdc, &rcLine, BDR_SUNKENOUTER, BF_RECT); - } - else { - RECT rcItemDescr, rcItemValue; - char str[MAX_PATH]; - - ListView_GetSubItemRect(dat->hwndList, cd->nmcd.dwItemSpec, 0, LVIR_BOUNDS, &rcItemDescr); - ListView_GetSubItemRect(dat->hwndList, cd->nmcd.dwItemSpec, 1, LVIR_BOUNDS, &rcItemValue); - - rcItemDescr.right = rcItemValue.left; - rcItemDescr.left += 2; - DrawTextUtf(cd->nmcd.hdc, ICQTranslateUtfStatic(setting[cd->nmcd.lItemlParam].szDescription, str, MAX_PATH), &rcItemDescr, DT_END_ELLIPSIS | DT_LEFT | DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER, NULL); - - dat->PaintItemSetting(cd->nmcd.hdc, &rcItemValue, cd->nmcd.lItemlParam, cd->nmcd.uItemState); - } - SelectObject(cd->nmcd.hdc, hoFont); - - SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT); - - return TRUE; - } - } - } - break; - - case NM_CLICK: - { - LPNMLISTVIEW nm = (LPNMLISTVIEW)lParam; - LV_ITEM lvi; - RECT rc; - - dat->EndStringEdit(1); - dat->EndListEdit(1); - if (nm->iSubItem != 1) break; - lvi.mask = LVIF_PARAM | LVIF_STATE; - lvi.stateMask = 0xFFFFFFFF; - lvi.iItem = nm->iItem; lvi.iSubItem = nm->iSubItem; - ListView_GetItem(dat->hwndList, &lvi); - if (!(lvi.state & LVIS_SELECTED)) break; - ListView_EnsureVisible(dat->hwndList, lvi.iItem, FALSE); - ListView_GetSubItemRect(dat->hwndList, lvi.iItem, lvi.iSubItem, LVIR_BOUNDS, &rc); - dat->editTopIndex = ListView_GetTopIndex(dat->hwndList); - switch (setting[lvi.lParam].displayType & LIM_TYPE) { - case LI_STRING: - case LI_LONGSTRING: - case LI_NUMBER: - dat->BeginStringEdit(nm->iItem, &rc, lvi.lParam, 0); - break; - case LI_LIST: - dat->BeginListEdit(nm->iItem, &rc, lvi.lParam, 0); - break; - } - } - break; - - case LVN_KEYDOWN: - { - LPNMLVKEYDOWN nm = (LPNMLVKEYDOWN)lParam; - LV_ITEM lvi; - RECT rc; - - dat->EndStringEdit(1); - dat->EndListEdit(1); - if (nm->wVKey == VK_SPACE || nm->wVKey == VK_RETURN || nm->wVKey == VK_F2) nm->wVKey = 0; - if (nm->wVKey && (nm->wVKey<'0' || (nm->wVKey>'9' && nm->wVKey<'A') || (nm->wVKey>'Z' && nm->wVKey < VK_NUMPAD0) || nm->wVKey >= VK_F1)) - break; - lvi.mask = LVIF_PARAM | LVIF_STATE; - lvi.stateMask = 0xFFFFFFFF; - lvi.iItem = ListView_GetNextItem(dat->hwndList, -1, LVNI_ALL | LVNI_SELECTED); - if (lvi.iItem == -1) break; - lvi.iSubItem = 1; - ListView_GetItem(dat->hwndList, &lvi); - ListView_EnsureVisible(dat->hwndList, lvi.iItem, FALSE); - ListView_GetSubItemRect(dat->hwndList, lvi.iItem, lvi.iSubItem, LVIR_BOUNDS, &rc); - dat->editTopIndex = ListView_GetTopIndex(dat->hwndList); - switch (setting[lvi.lParam].displayType & LIM_TYPE) { - case LI_STRING: - case LI_LONGSTRING: - case LI_NUMBER: - dat->BeginStringEdit(lvi.iItem, &rc, lvi.lParam, nm->wVKey); - break; - case LI_LIST: - dat->BeginListEdit(lvi.iItem, &rc, lvi.lParam, nm->wVKey); - break; - } - SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE); - } - return TRUE; - - case NM_KILLFOCUS: - if (!IsStringEditWindow(GetFocus())) - dat->EndStringEdit(1); - if (!IsListEditWindow(GetFocus())) - dat->EndListEdit(1); - } - } - break; - - case WM_KILLFOCUS: - dat->EndStringEdit(1); - dat->EndListEdit(1); - break; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDCANCEL: - SendMessage(GetParent(hwndDlg), msg, wParam, lParam); - break; - - case IDC_SAVE: - if (!dat->SaveSettingsToDb(hwndDlg)) - break; - - EnableDlgItem(hwndDlg, IDC_SAVE, FALSE); - EnableDlgItem(hwndDlg, IDC_LIST, FALSE); - SetDlgItemText(hwndDlg, IDC_UPLOADING, TranslateT("Upload in progress...")); - EnableDlgItem(hwndDlg, IDC_UPLOADING, TRUE); - ShowDlgItem(hwndDlg, IDC_UPLOADING, SW_SHOW); - dat->hAckHook = HookEventMessage(ME_PROTO_ACK, hwndDlg, DM_PROTOACK); - - if (!dat->UploadSettings()) { - EnableDlgItem(hwndDlg, IDC_SAVE, TRUE); - EnableDlgItem(hwndDlg, IDC_LIST, TRUE); - ShowDlgItem(hwndDlg, IDC_UPLOADING, SW_HIDE); - UnhookEvent(dat->hAckHook); - dat->hAckHook = NULL; - } - } - break; - - case WM_SIZE: - { // make the dlg resizeable - UTILRESIZEDIALOG urd = { 0 }; - - if (IsIconic(hwndDlg)) break; - urd.cbSize = sizeof(urd); - urd.hInstance = hInst; - urd.hwndDlg = hwndDlg; - urd.lParam = 0; // user-defined - urd.lpTemplate = MAKEINTRESOURCEA(IDD_INFO_CHANGEINFO); - urd.pfnResizer = ChangeInfoDlg_Resize; - CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd); - - { // update listview column widths - RECT rc; - - GetClientRect(dat->hwndList, &rc); - rc.right -= GetSystemMetrics(SM_CXVSCROLL); - ListView_SetColumnWidth(dat->hwndList, 0, rc.right / 3); - ListView_SetColumnWidth(dat->hwndList, 1, rc.right - rc.right / 3); - } - } - break; - - case DM_PROTOACK: - { - ACKDATA *ack = (ACKDATA*)lParam; - int i, done; - - if (ack->type != ACKTYPE_SETINFO) break; - if (ack->result == ACKRESULT_SUCCESS) { - for (i = 0; i < SIZEOF(dat->hUpload); i++) - if (dat->hUpload[i] && ack->hProcess == dat->hUpload[i]) break; - - if (i == SIZEOF(dat->hUpload)) break; - dat->hUpload[i] = NULL; - for (done = 0, i = 0; i < SIZEOF(dat->hUpload); i++) - done += dat->hUpload[i] == NULL; - TCHAR buf[MAX_PATH]; - mir_sntprintf(buf, SIZEOF(buf), TranslateT("Upload in progress...%d%%"), 100 * done / (SIZEOF(dat->hUpload))); - SetDlgItemText(hwndDlg, IDC_UPLOADING, buf); - if (done < SIZEOF(dat->hUpload)) break; - - dat->ClearChangeFlags(); - UnhookEvent(dat->hAckHook); - dat->hAckHook = NULL; - EnableDlgItem(hwndDlg, IDC_LIST, TRUE); - EnableDlgItem(hwndDlg, IDC_UPLOADING, FALSE); - SetDlgItemText(hwndDlg, IDC_UPLOADING, TranslateT("Upload complete")); - SendMessage(GetParent(hwndDlg), PSM_FORCECHANGED, 0, 0); - } - else if (ack->result == ACKRESULT_FAILED) { - UnhookEvent(dat->hAckHook); - dat->hAckHook = NULL; - EnableDlgItem(hwndDlg, IDC_LIST, TRUE); - EnableDlgItem(hwndDlg, IDC_UPLOADING, FALSE); - SetDlgItemText(hwndDlg, IDC_UPLOADING, TranslateT("Upload FAILED")); - SendMessage(GetParent(hwndDlg), PSM_FORCECHANGED, 0, 0); - EnableDlgItem(hwndDlg, IDC_SAVE, TRUE); - } - } - break; - - case WM_DESTROY: - if (dat->hAckHook) { - UnhookEvent(dat->hAckHook); - dat->hAckHook = NULL; - } - - DeleteObject((HFONT)SendMessage(dat->hwndList, WM_GETFONT, 0, 0)); - - dat->FreeStoredDbSettings(); - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0); - delete dat; - break; - } - return FALSE; -} diff --git a/protocols/IcqOscarJ/src/changeinfo/editlist.cpp b/protocols/IcqOscarJ/src/changeinfo/editlist.cpp deleted file mode 100644 index 765c99cce6..0000000000 --- a/protocols/IcqOscarJ/src/changeinfo/editlist.cpp +++ /dev/null @@ -1,196 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2001-2004 Richard Hughes, Martin Öberg -// Copyright © 2004-2009 Joe Kucera, Bio -// Copyright © 2012-2014 Miranda NG Team -// -// 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. -// ----------------------------------------------------------------------------- -// DESCRIPTION: -// -// ChangeInfo Plugin stuff -// ----------------------------------------------------------------------------- - -#include "icqoscar.h" - -static ChangeInfoData *dataListEdit = NULL; -static HWND hwndListEdit = NULL; - -static LRESULT CALLBACK ListEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_LBUTTONUP: - mir_callNextSubclass(hwnd, ListEditSubclassProc, msg, wParam, lParam); - { - POINT pt = { (short)LOWORD(lParam), (short)HIWORD(lParam) }; - ClientToScreen(hwnd, &pt); - if (SendMessage(hwnd, WM_NCHITTEST, 0, MAKELPARAM(pt.x, pt.y)) == HTVSCROLL) - break; - - int i = SendMessage(hwnd, LB_GETCURSEL, 0, 0); - if (dataListEdit) - dataListEdit->EndListEdit(i != LB_ERR); - } - return 0; - - case WM_CHAR: - if (wParam != '\r') break; - { - int i = SendMessage(hwnd, LB_GETCURSEL, 0, 0); - if (dataListEdit) - dataListEdit->EndListEdit(i != LB_ERR); - } - return 0; - - case WM_KILLFOCUS: - if (dataListEdit) - dataListEdit->EndListEdit(1); - return 0; - } - return mir_callNextSubclass(hwnd, ListEditSubclassProc, msg, wParam, lParam); -} - -void ChangeInfoData::BeginListEdit(int iItem, RECT *rc, int iSetting, WORD wVKey) -{ - if (dataListEdit) - dataListEdit->EndListEdit(0); - - POINT pt = { 0, 0 }; - ClientToScreen(hwndList, &pt); - OffsetRect(rc, pt.x, pt.y); - InflateRect(rc, -2, -2); - rc->left -= 2; - iEditItem = iItem; - ListView_RedrawItems(hwndList, iEditItem, iEditItem); - UpdateWindow(hwndList); - - dataListEdit = this; - hwndListEdit = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, _T("LISTBOX"), _T(""), WS_POPUP | WS_BORDER | WS_VSCROLL, - rc->left, rc->bottom, rc->right - rc->left, 150, NULL, NULL, hInst, NULL); - SendMessage(hwndListEdit, WM_SETFONT, (WPARAM)hListFont, 0); - int itemHeight = SendMessage(hwndListEdit, LB_GETITEMHEIGHT, 0, 0); - - const SettingItem &si = setting[iSetting]; - SettingItemData &sid = settingData[iSetting]; - FieldNamesItem *list = (FieldNamesItem*)si.pList; - - // some country codes were changed leaving old details uknown, convert it for the user - if (list == countryField) { - if (sid.value == 420) - sid.value = 42; // conversion of obsolete codes (OMG!) - else if (sid.value == 421) - sid.value = 4201; - else if (sid.value == 102) - sid.value = 1201; - } - - if (list == timezonesField) { - tmi.prepareList(NULL, ppro->m_szModuleName, hwndListEdit, TZF_PLF_LB); - } - else { - int j, n = ListBoxAddStringUtf(hwndListEdit, "Unspecified"); - for (j = 0;; j++) - if (!list[j].text) { - SendMessage(hwndListEdit, LB_SETITEMDATA, n, j); - if ((sid.value == 0 && list[j].code == 0) || (si.dbType != DBVT_ASCIIZ && sid.value == list[j].code)) - SendMessage(hwndListEdit, LB_SETCURSEL, n, 0); - break; - } - - for (j = 0; list[j].text; j++) { - char str[MAX_PATH]; - n = ListBoxAddStringUtf(hwndListEdit, list[j].text); - SendMessage(hwndListEdit, LB_SETITEMDATA, n, j); - if ((si.dbType == DBVT_ASCIIZ && (!strcmpnull((char*)sid.value, list[j].text)) - || (si.dbType == DBVT_ASCIIZ && (!strcmpnull((char*)sid.value, ICQTranslateUtfStatic(list[j].text, str, MAX_PATH)))) - || ((char*)sid.value == NULL && list[j].code == 0)) - || (si.dbType != DBVT_ASCIIZ && sid.value == list[j].code)) - SendMessage(hwndListEdit, LB_SETCURSEL, n, 0); - } - SendMessage(hwndListEdit, LB_SETTOPINDEX, SendMessage(hwndListEdit, LB_GETCURSEL, 0, 0) - 3, 0); - } - - int listCount = SendMessage(hwndListEdit, LB_GETCOUNT, 0, 0); - if (itemHeight * listCount < 150) - SetWindowPos(hwndListEdit, 0, 0, 0, rc->right - rc->left, itemHeight * listCount + GetSystemMetrics(SM_CYBORDER) * 2, SWP_NOZORDER | SWP_NOMOVE); - mir_subclassWindow(hwndListEdit, ListEditSubclassProc); - AnimateWindow(hwndListEdit, 200, AW_SLIDE | AW_ACTIVATE | AW_VER_POSITIVE); - ShowWindow(hwndListEdit, SW_SHOW); - SetFocus(hwndListEdit); - if (wVKey) - PostMessage(hwndListEdit, WM_KEYDOWN, wVKey, 0); -} - -void ChangeInfoData::EndListEdit(int save) -{ - if (hwndListEdit == NULL || iEditItem == -1 || this != dataListEdit) - return; - - if (save) { - const SettingItem &si = setting[iEditItem]; - SettingItemData &sid = settingData[iEditItem]; - - int iItem = SendMessage(hwndListEdit, LB_GETCURSEL, 0, 0); - int i = SendMessage(hwndListEdit, LB_GETITEMDATA, iItem, 0); - if (iItem != -1 && i != -1) { - FieldNamesItem *list = (FieldNamesItem*)si.pList; - if (list == timezonesField) { - tmi.storeListResults(NULL, ppro->m_szModuleName, hwndListEdit, TZF_PLF_LB); - list[i = 0].code = ppro->getDword("Timezone", 0); - } - - FieldNamesItem &pItem = list[i]; - - if (si.dbType == DBVT_ASCIIZ) { - char *szNewValue = pItem.text; - if (pItem.code || (si.displayType & LIF_ZEROISVALID)) { - sid.changed = strcmpnull(szNewValue, (char*)sid.value); - SAFE_FREE((void**)&sid.value); - sid.value = (LPARAM)null_strdup(szNewValue); - } - else { - sid.changed = (char*)sid.value != NULL; - SAFE_FREE((void**)&sid.value); - } - } - else { - sid.changed = pItem.code != sid.value; - sid.value = pItem.code; - } - - if (sid.changed) { - char buf[MAX_PATH]; - TCHAR tbuf[MAX_PATH]; - if (utf8_to_tchar_static(ICQTranslateUtfStatic(pItem.text, buf, SIZEOF(buf)), tbuf, SIZEOF(buf))) - ListView_SetItemText(hwndList, iEditItem, 1, tbuf); - - EnableDlgItem(GetParent(hwndList), IDC_SAVE, TRUE); - } - } - } - ListView_RedrawItems(hwndList, iEditItem, iEditItem); - iEditItem = -1; - dataListEdit = NULL; - DestroyWindow(hwndListEdit); - hwndListEdit = NULL; -} - -int IsListEditWindow(HWND hwnd) -{ - if (hwnd == hwndListEdit) return 1; - return 0; -} diff --git a/protocols/IcqOscarJ/src/changeinfo/editstring.cpp b/protocols/IcqOscarJ/src/changeinfo/editstring.cpp deleted file mode 100644 index 22ffcd6f23..0000000000 --- a/protocols/IcqOscarJ/src/changeinfo/editstring.cpp +++ /dev/null @@ -1,352 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2001-2004 Richard Hughes, Martin Öberg -// Copyright © 2004-2009 Joe Kucera, Bio -// Copyright © 2012-2014 Miranda NG Team -// -// 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. -// ----------------------------------------------------------------------------- -// DESCRIPTION: -// -// ChangeInfo Plugin stuff -// ----------------------------------------------------------------------------- - -#include "icqoscar.h" - -static ChangeInfoData *dataStringEdit = NULL; -static HWND hwndEdit = NULL, hwndExpandButton = NULL, hwndUpDown = NULL; - -static const char escapes[]={'a','\a', -'b','\b', -'e',27, -'f','\f', -'r','\r', -'t','\t', -'v','\v', -'\\','\\'}; - -static void EscapesToMultiline(WCHAR *str,PDWORD selStart,PDWORD selEnd) -{ //converts "\\n" and "\\t" to "\r\n" and "\t" because a multi-line edit box can show them properly - DWORD i; - - for(i=0; *str; str++, i++) - { - if (*str != '\\') continue; - if (str[1] == 'n') - { - *str++ = '\r'; - i++; - *str = '\n'; - } - else if (str[1] == 't') - { - *str = '\t'; - memmove(str+1, str+2, sizeof(WCHAR)*(mir_wstrlen(str)-1)); - - if (*selStart>i) --*selStart; - if (*selEnd>i) --*selEnd; - } - } -} - - - -static void EscapesToBinary(char *str) -{ - for (;*str;str++) - { - if (*str!='\\') continue; - if(str[1]=='n') {*str++='\r'; *str='\n'; continue;} - if(str[1]=='0') - { - char *codeend; - *str=(char)strtol(str+1,&codeend,8); - if (*str==0) {*str='\\'; continue;} - memmove(str+1,codeend,mir_strlen(codeend)+1); - continue; - } - for(int i=0;i=' ') - { - *pout++=*str; - continue; - } - if(str[0]=='\r' && str[1]=='\n') - { - *pout++='\\'; - *pout++='n'; - str++; - continue; - } - if(extra<3) - { - extra+=8; len+=8; - pout=out=(char*)SAFE_REALLOC(out,len); - } - *pout++='\\'; - for(i = 0; i < SIZEOF(escapes); i += 2) - if (*str==escapes[i+1]) - { - *pout++=escapes[i]; - extra--; - break; - } - if(i < SIZEOF(escapes)) continue; - *pout++='0'; extra--; - if (*str>=8) - { - *pout++=(*str>>3)+'0'; - extra--; - } - *pout++=(*str&7)+'0'; extra--; - } - *pout='\0'; - return out; -} - - - -static LRESULT CALLBACK StringEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) -{ - switch(msg) { - case WM_KEYDOWN: - if (wParam==VK_ESCAPE) - { - if (dataStringEdit) - dataStringEdit->EndStringEdit(0); - return 0; - } - if (wParam==VK_RETURN) - { - if (GetWindowLongPtr(hwnd, GWL_STYLE) & ES_MULTILINE && !(GetKeyState(VK_CONTROL) & 0x8000)) break; - if (dataStringEdit) - dataStringEdit->EndStringEdit(1); - return 0; - } - break; - - case WM_GETDLGCODE: - return DLGC_WANTALLKEYS | mir_callNextSubclass(hwnd, StringEditSubclassProc, msg, wParam, lParam); - - case WM_KILLFOCUS: - if ((HWND)wParam == hwndExpandButton) break; - if (dataStringEdit) - dataStringEdit->EndStringEdit(1); - return 0; - } - return mir_callNextSubclass(hwnd, StringEditSubclassProc, msg, wParam, lParam); -} - -static LRESULT CALLBACK ExpandButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_LBUTTONUP: - if (GetCapture() == hwnd) { - //do expand - RECT rcStart, rcEnd; - DWORD selStart, selEnd; - WCHAR *text; - BOOL animEnabled = TRUE; - - GetWindowRect(hwndEdit, &rcStart); - InflateRect(&rcStart, 2, 2); - - text = GetWindowTextUcs(hwndEdit); - SendMessage(hwndEdit, EM_GETSEL, (WPARAM)&selStart, (LPARAM)&selEnd); - DestroyWindow(hwndEdit); - EscapesToMultiline(text, &selStart, &selEnd); - hwndEdit = CreateWindowExA(WS_EX_TOOLWINDOW, "EDIT", "", WS_POPUP | WS_BORDER | WS_VISIBLE | ES_WANTRETURN | ES_AUTOVSCROLL | WS_VSCROLL | ES_MULTILINE, rcStart.left, rcStart.top, rcStart.right - rcStart.left, rcStart.bottom - rcStart.top, NULL, NULL, hInst, NULL); - SetWindowTextUcs(hwndEdit, text); - mir_subclassWindow(hwndEdit, StringEditSubclassProc); - SendMessage(hwndEdit, WM_SETFONT, (WPARAM)dataStringEdit->hListFont, 0); - SendMessage(hwndEdit, EM_SETSEL, selStart, selEnd); - SetFocus(hwndEdit); - - rcEnd.left = rcStart.left; rcEnd.top = rcStart.top; - rcEnd.right = rcEnd.left + 350; - rcEnd.bottom = rcEnd.top + 150; - if (LOBYTE(LOWORD(GetVersion())) > 4 || HIBYTE(LOWORD(GetVersion())) > 0) - SystemParametersInfo(SPI_GETCOMBOBOXANIMATION, 0, &animEnabled, FALSE); - if (animEnabled) { - DWORD startTime, timeNow; - startTime = GetTickCount(); - for (;;) { - UpdateWindow(hwndEdit); - timeNow = GetTickCount(); - if (timeNow > startTime + 200) break; - SetWindowPos(hwndEdit, 0, rcEnd.left, rcEnd.top, (rcEnd.right - rcStart.right)*(timeNow - startTime) / 200 + rcStart.right - rcEnd.left, (rcEnd.bottom - rcStart.bottom)*(timeNow - startTime) / 200 + rcStart.bottom - rcEnd.top, SWP_NOZORDER); - } - } - SetWindowPos(hwndEdit, 0, rcEnd.left, rcEnd.top, rcEnd.right - rcEnd.left, rcEnd.bottom - rcEnd.top, SWP_NOZORDER); - - DestroyWindow(hwnd); - hwndExpandButton = NULL; - - SAFE_FREE((void**)&text); - } - break; - } - return mir_callNextSubclass(hwnd, ExpandButtonSubclassProc, msg, wParam, lParam); -} - -void ChangeInfoData::BeginStringEdit(int iItem, RECT *rc, int i, WORD wVKey) -{ - char *szValue; - char str[80]; - int alloced = 0; - - EndStringEdit(0); - InflateRect(rc, -2, -2); - rc->left -= 2; - - const SettingItem &si = setting[i]; - SettingItemData &sid = settingData[i]; - - if (si.displayType & LIF_PASSWORD && !sid.changed) - szValue = " "; - else if ((si.displayType & LIM_TYPE) == LI_NUMBER) { - szValue = str; - mir_snprintf(str, SIZEOF(str), "%d", sid.value); - } - else if (sid.value) { - szValue = BinaryToEscapes((char*)sid.value); - alloced = 1; - } - else szValue = ""; - - iEditItem = iItem; - - if ((si.displayType & LIM_TYPE) == LI_LONGSTRING) { - rc->right -= rc->bottom - rc->top; - hwndExpandButton = CreateWindowA("BUTTON", "", WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | BS_ICON, rc->right, rc->top, rc->bottom - rc->top, rc->bottom - rc->top, hwndList, NULL, hInst, NULL); - SendMessage(hwndExpandButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_EXPANDSTRINGEDIT), IMAGE_ICON, 0, 0, LR_SHARED)); - mir_subclassWindow(hwndExpandButton, ExpandButtonSubclassProc); - } - - dataStringEdit = this; - hwndEdit = CreateWindow(_T("EDIT"), _T(""), WS_VISIBLE | WS_CHILD | ES_AUTOHSCROLL | ((si.displayType&LIM_TYPE) == LI_NUMBER ? ES_NUMBER : 0) | (si.displayType&LIF_PASSWORD ? ES_PASSWORD : 0), rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, hwndList, NULL, hInst, NULL); - SetWindowTextUtf(hwndEdit, szValue); - if (alloced) SAFE_FREE(&szValue); - mir_subclassWindow(hwndEdit, StringEditSubclassProc); - SendMessage(hwndEdit, WM_SETFONT, (WPARAM)hListFont, 0); - if ((si.displayType & LIM_TYPE) == LI_NUMBER) { - int *range = (int*)si.pList; - RECT rcUpDown; - hwndUpDown = CreateWindow(UPDOWN_CLASS, _T(""), WS_VISIBLE | WS_CHILD | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_HOTTRACK | UDS_NOTHOUSANDS | UDS_SETBUDDYINT, 0, 0, 0, 0, hwndList, NULL, hInst, NULL); - SendMessage(hwndUpDown, UDM_SETRANGE32, range[0], range[1]); - SendMessage(hwndUpDown, UDM_SETPOS32, 0, sid.value); - if (!(si.displayType & LIF_ZEROISVALID) && sid.value == 0) - SetWindowTextA(hwndEdit, ""); - GetClientRect(hwndUpDown, &rcUpDown); - rc->right -= rcUpDown.right; - SetWindowPos(hwndEdit, 0, 0, 0, rc->right - rc->left, rc->bottom - rc->top, SWP_NOZORDER | SWP_NOMOVE); - } - SendMessage(hwndEdit, EM_SETSEL, 0, (LPARAM)-1); - SetFocus(hwndEdit); - PostMessage(hwndEdit, WM_KEYDOWN, wVKey, 0); -} - -void ChangeInfoData::EndStringEdit(int save) -{ - if (hwndEdit == NULL || iEditItem == -1 || this != dataStringEdit) - return; - - if (save) { - char *text = (char*)SAFE_MALLOC(GetWindowTextLength(hwndEdit) + 1); - const SettingItem &si = setting[iEditItem]; - SettingItemData &sid = settingData[iEditItem]; - - GetWindowTextA(hwndEdit, (char*)text, GetWindowTextLength(hwndEdit) + 1); - EscapesToBinary(text); - if ((si.displayType & LIM_TYPE) == LI_NUMBER) { - LPARAM newValue; - int *range = (int*)si.pList; - newValue = atoi(text); - if (newValue) { - if (newValuerange[1]) newValue = range[1]; - } - sid.changed = sid.value != newValue; - sid.value = newValue; - SAFE_FREE(&text); - } - else { - if (!(si.displayType & LIF_PASSWORD)) { - SAFE_FREE(&text); - text = GetWindowTextUtf(hwndEdit); - EscapesToBinary(text); - } - if ((si.displayType & LIF_PASSWORD && strcmpnull(text, " ")) || - (!(si.displayType & LIF_PASSWORD) && strcmpnull(text, (char*)sid.value) && (mir_strlen(text) + mir_strlen((char*)sid.value)))) { - SAFE_FREE((void**)&sid.value); - if (mir_strlen(text)) - sid.value = (LPARAM)text; - else { - sid.value = 0; - SAFE_FREE(&text); - } - sid.changed = 1; - } - } - - if (sid.changed) { - TCHAR tbuf[MAX_PATH]; - - GetWindowText(hwndEdit, tbuf, SIZEOF(tbuf)); - ListView_SetItemText(hwndList, iEditItem, 1, tbuf); - - EnableDlgItem(hwndDlg, IDC_SAVE, TRUE); - } - } - - ListView_RedrawItems(hwndList, iEditItem, iEditItem); - iEditItem = -1; - dataStringEdit = NULL; - DestroyWindow(hwndEdit); - hwndEdit = NULL; - if (hwndExpandButton) DestroyWindow(hwndExpandButton); - hwndExpandButton = NULL; - if (hwndUpDown) DestroyWindow(hwndUpDown); - hwndUpDown = NULL; -} - -int IsStringEditWindow(HWND hwnd) -{ - if (hwnd == hwndEdit) return 1; - if (hwnd == hwndExpandButton) return 1; - if (hwnd == hwndUpDown) return 1; - return 0; -} diff --git a/protocols/IcqOscarJ/src/changeinfo/icqoscar.h b/protocols/IcqOscarJ/src/changeinfo/icqoscar.h deleted file mode 100644 index 77283f6f7f..0000000000 --- a/protocols/IcqOscarJ/src/changeinfo/icqoscar.h +++ /dev/null @@ -1,2 +0,0 @@ -/* For MinGW sake */ -#include "../icqoscar.h" diff --git a/protocols/IcqOscarJ/src/changeinfo/upload.cpp b/protocols/IcqOscarJ/src/changeinfo/upload.cpp deleted file mode 100644 index c8c515c950..0000000000 --- a/protocols/IcqOscarJ/src/changeinfo/upload.cpp +++ /dev/null @@ -1,86 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2001-2004 Richard Hughes, Martin Öberg -// Copyright © 2004-2009 Joe Kucera, Bio -// Copyright © 2012-2014 Miranda NG Team -// -// 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. -// ----------------------------------------------------------------------------- -// DESCRIPTION: -// -// ChangeInfo Plugin stuff -// ----------------------------------------------------------------------------- - -#include "icqoscar.h" - -int CIcqProto::StringToListItemId(const char *szSetting,int def) -{ - int i; - - for(i=0;iicqOnline()) { - MessageBox(hwndDlg, TranslateT("You are not currently connected to the ICQ network. You must be online in order to update your information on the server."), TranslateT("Change ICQ Details"), MB_OK); - return 0; - } - - hUpload[0] = (HANDLE)ppro->ChangeInfoEx(CIXT_FULL, 0); - - //password - char* tmp = ppro->GetUserPassword(TRUE); - if (tmp) { - if (mir_strlen(Password) > 0 && strcmpnull(Password, tmp)) { - // update password in user info dialog (still open) - strcpy(Password, tmp); - // update password in protocol - strcpy(ppro->m_szPassword, tmp); - - hUpload[1] = (HANDLE)ppro->icq_changeUserPasswordServ(tmp); - char szPwd[PASSWORDMAXLEN] = {0}; - - // password is stored in DB, update - if (ppro->GetUserStoredPassword(szPwd, sizeof(szPwd))) - ppro->setString("Password", tmp); - } - } - - return 1; -} diff --git a/protocols/IcqOscarJ/src/constants.cpp b/protocols/IcqOscarJ/src/constants.cpp new file mode 100644 index 0000000000..f97298b955 --- /dev/null +++ b/protocols/IcqOscarJ/src/constants.cpp @@ -0,0 +1,131 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2001-2004 Richard Hughes, Martin Öberg +// Copyright © 2004-2009 Joe Kucera, Bio +// Copyright © 2012-2014 Miranda NG Team +// +// 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. +// ----------------------------------------------------------------------------- +// DESCRIPTION: +// +// ChangeInfo Plugin stuff +// ----------------------------------------------------------------------------- + +#include "stdafx.h" + +static FieldNamesItem months[] = { + { 1, LPGEN("January") }, + { 2, LPGEN("February") }, + { 3, LPGEN("March") }, + { 4, LPGEN("April") }, + { 5, LPGEN("May") }, + { 6, LPGEN("June") }, + { 7, LPGEN("July") }, + { 8, LPGEN("August") }, + { 9, LPGEN("September") }, + { 10, LPGEN("October") }, + { 11, LPGEN("November") }, + { 12, LPGEN("December") }, + { 0, NULL } +}; + +const int ageRange[] = { 13, 0x7FFF }; // 14, 130 +const int yearRange[] = { 1753, 0x7FFF }; // 1880, 2000 +const int dayRange[] = { 1, 31 }; + +const SettingItem setting[] = +{ + // personal + { LPGEN("Personal"), LI_DIVIDER }, + { LPGEN("Nickname"), LI_STRING, DBVT_UTF8, "Nick" }, + { LPGEN("First name"), LI_STRING, DBVT_UTF8, "FirstName" }, + { LPGEN("Last name"), LI_STRING, DBVT_UTF8, "LastName" }, + { LPGEN("Gender"), LI_LIST, DBVT_BYTE, "Gender", genderField }, + { LPGEN("About"), LI_LONGSTRING, DBVT_UTF8, "About" }, + + // password + { LPGEN("Password"), LI_DIVIDER }, + { LPGEN("Password"), LI_STRING | LIF_PASSWORD, DBVT_UTF8, "Password" }, + + // contact + { LPGEN("Contact"), LI_DIVIDER }, + { LPGEN("Primary e-mail"), LI_STRING, DBVT_UTF8, "e-mail0" }, + { LPGEN("Secondary e-mail"), LI_STRING, DBVT_UTF8, "e-mail1" }, + { LPGEN("Tertiary e-mail"), LI_STRING, DBVT_UTF8, "e-mail2" }, + { LPGEN("Homepage"), LI_STRING, DBVT_UTF8, "Homepage" }, + { LPGEN("Street"), LI_STRING, DBVT_UTF8, "Street" }, + { LPGEN("City"), LI_STRING, DBVT_UTF8, "City" }, + { LPGEN("State"), LI_STRING, DBVT_UTF8, "State" }, + { LPGEN("ZIP/postcode"), LI_STRING, DBVT_UTF8, "ZIP" }, + { LPGEN("Country"), LI_LIST, DBVT_WORD, "Country", countryField }, + { LPGEN("Phone number"), LI_STRING, DBVT_UTF8, "Phone" }, + { LPGEN("Fax number"), LI_STRING, DBVT_UTF8, "Fax" }, + { LPGEN("Cellular number"), LI_STRING, DBVT_UTF8, "Cellular" }, + + // more + { LPGEN("Personal Detail"), LI_DIVIDER }, + { LPGEN("Timezone"), LI_LIST | LIF_ZEROISVALID | LIF_SIGNED, DBVT_BYTE, "Timezone", timezonesField }, + { LPGEN("Year of birth"), LI_NUMBER, DBVT_WORD, "BirthYear", yearRange }, + { LPGEN("Month of birth"), LI_LIST, DBVT_BYTE, "BirthMonth", months }, + { LPGEN("Day of birth"), LI_NUMBER, DBVT_BYTE, "BirthDay", dayRange }, + { LPGEN("Marital Status"), LI_LIST, DBVT_BYTE, "MaritalStatus", maritalField }, + { LPGEN("Spoken language 1"), LI_LIST, DBVT_BYTE, "Language1", languageField }, + { LPGEN("Spoken language 2"), LI_LIST, DBVT_BYTE, "Language2", languageField }, + { LPGEN("Spoken language 3"), LI_LIST, DBVT_BYTE, "Language3", languageField }, + + // more + { LPGEN("Originally from"), LI_DIVIDER }, + { LPGEN("Street"), LI_STRING, DBVT_UTF8, "OriginStreet" }, + { LPGEN("City"), LI_STRING, DBVT_UTF8, "OriginCity" }, + { LPGEN("State"), LI_STRING, DBVT_UTF8, "OriginState" }, + { LPGEN("Country"), LI_LIST, DBVT_WORD, "OriginCountry", countryField }, + + // study + { LPGEN("Education"), LI_DIVIDER }, + { LPGEN("Level"), LI_LIST, DBVT_WORD, "StudyLevel", studyLevelField }, + { LPGEN("Institute"), LI_STRING, DBVT_UTF8, "StudyInstitute" }, + { LPGEN("Degree"), LI_STRING, DBVT_UTF8, "StudyDegree" }, + { LPGEN("Graduation Year"), LI_NUMBER, DBVT_WORD, "StudyYear", yearRange }, + + // work + { LPGEN("Work"), LI_DIVIDER }, + { LPGEN("Company name"), LI_STRING, DBVT_UTF8, "Company" }, + { LPGEN("Company homepage"), LI_STRING, DBVT_UTF8, "CompanyHomepage" }, + { LPGEN("Company street"), LI_STRING, DBVT_UTF8, "CompanyStreet" }, + { LPGEN("Company city"), LI_STRING, DBVT_UTF8, "CompanyCity" }, + { LPGEN("Company state"), LI_STRING, DBVT_UTF8, "CompanyState" }, + { LPGEN("Company phone"), LI_STRING, DBVT_UTF8, "CompanyPhone" }, + { LPGEN("Company fax"), LI_STRING, DBVT_UTF8, "CompanyFax" }, + { LPGEN("Company ZIP/postcode"), LI_STRING, DBVT_UTF8, "CompanyZIP" }, + { LPGEN("Company country"), LI_LIST, DBVT_WORD, "CompanyCountry", countryField }, + { LPGEN("Company department"), LI_STRING, DBVT_UTF8, "CompanyDepartment" }, + { LPGEN("Company position"), LI_STRING, DBVT_UTF8, "CompanyPosition" }, + { LPGEN("Company industry"), LI_LIST, DBVT_WORD, "CompanyIndustry", industryField }, + + //interests + { LPGEN("Personal Interests"), LI_DIVIDER }, + { LPGEN("Interest category 1"), LI_LIST, DBVT_WORD, "Interest0Cat", interestsField }, + { LPGEN("Interest areas 1"), LI_STRING, DBVT_UTF8, "Interest0Text" }, + { LPGEN("Interest category 2"), LI_LIST, DBVT_WORD, "Interest1Cat", interestsField }, + { LPGEN("Interest areas 2"), LI_STRING, DBVT_UTF8, "Interest1Text" }, + { LPGEN("Interest category 3"), LI_LIST, DBVT_WORD, "Interest2Cat", interestsField }, + { LPGEN("Interest areas 3"), LI_STRING, DBVT_UTF8, "Interest2Text" }, + { LPGEN("Interest category 4"), LI_LIST, DBVT_WORD, "Interest3Cat", interestsField }, + { LPGEN("Interest areas 4"), LI_STRING, DBVT_UTF8, "Interest3Text" }, +}; + +const int settingCount = SIZEOF(setting); diff --git a/protocols/IcqOscarJ/src/cookies.cpp b/protocols/IcqOscarJ/src/cookies.cpp index 22bcf92a95..a18fdc7f87 100644 --- a/protocols/IcqOscarJ/src/cookies.cpp +++ b/protocols/IcqOscarJ/src/cookies.cpp @@ -27,7 +27,7 @@ // Handles packet & message cookies // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" #define INVALID_COOKIE_INDEX -1 diff --git a/protocols/IcqOscarJ/src/db.cpp b/protocols/IcqOscarJ/src/db.cpp new file mode 100644 index 0000000000..4080b800ff --- /dev/null +++ b/protocols/IcqOscarJ/src/db.cpp @@ -0,0 +1,220 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2001-2004 Richard Hughes, Martin Öberg +// Copyright © 2004-2009 Joe Kucera, Bio +// Copyright © 2012-2014 Miranda NG Team +// +// 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. +// ----------------------------------------------------------------------------- +// DESCRIPTION: +// +// ChangeInfo Plugin stuff +// ----------------------------------------------------------------------------- + +#include "stdafx.h" + +void ChangeInfoData::LoadSettingsFromDb(int keepChanged) +{ + for (int i = 0; i < settingCount; i++) { + const SettingItem &si = setting[i]; + if (si.displayType == LI_DIVIDER) + continue; + + SettingItemData &sid = settingData[i]; + if (keepChanged && sid.changed) + continue; + + if (si.dbType == DBVT_ASCIIZ || si.dbType == DBVT_UTF8) + SAFE_FREE((void**)(char**)&sid.value); + else if (!keepChanged) + sid.value = 0; + + sid.changed = 0; + + if (si.displayType & LIF_PASSWORD) + continue; + + DBVARIANT dbv = { DBVT_DELETED }; + if (!ppro->getSetting(NULL, si.szDbSetting, &dbv)) { + switch (dbv.type) { + case DBVT_ASCIIZ: + sid.value = (LPARAM)ppro->getSettingStringUtf(NULL, si.szDbSetting, NULL); + break; + + case DBVT_UTF8: + sid.value = (LPARAM)null_strdup(dbv.pszVal); + break; + + case DBVT_WORD: + if (si.displayType & LIF_SIGNED) + sid.value = dbv.sVal; + else + sid.value = dbv.wVal; + break; + + case DBVT_BYTE: + if (si.displayType & LIF_SIGNED) + sid.value = dbv.cVal; + else + sid.value = dbv.bVal; + break; + +#ifdef _DEBUG + default: + MessageBoxA(NULL, "That's not supposed to happen either", "Huh?", MB_OK); + break; +#endif + } + db_free(&dbv); + } + + char buf[MAX_PATH]; + TCHAR tbuf[MAX_PATH]; + + if (utf8_to_tchar_static(GetItemSettingText(i, buf, SIZEOF(buf)), tbuf, SIZEOF(tbuf))) + ListView_SetItemText(hwndList, i, 1, tbuf); + } +} + +void ChangeInfoData::FreeStoredDbSettings(void) +{ + for (int i = 0; i < settingCount; i++) + if (setting[i].dbType == DBVT_ASCIIZ || setting[i].dbType == DBVT_UTF8) + SAFE_FREE((void**)&settingData[i].value); +} + +int ChangeInfoData::ChangesMade(void) +{ + for (int i = 0; i < settingCount; i++) + if (settingData[i].changed) + return 1; + return 0; +} + +void ChangeInfoData::ClearChangeFlags(void) +{ + for (int i = 0; i < settingCount; i++) + settingData[i].changed = 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +struct PwConfirmDlgParam +{ + CIcqProto* ppro; + char* Pass; +}; + +static INT_PTR CALLBACK PwConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + PwConfirmDlgParam* dat = (PwConfirmDlgParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam); + SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_LIMITTEXT, 15, 0); + return TRUE; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + { + char szTest[16]; + + GetDlgItemTextA(hwndDlg, IDC_OLDPASS, szTest, SIZEOF(szTest)); + + if (strcmpnull(szTest, dat->ppro->GetUserPassword(TRUE))) { + MessageBox(hwndDlg, TranslateT("The password does not match your current password. Check Caps Lock and try again."), TranslateT("Change ICQ Details"), MB_OK); + SendDlgItemMessage(hwndDlg, IDC_OLDPASS, EM_SETSEL, 0, (LPARAM)-1); + SetFocus(GetDlgItem(hwndDlg, IDC_OLDPASS)); + break; + } + + GetDlgItemTextA(hwndDlg, IDC_PASSWORD, szTest, SIZEOF(szTest)); + if (strcmpnull(szTest, dat->Pass)) { + MessageBox(hwndDlg, TranslateT("The password does not match the password you originally entered. Check Caps Lock and try again."), TranslateT("Change ICQ Details"), MB_OK); + SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_SETSEL, 0, (LPARAM)-1); + SetFocus(GetDlgItem(hwndDlg, IDC_PASSWORD)); + break; + } + } + case IDCANCEL: + EndDialog(hwndDlg, wParam); + break; + } + break; + } + return FALSE; +} + +int ChangeInfoData::SaveSettingsToDb(HWND hwndDlg) +{ + int ret = 1; + + for (int i = 0; i < settingCount; i++) { + SettingItemData &sid = settingData[i]; + if (!sid.changed) + continue; + + const SettingItem &si = setting[i]; + if (!(si.displayType & LIF_ZEROISVALID) && sid.value == 0) { + ppro->delSetting(si.szDbSetting); + continue; + } + switch (si.dbType) { + case DBVT_ASCIIZ: + if (si.displayType & LIF_PASSWORD) { + size_t nSettingLen = mir_strlen((char*)sid.value); + if (nSettingLen > 8 || nSettingLen < 1) { + MessageBox(hwndDlg, TranslateT("The ICQ server does not support passwords longer than 8 characters. Please use a shorter password."), TranslateT("Change ICQ Details"), MB_OK); + ret = 0; + break; + } + PwConfirmDlgParam param = { ppro, (char*)sid.value }; + if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_PWCONFIRM), hwndDlg, PwConfirmDlgProc, (LPARAM)¶m)) { + ret = 0; + break; + } + strcpy(ppro->m_szPassword, (char*)sid.value); + } + else { + if (*(char*)sid.value) + db_set_utf(NULL, ppro->m_szModuleName, si.szDbSetting, (char*)sid.value); + else + ppro->delSetting(si.szDbSetting); + } + break; + + case DBVT_UTF8: + if (*(char*)sid.value) + db_set_utf(NULL, ppro->m_szModuleName, si.szDbSetting, (char*)sid.value); + else + ppro->delSetting(si.szDbSetting); + break; + + case DBVT_WORD: + ppro->setWord(si.szDbSetting, (WORD)sid.value); + break; + + case DBVT_BYTE: + ppro->setByte(si.szDbSetting, (BYTE)sid.value); + break; + } + } + return ret; +} diff --git a/protocols/IcqOscarJ/src/directpackets.cpp b/protocols/IcqOscarJ/src/directpackets.cpp index 34253c5763..4ab3cd8415 100644 --- a/protocols/IcqOscarJ/src/directpackets.cpp +++ b/protocols/IcqOscarJ/src/directpackets.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void EncryptDirectPacket(directconnect* dc, icq_packet* p); diff --git a/protocols/IcqOscarJ/src/dlgproc.cpp b/protocols/IcqOscarJ/src/dlgproc.cpp new file mode 100644 index 0000000000..f747a3d381 --- /dev/null +++ b/protocols/IcqOscarJ/src/dlgproc.cpp @@ -0,0 +1,516 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2001-2004 Richard Hughes, Martin Öberg +// Copyright © 2004-2010 Joe Kucera, Bio +// Copyright © 2012-2014 Miranda NG Team +// +// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// ----------------------------------------------------------------------------- +// DESCRIPTION: +// +// ChangeInfo Plugin stuff +// ----------------------------------------------------------------------------- + +#include "stdafx.h" + +#define DM_PROTOACK (WM_USER+10) + +static int DrawTextUtf(HDC hDC, char *text, LPRECT lpRect, UINT uFormat, LPSIZE lpSize) +{ + int res; + + WCHAR *tmp = make_unicode_string(text); + res = DrawTextW(hDC, tmp, -1, lpRect, uFormat); + if (lpSize) + GetTextExtentPoint32W(hDC, tmp, (int)mir_wstrlen(tmp), lpSize); + SAFE_FREE((void**)&tmp); + + return res; +} + +char* ChangeInfoData::GetItemSettingText(int i, char *buf, size_t bufsize) +{ + char *text = buf; + int alloced = 0; + + buf[0] = '\0'; + + const SettingItem &si = setting[i]; + SettingItemData &sid = settingData[i]; + if (sid.value == 0 && !(si.displayType & LIF_ZEROISVALID)) { + if (si.displayType & LIF_CHANGEONLY) + text = ICQTranslateUtfStatic(LPGEN(""), buf, bufsize); + else + text = ICQTranslateUtfStatic(LPGEN(""), buf, bufsize); + } + else { + switch (si.displayType & LIM_TYPE) { + case LI_STRING: + case LI_LONGSTRING: + text = BinaryToEscapes((char*)sid.value); + alloced = 1; + break; + + case LI_NUMBER: + _itoa(sid.value, text, 10); + break; + + case LI_LIST: + if (si.dbType == DBVT_ASCIIZ) + text = ICQTranslateUtfStatic((char*)sid.value, buf, bufsize); + else { + text = ICQTranslateUtfStatic(LPGEN("Unknown value"), buf, bufsize); + + FieldNamesItem *list = (FieldNamesItem*)si.pList; + if (list == timezonesField) { + HANDLE tz = tmi.createByContact(NULL, ppro->m_szModuleName, 0); + text = make_utf8_string_static(tmi.getTzDescription(tmi.getTzName(tz)), buf, bufsize); + break; + } + + for (int j = 0;; j++) { + if (list[j].code == sid.value) { + text = ICQTranslateUtfStatic(list[j].text, buf, bufsize); + break; + } + else if (!list[j].text) { + if (list[j].code == sid.value) + text = ICQTranslateUtfStatic("Unspecified", buf, bufsize); + break; + } + } + } + break; + } + } + + if (si.displayType & LIF_PASSWORD) { + if (sid.changed) { + for (int j = 0; text[j]; j++) + text[j] = '*'; + } + else { + if (alloced) { + SAFE_FREE(&text); + alloced = 0; + } + text = "********"; + } + } + if (text != buf) { + char *tmp = text; + + text = null_strcpy(buf, text, bufsize - 1); + if (alloced) + SAFE_FREE(&tmp); + } + + return text; +} + +void ChangeInfoData::PaintItemSetting(HDC hdc, RECT *rc, int i, UINT itemState) +{ + char str[MAX_PATH]; + char *text = GetItemSettingText(i, str, SIZEOF(str)); + + const SettingItem &si = setting[i]; + SettingItemData &sid = settingData[i]; + if (sid.value == 0 && !(si.displayType & LIF_ZEROISVALID)) + SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT)); + + if ((si.displayType & LIM_TYPE) == LI_LIST && (itemState & CDIS_SELECTED || iEditItem == i)) { + RECT rcBtn = *rc; + rcBtn.left = rcBtn.right - rc->bottom + rc->top; + InflateRect(&rcBtn, -2, -2); + rc->right = rcBtn.left; + DrawFrameControl(hdc, &rcBtn, DFC_SCROLL, iEditItem == i ? DFCS_SCROLLDOWN | DFCS_PUSHED : DFCS_SCROLLDOWN); + } + DrawTextUtf(hdc, text, rc, DT_END_ELLIPSIS | DT_LEFT | DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER, NULL); +} + +static int ChangeInfoDlg_Resize(HWND, LPARAM, UTILRESIZECONTROL *urc) +{ + switch (urc->wId) { + case IDC_LIST: + return RD_ANCHORX_WIDTH | RD_ANCHORY_HEIGHT; + + case IDC_SAVE: + return RD_ANCHORX_RIGHT | RD_ANCHORY_BOTTOM; + + case IDC_UPLOADING: + return RD_ANCHORX_WIDTH | RD_ANCHORY_BOTTOM; + } + + return RD_ANCHORX_LEFT | RD_ANCHORY_TOP; // default +} + + +INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + ChangeInfoData* dat = (ChangeInfoData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + + dat = new ChangeInfoData(); + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); + + dat->hwndDlg = hwndDlg; + dat->ppro = (CIcqProto*)lParam; + dat->hwndList = GetDlgItem(hwndDlg, IDC_LIST); + + ListView_SetExtendedListViewStyle(dat->hwndList, LVS_EX_FULLROWSELECT); + dat->iEditItem = -1; + { + dat->hListFont = (HFONT)SendMessage(dat->hwndList, WM_GETFONT, 0, 0); + + LOGFONT lf; + GetObject(dat->hListFont, sizeof(lf), &lf); + lf.lfHeight -= 5; + HFONT hFont = CreateFontIndirect(&lf); + SendMessage(dat->hwndList, WM_SETFONT, (WPARAM)hFont, 0); + + // Prepare ListView Columns + RECT rc; + GetClientRect(dat->hwndList, &rc); + rc.right -= GetSystemMetrics(SM_CXVSCROLL); + + LV_COLUMN lvc = { 0 }; + lvc.mask = LVCF_WIDTH; + lvc.cx = rc.right / 3; + ListView_InsertColumn(dat->hwndList, 0, &lvc); + lvc.cx = rc.right - lvc.cx; + ListView_InsertColumn(dat->hwndList, 1, &lvc); + + // Prepare Setting Items + LV_ITEM lvi = { 0 }; + lvi.mask = LVIF_PARAM | LVIF_TEXT; + for (lvi.iItem = 0; lvi.iItem < settingCount; lvi.iItem++) { + TCHAR text[MAX_PATH]; + lvi.lParam = lvi.iItem; + lvi.pszText = text; + utf8_to_tchar_static(setting[lvi.iItem].szDescription, text, SIZEOF(text)); + ListView_InsertItem(dat->hwndList, &lvi); + } + } + + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + return TRUE; + + case WM_NOTIFY: + switch (((LPNMHDR)lParam)->idFrom) { + case 0: + switch (((LPNMHDR)lParam)->code) { + case PSN_PARAMCHANGED: + dat->ppro = (CIcqProto*)((PSHNOTIFY*)lParam)->lParam; + dat->LoadSettingsFromDb(0); + { + char *pwd = dat->ppro->GetUserPassword(TRUE); + strcpy(dat->Password, (pwd) ? pwd : ""); /// FIXME + } + break; + + case PSN_INFOCHANGED: + dat->LoadSettingsFromDb(1); + break; + + case PSN_KILLACTIVE: + dat->EndStringEdit(1); + dat->EndListEdit(1); + break; + + case PSN_APPLY: + if (dat->ChangesMade()) { + if (MessageBox(hwndDlg, TranslateT("You've made some changes to your ICQ details but it has not been saved to the server. Are you sure you want to close this dialog?"), TranslateT("Change ICQ Details"), MB_YESNOCANCEL) != IDYES) { + SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); + return TRUE; + } + } + } + break; + + case IDC_LIST: + switch (((LPNMHDR)lParam)->code) { + case LVN_GETDISPINFO: + if (dat->iEditItem != -1) { + if (dat->editTopIndex != ListView_GetTopIndex(dat->hwndList)) { + dat->EndStringEdit(1); + dat->EndListEdit(1); + } + } + break; + + case NM_CUSTOMDRAW: + { + LPNMLVCUSTOMDRAW cd = (LPNMLVCUSTOMDRAW)lParam; + + switch (cd->nmcd.dwDrawStage) { + case CDDS_PREPAINT: + SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_NOTIFYITEMDRAW); + return TRUE; + + case CDDS_ITEMPREPAINT: + if (dat->iEditItem != -1) { + if (dat->editTopIndex != ListView_GetTopIndex(dat->hwndList)) { + dat->EndStringEdit(1); + dat->EndListEdit(1); + } + } + { + RECT rcItem; + ListView_GetItemRect(dat->hwndList, cd->nmcd.dwItemSpec, &rcItem, LVIR_BOUNDS); + + if (GetWindowLongPtr(dat->hwndList, GWL_STYLE) & WS_DISABLED) { // Disabled List + SetTextColor(cd->nmcd.hdc, cd->clrText); + FillRect(cd->nmcd.hdc, &rcItem, GetSysColorBrush(COLOR_3DFACE)); + } + else if ((cd->nmcd.uItemState & CDIS_SELECTED || dat->iEditItem == (int)cd->nmcd.dwItemSpec) + && setting[cd->nmcd.lItemlParam].displayType != LI_DIVIDER) { // Selected item + SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_HIGHLIGHTTEXT)); + FillRect(cd->nmcd.hdc, &rcItem, GetSysColorBrush(COLOR_HIGHLIGHT)); + } + else { // Unselected item + SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_WINDOWTEXT)); + FillRect(cd->nmcd.hdc, &rcItem, GetSysColorBrush(COLOR_WINDOW)); + } + + HFONT hoFont = (HFONT)SelectObject(cd->nmcd.hdc, dat->hListFont); + + if (setting[cd->nmcd.lItemlParam].displayType == LI_DIVIDER) { + RECT rcLine; + SIZE textSize; + char str[MAX_PATH]; + char *szText = ICQTranslateUtfStatic(setting[cd->nmcd.lItemlParam].szDescription, str, MAX_PATH); + + SetTextColor(cd->nmcd.hdc, GetSysColor(COLOR_3DSHADOW)); + DrawTextUtf(cd->nmcd.hdc, szText, &rcItem, DT_CENTER | DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER, &textSize); + rcLine.top = (rcItem.top + rcItem.bottom) / 2 - 1; + rcLine.bottom = rcLine.top + 2; + rcLine.left = rcItem.left + 3; + rcLine.right = (rcItem.left + rcItem.right - textSize.cx) / 2 - 3; + DrawEdge(cd->nmcd.hdc, &rcLine, BDR_SUNKENOUTER, BF_RECT); + rcLine.left = (rcItem.left + rcItem.right + textSize.cx) / 2 + 3; + rcLine.right = rcItem.right - 3; + DrawEdge(cd->nmcd.hdc, &rcLine, BDR_SUNKENOUTER, BF_RECT); + } + else { + RECT rcItemDescr, rcItemValue; + char str[MAX_PATH]; + + ListView_GetSubItemRect(dat->hwndList, cd->nmcd.dwItemSpec, 0, LVIR_BOUNDS, &rcItemDescr); + ListView_GetSubItemRect(dat->hwndList, cd->nmcd.dwItemSpec, 1, LVIR_BOUNDS, &rcItemValue); + + rcItemDescr.right = rcItemValue.left; + rcItemDescr.left += 2; + DrawTextUtf(cd->nmcd.hdc, ICQTranslateUtfStatic(setting[cd->nmcd.lItemlParam].szDescription, str, MAX_PATH), &rcItemDescr, DT_END_ELLIPSIS | DT_LEFT | DT_NOCLIP | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER, NULL); + + dat->PaintItemSetting(cd->nmcd.hdc, &rcItemValue, cd->nmcd.lItemlParam, cd->nmcd.uItemState); + } + SelectObject(cd->nmcd.hdc, hoFont); + + SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT); + + return TRUE; + } + } + } + break; + + case NM_CLICK: + { + LPNMLISTVIEW nm = (LPNMLISTVIEW)lParam; + LV_ITEM lvi; + RECT rc; + + dat->EndStringEdit(1); + dat->EndListEdit(1); + if (nm->iSubItem != 1) break; + lvi.mask = LVIF_PARAM | LVIF_STATE; + lvi.stateMask = 0xFFFFFFFF; + lvi.iItem = nm->iItem; lvi.iSubItem = nm->iSubItem; + ListView_GetItem(dat->hwndList, &lvi); + if (!(lvi.state & LVIS_SELECTED)) break; + ListView_EnsureVisible(dat->hwndList, lvi.iItem, FALSE); + ListView_GetSubItemRect(dat->hwndList, lvi.iItem, lvi.iSubItem, LVIR_BOUNDS, &rc); + dat->editTopIndex = ListView_GetTopIndex(dat->hwndList); + switch (setting[lvi.lParam].displayType & LIM_TYPE) { + case LI_STRING: + case LI_LONGSTRING: + case LI_NUMBER: + dat->BeginStringEdit(nm->iItem, &rc, lvi.lParam, 0); + break; + case LI_LIST: + dat->BeginListEdit(nm->iItem, &rc, lvi.lParam, 0); + break; + } + } + break; + + case LVN_KEYDOWN: + { + LPNMLVKEYDOWN nm = (LPNMLVKEYDOWN)lParam; + LV_ITEM lvi; + RECT rc; + + dat->EndStringEdit(1); + dat->EndListEdit(1); + if (nm->wVKey == VK_SPACE || nm->wVKey == VK_RETURN || nm->wVKey == VK_F2) nm->wVKey = 0; + if (nm->wVKey && (nm->wVKey<'0' || (nm->wVKey>'9' && nm->wVKey<'A') || (nm->wVKey>'Z' && nm->wVKey < VK_NUMPAD0) || nm->wVKey >= VK_F1)) + break; + lvi.mask = LVIF_PARAM | LVIF_STATE; + lvi.stateMask = 0xFFFFFFFF; + lvi.iItem = ListView_GetNextItem(dat->hwndList, -1, LVNI_ALL | LVNI_SELECTED); + if (lvi.iItem == -1) break; + lvi.iSubItem = 1; + ListView_GetItem(dat->hwndList, &lvi); + ListView_EnsureVisible(dat->hwndList, lvi.iItem, FALSE); + ListView_GetSubItemRect(dat->hwndList, lvi.iItem, lvi.iSubItem, LVIR_BOUNDS, &rc); + dat->editTopIndex = ListView_GetTopIndex(dat->hwndList); + switch (setting[lvi.lParam].displayType & LIM_TYPE) { + case LI_STRING: + case LI_LONGSTRING: + case LI_NUMBER: + dat->BeginStringEdit(lvi.iItem, &rc, lvi.lParam, nm->wVKey); + break; + case LI_LIST: + dat->BeginListEdit(lvi.iItem, &rc, lvi.lParam, nm->wVKey); + break; + } + SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, TRUE); + } + return TRUE; + + case NM_KILLFOCUS: + if (!IsStringEditWindow(GetFocus())) + dat->EndStringEdit(1); + if (!IsListEditWindow(GetFocus())) + dat->EndListEdit(1); + } + } + break; + + case WM_KILLFOCUS: + dat->EndStringEdit(1); + dat->EndListEdit(1); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDCANCEL: + SendMessage(GetParent(hwndDlg), msg, wParam, lParam); + break; + + case IDC_SAVE: + if (!dat->SaveSettingsToDb(hwndDlg)) + break; + + EnableDlgItem(hwndDlg, IDC_SAVE, FALSE); + EnableDlgItem(hwndDlg, IDC_LIST, FALSE); + SetDlgItemText(hwndDlg, IDC_UPLOADING, TranslateT("Upload in progress...")); + EnableDlgItem(hwndDlg, IDC_UPLOADING, TRUE); + ShowDlgItem(hwndDlg, IDC_UPLOADING, SW_SHOW); + dat->hAckHook = HookEventMessage(ME_PROTO_ACK, hwndDlg, DM_PROTOACK); + + if (!dat->UploadSettings()) { + EnableDlgItem(hwndDlg, IDC_SAVE, TRUE); + EnableDlgItem(hwndDlg, IDC_LIST, TRUE); + ShowDlgItem(hwndDlg, IDC_UPLOADING, SW_HIDE); + UnhookEvent(dat->hAckHook); + dat->hAckHook = NULL; + } + } + break; + + case WM_SIZE: + { // make the dlg resizeable + UTILRESIZEDIALOG urd = { 0 }; + + if (IsIconic(hwndDlg)) break; + urd.cbSize = sizeof(urd); + urd.hInstance = hInst; + urd.hwndDlg = hwndDlg; + urd.lParam = 0; // user-defined + urd.lpTemplate = MAKEINTRESOURCEA(IDD_INFO_CHANGEINFO); + urd.pfnResizer = ChangeInfoDlg_Resize; + CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd); + + { // update listview column widths + RECT rc; + + GetClientRect(dat->hwndList, &rc); + rc.right -= GetSystemMetrics(SM_CXVSCROLL); + ListView_SetColumnWidth(dat->hwndList, 0, rc.right / 3); + ListView_SetColumnWidth(dat->hwndList, 1, rc.right - rc.right / 3); + } + } + break; + + case DM_PROTOACK: + { + ACKDATA *ack = (ACKDATA*)lParam; + int i, done; + + if (ack->type != ACKTYPE_SETINFO) break; + if (ack->result == ACKRESULT_SUCCESS) { + for (i = 0; i < SIZEOF(dat->hUpload); i++) + if (dat->hUpload[i] && ack->hProcess == dat->hUpload[i]) break; + + if (i == SIZEOF(dat->hUpload)) break; + dat->hUpload[i] = NULL; + for (done = 0, i = 0; i < SIZEOF(dat->hUpload); i++) + done += dat->hUpload[i] == NULL; + TCHAR buf[MAX_PATH]; + mir_sntprintf(buf, SIZEOF(buf), TranslateT("Upload in progress...%d%%"), 100 * done / (SIZEOF(dat->hUpload))); + SetDlgItemText(hwndDlg, IDC_UPLOADING, buf); + if (done < SIZEOF(dat->hUpload)) break; + + dat->ClearChangeFlags(); + UnhookEvent(dat->hAckHook); + dat->hAckHook = NULL; + EnableDlgItem(hwndDlg, IDC_LIST, TRUE); + EnableDlgItem(hwndDlg, IDC_UPLOADING, FALSE); + SetDlgItemText(hwndDlg, IDC_UPLOADING, TranslateT("Upload complete")); + SendMessage(GetParent(hwndDlg), PSM_FORCECHANGED, 0, 0); + } + else if (ack->result == ACKRESULT_FAILED) { + UnhookEvent(dat->hAckHook); + dat->hAckHook = NULL; + EnableDlgItem(hwndDlg, IDC_LIST, TRUE); + EnableDlgItem(hwndDlg, IDC_UPLOADING, FALSE); + SetDlgItemText(hwndDlg, IDC_UPLOADING, TranslateT("Upload FAILED")); + SendMessage(GetParent(hwndDlg), PSM_FORCECHANGED, 0, 0); + EnableDlgItem(hwndDlg, IDC_SAVE, TRUE); + } + } + break; + + case WM_DESTROY: + if (dat->hAckHook) { + UnhookEvent(dat->hAckHook); + dat->hAckHook = NULL; + } + + DeleteObject((HFONT)SendMessage(dat->hwndList, WM_GETFONT, 0, 0)); + + dat->FreeStoredDbSettings(); + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0); + delete dat; + break; + } + return FALSE; +} diff --git a/protocols/IcqOscarJ/src/editlist.cpp b/protocols/IcqOscarJ/src/editlist.cpp new file mode 100644 index 0000000000..03218b9836 --- /dev/null +++ b/protocols/IcqOscarJ/src/editlist.cpp @@ -0,0 +1,196 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2001-2004 Richard Hughes, Martin Öberg +// Copyright © 2004-2009 Joe Kucera, Bio +// Copyright © 2012-2014 Miranda NG Team +// +// 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. +// ----------------------------------------------------------------------------- +// DESCRIPTION: +// +// ChangeInfo Plugin stuff +// ----------------------------------------------------------------------------- + +#include "stdafx.h" + +static ChangeInfoData *dataListEdit = NULL; +static HWND hwndListEdit = NULL; + +static LRESULT CALLBACK ListEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_LBUTTONUP: + mir_callNextSubclass(hwnd, ListEditSubclassProc, msg, wParam, lParam); + { + POINT pt = { (short)LOWORD(lParam), (short)HIWORD(lParam) }; + ClientToScreen(hwnd, &pt); + if (SendMessage(hwnd, WM_NCHITTEST, 0, MAKELPARAM(pt.x, pt.y)) == HTVSCROLL) + break; + + int i = SendMessage(hwnd, LB_GETCURSEL, 0, 0); + if (dataListEdit) + dataListEdit->EndListEdit(i != LB_ERR); + } + return 0; + + case WM_CHAR: + if (wParam != '\r') break; + { + int i = SendMessage(hwnd, LB_GETCURSEL, 0, 0); + if (dataListEdit) + dataListEdit->EndListEdit(i != LB_ERR); + } + return 0; + + case WM_KILLFOCUS: + if (dataListEdit) + dataListEdit->EndListEdit(1); + return 0; + } + return mir_callNextSubclass(hwnd, ListEditSubclassProc, msg, wParam, lParam); +} + +void ChangeInfoData::BeginListEdit(int iItem, RECT *rc, int iSetting, WORD wVKey) +{ + if (dataListEdit) + dataListEdit->EndListEdit(0); + + POINT pt = { 0, 0 }; + ClientToScreen(hwndList, &pt); + OffsetRect(rc, pt.x, pt.y); + InflateRect(rc, -2, -2); + rc->left -= 2; + iEditItem = iItem; + ListView_RedrawItems(hwndList, iEditItem, iEditItem); + UpdateWindow(hwndList); + + dataListEdit = this; + hwndListEdit = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, _T("LISTBOX"), _T(""), WS_POPUP | WS_BORDER | WS_VSCROLL, + rc->left, rc->bottom, rc->right - rc->left, 150, NULL, NULL, hInst, NULL); + SendMessage(hwndListEdit, WM_SETFONT, (WPARAM)hListFont, 0); + int itemHeight = SendMessage(hwndListEdit, LB_GETITEMHEIGHT, 0, 0); + + const SettingItem &si = setting[iSetting]; + SettingItemData &sid = settingData[iSetting]; + FieldNamesItem *list = (FieldNamesItem*)si.pList; + + // some country codes were changed leaving old details uknown, convert it for the user + if (list == countryField) { + if (sid.value == 420) + sid.value = 42; // conversion of obsolete codes (OMG!) + else if (sid.value == 421) + sid.value = 4201; + else if (sid.value == 102) + sid.value = 1201; + } + + if (list == timezonesField) { + tmi.prepareList(NULL, ppro->m_szModuleName, hwndListEdit, TZF_PLF_LB); + } + else { + int j, n = ListBoxAddStringUtf(hwndListEdit, "Unspecified"); + for (j = 0;; j++) + if (!list[j].text) { + SendMessage(hwndListEdit, LB_SETITEMDATA, n, j); + if ((sid.value == 0 && list[j].code == 0) || (si.dbType != DBVT_ASCIIZ && sid.value == list[j].code)) + SendMessage(hwndListEdit, LB_SETCURSEL, n, 0); + break; + } + + for (j = 0; list[j].text; j++) { + char str[MAX_PATH]; + n = ListBoxAddStringUtf(hwndListEdit, list[j].text); + SendMessage(hwndListEdit, LB_SETITEMDATA, n, j); + if ((si.dbType == DBVT_ASCIIZ && (!strcmpnull((char*)sid.value, list[j].text)) + || (si.dbType == DBVT_ASCIIZ && (!strcmpnull((char*)sid.value, ICQTranslateUtfStatic(list[j].text, str, MAX_PATH)))) + || ((char*)sid.value == NULL && list[j].code == 0)) + || (si.dbType != DBVT_ASCIIZ && sid.value == list[j].code)) + SendMessage(hwndListEdit, LB_SETCURSEL, n, 0); + } + SendMessage(hwndListEdit, LB_SETTOPINDEX, SendMessage(hwndListEdit, LB_GETCURSEL, 0, 0) - 3, 0); + } + + int listCount = SendMessage(hwndListEdit, LB_GETCOUNT, 0, 0); + if (itemHeight * listCount < 150) + SetWindowPos(hwndListEdit, 0, 0, 0, rc->right - rc->left, itemHeight * listCount + GetSystemMetrics(SM_CYBORDER) * 2, SWP_NOZORDER | SWP_NOMOVE); + mir_subclassWindow(hwndListEdit, ListEditSubclassProc); + AnimateWindow(hwndListEdit, 200, AW_SLIDE | AW_ACTIVATE | AW_VER_POSITIVE); + ShowWindow(hwndListEdit, SW_SHOW); + SetFocus(hwndListEdit); + if (wVKey) + PostMessage(hwndListEdit, WM_KEYDOWN, wVKey, 0); +} + +void ChangeInfoData::EndListEdit(int save) +{ + if (hwndListEdit == NULL || iEditItem == -1 || this != dataListEdit) + return; + + if (save) { + const SettingItem &si = setting[iEditItem]; + SettingItemData &sid = settingData[iEditItem]; + + int iItem = SendMessage(hwndListEdit, LB_GETCURSEL, 0, 0); + int i = SendMessage(hwndListEdit, LB_GETITEMDATA, iItem, 0); + if (iItem != -1 && i != -1) { + FieldNamesItem *list = (FieldNamesItem*)si.pList; + if (list == timezonesField) { + tmi.storeListResults(NULL, ppro->m_szModuleName, hwndListEdit, TZF_PLF_LB); + list[i = 0].code = ppro->getDword("Timezone", 0); + } + + FieldNamesItem &pItem = list[i]; + + if (si.dbType == DBVT_ASCIIZ) { + char *szNewValue = pItem.text; + if (pItem.code || (si.displayType & LIF_ZEROISVALID)) { + sid.changed = strcmpnull(szNewValue, (char*)sid.value); + SAFE_FREE((void**)&sid.value); + sid.value = (LPARAM)null_strdup(szNewValue); + } + else { + sid.changed = (char*)sid.value != NULL; + SAFE_FREE((void**)&sid.value); + } + } + else { + sid.changed = pItem.code != sid.value; + sid.value = pItem.code; + } + + if (sid.changed) { + char buf[MAX_PATH]; + TCHAR tbuf[MAX_PATH]; + if (utf8_to_tchar_static(ICQTranslateUtfStatic(pItem.text, buf, SIZEOF(buf)), tbuf, SIZEOF(buf))) + ListView_SetItemText(hwndList, iEditItem, 1, tbuf); + + EnableDlgItem(GetParent(hwndList), IDC_SAVE, TRUE); + } + } + } + ListView_RedrawItems(hwndList, iEditItem, iEditItem); + iEditItem = -1; + dataListEdit = NULL; + DestroyWindow(hwndListEdit); + hwndListEdit = NULL; +} + +int IsListEditWindow(HWND hwnd) +{ + if (hwnd == hwndListEdit) return 1; + return 0; +} diff --git a/protocols/IcqOscarJ/src/editstring.cpp b/protocols/IcqOscarJ/src/editstring.cpp new file mode 100644 index 0000000000..b73ae9e6a5 --- /dev/null +++ b/protocols/IcqOscarJ/src/editstring.cpp @@ -0,0 +1,352 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2001-2004 Richard Hughes, Martin Öberg +// Copyright © 2004-2009 Joe Kucera, Bio +// Copyright © 2012-2014 Miranda NG Team +// +// 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. +// ----------------------------------------------------------------------------- +// DESCRIPTION: +// +// ChangeInfo Plugin stuff +// ----------------------------------------------------------------------------- + +#include "stdafx.h" + +static ChangeInfoData *dataStringEdit = NULL; +static HWND hwndEdit = NULL, hwndExpandButton = NULL, hwndUpDown = NULL; + +static const char escapes[]={'a','\a', +'b','\b', +'e',27, +'f','\f', +'r','\r', +'t','\t', +'v','\v', +'\\','\\'}; + +static void EscapesToMultiline(WCHAR *str,PDWORD selStart,PDWORD selEnd) +{ //converts "\\n" and "\\t" to "\r\n" and "\t" because a multi-line edit box can show them properly + DWORD i; + + for(i=0; *str; str++, i++) + { + if (*str != '\\') continue; + if (str[1] == 'n') + { + *str++ = '\r'; + i++; + *str = '\n'; + } + else if (str[1] == 't') + { + *str = '\t'; + memmove(str+1, str+2, sizeof(WCHAR)*(mir_wstrlen(str)-1)); + + if (*selStart>i) --*selStart; + if (*selEnd>i) --*selEnd; + } + } +} + + + +static void EscapesToBinary(char *str) +{ + for (;*str;str++) + { + if (*str!='\\') continue; + if(str[1]=='n') {*str++='\r'; *str='\n'; continue;} + if(str[1]=='0') + { + char *codeend; + *str=(char)strtol(str+1,&codeend,8); + if (*str==0) {*str='\\'; continue;} + memmove(str+1,codeend,mir_strlen(codeend)+1); + continue; + } + for(int i=0;i=' ') + { + *pout++=*str; + continue; + } + if(str[0]=='\r' && str[1]=='\n') + { + *pout++='\\'; + *pout++='n'; + str++; + continue; + } + if(extra<3) + { + extra+=8; len+=8; + pout=out=(char*)SAFE_REALLOC(out,len); + } + *pout++='\\'; + for(i = 0; i < SIZEOF(escapes); i += 2) + if (*str==escapes[i+1]) + { + *pout++=escapes[i]; + extra--; + break; + } + if(i < SIZEOF(escapes)) continue; + *pout++='0'; extra--; + if (*str>=8) + { + *pout++=(*str>>3)+'0'; + extra--; + } + *pout++=(*str&7)+'0'; extra--; + } + *pout='\0'; + return out; +} + + + +static LRESULT CALLBACK StringEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) +{ + switch(msg) { + case WM_KEYDOWN: + if (wParam==VK_ESCAPE) + { + if (dataStringEdit) + dataStringEdit->EndStringEdit(0); + return 0; + } + if (wParam==VK_RETURN) + { + if (GetWindowLongPtr(hwnd, GWL_STYLE) & ES_MULTILINE && !(GetKeyState(VK_CONTROL) & 0x8000)) break; + if (dataStringEdit) + dataStringEdit->EndStringEdit(1); + return 0; + } + break; + + case WM_GETDLGCODE: + return DLGC_WANTALLKEYS | mir_callNextSubclass(hwnd, StringEditSubclassProc, msg, wParam, lParam); + + case WM_KILLFOCUS: + if ((HWND)wParam == hwndExpandButton) break; + if (dataStringEdit) + dataStringEdit->EndStringEdit(1); + return 0; + } + return mir_callNextSubclass(hwnd, StringEditSubclassProc, msg, wParam, lParam); +} + +static LRESULT CALLBACK ExpandButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_LBUTTONUP: + if (GetCapture() == hwnd) { + //do expand + RECT rcStart, rcEnd; + DWORD selStart, selEnd; + WCHAR *text; + BOOL animEnabled = TRUE; + + GetWindowRect(hwndEdit, &rcStart); + InflateRect(&rcStart, 2, 2); + + text = GetWindowTextUcs(hwndEdit); + SendMessage(hwndEdit, EM_GETSEL, (WPARAM)&selStart, (LPARAM)&selEnd); + DestroyWindow(hwndEdit); + EscapesToMultiline(text, &selStart, &selEnd); + hwndEdit = CreateWindowExA(WS_EX_TOOLWINDOW, "EDIT", "", WS_POPUP | WS_BORDER | WS_VISIBLE | ES_WANTRETURN | ES_AUTOVSCROLL | WS_VSCROLL | ES_MULTILINE, rcStart.left, rcStart.top, rcStart.right - rcStart.left, rcStart.bottom - rcStart.top, NULL, NULL, hInst, NULL); + SetWindowTextUcs(hwndEdit, text); + mir_subclassWindow(hwndEdit, StringEditSubclassProc); + SendMessage(hwndEdit, WM_SETFONT, (WPARAM)dataStringEdit->hListFont, 0); + SendMessage(hwndEdit, EM_SETSEL, selStart, selEnd); + SetFocus(hwndEdit); + + rcEnd.left = rcStart.left; rcEnd.top = rcStart.top; + rcEnd.right = rcEnd.left + 350; + rcEnd.bottom = rcEnd.top + 150; + if (LOBYTE(LOWORD(GetVersion())) > 4 || HIBYTE(LOWORD(GetVersion())) > 0) + SystemParametersInfo(SPI_GETCOMBOBOXANIMATION, 0, &animEnabled, FALSE); + if (animEnabled) { + DWORD startTime, timeNow; + startTime = GetTickCount(); + for (;;) { + UpdateWindow(hwndEdit); + timeNow = GetTickCount(); + if (timeNow > startTime + 200) break; + SetWindowPos(hwndEdit, 0, rcEnd.left, rcEnd.top, (rcEnd.right - rcStart.right)*(timeNow - startTime) / 200 + rcStart.right - rcEnd.left, (rcEnd.bottom - rcStart.bottom)*(timeNow - startTime) / 200 + rcStart.bottom - rcEnd.top, SWP_NOZORDER); + } + } + SetWindowPos(hwndEdit, 0, rcEnd.left, rcEnd.top, rcEnd.right - rcEnd.left, rcEnd.bottom - rcEnd.top, SWP_NOZORDER); + + DestroyWindow(hwnd); + hwndExpandButton = NULL; + + SAFE_FREE((void**)&text); + } + break; + } + return mir_callNextSubclass(hwnd, ExpandButtonSubclassProc, msg, wParam, lParam); +} + +void ChangeInfoData::BeginStringEdit(int iItem, RECT *rc, int i, WORD wVKey) +{ + char *szValue; + char str[80]; + int alloced = 0; + + EndStringEdit(0); + InflateRect(rc, -2, -2); + rc->left -= 2; + + const SettingItem &si = setting[i]; + SettingItemData &sid = settingData[i]; + + if (si.displayType & LIF_PASSWORD && !sid.changed) + szValue = " "; + else if ((si.displayType & LIM_TYPE) == LI_NUMBER) { + szValue = str; + mir_snprintf(str, SIZEOF(str), "%d", sid.value); + } + else if (sid.value) { + szValue = BinaryToEscapes((char*)sid.value); + alloced = 1; + } + else szValue = ""; + + iEditItem = iItem; + + if ((si.displayType & LIM_TYPE) == LI_LONGSTRING) { + rc->right -= rc->bottom - rc->top; + hwndExpandButton = CreateWindowA("BUTTON", "", WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON | BS_ICON, rc->right, rc->top, rc->bottom - rc->top, rc->bottom - rc->top, hwndList, NULL, hInst, NULL); + SendMessage(hwndExpandButton, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_EXPANDSTRINGEDIT), IMAGE_ICON, 0, 0, LR_SHARED)); + mir_subclassWindow(hwndExpandButton, ExpandButtonSubclassProc); + } + + dataStringEdit = this; + hwndEdit = CreateWindow(_T("EDIT"), _T(""), WS_VISIBLE | WS_CHILD | ES_AUTOHSCROLL | ((si.displayType&LIM_TYPE) == LI_NUMBER ? ES_NUMBER : 0) | (si.displayType&LIF_PASSWORD ? ES_PASSWORD : 0), rc->left, rc->top, rc->right - rc->left, rc->bottom - rc->top, hwndList, NULL, hInst, NULL); + SetWindowTextUtf(hwndEdit, szValue); + if (alloced) SAFE_FREE(&szValue); + mir_subclassWindow(hwndEdit, StringEditSubclassProc); + SendMessage(hwndEdit, WM_SETFONT, (WPARAM)hListFont, 0); + if ((si.displayType & LIM_TYPE) == LI_NUMBER) { + int *range = (int*)si.pList; + RECT rcUpDown; + hwndUpDown = CreateWindow(UPDOWN_CLASS, _T(""), WS_VISIBLE | WS_CHILD | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_HOTTRACK | UDS_NOTHOUSANDS | UDS_SETBUDDYINT, 0, 0, 0, 0, hwndList, NULL, hInst, NULL); + SendMessage(hwndUpDown, UDM_SETRANGE32, range[0], range[1]); + SendMessage(hwndUpDown, UDM_SETPOS32, 0, sid.value); + if (!(si.displayType & LIF_ZEROISVALID) && sid.value == 0) + SetWindowTextA(hwndEdit, ""); + GetClientRect(hwndUpDown, &rcUpDown); + rc->right -= rcUpDown.right; + SetWindowPos(hwndEdit, 0, 0, 0, rc->right - rc->left, rc->bottom - rc->top, SWP_NOZORDER | SWP_NOMOVE); + } + SendMessage(hwndEdit, EM_SETSEL, 0, (LPARAM)-1); + SetFocus(hwndEdit); + PostMessage(hwndEdit, WM_KEYDOWN, wVKey, 0); +} + +void ChangeInfoData::EndStringEdit(int save) +{ + if (hwndEdit == NULL || iEditItem == -1 || this != dataStringEdit) + return; + + if (save) { + char *text = (char*)SAFE_MALLOC(GetWindowTextLength(hwndEdit) + 1); + const SettingItem &si = setting[iEditItem]; + SettingItemData &sid = settingData[iEditItem]; + + GetWindowTextA(hwndEdit, (char*)text, GetWindowTextLength(hwndEdit) + 1); + EscapesToBinary(text); + if ((si.displayType & LIM_TYPE) == LI_NUMBER) { + LPARAM newValue; + int *range = (int*)si.pList; + newValue = atoi(text); + if (newValue) { + if (newValuerange[1]) newValue = range[1]; + } + sid.changed = sid.value != newValue; + sid.value = newValue; + SAFE_FREE(&text); + } + else { + if (!(si.displayType & LIF_PASSWORD)) { + SAFE_FREE(&text); + text = GetWindowTextUtf(hwndEdit); + EscapesToBinary(text); + } + if ((si.displayType & LIF_PASSWORD && strcmpnull(text, " ")) || + (!(si.displayType & LIF_PASSWORD) && strcmpnull(text, (char*)sid.value) && (mir_strlen(text) + mir_strlen((char*)sid.value)))) { + SAFE_FREE((void**)&sid.value); + if (mir_strlen(text)) + sid.value = (LPARAM)text; + else { + sid.value = 0; + SAFE_FREE(&text); + } + sid.changed = 1; + } + } + + if (sid.changed) { + TCHAR tbuf[MAX_PATH]; + + GetWindowText(hwndEdit, tbuf, SIZEOF(tbuf)); + ListView_SetItemText(hwndList, iEditItem, 1, tbuf); + + EnableDlgItem(hwndDlg, IDC_SAVE, TRUE); + } + } + + ListView_RedrawItems(hwndList, iEditItem, iEditItem); + iEditItem = -1; + dataStringEdit = NULL; + DestroyWindow(hwndEdit); + hwndEdit = NULL; + if (hwndExpandButton) DestroyWindow(hwndExpandButton); + hwndExpandButton = NULL; + if (hwndUpDown) DestroyWindow(hwndUpDown); + hwndUpDown = NULL; +} + +int IsStringEditWindow(HWND hwnd) +{ + if (hwnd == hwndEdit) return 1; + if (hwnd == hwndExpandButton) return 1; + if (hwnd == hwndUpDown) return 1; + return 0; +} diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp index 6363ab8d4f..f425543897 100644 --- a/protocols/IcqOscarJ/src/fam_01service.cpp +++ b/protocols/IcqOscarJ/src/fam_01service.cpp @@ -27,7 +27,7 @@ // Handles packets from Service family // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" extern capstr capXStatus[]; diff --git a/protocols/IcqOscarJ/src/fam_02location.cpp b/protocols/IcqOscarJ/src/fam_02location.cpp index 1a3953c717..fcbaa23fda 100644 --- a/protocols/IcqOscarJ/src/fam_02location.cpp +++ b/protocols/IcqOscarJ/src/fam_02location.cpp @@ -27,7 +27,7 @@ // Handles packets from Location family // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" extern const char* cliSpamBot; diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp index 057d7403b1..0c862db64e 100644 --- a/protocols/IcqOscarJ/src/fam_03buddy.cpp +++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp @@ -27,7 +27,7 @@ // Handles packets from Buddy family // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" extern const char* cliSpamBot; diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index 288d129b6e..84339c2846 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -27,7 +27,7 @@ // Handles packets from Family 4 ICBM Messages // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleMsgFam(BYTE *pBuffer, size_t wBufferLength, snac_header *pSnacHeader) { diff --git a/protocols/IcqOscarJ/src/fam_09bos.cpp b/protocols/IcqOscarJ/src/fam_09bos.cpp index a8b84290be..cda848a02f 100644 --- a/protocols/IcqOscarJ/src/fam_09bos.cpp +++ b/protocols/IcqOscarJ/src/fam_09bos.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleBosFam(unsigned char *pBuffer, size_t wBufferLength, snac_header* pSnacHeader) { diff --git a/protocols/IcqOscarJ/src/fam_0alookup.cpp b/protocols/IcqOscarJ/src/fam_0alookup.cpp index c05833eb92..44b529486b 100644 --- a/protocols/IcqOscarJ/src/fam_0alookup.cpp +++ b/protocols/IcqOscarJ/src/fam_0alookup.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleLookupFam(BYTE *pBuffer, size_t wBufferLength, snac_header* pSnacHeader) { diff --git a/protocols/IcqOscarJ/src/fam_0bstatus.cpp b/protocols/IcqOscarJ/src/fam_0bstatus.cpp index f56661315e..67158a2906 100644 --- a/protocols/IcqOscarJ/src/fam_0bstatus.cpp +++ b/protocols/IcqOscarJ/src/fam_0bstatus.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleStatusFam(unsigned char *pBuffer, size_t wBufferLength, snac_header* pSnacHeader) { diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index 948592dae4..77faf554f2 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" static int unpackServerListItem(BYTE **pbuf, size_t *pwLen, char *pszRecordName, WORD *pwGroupId, WORD *pwItemId, WORD *pwItemType, size_t *pwTlvLength); diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index 8db067a21e..09d6de130c 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleIcqExtensionsFam(BYTE *pBuffer, size_t wBufferLength, snac_header* pSnacHeader) { diff --git a/protocols/IcqOscarJ/src/fam_17signon.cpp b/protocols/IcqOscarJ/src/fam_17signon.cpp index a6689e6295..94c331e3b7 100644 --- a/protocols/IcqOscarJ/src/fam_17signon.cpp +++ b/protocols/IcqOscarJ/src/fam_17signon.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleAuthorizationFam(BYTE *pBuffer, size_t wBufferLength, snac_header *pSnacHeader, serverthread_info *info) { diff --git a/protocols/IcqOscarJ/src/i18n.cpp b/protocols/IcqOscarJ/src/i18n.cpp index 5b7ab1d2a2..2dfc79d17a 100644 --- a/protocols/IcqOscarJ/src/i18n.cpp +++ b/protocols/IcqOscarJ/src/i18n.cpp @@ -28,7 +28,7 @@ // character sets. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" static BOOL bHasCP_UTF8 = FALSE; diff --git a/protocols/IcqOscarJ/src/icq_advsearch.cpp b/protocols/IcqOscarJ/src/icq_advsearch.cpp index dfbe51a6d4..647faf6392 100644 --- a/protocols/IcqOscarJ/src/icq_advsearch.cpp +++ b/protocols/IcqOscarJ/src/icq_advsearch.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" static void InitComboBox(HWND hwndCombo, const FieldNamesItem *names) { diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index 18c802872a..645d5ec2c2 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -27,7 +27,7 @@ // Manages Avatar connection, provides internal service for handling avatars // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" #include "m_folders.h" BYTE hashEmptyAvatar[9] = {0x00, 0x01, 0x00, 0x05, 0x02, 0x01, 0xD2, 0x04, 0x72}; diff --git a/protocols/IcqOscarJ/src/icq_clients.cpp b/protocols/IcqOscarJ/src/icq_clients.cpp index 7b4f495295..a517288901 100644 --- a/protocols/IcqOscarJ/src/icq_clients.cpp +++ b/protocols/IcqOscarJ/src/icq_clients.cpp @@ -27,7 +27,7 @@ // Provides capability & signature based client detection // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" const capstr capShortCaps = {0x09, 0x46, 0x00, 0x00, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}; // CAP_AIM_BUDDYICON diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp index 53e41ef407..a9aa778cb1 100644 --- a/protocols/IcqOscarJ/src/icq_db.cpp +++ b/protocols/IcqOscarJ/src/icq_db.cpp @@ -27,7 +27,7 @@ // Internal Database API // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" int CIcqProto::getSetting(MCONTACT hContact, const char *szSetting, DBVARIANT *dbv) { diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp index 40d1a2961d..5c837b352a 100644 --- a/protocols/IcqOscarJ/src/icq_direct.cpp +++ b/protocols/IcqOscarJ/src/icq_direct.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" struct directthreadstartinfo { diff --git a/protocols/IcqOscarJ/src/icq_directmsg.cpp b/protocols/IcqOscarJ/src/icq_directmsg.cpp index 52b68a7ca6..3b5c74b381 100644 --- a/protocols/IcqOscarJ/src/icq_directmsg.cpp +++ b/protocols/IcqOscarJ/src/icq_directmsg.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleDirectMessage(directconnect* dc, PBYTE buf, size_t wLen) { diff --git a/protocols/IcqOscarJ/src/icq_fieldnames.cpp b/protocols/IcqOscarJ/src/icq_fieldnames.cpp index d5f80a5732..6bc676e7e3 100644 --- a/protocols/IcqOscarJ/src/icq_fieldnames.cpp +++ b/protocols/IcqOscarJ/src/icq_fieldnames.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" FieldNamesItem timezonesField[] = { diff --git a/protocols/IcqOscarJ/src/icq_filerequests.cpp b/protocols/IcqOscarJ/src/icq_filerequests.cpp index 6a757ce248..0b93cf87a5 100644 --- a/protocols/IcqOscarJ/src/icq_filerequests.cpp +++ b/protocols/IcqOscarJ/src/icq_filerequests.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleFileAck(PBYTE buf, size_t wLen, DWORD dwUin, DWORD dwCookie, WORD wStatus) { diff --git a/protocols/IcqOscarJ/src/icq_filetransfer.cpp b/protocols/IcqOscarJ/src/icq_filetransfer.cpp index 54b11af724..25bc45de50 100644 --- a/protocols/IcqOscarJ/src/icq_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/icq_filetransfer.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" static void file_buildProtoFileTransferStatus(filetransfer* ft, PROTOFILETRANSFERSTATUS* pfts) { diff --git a/protocols/IcqOscarJ/src/icq_firstrun.cpp b/protocols/IcqOscarJ/src/icq_firstrun.cpp index 34e1ff3b01..e5761b6052 100644 --- a/protocols/IcqOscarJ/src/icq_firstrun.cpp +++ b/protocols/IcqOscarJ/src/icq_firstrun.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" static void accountLoadDetails(CIcqProto *ppro, HWND hwndDlg) { diff --git a/protocols/IcqOscarJ/src/icq_http.cpp b/protocols/IcqOscarJ/src/icq_http.cpp index 9deb69ceb0..3620340f28 100644 --- a/protocols/IcqOscarJ/src/icq_http.cpp +++ b/protocols/IcqOscarJ/src/icq_http.cpp @@ -27,7 +27,7 @@ // HTTP Gateway Handling routines // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" int icq_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION*, NETLIBHTTPREQUEST *nlhr) { diff --git a/protocols/IcqOscarJ/src/icq_infoupdate.cpp b/protocols/IcqOscarJ/src/icq_infoupdate.cpp index 565dff43ee..64cbaeb4cd 100644 --- a/protocols/IcqOscarJ/src/icq_infoupdate.cpp +++ b/protocols/IcqOscarJ/src/icq_infoupdate.cpp @@ -27,7 +27,7 @@ // Background thread for automatic update of user details // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" // Retrieve users' info void CIcqProto::icq_InitInfoUpdate(void) diff --git a/protocols/IcqOscarJ/src/icq_menu.cpp b/protocols/IcqOscarJ/src/icq_menu.cpp index b1930d519f..4b93e445fc 100644 --- a/protocols/IcqOscarJ/src/icq_menu.cpp +++ b/protocols/IcqOscarJ/src/icq_menu.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" #include diff --git a/protocols/IcqOscarJ/src/icq_opts.cpp b/protocols/IcqOscarJ/src/icq_opts.cpp index c4a38e135c..6a319e06b5 100644 --- a/protocols/IcqOscarJ/src/icq_opts.cpp +++ b/protocols/IcqOscarJ/src/icq_opts.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" #include diff --git a/protocols/IcqOscarJ/src/icq_packet.cpp b/protocols/IcqOscarJ/src/icq_packet.cpp index 3bb6d024ed..395a155718 100644 --- a/protocols/IcqOscarJ/src/icq_packet.cpp +++ b/protocols/IcqOscarJ/src/icq_packet.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" WORD generate_flap_sequence() { diff --git a/protocols/IcqOscarJ/src/icq_popups.cpp b/protocols/IcqOscarJ/src/icq_popups.cpp index 0edbd79b40..ef73f29049 100644 --- a/protocols/IcqOscarJ/src/icq_popups.cpp +++ b/protocols/IcqOscarJ/src/icq_popups.cpp @@ -27,7 +27,7 @@ // Popup Plugin stuff // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" extern BOOL bPopupService; diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 1e4289a9f4..8fb7f68e67 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -27,7 +27,7 @@ // Protocol Interface Implementation // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" #include "m_icolib.h" diff --git a/protocols/IcqOscarJ/src/icq_rates.cpp b/protocols/IcqOscarJ/src/icq_rates.cpp index 138c8900a2..a00db8f212 100644 --- a/protocols/IcqOscarJ/src/icq_rates.cpp +++ b/protocols/IcqOscarJ/src/icq_rates.cpp @@ -27,7 +27,7 @@ // Rate Management stuff // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" // // Rate Level 1 Management diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp index 3bc7e459a3..585de4ba3c 100644 --- a/protocols/IcqOscarJ/src/icq_server.cpp +++ b/protocols/IcqOscarJ/src/icq_server.cpp @@ -27,7 +27,7 @@ // Manages main server connection, low-level communication // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void icq_newConnectionReceived(HANDLE hNewConnection, DWORD dwRemoteIP, void *pExtra); diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 72061b91ca..fed066f96a 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -27,7 +27,7 @@ // Functions that handles list of used server IDs, sends low-level packets for SSI information // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" // SERVER-LIST UPDATE BOARD // diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index 20775e1d84..793eaa4b4e 100644 --- a/protocols/IcqOscarJ/src/icq_uploadui.cpp +++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp @@ -27,7 +27,7 @@ // Implements Manage Server List dialog // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" static int bListInit = 0; static HANDLE hItemAll; diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 7c25aca840..530e900089 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -27,7 +27,7 @@ // Support for Custom Statuses // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" #include "m_extraicons.h" #include "..\icons_pack\src\resource.h" diff --git a/protocols/IcqOscarJ/src/icq_xtraz.cpp b/protocols/IcqOscarJ/src/icq_xtraz.cpp index 21d9b9592c..334ed7455b 100644 --- a/protocols/IcqOscarJ/src/icq_xtraz.cpp +++ b/protocols/IcqOscarJ/src/icq_xtraz.cpp @@ -27,7 +27,7 @@ // Internal Xtraz API // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" void CIcqProto::handleXtrazNotify(DWORD dwUin, DWORD dwMID, DWORD dwMID2, WORD wCookie, char* szMsg, size_t nMsgLen, BOOL bThruDC) { diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index 0e966c5a4a..a8c69b296f 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -27,7 +27,7 @@ // High-level code for exported API services // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" INT_PTR CIcqProto::AddServerContact(WPARAM hContact, LPARAM) { diff --git a/protocols/IcqOscarJ/src/icqoscar.h b/protocols/IcqOscarJ/src/icqoscar.h deleted file mode 100644 index c20297fd10..0000000000 --- a/protocols/IcqOscarJ/src/icqoscar.h +++ /dev/null @@ -1,122 +0,0 @@ -// ---------------------------------------------------------------------------80 -// ICQ plugin for Miranda Instant Messenger -// ________________________________________ -// -// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede -// Copyright © 2001-2002 Jon Keating, Richard Hughes -// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater -// Copyright © 2004-2010 Joe Kucera -// Copyright © 2012-2014 Miranda NG Team -// -// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -// ----------------------------------------------------------------------------- -// DESCRIPTION: -// -// Includes all header files that should be precompiled to speed up compilation. -// ----------------------------------------------------------------------------- - -// Windows includes -#include -#include - -// Standard includes -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef _DEBUG -#include -#endif - -#ifndef AW_VER_POSITIVE -#define AW_VER_POSITIVE 0x00000004 -#endif - -#ifndef _ASSERTE -#define _ASSERTE(x) -#endif - -// Miranda IM SDK includes -#include // This must be included first -#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 - -// Project resources -#include "resource.h" - -// ICQ plugin includes -#include "version.h" -#include "globals.h" -#include "i18n.h" -#include "cookies.h" -#include "icq_packet.h" -#include "utilities.h" -#include "oscar_filetransfer.h" -#include "icq_direct.h" -#include "icq_server.h" -#include "icqosc_svcs.h" -#include "icq_servlist.h" -#include "icq_http.h" -#include "icq_fieldnames.h" -#include "icq_constants.h" -#include "capabilities.h" -#include "guids.h" -#include "init.h" -#include "stdpackets.h" -#include "tlv.h" -#include "channels.h" -#include "families.h" -#include "m_icq.h" -#include "icq_advsearch.h" -#include "log.h" - -#include "icq_rates.h" - -#include "icq_avatar.h" - -#include "changeinfo/changeinfo.h" -#include "icq_popups.h" -#include "icq_proto.h" - -extern LIST g_Instances; diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp index c980609206..67d5626749 100644 --- a/protocols/IcqOscarJ/src/init.cpp +++ b/protocols/IcqOscarJ/src/init.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" #include "m_extraicons.h" #include "m_icolib.h" diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp index ccc3a1f2e8..c8439eeb6c 100644 --- a/protocols/IcqOscarJ/src/log.cpp +++ b/protocols/IcqOscarJ/src/log.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" extern BOOL bPopupService; diff --git a/protocols/IcqOscarJ/src/loginpassword.cpp b/protocols/IcqOscarJ/src/loginpassword.cpp new file mode 100644 index 0000000000..6268f76665 --- /dev/null +++ b/protocols/IcqOscarJ/src/loginpassword.cpp @@ -0,0 +1,90 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede +// Copyright © 2001-2002 Jon Keating, Richard Hughes +// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater +// Copyright © 2004-2009 Joe Kucera +// Copyright © 2012-2014 Miranda NG Team +// +// 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 "stdafx.h" + +INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + CIcqProto* ppro = (CIcqProto*)GetWindowLongPtr( hwndDlg, GWLP_USERDATA ); + + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + + ppro = (CIcqProto*)lParam; + SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam ); + + SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon, true)); + SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_GetIconByHandle(ppro->m_hProtoIcon)); + { + DWORD dwUin = ppro->getContactUin(NULL); + + TCHAR pszUIN[MAX_PATH]; + mir_sntprintf(pszUIN, SIZEOF(pszUIN), TranslateT("Enter a password for UIN %u:"), dwUin); + SetDlgItemText(hwndDlg, IDC_INSTRUCTION, pszUIN); + + SendDlgItemMessage(hwndDlg, IDC_LOGINPW, EM_LIMITTEXT, PASSWORDMAXLEN - 1, 0); + + CheckDlgButton(hwndDlg, IDC_SAVEPASS, ppro->getByte("RememberPass", 0) ? BST_CHECKED : BST_UNCHECKED); + } + break; + + case WM_DESTROY: + Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_BIG, 0)); + Skin_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0)); + break; + + case WM_CLOSE: + EndDialog(hwndDlg, 0); + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDOK: + ppro->m_bRememberPwd = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SAVEPASS); + ppro->setByte("RememberPass", ppro->m_bRememberPwd); + + GetDlgItemTextA(hwndDlg, IDC_LOGINPW, ppro->m_szPassword, SIZEOF(ppro->m_szPassword)); + + ppro->icq_login(ppro->m_szPassword); + + EndDialog(hwndDlg, IDOK); + break; + + case IDCANCEL: + ppro->SetCurrentStatus(ID_STATUS_OFFLINE); + EndDialog(hwndDlg, IDCANCEL); + break; + } + break; + } + + return FALSE; +} + +void CIcqProto::RequestPassword() +{ + DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_LOGINPW), NULL, LoginPasswdDlgProc, LPARAM(this)); +} diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index adde56ad16..917977dad5 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -27,7 +27,7 @@ // OSCAR File-Transfers implementation // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" struct oscarthreadstartinfo { diff --git a/protocols/IcqOscarJ/src/stdafx.cpp b/protocols/IcqOscarJ/src/stdafx.cpp deleted file mode 100644 index 60ae4f72b7..0000000000 --- a/protocols/IcqOscarJ/src/stdafx.cpp +++ /dev/null @@ -1,18 +0,0 @@ -/* -Copyright (C) 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 "icqoscar.h" \ No newline at end of file diff --git a/protocols/IcqOscarJ/src/stdafx.cxx b/protocols/IcqOscarJ/src/stdafx.cxx new file mode 100644 index 0000000000..0c766ea07f --- /dev/null +++ b/protocols/IcqOscarJ/src/stdafx.cxx @@ -0,0 +1,18 @@ +/* +Copyright (C) 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" diff --git a/protocols/IcqOscarJ/src/stdafx.h b/protocols/IcqOscarJ/src/stdafx.h new file mode 100644 index 0000000000..bfda6d4931 --- /dev/null +++ b/protocols/IcqOscarJ/src/stdafx.h @@ -0,0 +1,122 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede +// Copyright © 2001-2002 Jon Keating, Richard Hughes +// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater +// Copyright © 2004-2010 Joe Kucera +// Copyright © 2012-2014 Miranda NG Team +// +// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// ----------------------------------------------------------------------------- +// DESCRIPTION: +// +// Includes all header files that should be precompiled to speed up compilation. +// ----------------------------------------------------------------------------- + +// Windows includes +#include +#include + +// Standard includes +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef _DEBUG +#include +#endif + +#ifndef AW_VER_POSITIVE +#define AW_VER_POSITIVE 0x00000004 +#endif + +#ifndef _ASSERTE +#define _ASSERTE(x) +#endif + +// Miranda IM SDK includes +#include // This must be included first +#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 + +// Project resources +#include "resource.h" + +// ICQ plugin includes +#include "version.h" +#include "globals.h" +#include "i18n.h" +#include "cookies.h" +#include "icq_packet.h" +#include "utilities.h" +#include "oscar_filetransfer.h" +#include "icq_direct.h" +#include "icq_server.h" +#include "icqosc_svcs.h" +#include "icq_servlist.h" +#include "icq_http.h" +#include "icq_fieldnames.h" +#include "icq_constants.h" +#include "capabilities.h" +#include "guids.h" +#include "init.h" +#include "stdpackets.h" +#include "tlv.h" +#include "channels.h" +#include "families.h" +#include "m_icq.h" +#include "icq_advsearch.h" +#include "log.h" + +#include "icq_rates.h" + +#include "icq_avatar.h" + +#include "changeinfo.h" +#include "icq_popups.h" +#include "icq_proto.h" + +extern LIST g_Instances; diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index 7ce4d6ca90..59c0b51efc 100644 --- a/protocols/IcqOscarJ/src/stdpackets.cpp +++ b/protocols/IcqOscarJ/src/stdpackets.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" extern const int moodXStatus[]; diff --git a/protocols/IcqOscarJ/src/tlv.cpp b/protocols/IcqOscarJ/src/tlv.cpp index 1f395c6e63..81488e8c78 100644 --- a/protocols/IcqOscarJ/src/tlv.cpp +++ b/protocols/IcqOscarJ/src/tlv.cpp @@ -27,7 +27,7 @@ // Helper functions for Oscar TLV chains // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" /* set maxTlvs<=0 to get all TLVs in length, or a positive integer to get at most the first n */ oscar_tlv_chain* readIntoTLVChain(BYTE **buf, size_t wLen, int maxTlvs) diff --git a/protocols/IcqOscarJ/src/upload.cpp b/protocols/IcqOscarJ/src/upload.cpp new file mode 100644 index 0000000000..2f65194773 --- /dev/null +++ b/protocols/IcqOscarJ/src/upload.cpp @@ -0,0 +1,86 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2001-2004 Richard Hughes, Martin Öberg +// Copyright © 2004-2009 Joe Kucera, Bio +// Copyright © 2012-2014 Miranda NG Team +// +// 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. +// ----------------------------------------------------------------------------- +// DESCRIPTION: +// +// ChangeInfo Plugin stuff +// ----------------------------------------------------------------------------- + +#include "stdafx.h" + +int CIcqProto::StringToListItemId(const char *szSetting,int def) +{ + int i; + + for(i=0;iicqOnline()) { + MessageBox(hwndDlg, TranslateT("You are not currently connected to the ICQ network. You must be online in order to update your information on the server."), TranslateT("Change ICQ Details"), MB_OK); + return 0; + } + + hUpload[0] = (HANDLE)ppro->ChangeInfoEx(CIXT_FULL, 0); + + //password + char* tmp = ppro->GetUserPassword(TRUE); + if (tmp) { + if (mir_strlen(Password) > 0 && strcmpnull(Password, tmp)) { + // update password in user info dialog (still open) + strcpy(Password, tmp); + // update password in protocol + strcpy(ppro->m_szPassword, tmp); + + hUpload[1] = (HANDLE)ppro->icq_changeUserPasswordServ(tmp); + char szPwd[PASSWORDMAXLEN] = {0}; + + // password is stored in DB, update + if (ppro->GetUserStoredPassword(szPwd, sizeof(szPwd))) + ppro->setString("Password", tmp); + } + } + + return 1; +} diff --git a/protocols/IcqOscarJ/src/userinfotab.cpp b/protocols/IcqOscarJ/src/userinfotab.cpp new file mode 100644 index 0000000000..a3c5d56c2a --- /dev/null +++ b/protocols/IcqOscarJ/src/userinfotab.cpp @@ -0,0 +1,291 @@ +// ---------------------------------------------------------------------------80 +// ICQ plugin for Miranda Instant Messenger +// ________________________________________ +// +// Copyright © 2000-2001 Richard Hughes, Roland Rabien, Tristan Van de Vreede +// Copyright © 2001-2002 Jon Keating, Richard Hughes +// Copyright © 2002-2004 Martin Öberg, Sam Kothari, Robert Rainwater +// Copyright © 2004-2010 Joe Kucera +// Copyright © 2012-2014 Miranda NG Team +// +// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +// ----------------------------------------------------------------------------- +// DESCRIPTION: +// +// Code for User details ICQ specific pages +// ----------------------------------------------------------------------------- + +#include "stdafx.h" + +#define SVS_NORMAL 0 +#define SVS_ZEROISUNSPEC 2 +#define SVS_IP 3 +#define SVS_SIGNED 6 +#define SVS_ICQVERSION 8 +#define SVS_TIMESTAMP 9 +#define SVS_STATUSID 10 + +extern const char *nameXStatus[]; + +///////////////////////////////////////////////////////////////////////////////////////// + +static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContact, char* szModule, char* szSetting, int special) +{ + DBVARIANT dbv = { 0 }; + char str[MAX_PATH]; + char* pstr = NULL; + int unspecified = 0; + int bUtf = 0, bDbv = 0, bAlloc = 0; + + dbv.type = DBVT_DELETED; + + if ((hContact == NULL) && ((int)szModule < 0x100)) { + dbv.type = (BYTE)szModule; + + switch ((int)szModule) { + case DBVT_BYTE: + dbv.cVal = (BYTE)szSetting; + break; + case DBVT_WORD: + dbv.wVal = (WORD)szSetting; + break; + case DBVT_DWORD: + dbv.dVal = (DWORD)szSetting; + break; + case DBVT_ASCIIZ: + dbv.pszVal = pstr = szSetting; + break; + default: + unspecified = 1; + dbv.type = DBVT_DELETED; + } + } + else { + if (szModule == NULL) + unspecified = 1; + else { + unspecified = db_get(hContact, szModule, szSetting, &dbv); + bDbv = 1; + } + } + + if (!unspecified) { + switch (dbv.type) { + case DBVT_BYTE: + unspecified = (special == SVS_ZEROISUNSPEC && dbv.bVal == 0); + pstr = _itoa(special == SVS_SIGNED ? dbv.cVal : dbv.bVal, str, 10); + break; + + case DBVT_WORD: + if (special == SVS_ICQVERSION) { + if (dbv.wVal != 0) { + char szExtra[80]; + + mir_snprintf(str, SIZEOF(str), "%d", dbv.wVal); + pstr = str; + + if (hContact && ppro->IsDirectConnectionOpen(hContact, DIRECTCONN_STANDARD, 1)) { + ICQTranslateUtfStatic(LPGEN(" (DC Established)"), szExtra, SIZEOF(szExtra)); + strcat(str, (char*)szExtra); + bUtf = 1; + } + } + else + unspecified = 1; + } + else if (special == SVS_STATUSID) { + char *pszStatus = MirandaStatusToStringUtf(dbv.wVal); + BYTE bXStatus = ppro->getContactXStatus(hContact); + + if (bXStatus) { + char *pXName = ppro->getSettingStringUtf(hContact, DBSETTING_XSTATUS_NAME, NULL); + if (pXName == NULL) // give default name + pXName = ICQTranslateUtf(nameXStatus[bXStatus - 1]); + + mir_snprintf(str, SIZEOF(str), "%s (%s)", pszStatus, pXName); + SAFE_FREE((void**)&pXName); + } + else strncpy_s(str, pszStatus, _TRUNCATE); + + bUtf = 1; + SAFE_FREE(&pszStatus); + pstr = str; + unspecified = 0; + } + else { + unspecified = (special == SVS_ZEROISUNSPEC && dbv.wVal == 0); + pstr = _itoa(special == SVS_SIGNED ? dbv.sVal : dbv.wVal, str, 10); + } + break; + + case DBVT_DWORD: + unspecified = (special == SVS_ZEROISUNSPEC && dbv.dVal == 0); + if (special == SVS_IP) { + struct in_addr ia; + ia.S_un.S_addr = htonl(dbv.dVal); + pstr = inet_ntoa(ia); + if (dbv.dVal == 0) + unspecified = 1; + } + else if (special == SVS_TIMESTAMP) { + if (dbv.dVal == 0) + unspecified = 1; + else + pstr = time2text(dbv.dVal); + } + else + pstr = _itoa(special == SVS_SIGNED ? dbv.lVal : dbv.dVal, str, 10); + break; + + case DBVT_ASCIIZ: + case DBVT_WCHAR: + unspecified = (special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0'); + if (!unspecified && pstr != szSetting) { + pstr = ppro->getSettingStringUtf(hContact, szModule, szSetting, NULL); + bUtf = 1; + bAlloc = 1; + } + if (idCtrl == IDC_UIN) + SetDlgItemText(hwndDlg, IDC_UINSTATIC, TranslateT("ScreenName:")); + break; + + default: + pstr = str; + strcpy(str, "???"); + break; + } + } + + EnableDlgItem(hwndDlg, idCtrl, !unspecified); + if (unspecified) + SetDlgItemText(hwndDlg, idCtrl, TranslateT("")); + else if (bUtf) + SetDlgItemTextUtf(hwndDlg, idCtrl, pstr); + else + SetDlgItemTextA(hwndDlg, idCtrl, pstr); + + if (bDbv) + db_free(&dbv); + + if (bAlloc) + SAFE_FREE(&pstr); +} + +///////////////////////////////////////////////////////////////////////////////////////// + +static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + break; + + case WM_NOTIFY: + switch (((LPNMHDR)lParam)->idFrom) { + case 0: + switch (((LPNMHDR)lParam)->code) { + case PSN_PARAMCHANGED: + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, ((PSHNOTIFY*)lParam)->lParam); + break; + + case PSN_INFOCHANGED: + CIcqProto* ppro = (CIcqProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA); + if (!ppro) + break; + + char* szProto; + MCONTACT hContact = (MCONTACT)((LPPSHNOTIFY)lParam)->lParam; + + if (hContact == NULL) + szProto = ppro->m_szModuleName; + else + szProto = GetContactProto(hContact); + + if (!szProto) + break; + + SetValue(ppro, hwndDlg, IDC_UIN, hContact, szProto, UNIQUEIDSETTING, SVS_NORMAL); + SetValue(ppro, hwndDlg, IDC_ONLINESINCE, hContact, szProto, "LogonTS", SVS_TIMESTAMP); + SetValue(ppro, hwndDlg, IDC_IDLETIME, hContact, szProto, "IdleTS", SVS_TIMESTAMP); + SetValue(ppro, hwndDlg, IDC_IP, hContact, szProto, "IP", SVS_IP); + SetValue(ppro, hwndDlg, IDC_REALIP, hContact, szProto, "RealIP", SVS_IP); + + if (hContact) { + SetValue(ppro, hwndDlg, IDC_PORT, hContact, szProto, "UserPort", SVS_ZEROISUNSPEC); + SetValue(ppro, hwndDlg, IDC_VERSION, hContact, szProto, "Version", SVS_ICQVERSION); + SetValue(ppro, hwndDlg, IDC_MIRVER, hContact, szProto, "MirVer", SVS_ZEROISUNSPEC); + if (ppro->getByte(hContact, "ClientID", 0)) + ppro->setDword(hContact, "TickTS", 0); + SetValue(ppro, hwndDlg, IDC_SYSTEMUPTIME, hContact, szProto, "TickTS", SVS_TIMESTAMP); + SetValue(ppro, hwndDlg, IDC_STATUS, hContact, szProto, "Status", SVS_STATUSID); + } + else { + char str[MAX_PATH]; + WORD v[4]; + CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v); + mir_snprintf(str, SIZEOF(str), "Miranda NG %d.%d.%d.%d (ICQ %s)", v[0], v[1], v[2], v[3], __VERSION_STRING_DOTS); + + SetValue(ppro, hwndDlg, IDC_PORT, hContact, (char*)DBVT_WORD, (char*)ppro->wListenPort, SVS_ZEROISUNSPEC); + SetValue(ppro, hwndDlg, IDC_VERSION, hContact, (char*)DBVT_WORD, (char*)ICQ_VERSION, SVS_ICQVERSION); + SetValue(ppro, hwndDlg, IDC_MIRVER, hContact, (char*)DBVT_ASCIIZ, str, SVS_ZEROISUNSPEC); + SetDlgItemText(hwndDlg, IDC_SUPTIME, TranslateT("Member since:")); + SetValue(ppro, hwndDlg, IDC_SYSTEMUPTIME, hContact, szProto, "MemberTS", SVS_TIMESTAMP); + SetValue(ppro, hwndDlg, IDC_STATUS, hContact, (char*)DBVT_WORD, (char*)ppro->m_iStatus, SVS_STATUSID); + } + } + } + break; + + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDCANCEL: + SendMessage(GetParent(hwndDlg), msg, wParam, lParam); + break; + } + break; + } + + return FALSE; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) +{ + if ((!IsICQContact(lParam)) && lParam) + return 0; + + OPTIONSDIALOGPAGE odp = { 0 }; + odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE; + odp.hInstance = hInst; + odp.dwInitParam = LPARAM(this); + odp.pfnDlgProc = IcqDlgProc; + odp.position = -1900000000; + odp.ptszTitle = m_tszUserName; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_ICQ); + UserInfo_AddPage(wParam, &odp); + + if (!lParam) { + TCHAR buf[200]; + mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s Details"), m_tszUserName); + odp.ptszTitle = buf; + + odp.position = -1899999999; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_CHANGEINFO); + odp.pfnDlgProc = ChangeInfoDlgProc; + UserInfo_AddPage(wParam, &odp); + } + return 0; +} diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index ef8b905a52..8799ea7c79 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -23,7 +23,7 @@ // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. // ----------------------------------------------------------------------------- -#include "icqoscar.h" +#include "stdafx.h" struct gateway_index { -- cgit v1.2.3