summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2020-04-07 22:57:27 +0300
committerdartraiden <wowemuh@gmail.com>2020-04-07 22:57:44 +0300
commit71cfe74d3618c15feab24032c7d4cd71d77129af (patch)
tree7b3e5fcababe16ce26b8b8bfc8591d9732e2cb33
parent559cc9efdc9fbc5d3da5edaaf24924e0cc57a20d (diff)
MSN: moved to deprecated, banned, removed support from plugins, etc
-rw-r--r--README.md1
-rw-r--r--bin15/mir_full.sln11
-rw-r--r--bin15/mir_icons.sln10
-rw-r--r--bin15/miranda32.sln22
-rw-r--r--bin16/mir_full.sln11
-rw-r--r--bin16/mir_icons.sln10
-rw-r--r--bin16/miranda32.sln22
-rw-r--r--docs/mirandaboot.ini4
-rw-r--r--include/delphi/m_acc.inc2
-rw-r--r--include/delphi/m_protosvc.inc6
-rw-r--r--include/m_acc.h2
-rw-r--r--include/m_protosvc.h6
-rw-r--r--langpacks/belarusian/Deprecated/MSN.txt (renamed from langpacks/belarusian/Plugins/MSN.txt)508
-rw-r--r--langpacks/belarusian/Untranslated/MSN.txt6
-rw-r--r--langpacks/bulgarian/Deprecated/MSN.txt (renamed from langpacks/bulgarian/Plugins/MSN.txt)508
-rw-r--r--langpacks/bulgarian/Untranslated/MSN.txt13
-rw-r--r--langpacks/czech/Deprecated/MSN.txt (renamed from langpacks/czech/Plugins/MSN.txt)508
-rw-r--r--langpacks/czech/Untranslated/MSN.txt6
-rw-r--r--langpacks/english/Plugins/MSN.txt136
-rw-r--r--langpacks/english_gb/Plugins/MSN.txt9
-rw-r--r--langpacks/french/Deprecated/MSN.txt (renamed from langpacks/french/Plugins/MSN.txt)508
-rw-r--r--langpacks/french/Untranslated/MSN.txt64
-rw-r--r--langpacks/german/Deprecated/MSN.txt (renamed from langpacks/german/Plugins/MSN.txt)508
-rw-r--r--langpacks/polish/Deprecated/MSN.txt (renamed from langpacks/polish/Plugins/MSN.txt)508
-rw-r--r--langpacks/polish/Untranslated/MSN.txt1
-rw-r--r--langpacks/russian/Deprecated/MSN.txt (renamed from langpacks/russian/Plugins/MSN.txt)508
-rw-r--r--langpacks/spanish/Plugins/MSN.txt254
-rw-r--r--langpacks/spanish/Untranslated/MSN.txt95
-rw-r--r--langpacks/ukrainian/Deprecated/MSN.txt (renamed from langpacks/ukrainian/Plugins/MSN.txt)508
-rw-r--r--langpacks/ukrainian/Untranslated/MSN.txt3
-rw-r--r--plugins/ExternalAPI/delphi/m_ieview.inc2
-rw-r--r--plugins/ExternalAPI/delphi/m_smileyadd.inc6
-rw-r--r--plugins/ExternalAPI/m_smileyadd.h8
-rw-r--r--plugins/FingerprintNG/iconpacks/res/MSN/MSN Mac.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/MSN/MSN v4.5-v5.x.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/MSN/MSN v6.x.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/MSN/MSN v7.x.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/MSN/MSN v8.x.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/MSN/MSN.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/MSN/WLM10-11.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/MSN/WLM9.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/MSN/WebMessenger.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/MSN/aMSN.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/Overlays/overlay_proto_msn.icobin1150 -> 0 bytes
-rw-r--r--plugins/FingerprintNG/iconpacks/res/fp_icons.rc11
-rw-r--r--plugins/FingerprintNG/res/resource.rc1
-rw-r--r--plugins/FingerprintNG/src/finger_groups.h5
-rw-r--r--plugins/FingerprintNG/src/masks.cpp16
-rw-r--r--plugins/FingerprintNG/src/options.cpp4
-rw-r--r--plugins/FingerprintNG/src/resource.h12
-rw-r--r--plugins/FingerprintNG/src/stdafx.h1
-rw-r--r--plugins/Nudge/res/NudgeMSN.icobin1150 -> 0 bytes
-rw-r--r--plugins/Nudge/res/resource.rc1
-rw-r--r--plugins/Nudge/src/resource.h1
-rw-r--r--plugins/PluginUpdater/src/DlgUpdate.cpp1
-rw-r--r--plugins/SmileyAdd/smileys/nova/MSN.mslbin11390 -> 0 bytes
-rw-r--r--plugins/SmileyAdd/src/smileys.cpp10
-rw-r--r--plugins/Variables/src/stdafx.h2
-rw-r--r--protocols/CMakeLists.txt1
-rw-r--r--protocols/Dummy/src/main.cpp9
-rw-r--r--protocols/MSN/CMakeLists.txt5
-rw-r--r--protocols/MSN/docs/gpl.txt340
-rw-r--r--protocols/MSN/docs/history.txt529
-rw-r--r--protocols/MSN/docs/readme.txt125
-rw-r--r--protocols/MSN/docs/todo.txt10
-rw-r--r--protocols/MSN/msn.vcxproj43
-rw-r--r--protocols/MSN/msn.vcxproj.filters18
-rw-r--r--protocols/MSN/proto_msn/CMakeLists.txt2
-rw-r--r--protocols/MSN/proto_msn/Proto_MSN.vcxproj28
-rw-r--r--protocols/MSN/proto_msn/Proto_MSN.vcxproj.filters18
-rw-r--r--protocols/MSN/proto_msn/res/Away.icobin5430 -> 0 bytes
-rw-r--r--protocols/MSN/proto_msn/res/Invisible.icobin5430 -> 0 bytes
-rw-r--r--protocols/MSN/proto_msn/res/Occupied.icobin5430 -> 0 bytes
-rw-r--r--protocols/MSN/proto_msn/res/Offline.icobin5430 -> 0 bytes
-rw-r--r--protocols/MSN/proto_msn/res/Online.icobin5430 -> 0 bytes
-rw-r--r--protocols/MSN/proto_msn/res/Proto_MSN.rc74
-rw-r--r--protocols/MSN/proto_msn/src/resource.h20
-rw-r--r--protocols/MSN/res/inbox.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/invite.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/list_al.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/list_bl.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/list_fl.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/list_ph.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/list_rl.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/msn.icobin5430 -> 0 bytes
-rw-r--r--protocols/MSN/res/msn.rc368
-rw-r--r--protocols/MSN/res/msnblock.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/netmeeting.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/profile.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/services.icobin1150 -> 0 bytes
-rw-r--r--protocols/MSN/res/version.rc9
-rw-r--r--protocols/MSN/src/ezxml.c969
-rw-r--r--protocols/MSN/src/ezxml.h165
-rw-r--r--protocols/MSN/src/msn.cpp91
-rw-r--r--protocols/MSN/src/msn_auth.cpp1233
-rw-r--r--protocols/MSN/src/msn_avatar.cpp123
-rw-r--r--protocols/MSN/src/msn_chat.cpp605
-rw-r--r--protocols/MSN/src/msn_commands.cpp1219
-rw-r--r--protocols/MSN/src/msn_contact.cpp269
-rw-r--r--protocols/MSN/src/msn_errors.cpp126
-rw-r--r--protocols/MSN/src/msn_ieembed.cpp446
-rw-r--r--protocols/MSN/src/msn_ieembed.h150
-rw-r--r--protocols/MSN/src/msn_libstr.cpp381
-rw-r--r--protocols/MSN/src/msn_lists.cpp576
-rw-r--r--protocols/MSN/src/msn_mail.cpp396
-rw-r--r--protocols/MSN/src/msn_menu.cpp265
-rw-r--r--protocols/MSN/src/msn_mime.cpp502
-rw-r--r--protocols/MSN/src/msn_misc.cpp1112
-rw-r--r--protocols/MSN/src/msn_msgsplit.cpp118
-rw-r--r--protocols/MSN/src/msn_opts.cpp634
-rw-r--r--protocols/MSN/src/msn_proto.cpp919
-rw-r--r--protocols/MSN/src/msn_proto.h474
-rw-r--r--protocols/MSN/src/msn_skypeab.cpp415
-rw-r--r--protocols/MSN/src/msn_soapab.cpp1608
-rw-r--r--protocols/MSN/src/msn_soapstore.cpp731
-rw-r--r--protocols/MSN/src/msn_srv.cpp350
-rw-r--r--protocols/MSN/src/msn_ssl.cpp124
-rw-r--r--protocols/MSN/src/msn_std.cpp65
-rw-r--r--protocols/MSN/src/msn_svcs.cpp426
-rw-r--r--protocols/MSN/src/msn_threads.cpp500
-rw-r--r--protocols/MSN/src/msn_ws.cpp102
-rw-r--r--protocols/MSN/src/resource.h100
-rw-r--r--protocols/MSN/src/skylogin/README.md2
-rw-r--r--protocols/MSN/src/skylogin/common.c92
-rw-r--r--protocols/MSN/src/skylogin/common.h131
-rw-r--r--protocols/MSN/src/skylogin/crc.c113
-rw-r--r--protocols/MSN/src/skylogin/crc.h6
-rw-r--r--protocols/MSN/src/skylogin/credentials.c167
-rw-r--r--protocols/MSN/src/skylogin/credentials.h3
-rw-r--r--protocols/MSN/src/skylogin/login.c417
-rw-r--r--protocols/MSN/src/skylogin/login.h2
-rw-r--r--protocols/MSN/src/skylogin/objects.c252
-rw-r--r--protocols/MSN/src/skylogin/objects.h136
-rw-r--r--protocols/MSN/src/skylogin/platform.h6
-rw-r--r--protocols/MSN/src/skylogin/platform_w32.c195
-rw-r--r--protocols/MSN/src/skylogin/random.c178
-rw-r--r--protocols/MSN/src/skylogin/random.h7
-rw-r--r--protocols/MSN/src/skylogin/rc4comm.c83
-rw-r--r--protocols/MSN/src/skylogin/rc4comm.h3
-rw-r--r--protocols/MSN/src/skylogin/skylogin.c173
-rw-r--r--protocols/MSN/src/skylogin/skylogin.h62
-rw-r--r--protocols/MSN/src/skylogin/uic.c105
-rw-r--r--protocols/MSN/src/skylogin/uic.h3
-rw-r--r--protocols/MSN/src/stdafx.cxx18
-rw-r--r--protocols/MSN/src/stdafx.h902
-rw-r--r--protocols/MSN/src/version.h33
-rw-r--r--src/mir_app/src/db_ini.cpp2
-rw-r--r--src/mir_app/src/newplugins.cpp1
-rw-r--r--tools/build_scripts/bin15/z2_PackPluginUpdater_x32.txt2
-rw-r--r--tools/build_scripts/bin15/z2_PackPluginUpdater_x64.txt2
-rw-r--r--tools/build_scripts/bin15/z3_PackArchives.txt2
-rw-r--r--tools/build_scripts/z2_PackPluginUpdater.bat1
-rw-r--r--tools/installer_ng/Common/Files/Settings/autoexec_sounds.ini4
-rw-r--r--tools/installer_ng/Common/Files/Settings/mirandaboot_default.ini4
-rw-r--r--tools/installer_ng/Common/Files/Settings/mirandaboot_portable.ini4
-rw-r--r--tools/installer_ng/MirandaNG.iss17
-rw-r--r--tools/installer_ng_stable/Common/Files/Settings/autoexec_sounds.ini4
-rw-r--r--tools/installer_ng_stable/Common/Files/Settings/mirandaboot_default.ini4
-rw-r--r--tools/installer_ng_stable/Common/Files/Settings/mirandaboot_portable.ini4
-rw-r--r--tools/installer_ng_stable/MirandaNG.iss17
-rw-r--r--tools/lpgen/lpgen.js4
161 files changed, 2077 insertions, 22716 deletions
diff --git a/README.md b/README.md
index ca3aa7f125..aee51c33e4 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,6 @@ fast.
- IRC (Internet Relay Chat)
- Jabber
- MinecraftDynmap
-- MSN
- Omegle
- Sametime
- Skype
diff --git a/bin15/mir_full.sln b/bin15/mir_full.sln
index c518ab677f..0d25fef68c 100644
--- a/bin15/mir_full.sln
+++ b/bin15/mir_full.sln
@@ -32,8 +32,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_nicer", "..\plugins\Clist_nicer\clist_nicer.vcxproj", "{3C42510C-A29E-4A53-899C-203BFA874E0B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cln_skinedit", "..\plugins\Cln_skinedit\skinedit.vcxproj", "{987F026D-EB1F-4013-ADA8-2406ACCDA526}"
@@ -565,14 +563,6 @@ Global
{33276462-8313-4192-8306-13717ECCA60A}.Release|Win32.Build.0 = Release|Win32
{33276462-8313-4192-8306-13717ECCA60A}.Release|x64.ActiveCfg = Release|x64
{33276462-8313-4192-8306-13717ECCA60A}.Release|x64.Build.0 = Release|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|Win32.ActiveCfg = Debug|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|Win32.Build.0 = Debug|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|x64.ActiveCfg = Debug|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|x64.Build.0 = Debug|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|Win32.ActiveCfg = Release|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|Win32.Build.0 = Release|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|x64.ActiveCfg = Release|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|x64.Build.0 = Release|x64
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|Win32.ActiveCfg = Debug|Win32
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|Win32.Build.0 = Debug|Win32
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|x64.ActiveCfg = Debug|x64
@@ -2060,7 +2050,6 @@ Global
{6DA1396F-2A44-4D5C-8442-012F71006217} = {A035B524-0F2D-45D0-BCF2-3C20279C77E2}
{3A12F777-56A8-42EC-BD17-8F325524241E} = {A035B524-0F2D-45D0-BCF2-3C20279C77E2}
{33276462-8313-4192-8306-13717ECCA60A} = {A035B524-0F2D-45D0-BCF2-3C20279C77E2}
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D} = {A035B524-0F2D-45D0-BCF2-3C20279C77E2}
{3C42510C-A29E-4A53-899C-203BFA874E0B} = {F9C41695-3353-4564-A154-58106829B19C}
{987F026D-EB1F-4013-ADA8-2406ACCDA526} = {F9C41695-3353-4564-A154-58106829B19C}
{DB315D7D-00BB-43B2-93A6-0430CA2B9F28} = {F9C41695-3353-4564-A154-58106829B19C}
diff --git a/bin15/mir_icons.sln b/bin15/mir_icons.sln
index b9220ad125..733fab3585 100644
--- a/bin15/mir_icons.sln
+++ b/bin15/mir_icons.sln
@@ -14,8 +14,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_IRC", "..\protocols\I
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Jabber", "..\protocols\JabberG\proto_jabber\Proto_Jabber.vcxproj", "{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_MSN", "..\protocols\MSN\proto_msn\Proto_MSN.vcxproj", "{7BC6C3E7-2B17-4718-A82E-084798710E14}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_GG", "..\protocols\Gadu-Gadu\proto_gg\Proto_GG.vcxproj", "{33912E32-3B68-4E2C-82AE-64C06EE987A7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Twitter", "..\protocols\Twitter\proto_twitter\Proto_Twitter.vcxproj", "{A82C682E-8596-4DCA-98A6-50436194714B}"
@@ -120,14 +118,6 @@ Global
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|Win32.Build.0 = Release|Win32
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|x64.ActiveCfg = Release|x64
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|x64.Build.0 = Release|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|Win32.ActiveCfg = Debug|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|Win32.Build.0 = Debug|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|x64.ActiveCfg = Debug|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|x64.Build.0 = Debug|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|Win32.ActiveCfg = Release|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|Win32.Build.0 = Release|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|x64.ActiveCfg = Release|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|x64.Build.0 = Release|x64
{33912E32-3B68-4E2C-82AE-64C06EE987A7}.Debug|Win32.ActiveCfg = Debug|Win32
{33912E32-3B68-4E2C-82AE-64C06EE987A7}.Debug|Win32.Build.0 = Debug|Win32
{33912E32-3B68-4E2C-82AE-64C06EE987A7}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/bin15/miranda32.sln b/bin15/miranda32.sln
index f5dc2c5572..ea883f8494 100644
--- a/bin15/miranda32.sln
+++ b/bin15/miranda32.sln
@@ -28,8 +28,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_nicer", "..\plugins\clist_nicer\clist_nicer.vcxproj", "{3C42510C-A29E-4A53-899C-203BFA874E0B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xStatus_Jabber", "..\protocols\JabberG\jabber_xstatus\xStatus_Jabber.vcxproj", "{6BBEEA1E-3C87-6CD1-F32A-027C3EC5320E}"
@@ -42,8 +40,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_IRC", "..\protocols\I
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Jabber", "..\protocols\JabberG\proto_jabber\Proto_Jabber.vcxproj", "{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_MSN", "..\protocols\MSN\proto_msn\Proto_MSN.vcxproj", "{7BC6C3E7-2B17-4718-A82E-084798710E14}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_modern", "..\plugins\Clist_modern\clist_modern.vcxproj", "{D9057E63-AAAA-4FE7-800A-20C02F4761F3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StdUserInfo", "..\src\core\stduserinfo\stduserinfo.vcxproj", "{1C856B14-54CD-4D07-B18B-5F7DB073AB51}"
@@ -247,14 +243,6 @@ Global
{33276462-8313-4192-8306-13717ECCA60A}.Release|Win32.Build.0 = Release|Win32
{33276462-8313-4192-8306-13717ECCA60A}.Release|x64.ActiveCfg = Release|x64
{33276462-8313-4192-8306-13717ECCA60A}.Release|x64.Build.0 = Release|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|Win32.ActiveCfg = Debug|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|Win32.Build.0 = Debug|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|x64.ActiveCfg = Debug|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|x64.Build.0 = Debug|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|Win32.ActiveCfg = Release|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|Win32.Build.0 = Release|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|x64.ActiveCfg = Release|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|x64.Build.0 = Release|x64
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|Win32.ActiveCfg = Debug|Win32
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|Win32.Build.0 = Debug|Win32
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|x64.ActiveCfg = Debug|x64
@@ -303,14 +291,6 @@ Global
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|Win32.Build.0 = Release|Win32
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|x64.ActiveCfg = Release|x64
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|x64.Build.0 = Release|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|Win32.ActiveCfg = Debug|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|Win32.Build.0 = Debug|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|x64.ActiveCfg = Debug|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|x64.Build.0 = Debug|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|Win32.ActiveCfg = Release|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|Win32.Build.0 = Release|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|x64.ActiveCfg = Release|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|x64.Build.0 = Release|x64
{D9057E63-AAAA-4FE7-800A-20C02F4761F3}.Debug|Win32.ActiveCfg = Debug|Win32
{D9057E63-AAAA-4FE7-800A-20C02F4761F3}.Debug|Win32.Build.0 = Debug|Win32
{D9057E63-AAAA-4FE7-800A-20C02F4761F3}.Debug|x64.ActiveCfg = Debug|x64
@@ -574,14 +554,12 @@ Global
{6DA1396F-2A44-4D5C-8442-012F71006217} = {812EF24D-9B76-4A94-ABE0-6F80C381C203}
{3A12F777-56A8-42EC-BD17-8F325524241E} = {812EF24D-9B76-4A94-ABE0-6F80C381C203}
{33276462-8313-4192-8306-13717ECCA60A} = {812EF24D-9B76-4A94-ABE0-6F80C381C203}
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D} = {812EF24D-9B76-4A94-ABE0-6F80C381C203}
{3C42510C-A29E-4A53-899C-203BFA874E0B} = {6221EF9E-F53A-4381-B760-4C0208E5D597}
{6BBEEA1E-3C87-6CD1-F32A-027C3EC5320E} = {949AF443-676D-4B48-B21E-9B6FC3A4808D}
{987F026D-EB1F-4013-ADA8-2406ACCDA526} = {6221EF9E-F53A-4381-B760-4C0208E5D597}
{33912E32-3B68-4E2C-82AE-64C06EE987A7} = {949AF443-676D-4B48-B21E-9B6FC3A4808D}
{DD667247-3712-4355-9774-7E6ACAF2275E} = {949AF443-676D-4B48-B21E-9B6FC3A4808D}
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0} = {949AF443-676D-4B48-B21E-9B6FC3A4808D}
- {7BC6C3E7-2B17-4718-A82E-084798710E14} = {949AF443-676D-4B48-B21E-9B6FC3A4808D}
{D9057E63-AAAA-4FE7-800A-20C02F4761F3} = {6221EF9E-F53A-4381-B760-4C0208E5D597}
{1C856B14-54CD-4D07-B18B-5F7DB073AB51} = {85220459-761D-4E24-A381-D35A95880254}
{A5B558C6-C767-11E1-A335-F6EB6188709B} = {85220459-761D-4E24-A381-D35A95880254}
diff --git a/bin16/mir_full.sln b/bin16/mir_full.sln
index 5c26d09f5d..245fe87f02 100644
--- a/bin16/mir_full.sln
+++ b/bin16/mir_full.sln
@@ -32,8 +32,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_nicer", "..\plugins\Clist_nicer\clist_nicer.vcxproj", "{3C42510C-A29E-4A53-899C-203BFA874E0B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Cln_skinedit", "..\plugins\Cln_skinedit\skinedit.vcxproj", "{987F026D-EB1F-4013-ADA8-2406ACCDA526}"
@@ -565,14 +563,6 @@ Global
{33276462-8313-4192-8306-13717ECCA60A}.Release|Win32.Build.0 = Release|Win32
{33276462-8313-4192-8306-13717ECCA60A}.Release|x64.ActiveCfg = Release|x64
{33276462-8313-4192-8306-13717ECCA60A}.Release|x64.Build.0 = Release|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|Win32.ActiveCfg = Debug|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|Win32.Build.0 = Debug|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|x64.ActiveCfg = Debug|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|x64.Build.0 = Debug|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|Win32.ActiveCfg = Release|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|Win32.Build.0 = Release|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|x64.ActiveCfg = Release|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|x64.Build.0 = Release|x64
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|Win32.ActiveCfg = Debug|Win32
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|Win32.Build.0 = Debug|Win32
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|x64.ActiveCfg = Debug|x64
@@ -2060,7 +2050,6 @@ Global
{6DA1396F-2A44-4D5C-8442-012F71006217} = {A035B524-0F2D-45D0-BCF2-3C20279C77E2}
{3A12F777-56A8-42EC-BD17-8F325524241E} = {A035B524-0F2D-45D0-BCF2-3C20279C77E2}
{33276462-8313-4192-8306-13717ECCA60A} = {A035B524-0F2D-45D0-BCF2-3C20279C77E2}
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D} = {A035B524-0F2D-45D0-BCF2-3C20279C77E2}
{3C42510C-A29E-4A53-899C-203BFA874E0B} = {F9C41695-3353-4564-A154-58106829B19C}
{987F026D-EB1F-4013-ADA8-2406ACCDA526} = {F9C41695-3353-4564-A154-58106829B19C}
{DB315D7D-00BB-43B2-93A6-0430CA2B9F28} = {F9C41695-3353-4564-A154-58106829B19C}
diff --git a/bin16/mir_icons.sln b/bin16/mir_icons.sln
index 6eed7044d1..2600666b51 100644
--- a/bin16/mir_icons.sln
+++ b/bin16/mir_icons.sln
@@ -14,8 +14,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_IRC", "..\protocols\I
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Jabber", "..\protocols\JabberG\proto_jabber\Proto_Jabber.vcxproj", "{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_MSN", "..\protocols\MSN\proto_msn\Proto_MSN.vcxproj", "{7BC6C3E7-2B17-4718-A82E-084798710E14}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_GG", "..\protocols\Gadu-Gadu\proto_gg\Proto_GG.vcxproj", "{33912E32-3B68-4E2C-82AE-64C06EE987A7}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Twitter", "..\protocols\Twitter\proto_twitter\Proto_Twitter.vcxproj", "{A82C682E-8596-4DCA-98A6-50436194714B}"
@@ -120,14 +118,6 @@ Global
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|Win32.Build.0 = Release|Win32
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|x64.ActiveCfg = Release|x64
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|x64.Build.0 = Release|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|Win32.ActiveCfg = Debug|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|Win32.Build.0 = Debug|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|x64.ActiveCfg = Debug|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|x64.Build.0 = Debug|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|Win32.ActiveCfg = Release|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|Win32.Build.0 = Release|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|x64.ActiveCfg = Release|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|x64.Build.0 = Release|x64
{33912E32-3B68-4E2C-82AE-64C06EE987A7}.Debug|Win32.ActiveCfg = Debug|Win32
{33912E32-3B68-4E2C-82AE-64C06EE987A7}.Debug|Win32.Build.0 = Debug|Win32
{33912E32-3B68-4E2C-82AE-64C06EE987A7}.Debug|x64.ActiveCfg = Debug|x64
diff --git a/bin16/miranda32.sln b/bin16/miranda32.sln
index d2cf38de25..6a21230742 100644
--- a/bin16/miranda32.sln
+++ b/bin16/miranda32.sln
@@ -28,8 +28,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IRC", "..\protocols\IRCG\IR
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Jabber", "..\protocols\JabberG\jabber.vcxproj", "{33276462-8313-4192-8306-13717ECCA60A}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MSN", "..\protocols\MSN\msn.vcxproj", "{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_nicer", "..\plugins\clist_nicer\clist_nicer.vcxproj", "{3C42510C-A29E-4A53-899C-203BFA874E0B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xStatus_Jabber", "..\protocols\JabberG\jabber_xstatus\xStatus_Jabber.vcxproj", "{6BBEEA1E-3C87-6CD1-F32A-027C3EC5320E}"
@@ -42,8 +40,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_IRC", "..\protocols\I
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_Jabber", "..\protocols\JabberG\proto_jabber\Proto_Jabber.vcxproj", "{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Proto_MSN", "..\protocols\MSN\proto_msn\Proto_MSN.vcxproj", "{7BC6C3E7-2B17-4718-A82E-084798710E14}"
-EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Clist_modern", "..\plugins\Clist_modern\clist_modern.vcxproj", "{D9057E63-AAAA-4FE7-800A-20C02F4761F3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StdUserInfo", "..\src\core\stduserinfo\stduserinfo.vcxproj", "{1C856B14-54CD-4D07-B18B-5F7DB073AB51}"
@@ -247,14 +243,6 @@ Global
{33276462-8313-4192-8306-13717ECCA60A}.Release|Win32.Build.0 = Release|Win32
{33276462-8313-4192-8306-13717ECCA60A}.Release|x64.ActiveCfg = Release|x64
{33276462-8313-4192-8306-13717ECCA60A}.Release|x64.Build.0 = Release|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|Win32.ActiveCfg = Debug|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|Win32.Build.0 = Debug|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|x64.ActiveCfg = Debug|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Debug|x64.Build.0 = Debug|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|Win32.ActiveCfg = Release|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|Win32.Build.0 = Release|Win32
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|x64.ActiveCfg = Release|x64
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D}.Release|x64.Build.0 = Release|x64
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|Win32.ActiveCfg = Debug|Win32
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|Win32.Build.0 = Debug|Win32
{3C42510C-A29E-4A53-899C-203BFA874E0B}.Debug|x64.ActiveCfg = Debug|x64
@@ -303,14 +291,6 @@ Global
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|Win32.Build.0 = Release|Win32
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|x64.ActiveCfg = Release|x64
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0}.Release|x64.Build.0 = Release|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|Win32.ActiveCfg = Debug|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|Win32.Build.0 = Debug|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|x64.ActiveCfg = Debug|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Debug|x64.Build.0 = Debug|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|Win32.ActiveCfg = Release|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|Win32.Build.0 = Release|Win32
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|x64.ActiveCfg = Release|x64
- {7BC6C3E7-2B17-4718-A82E-084798710E14}.Release|x64.Build.0 = Release|x64
{D9057E63-AAAA-4FE7-800A-20C02F4761F3}.Debug|Win32.ActiveCfg = Debug|Win32
{D9057E63-AAAA-4FE7-800A-20C02F4761F3}.Debug|Win32.Build.0 = Debug|Win32
{D9057E63-AAAA-4FE7-800A-20C02F4761F3}.Debug|x64.ActiveCfg = Debug|x64
@@ -574,14 +554,12 @@ Global
{6DA1396F-2A44-4D5C-8442-012F71006217} = {812EF24D-9B76-4A94-ABE0-6F80C381C203}
{3A12F777-56A8-42EC-BD17-8F325524241E} = {812EF24D-9B76-4A94-ABE0-6F80C381C203}
{33276462-8313-4192-8306-13717ECCA60A} = {812EF24D-9B76-4A94-ABE0-6F80C381C203}
- {7B0F213E-C15E-4219-8AE5-49DD3D3D553D} = {812EF24D-9B76-4A94-ABE0-6F80C381C203}
{3C42510C-A29E-4A53-899C-203BFA874E0B} = {6221EF9E-F53A-4381-B760-4C0208E5D597}
{6BBEEA1E-3C87-6CD1-F32A-027C3EC5320E} = {949AF443-676D-4B48-B21E-9B6FC3A4808D}
{987F026D-EB1F-4013-ADA8-2406ACCDA526} = {6221EF9E-F53A-4381-B760-4C0208E5D597}
{33912E32-3B68-4E2C-82AE-64C06EE987A7} = {949AF443-676D-4B48-B21E-9B6FC3A4808D}
{DD667247-3712-4355-9774-7E6ACAF2275E} = {949AF443-676D-4B48-B21E-9B6FC3A4808D}
{1AA0A504-0644-4F00-A1AD-F55D69E50DD0} = {949AF443-676D-4B48-B21E-9B6FC3A4808D}
- {7BC6C3E7-2B17-4718-A82E-084798710E14} = {949AF443-676D-4B48-B21E-9B6FC3A4808D}
{D9057E63-AAAA-4FE7-800A-20C02F4761F3} = {6221EF9E-F53A-4381-B760-4C0208E5D597}
{1C856B14-54CD-4D07-B18B-5F7DB073AB51} = {85220459-761D-4E24-A381-D35A95880254}
{A5B558C6-C767-11E1-A335-F6EB6188709B} = {85220459-761D-4E24-A381-D35A95880254}
diff --git a/docs/mirandaboot.ini b/docs/mirandaboot.ini
index 23bd4360a5..5f251b134d 100644
--- a/docs/mirandaboot.ini
+++ b/docs/mirandaboot.ini
@@ -74,8 +74,8 @@ Safe=CLC Icons CLUI CList SkinSounds
;Unsafe
;A space-separated list of database module names that could be altered for
;malicious purposes (e.g., by faking a login server to steal passwords).
-;Default: Facebook GG ICQ IRC JABBER MRA MSN SKYPE TWITTER VKontakte
-Unsafe=Facebook GG ICQ IRC JABBER MRA MSN SKYPE TWITTER VKontakte
+;Default: Facebook GG ICQ IRC JABBER MRA SKYPE TWITTER VKontakte
+Unsafe=Facebook GG ICQ IRC JABBER MRA SKYPE TWITTER VKontakte
;OverrideSecurityFilename
;System administrators may find it desirable to install settings without prompting
diff --git a/include/delphi/m_acc.inc b/include/delphi/m_acc.inc
index 7556af5130..1aff95d4e2 100644
--- a/include/delphi/m_acc.inc
+++ b/include/delphi/m_acc.inc
@@ -38,7 +38,7 @@ const
a previous call of AVATAR_SETCONTACT.
wParam = not used
lParam = (AnsiChar *) protcol name
- Usage: SendMessage(hwnd, AVATAR_SETPROTOCOL, 0, (LPARAM) "MSN");
+ Usage: SendMessage(hwnd, AVATAR_SETPROTOCOL, 0, (LPARAM) "ICQ");
Only works on AVATAR_CONTROL_CLASS controls
}
AVATAR_SETPROTOCOL = WM_USER+2;
diff --git a/include/delphi/m_protosvc.inc b/include/delphi/m_protosvc.inc
index a719fc5e38..69d9435a4e 100644
--- a/include/delphi/m_protosvc.inc
+++ b/include/delphi/m_protosvc.inc
@@ -100,9 +100,9 @@ const
PFLAGNUM_2 = 2; // the status modes that the protocol supports
PF2_ONLINE = $00000001; // an unadorned online mode
PF2_INVISIBLE = $00000002;
- PF2_SHORTAWAY = $00000004; // Away on ICQ, BRB on MSN
- PF2_LONGAWAY = $00000008; // NA on ICQ, Away on MSN
- PF2_LIGHTDND = $00000010; // Occupied on ICQ, Busy on MSN
+ PF2_SHORTAWAY = $00000004; // Away on ICQ
+ PF2_LONGAWAY = $00000008; // NA on ICQ
+ PF2_LIGHTDND = $00000010; // Occupied on ICQ
PF2_HEAVYDND = $00000020; // DND on ICQ
PF2_FREECHAT = $00000040;
PF2_IDLE = $00000200; //added during 0.3.4 (2004/09/13)
diff --git a/include/m_acc.h b/include/m_acc.h
index 93be99d204..b0236b1aa6 100644
--- a/include/m_acc.h
+++ b/include/m_acc.h
@@ -37,7 +37,7 @@ Boston, MA 02111-1307, USA.
// a previous call of AVATAR_SETCONTACT.
// wParam = not used
// lParam = (char *) protcol name
-// Usage: SendMessage(hwnd, AVATAR_SETPROTOCOL, 0, (LPARAM) "MSN");
+// Usage: SendMessage(hwnd, AVATAR_SETPROTOCOL, 0, (LPARAM) "ICQ");
// Only works on AVATAR_CONTROL_CLASS controls
#define AVATAR_SETPROTOCOL (WM_USER+2)
diff --git a/include/m_protosvc.h b/include/m_protosvc.h
index 8397be07cb..b44732fa18 100644
--- a/include/m_protosvc.h
+++ b/include/m_protosvc.h
@@ -90,9 +90,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define PF2_ONLINE 0x00000001 // an unadorned online mode
#define PF2_INVISIBLE 0x00000002
-#define PF2_SHORTAWAY 0x00000004 // Away on ICQ, BRB on MSN
-#define PF2_LONGAWAY 0x00000008 // NA on ICQ, Away on MSN
-#define PF2_LIGHTDND 0x00000010 // Occupied on ICQ, Busy on MSN
+#define PF2_SHORTAWAY 0x00000004 // Away on ICQ
+#define PF2_LONGAWAY 0x00000008 // NA on ICQ
+#define PF2_LIGHTDND 0x00000010 // Occupied on ICQ
#define PF2_HEAVYDND 0x00000020 // DND on ICQ
#define PF2_FREECHAT 0x00000040
#define PF2_IDLE 0x00000200
diff --git a/langpacks/belarusian/Plugins/MSN.txt b/langpacks/belarusian/Deprecated/MSN.txt
index 1fd328a34d..e4205ff35c 100644
--- a/langpacks/belarusian/Plugins/MSN.txt
+++ b/langpacks/belarusian/Deprecated/MSN.txt
@@ -1,254 +1,254 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-Падтрымка пратаколу Microsoft Network (MSN).
-;file \protocols\MSN\res\msn.rc
-[Live ID:]
-
-[Password:]
-Пароль:
-[Nickname:]
-Мянушка:
-[Create a new Windows Live account]
-Стварыць новы конт Windows Live
-[Expert]
-Эксперт
-[Send message font color/size info inside messages]
-Адпраўляць інфармацыю пра шрыфт/колеры ў паведамленні
-[Disable all contacts not included into my contact list]
-Адключыць усе кантакты не ў спісе кантактаў
-[Manage server groups]
-Кіраваць гуртамі на серверы
-[Allow people on my contact list send messages to mobile device]
-Дазволіць кантактам са спісу адпраўляць паведамленні на мабільнік
-[Run the following application when new Hotmail arrives]
-Запусціць прыкладанне пры з'яўленні новай пошты
-[Connection settings]
-Налады далучэння
-[Direct:]
-Сервер:
-[Gateway:]
-Шлюз:
-[Reset]
-Скід
-[Notify me when a message delivery has failed]
-Абвясціць, калі паведамленне не дайшло
-[Incoming file transfers]
-Прыем файлаў
-[Your host (or router):]
-Ваш хост (ці роўтар):
-[Server List Manager]
-Кіраванне спісам на серверы
-[Contact is on your local list]
-Кантакт у вашым лакальным спісе
-[Contact is included into your server list]
-Кантакт у вашым спісе на серверы
-[Allowed (active) contact]
-Дазволены кантакт
-[Blocked contact]
-Блакаваны
-[Somebody included you in his/her server list]
-Вы ў спісе кантакту на серверы
-[Refresh]
-Абнавіць
-[Enable Popup notifications]
-Уключыць абвесткі ўсплывальнымі вокнамі
-[Enable Contact List notifications]
-Уключыць абвесткі ў спісе кантактаў
-[Enable Tray notifications]
-Уключыць абвесткі ў трэі
-[Ignore new messages not in Inbox folder]
-Ігнараваць новыя лісты не з "Уваходных"
-[Other]
-Іншае
-[Display errors using popups]
-Паказваць памылкі ў вокнах
-[Enable 'Chat Session Established' popup]
-Усплывальнае вакно 'Чат сесія ўсталявана'
-[Enable 'Contact left channel' popup]
-Усплывальнае вакно 'Кантакт пакінуў канал'
-[Set Nickname]
-Мянушка
-[Cancel]
-Скасаваць
-[Mobile Device (used for SMS)]
-Мабільная прылада (SMS)
-[Spouse/Partner]
-Сужэнец(ца)/Партнёр
-[Middle Name]
-Імя па бацьку
-[First Name]
-Імя
-[Last Name]
-Прозвішча
-[Anniversary]
-Свята
-[Birthday]
-Дзень нараджэння
-[Nickname]
-Мянушка
-[Place:]
-Месца:
-[MSN Delete Contact]
-Выдаленне MSN-кантакту
-[Remove from Hotmail Address book]
-Выдаліць з адраснай кнігі Hotmail
-[Block Contact]
-Заблакаваць
-[Invite Contact To Chat]
-Запрасіць да чата
-[Live ID]
-
-[&Invite]
-Запрасіць
-[&Cancel]
-С&касаваць
-[Add]
-Дадаць
-;file \protocols\MSN\src\msn_chat.cpp
-[Admin]
-Адмін
-[User]
-Карыстач
-[Chat #]
-Чат #
-[&Invite user...]
-&Запрасіць кантакт...
-[&Leave chat session]
-&Пакінуць сеанс
-[User &details]
-&Дадзеныя кантакту
-[User &history]
-&Гісторыя кантакта
-[&Kick user]
-
-[&Op user]
-
-[&Deop user]
-
-;file \protocols\MSN\src\msn_commands.cpp
-[%I64u bytes]
-
-[MSN Alert]
-Абвестка MSN
-;file \protocols\MSN\src\msn_errors.cpp
-[User not online]
-Кантакт не далучаны
-;file \protocols\MSN\src\msn_lists.cpp
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-Кантакт %s быў выдалены з сервера.\nЦі хочаце вы пакінуць яго ў лакальным спісе, каб захаваць гісторыю?
-[%s protocol]
-%s конт
-;file \protocols\MSN\src\msn_mail.cpp
-[Subject: %s]
-Тэма: %s
-[Hotmail from %s (%S)]
-Пошта ад %s (%S)
-[Hotmail from %s]
-Пошта Hotmail ад %s
-[Unread mail is available: %d in Inbox and %d in other folders.]
-Маецца непрачытаная пошта: %d уваходных пісьмаў і %d у іншых тэчках.
-;file \protocols\MSN\src\msn_menu.cpp
-[&Unblock]
-Разблакаваць
-[&Block]
-Блакаваць
-[Open &Hotmail Inbox]
-Адкрыць скрыню &Hotmail
-[Send &Hotmail E-mail]
-Адправіць пошту Hotmail
-[Create &Chat]
-Стварыць &чат
-[Display &Hotmail Inbox]
-Паказаць скрыню Hotmail
-[View &Profile]
-Прагледзець &профіль
-[Setup Live &Alerts]
-Налады Live &Alerts
-;file \protocols\MSN\src\msn_misc.cpp
-[Custom Smileys]
-Свае смайлы
-[Notifications]
-Абвесткі
-[Errors]
-Памылкі
-[MSN Protocol]
-Пратакол MSN
-;file \protocols\MSN\src\msn_opts.cpp
-[Protocol icon]
-Абразок конту
-[Hotmail Inbox]
-Уваходныя Hotmail
-[Profile]
-Профіль
-[MSN Services]
-Службы MSN
-[Block user]
-Заблакаваць
-[Invite to chat]
-Запрасіць у чат
-[Start Netmeeting]
-Запусціць Netmeeting
-[Contact list]
-Спіс кантактаў
-[Allowed list]
-Спіс дазволеных
-[Blocked list]
-Спіс заблакаваных
-[Relative list]
-Спіс "вы ў спісе"
-[Local list]
-Лакальны спіс
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-Імпарт гуртоў з сервера можа змяніць размяшчэнне кантактаў пасля наступнага ўваходу. Загрузіць гурты на сервер?
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-Змены будуць ужытыя пры наступным уваходзе ў MSN Messenger.
-[MSN options]
-Налады MSN
-[Automatically obtain host/port]
-Аўтаматычна атрымліваць хост/порт
-[Manually specify host/port]
-Паказваць хост/порт
-[Disable]
-Выключыць
-[IP info available only after login]
-Інфармацыя о IP даступная пасля ўваходу
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-Пратакол MSN патрабуе затрымцы адпраўкі паведамлення не меней 60 секунд. Выправіце налады.
-[Network]
-Сеціва
-[Account]
-Конт
-[Connection]
-Далучэнне
-[Server list]
-Спіс на серверы
-;file \protocols\MSN\src\msn_proto.cpp
-[Live Mail]
-Пошта Live
-[Live Alert]
-Абвестка Live
-[%s plugin connections]
-%s злучэнне з серверам
-[Contact already in your contact list]
-Кантакт ужо ў вашым спісе
-[Protocol is offline]
-Конт адключаны
-[You cannot send message to yourself]
-Вы не можаце пасылаць паведамленні самому сабе
-[Message is too long: SMS page limited to 133 UTF8 chars]
-Занадта вялікае паведамленне, максімум 133 знака UTF8
-[Message is too long: MSN messages are limited by 1202 UTF8 chars]
-Паведамленні MSN абмежаваны 1202 знакамі UTF-8
-[Offline messaging is not allowed for LCS contacts]
-Паведамленні адключаным LCS кантактам немагчымыя
-;file \protocols\MSN\src\msn_svcs.cpp
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-Для MSN затрымка адпраўлення паведамлення павінна быць не меней, чым 60 секунд. Калі ласка, наладзьце ваш плагін гутаркі.
-[Convert to Chat]
-Канвертаваць у чат
+#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
+;============================================================
+; File: MSN.dll
+; Plugin: MSN protocol
+; Version: 0.95.11.1
+; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
+;============================================================
+[Microsoft Network (MSN) protocol support for Miranda NG.]
+Падтрымка пратаколу Microsoft Network (MSN).
+;file \protocols\MSN\res\msn.rc
+[Live ID:]
+
+[Password:]
+Пароль:
+[Nickname:]
+Мянушка:
+[Create a new Windows Live account]
+Стварыць новы конт Windows Live
+[Expert]
+Эксперт
+[Send message font color/size info inside messages]
+Адпраўляць інфармацыю пра шрыфт/колеры ў паведамленні
+[Disable all contacts not included into my contact list]
+Адключыць усе кантакты не ў спісе кантактаў
+[Manage server groups]
+Кіраваць гуртамі на серверы
+[Allow people on my contact list send messages to mobile device]
+Дазволіць кантактам са спісу адпраўляць паведамленні на мабільнік
+[Run the following application when new Hotmail arrives]
+Запусціць прыкладанне пры з'яўленні новай пошты
+[Connection settings]
+Налады далучэння
+[Direct:]
+Сервер:
+[Gateway:]
+Шлюз:
+[Reset]
+Скід
+[Notify me when a message delivery has failed]
+Абвясціць, калі паведамленне не дайшло
+[Incoming file transfers]
+Прыем файлаў
+[Your host (or router):]
+Ваш хост (ці роўтар):
+[Server List Manager]
+Кіраванне спісам на серверы
+[Contact is on your local list]
+Кантакт у вашым лакальным спісе
+[Contact is included into your server list]
+Кантакт у вашым спісе на серверы
+[Allowed (active) contact]
+Дазволены кантакт
+[Blocked contact]
+Блакаваны
+[Somebody included you in his/her server list]
+Вы ў спісе кантакту на серверы
+[Refresh]
+Абнавіць
+[Enable Popup notifications]
+Уключыць абвесткі ўсплывальнымі вокнамі
+[Enable Contact List notifications]
+Уключыць абвесткі ў спісе кантактаў
+[Enable Tray notifications]
+Уключыць абвесткі ў трэі
+[Ignore new messages not in Inbox folder]
+Ігнараваць новыя лісты не з "Уваходных"
+[Other]
+Іншае
+[Display errors using popups]
+Паказваць памылкі ў вокнах
+[Enable 'Chat Session Established' popup]
+Усплывальнае вакно 'Чат сесія ўсталявана'
+[Enable 'Contact left channel' popup]
+Усплывальнае вакно 'Кантакт пакінуў канал'
+[Set Nickname]
+Мянушка
+[Cancel]
+Скасаваць
+[Mobile Device (used for SMS)]
+Мабільная прылада (SMS)
+[Spouse/Partner]
+Сужэнец(ца)/Партнёр
+[Middle Name]
+Імя па бацьку
+[First Name]
+Імя
+[Last Name]
+Прозвішча
+[Anniversary]
+Свята
+[Birthday]
+Дзень нараджэння
+[Nickname]
+Мянушка
+[Place:]
+Месца:
+[MSN Delete Contact]
+Выдаленне MSN-кантакту
+[Remove from Hotmail Address book]
+Выдаліць з адраснай кнігі Hotmail
+[Block Contact]
+Заблакаваць
+[Invite Contact To Chat]
+Запрасіць да чата
+[Live ID]
+
+[&Invite]
+Запрасіць
+[&Cancel]
+С&касаваць
+[Add]
+Дадаць
+;file \protocols\MSN\src\msn_chat.cpp
+[Admin]
+Адмін
+[User]
+Карыстач
+[Chat #]
+Чат #
+[&Invite user...]
+&Запрасіць кантакт...
+[&Leave chat session]
+&Пакінуць сеанс
+[User &details]
+&Дадзеныя кантакту
+[User &history]
+&Гісторыя кантакта
+[&Kick user]
+
+[&Op user]
+
+[&Deop user]
+
+;file \protocols\MSN\src\msn_commands.cpp
+[%I64u bytes]
+
+[MSN Alert]
+Абвестка MSN
+;file \protocols\MSN\src\msn_errors.cpp
+[User not online]
+Кантакт не далучаны
+;file \protocols\MSN\src\msn_lists.cpp
+[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
+Кантакт %s быў выдалены з сервера.\nЦі хочаце вы пакінуць яго ў лакальным спісе, каб захаваць гісторыю?
+[%s protocol]
+%s конт
+;file \protocols\MSN\src\msn_mail.cpp
+[Subject: %s]
+Тэма: %s
+[Hotmail from %s (%S)]
+Пошта ад %s (%S)
+[Hotmail from %s]
+Пошта Hotmail ад %s
+[Unread mail is available: %d in Inbox and %d in other folders.]
+Маецца непрачытаная пошта: %d уваходных пісьмаў і %d у іншых тэчках.
+;file \protocols\MSN\src\msn_menu.cpp
+[&Unblock]
+Разблакаваць
+[&Block]
+Блакаваць
+[Open &Hotmail Inbox]
+Адкрыць скрыню &Hotmail
+[Send &Hotmail E-mail]
+Адправіць пошту Hotmail
+[Create &Chat]
+Стварыць &чат
+[Display &Hotmail Inbox]
+Паказаць скрыню Hotmail
+[View &Profile]
+Прагледзець &профіль
+[Setup Live &Alerts]
+Налады Live &Alerts
+;file \protocols\MSN\src\msn_misc.cpp
+[Custom Smileys]
+Свае смайлы
+[Notifications]
+Абвесткі
+[Errors]
+Памылкі
+[MSN Protocol]
+Пратакол MSN
+;file \protocols\MSN\src\msn_opts.cpp
+[Protocol icon]
+Абразок конту
+[Hotmail Inbox]
+Уваходныя Hotmail
+[Profile]
+Профіль
+[MSN Services]
+Службы MSN
+[Block user]
+Заблакаваць
+[Invite to chat]
+Запрасіць у чат
+[Start Netmeeting]
+Запусціць Netmeeting
+[Contact list]
+Спіс кантактаў
+[Allowed list]
+Спіс дазволеных
+[Blocked list]
+Спіс заблакаваных
+[Relative list]
+Спіс "вы ў спісе"
+[Local list]
+Лакальны спіс
+[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
+Імпарт гуртоў з сервера можа змяніць размяшчэнне кантактаў пасля наступнага ўваходу. Загрузіць гурты на сервер?
+[These changes will take effect the next time you connect to the MSN Messenger network.]
+Змены будуць ужытыя пры наступным уваходзе ў MSN Messenger.
+[MSN options]
+Налады MSN
+[Automatically obtain host/port]
+Аўтаматычна атрымліваць хост/порт
+[Manually specify host/port]
+Паказваць хост/порт
+[Disable]
+Выключыць
+[IP info available only after login]
+Інфармацыя о IP даступная пасля ўваходу
+[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
+Пратакол MSN патрабуе затрымцы адпраўкі паведамлення не меней 60 секунд. Выправіце налады.
+[Network]
+Сеціва
+[Account]
+Конт
+[Connection]
+Далучэнне
+[Server list]
+Спіс на серверы
+;file \protocols\MSN\src\msn_proto.cpp
+[Live Mail]
+Пошта Live
+[Live Alert]
+Абвестка Live
+[%s plugin connections]
+%s злучэнне з серверам
+[Contact already in your contact list]
+Кантакт ужо ў вашым спісе
+[Protocol is offline]
+Конт адключаны
+[You cannot send message to yourself]
+Вы не можаце пасылаць паведамленні самому сабе
+[Message is too long: SMS page limited to 133 UTF8 chars]
+Занадта вялікае паведамленне, максімум 133 знака UTF8
+[Message is too long: MSN messages are limited by 1202 UTF8 chars]
+Паведамленні MSN абмежаваны 1202 знакамі UTF-8
+[Offline messaging is not allowed for LCS contacts]
+Паведамленні адключаным LCS кантактам немагчымыя
+;file \protocols\MSN\src\msn_svcs.cpp
+[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
+Для MSN затрымка адпраўлення паведамлення павінна быць не меней, чым 60 секунд. Калі ласка, наладзьце ваш плагін гутаркі.
+[Convert to Chat]
+Канвертаваць у чат
diff --git a/langpacks/belarusian/Untranslated/MSN.txt b/langpacks/belarusian/Untranslated/MSN.txt
deleted file mode 100644
index eaf1275291..0000000000
--- a/langpacks/belarusian/Untranslated/MSN.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-[Live ID:]
-[Live ID]
-[&Kick user]
-[&Op user]
-[&Deop user]
-[%I64u bytes]
diff --git a/langpacks/bulgarian/Plugins/MSN.txt b/langpacks/bulgarian/Deprecated/MSN.txt
index d301b2fffb..d3f7736fe5 100644
--- a/langpacks/bulgarian/Plugins/MSN.txt
+++ b/langpacks/bulgarian/Deprecated/MSN.txt
@@ -1,254 +1,254 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-Осигурява комуникация чрез протокола Microsoft Network (MSN) в Miranda NG.
-;file \protocols\MSN\res\msn.rc
-[Live ID:]
-Live ID:
-[Password:]
-Парола:
-[Nickname:]
-Прякор:
-[Create a new Windows Live account]
-Създаване на Windows Live акаунт
-[Expert]
-Експерт
-[Send message font color/size info inside messages]
-Изпращане на информация за шрифта и размера на съобщението
-[Disable all contacts not included into my contact list]
-Изключване на контактите, които не са в списъка с контакти
-[Manage server groups]
-Управление групите на сървъра
-[Allow people on my contact list send messages to mobile device]
-Изпращане на съобщ. до мобилното ми устройство от хора в списъка с контакти
-[Run the following application when new Hotmail arrives]
-Изпълнение на следната програма при пристигане на ново писмо в Hotmail
-[Connection settings]
-Настройки за свързване
-[Direct:]
-Директно:
-[Gateway:]
-Шлюз:
-[Reset]
-Анулиране
-[Notify me when a message delivery has failed]
-Уведомяване при неуспешно доставяне на съобщение
-[Incoming file transfers]
-Входящо прехвърляне на файл
-[Your host (or router):]
-Ваш хост (или рутер):
-[Server List Manager]
-Диспечер на сървърния списък
-[Contact is on your local list]
-Контакт в местния списък с контакти
-[Contact is included into your server list]
-Контактът не е в списъка на сървъра
-[Allowed (active) contact]
-
-[Blocked contact]
-Блокиран контакт
-[Somebody included you in his/her server list]
-Потребител добавил ви в списъка си с контакти
-[Refresh]
-Обновяване
-[Enable Popup notifications]
-Уведомяване с Popup
-[Enable Contact List notifications]
-
-[Enable Tray notifications]
-
-[Ignore new messages not in Inbox folder]
-Игнориране на писмата в папки различни от Inbox
-[Other]
-Друго
-[Display errors using popups]
-Изобразяване на грешки чрез popups
-[Enable 'Chat Session Established' popup]
-popup при установяване на разговор
-[Enable 'Contact left channel' popup]
-popup при излизане на контакт от канал
-[Set Nickname]
-Задаване на прякор
-[Cancel]
-Отказ
-[Mobile Device (used for SMS)]
-Мобилно устройство (използва се за SMS-и)
-[Spouse/Partner]
-Съпруг(а)/Партньор
-[Middle Name]
-Презиме
-[First Name]
-Име
-[Last Name]
-Фамилия
-[Anniversary]
-Годишнина
-[Birthday]
-Рожден ден
-[Nickname]
-Прякор
-[Place:]
-Място:
-[MSN Delete Contact]
-MSN изтриване на контакт
-[Remove from Hotmail Address book]
-Премахване от книгата с адреси в Hotmail
-[Block Contact]
-Блокиране на контакта
-[Invite Contact To Chat]
-Поканете контакт
-[Live ID]
-Live ID
-[&Invite]
-Покана
-[&Cancel]
-Отказ
-[Add]
-Добавяне
-;file \protocols\MSN\src\msn_chat.cpp
-[Admin]
-Администратор
-[User]
-Потребител
-[Chat #]
-Чат №
-[&Invite user...]
-Покани потребител...
-[&Leave chat session]
-Напускане от разговора
-[User &details]
-Подробности за потребителя
-[User &history]
-История на потребителя
-[&Kick user]
-
-[&Op user]
-
-[&Deop user]
-
-;file \protocols\MSN\src\msn_commands.cpp
-[%I64u bytes]
-
-[MSN Alert]
-MSN уведовяване
-;file \protocols\MSN\src\msn_errors.cpp
-[User not online]
-Потребителя не е на линия
-;file \protocols\MSN\src\msn_lists.cpp
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-Контактът %s е премахнат от сървъра.\nЖелаете ли да бъде запазен като "Локален контакт" за да се съхрани историята на разговорите?
-[%s protocol]
-Протокол "%s"
-;file \protocols\MSN\src\msn_mail.cpp
-[Subject: %s]
-Тема: %s
-[Hotmail from %s (%S)]
-Hotmail от %s (%S)
-[Hotmail from %s]
-Hotmail от %s
-[Unread mail is available: %d in Inbox and %d in other folders.]
-Непрочетени е-писма: %d в Inbox и %d в други папки
-;file \protocols\MSN\src\msn_menu.cpp
-[&Unblock]
-Деблокиране
-[&Block]
-Блокиране
-[Open &Hotmail Inbox]
-
-[Send &Hotmail E-mail]
-
-[Create &Chat]
-Създаване на чат
-[Display &Hotmail Inbox]
-Показване на пощата в Hotmail
-[View &Profile]
-Преглед на профила
-[Setup Live &Alerts]
-
-;file \protocols\MSN\src\msn_misc.cpp
-[Custom Smileys]
-
-[Notifications]
-Уведомявания
-[Errors]
-Грешки
-[MSN Protocol]
-MSN протокол
-;file \protocols\MSN\src\msn_opts.cpp
-[Protocol icon]
-Икона на протокола
-[Hotmail Inbox]
-
-[Profile]
-Профил
-[MSN Services]
-MSN услуги
-[Block user]
-Блокиране
-[Invite to chat]
-Покана за чат
-[Start Netmeeting]
-Иницииране на Netmeeting
-[Contact list]
-Списък с контакти
-[Allowed list]
-Списък "Разрешени"
-[Blocked list]
-Списък "Блокирани"
-[Relative list]
-
-[Local list]
-Местен списък
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-Внасянето на групите от сървъра може да измени положението на някои контакти при следващо вписване в MSN. Желаете ли вашите групи да бъдат качени на сървъра?
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-Промените ще бъдат осъществени при следващо свързване към мрежата MSN.
-[MSN options]
-MSN настройки
-[Automatically obtain host/port]
-Автоматично получаване на хост/порт
-[Manually specify host/port]
-Ръчно определяне на хост/порт
-[Disable]
-Изключване
-[IP info available only after login]
-IP информацията е налична само след вписване
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-Протоколът MSN изисква закъснението за съобщения да е не по-малко от 60 секунди. Поправете стойността.
-[Network]
-Мрежа
-[Account]
-Акаунт
-[Connection]
-Връзка
-[Server list]
-Списък на сървъра
-;file \protocols\MSN\src\msn_proto.cpp
-[Live Mail]
-Live поща
-[Live Alert]
-Live уведомяване
-[%s plugin connections]
-Връзки на приставката "%s"
-[Contact already in your contact list]
-Контактът вече присъства в списъка ви с контакти
-[Protocol is offline]
-Протоколът е извън линия
-[You cannot send message to yourself]
-Не е възможно изпращането на съобщения до себе си
-[Message is too long: SMS page limited to 133 UTF8 chars]
-Съобщението е твърде дълго: SMS страниците са ограничени до 133 UTF8 знака
-[Message is too long: MSN messages are limited by 1202 UTF8 chars]
-Съобщението е твърде дълго: MSN съобщенията са ограничени до 1202 UTF8 знака
-[Offline messaging is not allowed for LCS contacts]
-Изпращането на съобщения извън линия не е позволено за LCS контакти
-;file \protocols\MSN\src\msn_svcs.cpp
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-Протоколът MSN изисква закъснението за съобщения да е не по-малко от 60 секунди. Поправете стойността.
-[Convert to Chat]
-Конвертиране в чат
+#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
+;============================================================
+; File: MSN.dll
+; Plugin: MSN protocol
+; Version: 0.95.11.1
+; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
+;============================================================
+[Microsoft Network (MSN) protocol support for Miranda NG.]
+Осигурява комуникация чрез протокола Microsoft Network (MSN) в Miranda NG.
+;file \protocols\MSN\res\msn.rc
+[Live ID:]
+Live ID:
+[Password:]
+Парола:
+[Nickname:]
+Прякор:
+[Create a new Windows Live account]
+Създаване на Windows Live акаунт
+[Expert]
+Експерт
+[Send message font color/size info inside messages]
+Изпращане на информация за шрифта и размера на съобщението
+[Disable all contacts not included into my contact list]
+Изключване на контактите, които не са в списъка с контакти
+[Manage server groups]
+Управление групите на сървъра
+[Allow people on my contact list send messages to mobile device]
+Изпращане на съобщ. до мобилното ми устройство от хора в списъка с контакти
+[Run the following application when new Hotmail arrives]
+Изпълнение на следната програма при пристигане на ново писмо в Hotmail
+[Connection settings]
+Настройки за свързване
+[Direct:]
+Директно:
+[Gateway:]
+Шлюз:
+[Reset]
+Анулиране
+[Notify me when a message delivery has failed]
+Уведомяване при неуспешно доставяне на съобщение
+[Incoming file transfers]
+Входящо прехвърляне на файл
+[Your host (or router):]
+Ваш хост (или рутер):
+[Server List Manager]
+Диспечер на сървърния списък
+[Contact is on your local list]
+Контакт в местния списък с контакти
+[Contact is included into your server list]
+Контактът не е в списъка на сървъра
+[Allowed (active) contact]
+
+[Blocked contact]
+Блокиран контакт
+[Somebody included you in his/her server list]
+Потребител добавил ви в списъка си с контакти
+[Refresh]
+Обновяване
+[Enable Popup notifications]
+Уведомяване с Popup
+[Enable Contact List notifications]
+
+[Enable Tray notifications]
+
+[Ignore new messages not in Inbox folder]
+Игнориране на писмата в папки различни от Inbox
+[Other]
+Друго
+[Display errors using popups]
+Изобразяване на грешки чрез popups
+[Enable 'Chat Session Established' popup]
+popup при установяване на разговор
+[Enable 'Contact left channel' popup]
+popup при излизане на контакт от канал
+[Set Nickname]
+Задаване на прякор
+[Cancel]
+Отказ
+[Mobile Device (used for SMS)]
+Мобилно устройство (използва се за SMS-и)
+[Spouse/Partner]
+Съпруг(а)/Партньор
+[Middle Name]
+Презиме
+[First Name]
+Име
+[Last Name]
+Фамилия
+[Anniversary]
+Годишнина
+[Birthday]
+Рожден ден
+[Nickname]
+Прякор
+[Place:]
+Място:
+[MSN Delete Contact]
+MSN изтриване на контакт
+[Remove from Hotmail Address book]
+Премахване от книгата с адреси в Hotmail
+[Block Contact]
+Блокиране на контакта
+[Invite Contact To Chat]
+Поканете контакт
+[Live ID]
+Live ID
+[&Invite]
+Покана
+[&Cancel]
+Отказ
+[Add]
+Добавяне
+;file \protocols\MSN\src\msn_chat.cpp
+[Admin]
+Администратор
+[User]
+Потребител
+[Chat #]
+Чат №
+[&Invite user...]
+Покани потребител...
+[&Leave chat session]
+Напускане от разговора
+[User &details]
+Подробности за потребителя
+[User &history]
+История на потребителя
+[&Kick user]
+
+[&Op user]
+
+[&Deop user]
+
+;file \protocols\MSN\src\msn_commands.cpp
+[%I64u bytes]
+
+[MSN Alert]
+MSN уведовяване
+;file \protocols\MSN\src\msn_errors.cpp
+[User not online]
+Потребителя не е на линия
+;file \protocols\MSN\src\msn_lists.cpp
+[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
+Контактът %s е премахнат от сървъра.\nЖелаете ли да бъде запазен като "Локален контакт" за да се съхрани историята на разговорите?
+[%s protocol]
+Протокол "%s"
+;file \protocols\MSN\src\msn_mail.cpp
+[Subject: %s]
+Тема: %s
+[Hotmail from %s (%S)]
+Hotmail от %s (%S)
+[Hotmail from %s]
+Hotmail от %s
+[Unread mail is available: %d in Inbox and %d in other folders.]
+Непрочетени е-писма: %d в Inbox и %d в други папки
+;file \protocols\MSN\src\msn_menu.cpp
+[&Unblock]
+Деблокиране
+[&Block]
+Блокиране
+[Open &Hotmail Inbox]
+
+[Send &Hotmail E-mail]
+
+[Create &Chat]
+Създаване на чат
+[Display &Hotmail Inbox]
+Показване на пощата в Hotmail
+[View &Profile]
+Преглед на профила
+[Setup Live &Alerts]
+
+;file \protocols\MSN\src\msn_misc.cpp
+[Custom Smileys]
+
+[Notifications]
+Уведомявания
+[Errors]
+Грешки
+[MSN Protocol]
+MSN протокол
+;file \protocols\MSN\src\msn_opts.cpp
+[Protocol icon]
+Икона на протокола
+[Hotmail Inbox]
+
+[Profile]
+Профил
+[MSN Services]
+MSN услуги
+[Block user]
+Блокиране
+[Invite to chat]
+Покана за чат
+[Start Netmeeting]
+Иницииране на Netmeeting
+[Contact list]
+Списък с контакти
+[Allowed list]
+Списък "Разрешени"
+[Blocked list]
+Списък "Блокирани"
+[Relative list]
+
+[Local list]
+Местен списък
+[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
+Внасянето на групите от сървъра може да измени положението на някои контакти при следващо вписване в MSN. Желаете ли вашите групи да бъдат качени на сървъра?
+[These changes will take effect the next time you connect to the MSN Messenger network.]
+Промените ще бъдат осъществени при следващо свързване към мрежата MSN.
+[MSN options]
+MSN настройки
+[Automatically obtain host/port]
+Автоматично получаване на хост/порт
+[Manually specify host/port]
+Ръчно определяне на хост/порт
+[Disable]
+Изключване
+[IP info available only after login]
+IP информацията е налична само след вписване
+[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
+Протоколът MSN изисква закъснението за съобщения да е не по-малко от 60 секунди. Поправете стойността.
+[Network]
+Мрежа
+[Account]
+Акаунт
+[Connection]
+Връзка
+[Server list]
+Списък на сървъра
+;file \protocols\MSN\src\msn_proto.cpp
+[Live Mail]
+Live поща
+[Live Alert]
+Live уведомяване
+[%s plugin connections]
+Връзки на приставката "%s"
+[Contact already in your contact list]
+Контактът вече присъства в списъка ви с контакти
+[Protocol is offline]
+Протоколът е извън линия
+[You cannot send message to yourself]
+Не е възможно изпращането на съобщения до себе си
+[Message is too long: SMS page limited to 133 UTF8 chars]
+Съобщението е твърде дълго: SMS страниците са ограничени до 133 UTF8 знака
+[Message is too long: MSN messages are limited by 1202 UTF8 chars]
+Съобщението е твърде дълго: MSN съобщенията са ограничени до 1202 UTF8 знака
+[Offline messaging is not allowed for LCS contacts]
+Изпращането на съобщения извън линия не е позволено за LCS контакти
+;file \protocols\MSN\src\msn_svcs.cpp
+[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
+Протоколът MSN изисква закъснението за съобщения да е не по-малко от 60 секунди. Поправете стойността.
+[Convert to Chat]
+Конвертиране в чат
diff --git a/langpacks/bulgarian/Untranslated/MSN.txt b/langpacks/bulgarian/Untranslated/MSN.txt
deleted file mode 100644
index a216eca7be..0000000000
--- a/langpacks/bulgarian/Untranslated/MSN.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-[Allowed (active) contact]
-[Enable Contact List notifications]
-[Enable Tray notifications]
-[&Kick user]
-[&Op user]
-[&Deop user]
-[%I64u bytes]
-[Open &Hotmail Inbox]
-[Send &Hotmail E-mail]
-[Setup Live &Alerts]
-[Custom Smileys]
-[Hotmail Inbox]
-[Relative list]
diff --git a/langpacks/czech/Plugins/MSN.txt b/langpacks/czech/Deprecated/MSN.txt
index d269452113..e6647869d0 100644
--- a/langpacks/czech/Plugins/MSN.txt
+++ b/langpacks/czech/Deprecated/MSN.txt
@@ -1,254 +1,254 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-Microsoft Network (MSN) protokol pro Mirandu NG.
-;file \protocols\MSN\res\msn.rc
-[Live ID:]
-Identifikátor:
-[Password:]
-Heslo:
-[Nickname:]
-Přezdívka:
-[Create a new Windows Live account]
-Zřídit nový účet v síti Windows Live
-[Expert]
-Pokročilé
-[Send message font color/size info inside messages]
-Ke zprávě přidat informaci o barvě a velikosti písma
-[Disable all contacts not included into my contact list]
-Vypnout všechny kontakty neuvedené v aktuálním seznamu
-[Manage server groups]
-Zapnout správu skupin na serveru
-[Allow people on my contact list send messages to mobile device]
-Lidem ze seznamu kontaktů povolit posílání zpráv na mobil
-[Run the following application when new Hotmail arrives]
-Spustit vybranou aplikaci (po příchodu nové pošty)
-[Connection settings]
-Možnosti připojení
-[Direct:]
-Přímé:
-[Gateway:]
-Brána:
-[Reset]
-Reset
-[Notify me when a message delivery has failed]
-Upozornit při nedoručení odeslané zprávy
-[Incoming file transfers]
-Přenos příchozích souborů
-[Your host (or router):]
-Počítač (nebo brána):
-[Server List Manager]
-Správa kontaktů na serveru
-[Contact is on your local list]
-Kontakt je ve vašem lokálním seznamu
-[Contact is included into your server list]
-Kontakt je umístěn v seznamu na serveru
-[Allowed (active) contact]
-Povolený kontakt
-[Blocked contact]
-Zablokovaný kontakt
-[Somebody included you in his/her server list]
-Kontakt vás má umístěn ve svém seznamu na serveru
-[Refresh]
-Aktualizovat
-[Enable Popup notifications]
-Povolit oznámení
-[Enable Contact List notifications]
-
-[Enable Tray notifications]
-
-[Ignore new messages not in Inbox folder]
-Ignorovat nové zprávy z jiné složky než Doručená pošta
-[Other]
-Ostatní
-[Display errors using popups]
-Zobrazit chybová hlášení jako oznámení
-[Enable 'Chat Session Established' popup]
-Zapnout oznámení typu 'Spojení navázáno'
-[Enable 'Contact left channel' popup]
-Zapnout oznámení typu 'Odchod z kanálu'
-[Set Nickname]
-Nastavit přezdívku
-[Cancel]
-Zrušit
-[Mobile Device (used for SMS)]
-Mobilní zařízení (použito pro SMS)
-[Spouse/Partner]
-Manžel(ka)/Partner
-[Middle Name]
-Prostřední jméno
-[First Name]
-Jméno
-[Last Name]
-Příjmení
-[Anniversary]
-Výročí
-[Birthday]
-Narozeniny
-[Nickname]
-Přezdívka
-[Place:]
-Místo:
-[MSN Delete Contact]
-Smazat kontakt (MSN)
-[Remove from Hotmail Address book]
-Odebrat z adresáře Hotmail
-[Block Contact]
-Zablokovat kontakt
-[Invite Contact To Chat]
-Pozvat k diskusi
-[Live ID]
-Identifikátor
-[&Invite]
-&Pozvat
-[&Cancel]
-&Zrušit
-[Add]
-Přidat
-;file \protocols\MSN\src\msn_chat.cpp
-[Admin]
-Admin
-[User]
-Uživatel
-[Chat #]
-Diskuse č.
-[&Invite user...]
-Pozvat k d&iskusi...
-[&Leave chat session]
-&Opustit diskusi
-[User &details]
-&Detaily uživatele
-[User &history]
-Zobrazit &historii
-[&Kick user]
-
-[&Op user]
-
-[&Deop user]
-
-;file \protocols\MSN\src\msn_commands.cpp
-[%I64u bytes]
-
-[MSN Alert]
-Upozornění MSN
-;file \protocols\MSN\src\msn_errors.cpp
-[User not online]
-Uživatel není online
-;file \protocols\MSN\src\msn_lists.cpp
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-Kontakt %s byl odebrán ze serveru.\nPřejete si kontakt ponechat uložený lokálně pro zachování historie?
-[%s protocol]
-%s protokol
-;file \protocols\MSN\src\msn_mail.cpp
-[Subject: %s]
-Předmět: %s
-[Hotmail from %s (%S)]
-Zpráva od %s (%S)
-[Hotmail from %s]
-Zpráva od: %s
-[Unread mail is available: %d in Inbox and %d in other folders.]
-Máte neprečtenou poštu. Příchozí: %d, ostatní: %d.
-;file \protocols\MSN\src\msn_menu.cpp
-[&Unblock]
-Od&blokovat
-[&Block]
-Za&blokovat
-[Open &Hotmail Inbox]
-Přečíst poštu &Hotmail
-[Send &Hotmail E-mail]
-E-mail přes &Hotmail
-[Create &Chat]
-Začít &diskusi
-[Display &Hotmail Inbox]
-Přečíst poštu &Hotmail
-[View &Profile]
-Zobrazit profil
-[Setup Live &Alerts]
-N&astavit upozornění
-;file \protocols\MSN\src\msn_misc.cpp
-[Custom Smileys]
-Vlastní smajlíky
-[Notifications]
-Upozornění
-[Errors]
-Chyby
-[MSN Protocol]
-Protokol MSN
-;file \protocols\MSN\src\msn_opts.cpp
-[Protocol icon]
-Ikona protokolu
-[Hotmail Inbox]
-Schránka Hotmail
-[Profile]
-Profil
-[MSN Services]
-Služby MSN
-[Block user]
-Zablokovat uživatele
-[Invite to chat]
-Pozvat k diskusi
-[Start Netmeeting]
-Spustit Netmeeting
-[Contact list]
-Seznam kontaktů
-[Allowed list]
-Seznam povolených
-[Blocked list]
-Seznam zablokovaných
-[Relative list]
-Seznam protistrany
-[Local list]
-Lokální seznam
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-Import skupin ze serveru může při příštím přihlášení ovlivnit seznam\nkontaktů. Opravdu chcete zapnout správu skupin na serveru?
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-Provedené změny se projeví až při dalším připojení k síti MSN Messenger.
-[MSN options]
-MSN - možnosti
-[Automatically obtain host/port]
-Automaticky zjistit kombinaci hostitel/port
-[Manually specify host/port]
-Ručně zadat kombinaci hostitel/port
-[Disable]
-Vypnout
-[IP info available only after login]
-Informace o IP jsou dostupné až po přihlášení
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-MSN protokol vyžaduje časový interval pro odeslání zprávy 60 sek. a vyšší. Opravte nastavenou hodnotu.
-[Network]
-Sítě
-[Account]
-Účet
-[Connection]
-Spojení
-[Server list]
-Seznamy
-;file \protocols\MSN\src\msn_proto.cpp
-[Live Mail]
-Nová pošta (Live)
-[Live Alert]
-Upozornění (Live)
-[%s plugin connections]
-%s - spojení se serverem
-[Contact already in your contact list]
-Kontakt je již ve vašem seznamu
-[Protocol is offline]
-Protokol je offline
-[You cannot send message to yourself]
-Nemůžete poslat zprávu sami sobě.
-[Message is too long: SMS page limited to 133 UTF8 chars]
-Příliš dlouhá zpráva: Max. počet znaků je 133 (s diakritikou)
-[Message is too long: MSN messages are limited by 1202 UTF8 chars]
-Zpráva je příliš dlouhá. Protokol MSN umožňuje napsat max. 1202 znaků (v kódování UTF8).
-[Offline messaging is not allowed for LCS contacts]
-Pro LCS kontakty není umožněna offline komunikace
-;file \protocols\MSN\src\msn_svcs.cpp
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-MSN protokol vyžaduje časový interval pro odeslání zprávy 60 sek. a vyšší. Opravte prosím nastavenou hodnotu.
-[Convert to Chat]
-Převést na chat
+#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
+;============================================================
+; File: MSN.dll
+; Plugin: MSN protocol
+; Version: 0.95.11.1
+; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
+;============================================================
+[Microsoft Network (MSN) protocol support for Miranda NG.]
+Microsoft Network (MSN) protokol pro Mirandu NG.
+;file \protocols\MSN\res\msn.rc
+[Live ID:]
+Identifikátor:
+[Password:]
+Heslo:
+[Nickname:]
+Přezdívka:
+[Create a new Windows Live account]
+Zřídit nový účet v síti Windows Live
+[Expert]
+Pokročilé
+[Send message font color/size info inside messages]
+Ke zprávě přidat informaci o barvě a velikosti písma
+[Disable all contacts not included into my contact list]
+Vypnout všechny kontakty neuvedené v aktuálním seznamu
+[Manage server groups]
+Zapnout správu skupin na serveru
+[Allow people on my contact list send messages to mobile device]
+Lidem ze seznamu kontaktů povolit posílání zpráv na mobil
+[Run the following application when new Hotmail arrives]
+Spustit vybranou aplikaci (po příchodu nové pošty)
+[Connection settings]
+Možnosti připojení
+[Direct:]
+Přímé:
+[Gateway:]
+Brána:
+[Reset]
+Reset
+[Notify me when a message delivery has failed]
+Upozornit při nedoručení odeslané zprávy
+[Incoming file transfers]
+Přenos příchozích souborů
+[Your host (or router):]
+Počítač (nebo brána):
+[Server List Manager]
+Správa kontaktů na serveru
+[Contact is on your local list]
+Kontakt je ve vašem lokálním seznamu
+[Contact is included into your server list]
+Kontakt je umístěn v seznamu na serveru
+[Allowed (active) contact]
+Povolený kontakt
+[Blocked contact]
+Zablokovaný kontakt
+[Somebody included you in his/her server list]
+Kontakt vás má umístěn ve svém seznamu na serveru
+[Refresh]
+Aktualizovat
+[Enable Popup notifications]
+Povolit oznámení
+[Enable Contact List notifications]
+
+[Enable Tray notifications]
+
+[Ignore new messages not in Inbox folder]
+Ignorovat nové zprávy z jiné složky než Doručená pošta
+[Other]
+Ostatní
+[Display errors using popups]
+Zobrazit chybová hlášení jako oznámení
+[Enable 'Chat Session Established' popup]
+Zapnout oznámení typu 'Spojení navázáno'
+[Enable 'Contact left channel' popup]
+Zapnout oznámení typu 'Odchod z kanálu'
+[Set Nickname]
+Nastavit přezdívku
+[Cancel]
+Zrušit
+[Mobile Device (used for SMS)]
+Mobilní zařízení (použito pro SMS)
+[Spouse/Partner]
+Manžel(ka)/Partner
+[Middle Name]
+Prostřední jméno
+[First Name]
+Jméno
+[Last Name]
+Příjmení
+[Anniversary]
+Výročí
+[Birthday]
+Narozeniny
+[Nickname]
+Přezdívka
+[Place:]
+Místo:
+[MSN Delete Contact]
+Smazat kontakt (MSN)
+[Remove from Hotmail Address book]
+Odebrat z adresáře Hotmail
+[Block Contact]
+Zablokovat kontakt
+[Invite Contact To Chat]
+Pozvat k diskusi
+[Live ID]
+Identifikátor
+[&Invite]
+&Pozvat
+[&Cancel]
+&Zrušit
+[Add]
+Přidat
+;file \protocols\MSN\src\msn_chat.cpp
+[Admin]
+Admin
+[User]
+Uživatel
+[Chat #]
+Diskuse č.
+[&Invite user...]
+Pozvat k d&iskusi...
+[&Leave chat session]
+&Opustit diskusi
+[User &details]
+&Detaily uživatele
+[User &history]
+Zobrazit &historii
+[&Kick user]
+
+[&Op user]
+
+[&Deop user]
+
+;file \protocols\MSN\src\msn_commands.cpp
+[%I64u bytes]
+
+[MSN Alert]
+Upozornění MSN
+;file \protocols\MSN\src\msn_errors.cpp
+[User not online]
+Uživatel není online
+;file \protocols\MSN\src\msn_lists.cpp
+[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
+Kontakt %s byl odebrán ze serveru.\nPřejete si kontakt ponechat uložený lokálně pro zachování historie?
+[%s protocol]
+%s protokol
+;file \protocols\MSN\src\msn_mail.cpp
+[Subject: %s]
+Předmět: %s
+[Hotmail from %s (%S)]
+Zpráva od %s (%S)
+[Hotmail from %s]
+Zpráva od: %s
+[Unread mail is available: %d in Inbox and %d in other folders.]
+Máte neprečtenou poštu. Příchozí: %d, ostatní: %d.
+;file \protocols\MSN\src\msn_menu.cpp
+[&Unblock]
+Od&blokovat
+[&Block]
+Za&blokovat
+[Open &Hotmail Inbox]
+Přečíst poštu &Hotmail
+[Send &Hotmail E-mail]
+E-mail přes &Hotmail
+[Create &Chat]
+Začít &diskusi
+[Display &Hotmail Inbox]
+Přečíst poštu &Hotmail
+[View &Profile]
+Zobrazit profil
+[Setup Live &Alerts]
+N&astavit upozornění
+;file \protocols\MSN\src\msn_misc.cpp
+[Custom Smileys]
+Vlastní smajlíky
+[Notifications]
+Upozornění
+[Errors]
+Chyby
+[MSN Protocol]
+Protokol MSN
+;file \protocols\MSN\src\msn_opts.cpp
+[Protocol icon]
+Ikona protokolu
+[Hotmail Inbox]
+Schránka Hotmail
+[Profile]
+Profil
+[MSN Services]
+Služby MSN
+[Block user]
+Zablokovat uživatele
+[Invite to chat]
+Pozvat k diskusi
+[Start Netmeeting]
+Spustit Netmeeting
+[Contact list]
+Seznam kontaktů
+[Allowed list]
+Seznam povolených
+[Blocked list]
+Seznam zablokovaných
+[Relative list]
+Seznam protistrany
+[Local list]
+Lokální seznam
+[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
+Import skupin ze serveru může při příštím přihlášení ovlivnit seznam\nkontaktů. Opravdu chcete zapnout správu skupin na serveru?
+[These changes will take effect the next time you connect to the MSN Messenger network.]
+Provedené změny se projeví až při dalším připojení k síti MSN Messenger.
+[MSN options]
+MSN - možnosti
+[Automatically obtain host/port]
+Automaticky zjistit kombinaci hostitel/port
+[Manually specify host/port]
+Ručně zadat kombinaci hostitel/port
+[Disable]
+Vypnout
+[IP info available only after login]
+Informace o IP jsou dostupné až po přihlášení
+[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
+MSN protokol vyžaduje časový interval pro odeslání zprávy 60 sek. a vyšší. Opravte nastavenou hodnotu.
+[Network]
+Sítě
+[Account]
+Účet
+[Connection]
+Spojení
+[Server list]
+Seznamy
+;file \protocols\MSN\src\msn_proto.cpp
+[Live Mail]
+Nová pošta (Live)
+[Live Alert]
+Upozornění (Live)
+[%s plugin connections]
+%s - spojení se serverem
+[Contact already in your contact list]
+Kontakt je již ve vašem seznamu
+[Protocol is offline]
+Protokol je offline
+[You cannot send message to yourself]
+Nemůžete poslat zprávu sami sobě.
+[Message is too long: SMS page limited to 133 UTF8 chars]
+Příliš dlouhá zpráva: Max. počet znaků je 133 (s diakritikou)
+[Message is too long: MSN messages are limited by 1202 UTF8 chars]
+Zpráva je příliš dlouhá. Protokol MSN umožňuje napsat max. 1202 znaků (v kódování UTF8).
+[Offline messaging is not allowed for LCS contacts]
+Pro LCS kontakty není umožněna offline komunikace
+;file \protocols\MSN\src\msn_svcs.cpp
+[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
+MSN protokol vyžaduje časový interval pro odeslání zprávy 60 sek. a vyšší. Opravte prosím nastavenou hodnotu.
+[Convert to Chat]
+Převést na chat
diff --git a/langpacks/czech/Untranslated/MSN.txt b/langpacks/czech/Untranslated/MSN.txt
deleted file mode 100644
index 5714d139d1..0000000000
--- a/langpacks/czech/Untranslated/MSN.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-[Enable Contact List notifications]
-[Enable Tray notifications]
-[&Kick user]
-[&Op user]
-[&Deop user]
-[%I64u bytes]
diff --git a/langpacks/english/Plugins/MSN.txt b/langpacks/english/Plugins/MSN.txt
deleted file mode 100644
index 5c679061dc..0000000000
--- a/langpacks/english/Plugins/MSN.txt
+++ /dev/null
@@ -1,136 +0,0 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-;file \protocols\MSN\res\msn.rc
-[Live ID:]
-[Password:]
-[Nickname:]
-[Create a new Windows Live account]
-[Expert]
-[Send message font color/size info inside messages]
-[Disable all contacts not included into my contact list]
-[Manage server groups]
-[Allow people on my contact list send messages to mobile device]
-[Run the following application when new Hotmail arrives]
-[Connection settings]
-[Direct:]
-[Gateway:]
-[Reset]
-[Notify me when a message delivery has failed]
-[Incoming file transfers]
-[Your host (or router):]
-[Server List Manager]
-[Contact is on your local list]
-[Contact is included into your server list]
-[Allowed (active) contact]
-[Blocked contact]
-[Somebody included you in his/her server list]
-[Refresh]
-[Enable Popup notifications]
-[Enable Contact List notifications]
-[Enable Tray notifications]
-[Ignore new messages not in Inbox folder]
-[Other]
-[Display errors using popups]
-[Enable 'Chat Session Established' popup]
-[Enable 'Contact left channel' popup]
-[Set Nickname]
-[Cancel]
-[Mobile Device (used for SMS)]
-[Spouse/Partner]
-[Middle Name]
-[First Name]
-[Last Name]
-[Anniversary]
-[Birthday]
-[Nickname]
-[Place:]
-[MSN Delete Contact]
-[Remove from Hotmail Address book]
-[Block Contact]
-[Invite Contact To Chat]
-[Live ID]
-[&Invite]
-[&Cancel]
-[Add]
-;file \protocols\MSN\src\msn_chat.cpp
-[Admin]
-[User]
-[Chat #]
-[&Invite user...]
-[&Leave chat session]
-[User &details]
-[User &history]
-[&Kick user]
-[&Op user]
-[&Deop user]
-;file \protocols\MSN\src\msn_commands.cpp
-[%I64u bytes]
-[MSN Alert]
-;file \protocols\MSN\src\msn_errors.cpp
-[User not online]
-;file \protocols\MSN\src\msn_lists.cpp
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-[%s protocol]
-;file \protocols\MSN\src\msn_mail.cpp
-[Subject: %s]
-[Hotmail from %s (%S)]
-[Hotmail from %s]
-[Unread mail is available: %d in Inbox and %d in other folders.]
-;file \protocols\MSN\src\msn_menu.cpp
-[&Unblock]
-[&Block]
-[Open &Hotmail Inbox]
-[Send &Hotmail E-mail]
-[Create &Chat]
-[Display &Hotmail Inbox]
-[View &Profile]
-[Setup Live &Alerts]
-;file \protocols\MSN\src\msn_misc.cpp
-[Custom Smileys]
-[Notifications]
-[Errors]
-[MSN Protocol]
-;file \protocols\MSN\src\msn_opts.cpp
-[Protocol icon]
-[Hotmail Inbox]
-[Profile]
-[MSN Services]
-[Block user]
-[Invite to chat]
-[Start Netmeeting]
-[Contact list]
-[Allowed list]
-[Blocked list]
-[Relative list]
-[Local list]
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-[MSN options]
-[Automatically obtain host/port]
-[Manually specify host/port]
-[Disable]
-[IP info available only after login]
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-[Network]
-[Account]
-[Connection]
-[Server list]
-;file \protocols\MSN\src\msn_proto.cpp
-[Live Mail]
-[Live Alert]
-[%s plugin connections]
-[Contact already in your contact list]
-[Protocol is offline]
-[You cannot send message to yourself]
-[Message is too long: SMS page limited to 133 UTF-8 chars]
-[Message is too long: MSN messages are limited by 1202 UTF-8 chars]
-[Offline messaging is not allowed for LCS contacts]
-;file \protocols\MSN\src\msn_svcs.cpp
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-[Convert to Chat]
diff --git a/langpacks/english_gb/Plugins/MSN.txt b/langpacks/english_gb/Plugins/MSN.txt
deleted file mode 100644
index c80145592c..0000000000
--- a/langpacks/english_gb/Plugins/MSN.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Send message font color/size info inside messages]
-Send message font colour/size info inside messages
diff --git a/langpacks/french/Plugins/MSN.txt b/langpacks/french/Deprecated/MSN.txt
index ceb5797245..236782a6b4 100644
--- a/langpacks/french/Plugins/MSN.txt
+++ b/langpacks/french/Deprecated/MSN.txt
@@ -1,254 +1,254 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-Support du protocole Microsoft Network (MSN) pour Miranda NG.
-;file \protocols\MSN\res\msn.rc
-[Live ID:]
-
-[Password:]
-Passe :
-[Nickname:]
-Pseudo :
-[Create a new Windows Live account]
-
-[Expert]
-Expert
-[Send message font color/size info inside messages]
-Envoyer les infos de couleur/taille dans les messages
-[Disable all contacts not included into my contact list]
-Désactiver tous les contacts non inclus dans ma liste
-[Manage server groups]
-Gestion des groupes sur le serveur
-[Allow people on my contact list send messages to mobile device]
-Autoriser les contacts de ma liste à m'envoyer des messages sur mon portable
-[Run the following application when new Hotmail arrives]
-Lancer l'application suivante quand un Hotmail arrive :
-[Connection settings]
-
-[Direct:]
-
-[Gateway:]
-Passage :
-[Reset]
-RAZ
-[Notify me when a message delivery has failed]
-
-[Incoming file transfers]
-Transferts de fichiers entrant
-[Your host (or router):]
-
-[Server List Manager]
-Gestion de la liste du serveur
-[Contact is on your local list]
-
-[Contact is included into your server list]
-Contact inclus dans ma liste du serveur
-[Allowed (active) contact]
-Contact autorisé
-[Blocked contact]
-Contact bloqué
-[Somebody included you in his/her server list]
-Vous êtes dans la liste de ce contact
-[Refresh]
-Actualiser
-[Enable Popup notifications]
-Activer les notifications par popup
-[Enable Contact List notifications]
-
-[Enable Tray notifications]
-
-[Ignore new messages not in Inbox folder]
-
-[Other]
-Autre
-[Display errors using popups]
-
-[Enable 'Chat Session Established' popup]
-Activer le popup "La connexion au salon est établie"
-[Enable 'Contact left channel' popup]
-Activer le popup "Le contact a quitter le salon"
-[Set Nickname]
-
-[Cancel]
-Annuler
-[Mobile Device (used for SMS)]
-
-[Spouse/Partner]
-
-[Middle Name]
-
-[First Name]
-Prénom
-[Last Name]
-Nom
-[Anniversary]
-
-[Birthday]
-
-[Nickname]
-Pseudo
-[Place:]
-
-[MSN Delete Contact]
-
-[Remove from Hotmail Address book]
-
-[Block Contact]
-
-[Invite Contact To Chat]
-
-[Live ID]
-
-[&Invite]
-&Inviter
-[&Cancel]
-&Annuler
-[Add]
-Ajouter
-;file \protocols\MSN\src\msn_chat.cpp
-[Admin]
-
-[User]
-Utilisateur
-[Chat #]
-
-[&Invite user...]
-&Inviter l'utilisateur...
-[&Leave chat session]
-
-[User &details]
-&Détails du contact
-[User &history]
-
-[&Kick user]
-
-[&Op user]
-
-[&Deop user]
-
-;file \protocols\MSN\src\msn_commands.cpp
-[%I64u bytes]
-
-[MSN Alert]
-Alerte MSN
-;file \protocols\MSN\src\msn_errors.cpp
-[User not online]
-Contact non connecté
-;file \protocols\MSN\src\msn_lists.cpp
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-
-[%s protocol]
-%s protocole
-;file \protocols\MSN\src\msn_mail.cpp
-[Subject: %s]
-Sujet : %s
-[Hotmail from %s (%S)]
-Hotmail de %s (%S)
-[Hotmail from %s]
-Hotmail de %s
-[Unread mail is available: %d in Inbox and %d in other folders.]
-
-;file \protocols\MSN\src\msn_menu.cpp
-[&Unblock]
-
-[&Block]
-
-[Open &Hotmail Inbox]
-
-[Send &Hotmail E-mail]
-
-[Create &Chat]
-
-[Display &Hotmail Inbox]
-
-[View &Profile]
-
-[Setup Live &Alerts]
-
-;file \protocols\MSN\src\msn_misc.cpp
-[Custom Smileys]
-
-[Notifications]
-Notifications
-[Errors]
-Erreurs
-[MSN Protocol]
-Protocole MSN
-;file \protocols\MSN\src\msn_opts.cpp
-[Protocol icon]
-
-[Hotmail Inbox]
-
-[Profile]
-Profil
-[MSN Services]
-
-[Block user]
-
-[Invite to chat]
-
-[Start Netmeeting]
-
-[Contact list]
-Liste de contacts
-[Allowed list]
-
-[Blocked list]
-
-[Relative list]
-
-[Local list]
-
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-L'importation des groupes du serveur devrait changer l'apparence de votre liste de contacts à la prochaine connexion. Voulez-vous enregistrer vos groupes sur le serveur ?
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-Ces changements ne prendront effet qu'à la prochaine connexion au réseau MSN Messenger.
-[MSN options]
-Options MSN
-[Automatically obtain host/port]
-Port et hôte automatique
-[Manually specify host/port]
-Port et hôte manuel
-[Disable]
-
-[IP info available only after login]
-
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-
-[Network]
-Réseau
-[Account]
-Compte
-[Connection]
-
-[Server list]
-Liste côté serveur
-;file \protocols\MSN\src\msn_proto.cpp
-[Live Mail]
-
-[Live Alert]
-
-[%s plugin connections]
-
-[Contact already in your contact list]
-
-[Protocol is offline]
-
-[You cannot send message to yourself]
-Vous ne pouvez vous envoyer de message à vous-même
-[Message is too long: SMS page limited to 133 UTF8 chars]
-Message trop long : les SMS sont limités à 133 caractères UTF-8
-[Message is too long: MSN messages are limited by 1202 UTF8 chars]
-Message trop long : MSN les limite à 1202 caractères en UTF8
-[Offline messaging is not allowed for LCS contacts]
-
-;file \protocols\MSN\src\msn_svcs.cpp
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-
-[Convert to Chat]
-
+#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
+;============================================================
+; File: MSN.dll
+; Plugin: MSN protocol
+; Version: 0.95.11.1
+; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
+;============================================================
+[Microsoft Network (MSN) protocol support for Miranda NG.]
+Support du protocole Microsoft Network (MSN) pour Miranda NG.
+;file \protocols\MSN\res\msn.rc
+[Live ID:]
+
+[Password:]
+Passe :
+[Nickname:]
+Pseudo :
+[Create a new Windows Live account]
+
+[Expert]
+Expert
+[Send message font color/size info inside messages]
+Envoyer les infos de couleur/taille dans les messages
+[Disable all contacts not included into my contact list]
+Désactiver tous les contacts non inclus dans ma liste
+[Manage server groups]
+Gestion des groupes sur le serveur
+[Allow people on my contact list send messages to mobile device]
+Autoriser les contacts de ma liste à m'envoyer des messages sur mon portable
+[Run the following application when new Hotmail arrives]
+Lancer l'application suivante quand un Hotmail arrive :
+[Connection settings]
+
+[Direct:]
+
+[Gateway:]
+Passage :
+[Reset]
+RAZ
+[Notify me when a message delivery has failed]
+
+[Incoming file transfers]
+Transferts de fichiers entrant
+[Your host (or router):]
+
+[Server List Manager]
+Gestion de la liste du serveur
+[Contact is on your local list]
+
+[Contact is included into your server list]
+Contact inclus dans ma liste du serveur
+[Allowed (active) contact]
+Contact autorisé
+[Blocked contact]
+Contact bloqué
+[Somebody included you in his/her server list]
+Vous êtes dans la liste de ce contact
+[Refresh]
+Actualiser
+[Enable Popup notifications]
+Activer les notifications par popup
+[Enable Contact List notifications]
+
+[Enable Tray notifications]
+
+[Ignore new messages not in Inbox folder]
+
+[Other]
+Autre
+[Display errors using popups]
+
+[Enable 'Chat Session Established' popup]
+Activer le popup "La connexion au salon est établie"
+[Enable 'Contact left channel' popup]
+Activer le popup "Le contact a quitter le salon"
+[Set Nickname]
+
+[Cancel]
+Annuler
+[Mobile Device (used for SMS)]
+
+[Spouse/Partner]
+
+[Middle Name]
+
+[First Name]
+Prénom
+[Last Name]
+Nom
+[Anniversary]
+
+[Birthday]
+
+[Nickname]
+Pseudo
+[Place:]
+
+[MSN Delete Contact]
+
+[Remove from Hotmail Address book]
+
+[Block Contact]
+
+[Invite Contact To Chat]
+
+[Live ID]
+
+[&Invite]
+&Inviter
+[&Cancel]
+&Annuler
+[Add]
+Ajouter
+;file \protocols\MSN\src\msn_chat.cpp
+[Admin]
+
+[User]
+Utilisateur
+[Chat #]
+
+[&Invite user...]
+&Inviter l'utilisateur...
+[&Leave chat session]
+
+[User &details]
+&Détails du contact
+[User &history]
+
+[&Kick user]
+
+[&Op user]
+
+[&Deop user]
+
+;file \protocols\MSN\src\msn_commands.cpp
+[%I64u bytes]
+
+[MSN Alert]
+Alerte MSN
+;file \protocols\MSN\src\msn_errors.cpp
+[User not online]
+Contact non connecté
+;file \protocols\MSN\src\msn_lists.cpp
+[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
+
+[%s protocol]
+%s protocole
+;file \protocols\MSN\src\msn_mail.cpp
+[Subject: %s]
+Sujet : %s
+[Hotmail from %s (%S)]
+Hotmail de %s (%S)
+[Hotmail from %s]
+Hotmail de %s
+[Unread mail is available: %d in Inbox and %d in other folders.]
+
+;file \protocols\MSN\src\msn_menu.cpp
+[&Unblock]
+
+[&Block]
+
+[Open &Hotmail Inbox]
+
+[Send &Hotmail E-mail]
+
+[Create &Chat]
+
+[Display &Hotmail Inbox]
+
+[View &Profile]
+
+[Setup Live &Alerts]
+
+;file \protocols\MSN\src\msn_misc.cpp
+[Custom Smileys]
+
+[Notifications]
+Notifications
+[Errors]
+Erreurs
+[MSN Protocol]
+Protocole MSN
+;file \protocols\MSN\src\msn_opts.cpp
+[Protocol icon]
+
+[Hotmail Inbox]
+
+[Profile]
+Profil
+[MSN Services]
+
+[Block user]
+
+[Invite to chat]
+
+[Start Netmeeting]
+
+[Contact list]
+Liste de contacts
+[Allowed list]
+
+[Blocked list]
+
+[Relative list]
+
+[Local list]
+
+[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
+L'importation des groupes du serveur devrait changer l'apparence de votre liste de contacts à la prochaine connexion. Voulez-vous enregistrer vos groupes sur le serveur ?
+[These changes will take effect the next time you connect to the MSN Messenger network.]
+Ces changements ne prendront effet qu'à la prochaine connexion au réseau MSN Messenger.
+[MSN options]
+Options MSN
+[Automatically obtain host/port]
+Port et hôte automatique
+[Manually specify host/port]
+Port et hôte manuel
+[Disable]
+
+[IP info available only after login]
+
+[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
+
+[Network]
+Réseau
+[Account]
+Compte
+[Connection]
+
+[Server list]
+Liste côté serveur
+;file \protocols\MSN\src\msn_proto.cpp
+[Live Mail]
+
+[Live Alert]
+
+[%s plugin connections]
+
+[Contact already in your contact list]
+
+[Protocol is offline]
+
+[You cannot send message to yourself]
+Vous ne pouvez vous envoyer de message à vous-même
+[Message is too long: SMS page limited to 133 UTF8 chars]
+Message trop long : les SMS sont limités à 133 caractères UTF-8
+[Message is too long: MSN messages are limited by 1202 UTF8 chars]
+Message trop long : MSN les limite à 1202 caractères en UTF8
+[Offline messaging is not allowed for LCS contacts]
+
+;file \protocols\MSN\src\msn_svcs.cpp
+[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
+
+[Convert to Chat]
+
diff --git a/langpacks/french/Untranslated/MSN.txt b/langpacks/french/Untranslated/MSN.txt
deleted file mode 100644
index 65e6728d1e..0000000000
--- a/langpacks/french/Untranslated/MSN.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-[Live ID:]
-[Create a new Windows Live account]
-[Connection settings]
-[Direct:]
-[Notify me when a message delivery has failed]
-[Your host (or router):]
-[Contact is on your local list]
-[Enable Contact List notifications]
-[Enable Tray notifications]
-[Ignore new messages not in Inbox folder]
-[Display errors using popups]
-[Set Nickname]
-[Mobile Device (used for SMS)]
-[Spouse/Partner]
-[Middle Name]
-[Anniversary]
-[Birthday]
-[Place:]
-[MSN Delete Contact]
-[Remove from Hotmail Address book]
-[Block Contact]
-[Invite Contact To Chat]
-[Live ID]
-[Admin]
-[Chat #]
-[&Leave chat session]
-[User &history]
-[&Kick user]
-[&Op user]
-[&Deop user]
-[%I64u bytes]
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-[Unread mail is available: %d in Inbox and %d in other folders.]
-[&Unblock]
-[&Block]
-[Open &Hotmail Inbox]
-[Send &Hotmail E-mail]
-[Create &Chat]
-[Display &Hotmail Inbox]
-[View &Profile]
-[Setup Live &Alerts]
-[Custom Smileys]
-[Protocol icon]
-[Hotmail Inbox]
-[MSN Services]
-[Block user]
-[Invite to chat]
-[Start Netmeeting]
-[Allowed list]
-[Blocked list]
-[Relative list]
-[Local list]
-[Disable]
-[IP info available only after login]
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-[Connection]
-[Live Mail]
-[Live Alert]
-[%s plugin connections]
-[Contact already in your contact list]
-[Protocol is offline]
-[Offline messaging is not allowed for LCS contacts]
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-[Convert to Chat]
diff --git a/langpacks/german/Plugins/MSN.txt b/langpacks/german/Deprecated/MSN.txt
index 7e1de0e9c4..577ce3b25f 100644
--- a/langpacks/german/Plugins/MSN.txt
+++ b/langpacks/german/Deprecated/MSN.txt
@@ -1,254 +1,254 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-Microsoft Netzwerk (MSN) Protokollunterstützung für Miranda NG.
-;file \protocols\MSN\res\msn.rc
-[Live ID:]
-Live-ID:
-[Password:]
-Passwort:
-[Nickname:]
-Nick:
-[Create a new Windows Live account]
-Ein neues Windows-Live-Konto erstellen
-[Expert]
-Experte
-[Send message font color/size info inside messages]
-Farbe und Größe der Nachrichtenschrift senden
-[Disable all contacts not included into my contact list]
-Alle Kontakte deaktivieren, die nicht in meiner Kontaktliste sind
-[Manage server groups]
-Serverseitige Gruppen verwalten
-[Allow people on my contact list send messages to mobile device]
-Kontakte auf meiner Kontaktliste dürfen Nachrichten auf mein mobiles Gerät senden
-[Run the following application when new Hotmail arrives]
-Führe folgendes Programm aus, sobald eine neue Hotmail eintrifft:
-[Connection settings]
-Verbindungseinstellungen
-[Direct:]
-Direkt:
-[Gateway:]
-Gateway:
-[Reset]
-Standard
-[Notify me when a message delivery has failed]
-Teile mir mit, wenn eine Nachricht nicht gesendet werden konnte
-[Incoming file transfers]
-Eingehende Dateiübertragungen
-[Your host (or router):]
-Ihr Host (oder Router):
-[Server List Manager]
-Serverliste verwalten
-[Contact is on your local list]
-Kontakt ist in Ihrer lokalen Liste
-[Contact is included into your server list]
-Kontakt ist in Ihrer Serverliste enthalten
-[Allowed (active) contact]
-Erlaubter Kontakt
-[Blocked contact]
-Blockierter Kontakt
-[Somebody included you in his/her server list]
-Jemand führt Sie in seiner/ihrer Serverliste
-[Refresh]
-Aktualisieren
-[Enable Popup notifications]
-Popup-Benachrichtigungen aktivieren
-[Enable Contact List notifications]
-Kontaktlisten-Benachrichtigungen aktivieren
-[Enable Tray notifications]
-Tray-Benachrichtigungen aktivieren
-[Ignore new messages not in Inbox folder]
-Neue Nachrichten außerhalb des Posteingangs ignorieren
-[Other]
-Sonstige
-[Display errors using popups]
-Fehler durch Popups anzeigen
-[Enable 'Chat Session Established' popup]
-Popup 'Chatsitzung eingeleitet' aktivieren
-[Enable 'Contact left channel' popup]
-Popup 'Benutzer hat Channel verlassen' aktivieren
-[Set Nickname]
-Nickname setzen
-[Cancel]
-Abbrechen
-[Mobile Device (used for SMS)]
-Mobiles Gerät (für SMS verwendet)
-[Spouse/Partner]
-Ehegatte/Partner
-[Middle Name]
-Zweiter Name
-[First Name]
-Vorname
-[Last Name]
-Nachname
-[Anniversary]
-Jahrestag
-[Birthday]
-Geburtstag
-[Nickname]
-Nickname
-[Place:]
-Ort:
-[MSN Delete Contact]
-MSN-Kontakt löschen
-[Remove from Hotmail Address book]
-Aus Hotmail-Adressbuch entfernen
-[Block Contact]
-Kontakt blockieren
-[Invite Contact To Chat]
-Kontakt zu Chat einladen
-[Live ID]
-Live-ID
-[&Invite]
-E&inladen
-[&Cancel]
-Abbre&chen
-[Add]
-Hinzufügen
-;file \protocols\MSN\src\msn_chat.cpp
-[Admin]
-Administrator
-[User]
-Benutzer
-[Chat #]
-Chat #
-[&Invite user...]
-Kontakt e&inladen...
-[&Leave chat session]
-Chat ver&lassen
-[User &details]
-Kontaktprofil
-[User &history]
-Kontakt&verlauf
-[&Kick user]
-Benutzer &kicken
-[&Op user]
-Benutzer &Op geben
-[&Deop user]
-Benutzer Op &entziehen
-;file \protocols\MSN\src\msn_commands.cpp
-[%I64u bytes]
-%I64u Bytes
-[MSN Alert]
-MSN Alert
-;file \protocols\MSN\src\msn_errors.cpp
-[User not online]
-Benutzer nicht online
-;file \protocols\MSN\src\msn_lists.cpp
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-Kontakt %s wurde vom Server entfernt.\nWollen Sie den Kontakt lokal behalten, um den Verlauf zu erhalten?
-[%s protocol]
-%s-Protokoll
-;file \protocols\MSN\src\msn_mail.cpp
-[Subject: %s]
-Betreff: %s
-[Hotmail from %s (%S)]
-Hotmail von %s (%S)
-[Hotmail from %s]
-Hotmail von %s
-[Unread mail is available: %d in Inbox and %d in other folders.]
-Ungelesene E-Mails sind verfügbar: %d im Posteingang und %d in anderen Verzeichnissen.
-;file \protocols\MSN\src\msn_menu.cpp
-[&Unblock]
-Blockieren a&ufheben
-[&Block]
-&Blockieren
-[Open &Hotmail Inbox]
-&Hotmail-Posteingang öffnen
-[Send &Hotmail E-mail]
-&Hotmail E-Mail senden
-[Create &Chat]
-&Chat erstellen
-[Display &Hotmail Inbox]
-&Hotmail-Posteingang anzeigen
-[View &Profile]
-&Profil ansehen
-[Setup Live &Alerts]
-Live &Alerts einstellen
-;file \protocols\MSN\src\msn_misc.cpp
-[Custom Smileys]
-Custom Smileys
-[Notifications]
-Benachrichtigungen
-[Errors]
-Fehler
-[MSN Protocol]
-MSN-Protokoll
-;file \protocols\MSN\src\msn_opts.cpp
-[Protocol icon]
-Protokollicon
-[Hotmail Inbox]
-Hotmail-Posteingang
-[Profile]
-Profil
-[MSN Services]
-MSN-Dienste
-[Block user]
-Blockiere Benutzer
-[Invite to chat]
-Zum Chat einladen
-[Start Netmeeting]
-Netmeeting starten
-[Contact list]
-Kontaktliste
-[Allowed list]
-Erlaubte Liste
-[Blocked list]
-Blockierliste
-[Relative list]
-Verwandte Liste
-[Local list]
-Lokale Liste
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-Der Import von serverseitigen Gruppen wird Ihre Kontaktliste verändern. Wollen Sie Ihre Gruppen an den Server übermitteln?
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-Die Änderungen werden erst nach einer Neueinwahl ins MSN-Netzwerk aktiv.
-[MSN options]
-MSN-Einstellungen
-[Automatically obtain host/port]
-Host/Port automatisch ermitteln
-[Manually specify host/port]
-Host/Port manuell angeben
-[Disable]
-Deaktivieren
-[IP info available only after login]
-IP-Info ist nur nach Login verfügbar
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-Das MSN-Protokoll benötigt ein Nachrichtentimeout kleiner als 60 Sek. Korrigieren Sie das Timeout.
-[Network]
-Netzwerk
-[Account]
-Konto
-[Connection]
-Verbindung
-[Server list]
-Serverliste
-;file \protocols\MSN\src\msn_proto.cpp
-[Live Mail]
-Live Mail
-[Live Alert]
-Live Alert
-[%s plugin connections]
-%s Pluginverbindungen
-[Contact already in your contact list]
-Der Kontakt ist bereits in Ihrer Kontaktliste
-[Protocol is offline]
-Protokoll ist offline
-[You cannot send message to yourself]
-Sie können keine Nachricht zu sich selbst schicken!
-[Message is too long: SMS page limited to 133 UTF8 chars]
-Die Nachricht ist zu lang: Die SMS-Seite ist begrenzt auf 133 UTF8-Zeichen!
-[Message is too long: MSN messages are limited by 1202 UTF8 chars]
-Nachricht ist zu lang: MSN-Nachrichten dürfen maximal 1202 UTF8-Zeichen lang sein.
-[Offline messaging is not allowed for LCS contacts]
-Offline-Nachrichten sind nicht für LCS-Kontakte erlaubt!
-;file \protocols\MSN\src\msn_svcs.cpp
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-MSN benötigt ein Timeout von weniger als 60 Sekunden in Ihrem Nachrichtenfensterplugin. Bitte korrigieren Sie das Timeout.
-[Convert to Chat]
-In Chat umwandeln
+#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
+;============================================================
+; File: MSN.dll
+; Plugin: MSN protocol
+; Version: 0.95.11.1
+; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
+;============================================================
+[Microsoft Network (MSN) protocol support for Miranda NG.]
+Microsoft Netzwerk (MSN) Protokollunterstützung für Miranda NG.
+;file \protocols\MSN\res\msn.rc
+[Live ID:]
+Live-ID:
+[Password:]
+Passwort:
+[Nickname:]
+Nick:
+[Create a new Windows Live account]
+Ein neues Windows-Live-Konto erstellen
+[Expert]
+Experte
+[Send message font color/size info inside messages]
+Farbe und Größe der Nachrichtenschrift senden
+[Disable all contacts not included into my contact list]
+Alle Kontakte deaktivieren, die nicht in meiner Kontaktliste sind
+[Manage server groups]
+Serverseitige Gruppen verwalten
+[Allow people on my contact list send messages to mobile device]
+Kontakte auf meiner Kontaktliste dürfen Nachrichten auf mein mobiles Gerät senden
+[Run the following application when new Hotmail arrives]
+Führe folgendes Programm aus, sobald eine neue Hotmail eintrifft:
+[Connection settings]
+Verbindungseinstellungen
+[Direct:]
+Direkt:
+[Gateway:]
+Gateway:
+[Reset]
+Standard
+[Notify me when a message delivery has failed]
+Teile mir mit, wenn eine Nachricht nicht gesendet werden konnte
+[Incoming file transfers]
+Eingehende Dateiübertragungen
+[Your host (or router):]
+Ihr Host (oder Router):
+[Server List Manager]
+Serverliste verwalten
+[Contact is on your local list]
+Kontakt ist in Ihrer lokalen Liste
+[Contact is included into your server list]
+Kontakt ist in Ihrer Serverliste enthalten
+[Allowed (active) contact]
+Erlaubter Kontakt
+[Blocked contact]
+Blockierter Kontakt
+[Somebody included you in his/her server list]
+Jemand führt Sie in seiner/ihrer Serverliste
+[Refresh]
+Aktualisieren
+[Enable Popup notifications]
+Popup-Benachrichtigungen aktivieren
+[Enable Contact List notifications]
+Kontaktlisten-Benachrichtigungen aktivieren
+[Enable Tray notifications]
+Tray-Benachrichtigungen aktivieren
+[Ignore new messages not in Inbox folder]
+Neue Nachrichten außerhalb des Posteingangs ignorieren
+[Other]
+Sonstige
+[Display errors using popups]
+Fehler durch Popups anzeigen
+[Enable 'Chat Session Established' popup]
+Popup 'Chatsitzung eingeleitet' aktivieren
+[Enable 'Contact left channel' popup]
+Popup 'Benutzer hat Channel verlassen' aktivieren
+[Set Nickname]
+Nickname setzen
+[Cancel]
+Abbrechen
+[Mobile Device (used for SMS)]
+Mobiles Gerät (für SMS verwendet)
+[Spouse/Partner]
+Ehegatte/Partner
+[Middle Name]
+Zweiter Name
+[First Name]
+Vorname
+[Last Name]
+Nachname
+[Anniversary]
+Jahrestag
+[Birthday]
+Geburtstag
+[Nickname]
+Nickname
+[Place:]
+Ort:
+[MSN Delete Contact]
+MSN-Kontakt löschen
+[Remove from Hotmail Address book]
+Aus Hotmail-Adressbuch entfernen
+[Block Contact]
+Kontakt blockieren
+[Invite Contact To Chat]
+Kontakt zu Chat einladen
+[Live ID]
+Live-ID
+[&Invite]
+E&inladen
+[&Cancel]
+Abbre&chen
+[Add]
+Hinzufügen
+;file \protocols\MSN\src\msn_chat.cpp
+[Admin]
+Administrator
+[User]
+Benutzer
+[Chat #]
+Chat #
+[&Invite user...]
+Kontakt e&inladen...
+[&Leave chat session]
+Chat ver&lassen
+[User &details]
+Kontaktprofil
+[User &history]
+Kontakt&verlauf
+[&Kick user]
+Benutzer &kicken
+[&Op user]
+Benutzer &Op geben
+[&Deop user]
+Benutzer Op &entziehen
+;file \protocols\MSN\src\msn_commands.cpp
+[%I64u bytes]
+%I64u Bytes
+[MSN Alert]
+MSN Alert
+;file \protocols\MSN\src\msn_errors.cpp
+[User not online]
+Benutzer nicht online
+;file \protocols\MSN\src\msn_lists.cpp
+[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
+Kontakt %s wurde vom Server entfernt.\nWollen Sie den Kontakt lokal behalten, um den Verlauf zu erhalten?
+[%s protocol]
+%s-Protokoll
+;file \protocols\MSN\src\msn_mail.cpp
+[Subject: %s]
+Betreff: %s
+[Hotmail from %s (%S)]
+Hotmail von %s (%S)
+[Hotmail from %s]
+Hotmail von %s
+[Unread mail is available: %d in Inbox and %d in other folders.]
+Ungelesene E-Mails sind verfügbar: %d im Posteingang und %d in anderen Verzeichnissen.
+;file \protocols\MSN\src\msn_menu.cpp
+[&Unblock]
+Blockieren a&ufheben
+[&Block]
+&Blockieren
+[Open &Hotmail Inbox]
+&Hotmail-Posteingang öffnen
+[Send &Hotmail E-mail]
+&Hotmail E-Mail senden
+[Create &Chat]
+&Chat erstellen
+[Display &Hotmail Inbox]
+&Hotmail-Posteingang anzeigen
+[View &Profile]
+&Profil ansehen
+[Setup Live &Alerts]
+Live &Alerts einstellen
+;file \protocols\MSN\src\msn_misc.cpp
+[Custom Smileys]
+Custom Smileys
+[Notifications]
+Benachrichtigungen
+[Errors]
+Fehler
+[MSN Protocol]
+MSN-Protokoll
+;file \protocols\MSN\src\msn_opts.cpp
+[Protocol icon]
+Protokollicon
+[Hotmail Inbox]
+Hotmail-Posteingang
+[Profile]
+Profil
+[MSN Services]
+MSN-Dienste
+[Block user]
+Blockiere Benutzer
+[Invite to chat]
+Zum Chat einladen
+[Start Netmeeting]
+Netmeeting starten
+[Contact list]
+Kontaktliste
+[Allowed list]
+Erlaubte Liste
+[Blocked list]
+Blockierliste
+[Relative list]
+Verwandte Liste
+[Local list]
+Lokale Liste
+[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
+Der Import von serverseitigen Gruppen wird Ihre Kontaktliste verändern. Wollen Sie Ihre Gruppen an den Server übermitteln?
+[These changes will take effect the next time you connect to the MSN Messenger network.]
+Die Änderungen werden erst nach einer Neueinwahl ins MSN-Netzwerk aktiv.
+[MSN options]
+MSN-Einstellungen
+[Automatically obtain host/port]
+Host/Port automatisch ermitteln
+[Manually specify host/port]
+Host/Port manuell angeben
+[Disable]
+Deaktivieren
+[IP info available only after login]
+IP-Info ist nur nach Login verfügbar
+[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
+Das MSN-Protokoll benötigt ein Nachrichtentimeout kleiner als 60 Sek. Korrigieren Sie das Timeout.
+[Network]
+Netzwerk
+[Account]
+Konto
+[Connection]
+Verbindung
+[Server list]
+Serverliste
+;file \protocols\MSN\src\msn_proto.cpp
+[Live Mail]
+Live Mail
+[Live Alert]
+Live Alert
+[%s plugin connections]
+%s Pluginverbindungen
+[Contact already in your contact list]
+Der Kontakt ist bereits in Ihrer Kontaktliste
+[Protocol is offline]
+Protokoll ist offline
+[You cannot send message to yourself]
+Sie können keine Nachricht zu sich selbst schicken!
+[Message is too long: SMS page limited to 133 UTF8 chars]
+Die Nachricht ist zu lang: Die SMS-Seite ist begrenzt auf 133 UTF8-Zeichen!
+[Message is too long: MSN messages are limited by 1202 UTF8 chars]
+Nachricht ist zu lang: MSN-Nachrichten dürfen maximal 1202 UTF8-Zeichen lang sein.
+[Offline messaging is not allowed for LCS contacts]
+Offline-Nachrichten sind nicht für LCS-Kontakte erlaubt!
+;file \protocols\MSN\src\msn_svcs.cpp
+[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
+MSN benötigt ein Timeout von weniger als 60 Sekunden in Ihrem Nachrichtenfensterplugin. Bitte korrigieren Sie das Timeout.
+[Convert to Chat]
+In Chat umwandeln
diff --git a/langpacks/polish/Plugins/MSN.txt b/langpacks/polish/Deprecated/MSN.txt
index facee3bbcd..718ae1231e 100644
--- a/langpacks/polish/Plugins/MSN.txt
+++ b/langpacks/polish/Deprecated/MSN.txt
@@ -1,254 +1,254 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-Zapewnia obsługę protokołu Microsoft Network (MSN).
-;file \protocols\MSN\res\msn.rc
-[Live ID:]
-Identyfikator Live:
-[Password:]
-Hasło:
-[Nickname:]
-Nick:
-[Create a new Windows Live account]
-Utwórz nowe konto Windows Live
-[Expert]
-Zaawansowane
-[Send message font color/size info inside messages]
-Wyślij informacje o kolorze/rozmiarze czcionki w wiadomościach
-[Disable all contacts not included into my contact list]
-Wyłącz wszystkie kontakty nieznajdujące się na mojej liście
-[Manage server groups]
-Zarządzaj grupami serwera
-[Allow people on my contact list send messages to mobile device]
-Zezwalaj osobom z mojej listy na wysyłanie wiadomości na urządzenie mobilne
-[Run the following application when new Hotmail arrives]
-Uruchom następującą aplikację po otrzymaniu Hotmaila
-[Connection settings]
-Ustawienia połączenia
-[Direct:]
-Bezpośrednie:
-[Gateway:]
-Bramka:
-[Reset]
-Domyślne
-[Notify me when a message delivery has failed]
-Powiadom mnie jeśli nie uda się dostarczyć wiadomości
-[Incoming file transfers]
-Przychodzące transfery
-[Your host (or router):]
-Twój host(lub router):
-[Server List Manager]
-Zarządzanie listą na serwerze
-[Contact is on your local list]
-Kontakt znajduje się na lokalnej liście
-[Contact is included into your server list]
-Kontakt znajduje się na twojej liście na serwerze
-[Allowed (active) contact]
-Dozwolony (aktywny) kontakt
-[Blocked contact]
-Zablokowany kontakt
-[Somebody included you in his/her server list]
-Ktoś dodał cię do swojej listy na serwerze
-[Refresh]
-Odśwież
-[Enable Popup notifications]
-Włącz powiadomienia
-[Enable Contact List notifications]
-Włącz powiadomienia listy kontaktów
-[Enable Tray notifications]
-Włącz powiadomienia w zasobniku
-[Ignore new messages not in Inbox folder]
-Ignoruj nowe wiadomości nie będące w skrzynce odbiorczej
-[Other]
-Inne
-[Display errors using popups]
-Wyświetlaj błędy za pomocą popupów
-[Enable 'Chat Session Established' popup]
-Włącz popup "nawiązano sesję czatu"
-[Enable 'Contact left channel' popup]
-Włącz popup "kontakt opuścił kanał"
-[Set Nickname]
-Edytuj nick
-[Cancel]
-Anuluj
-[Mobile Device (used for SMS)]
-Urządzenie przenośne (używane do SMS)
-[Spouse/Partner]
-Małżonek(ka)/Partner
-[Middle Name]
-Drugie imię
-[First Name]
-Imię
-[Last Name]
-Nazwisko
-[Anniversary]
-Rocznica
-[Birthday]
-Urodziny
-[Nickname]
-Nick
-[Place:]
-Miejsce:
-[MSN Delete Contact]
-MSN usuń kontakt
-[Remove from Hotmail Address book]
-Usuń z książki adresowej Hotmail
-[Block Contact]
-Zablokuj kontakt
-[Invite Contact To Chat]
-Zaproś kontakt do czatu
-[Live ID]
-Live ID
-[&Invite]
-&Zaproś
-[&Cancel]
-&Anuluj
-[Add]
-Dodaj
-;file \protocols\MSN\src\msn_chat.cpp
-[Admin]
-Admin
-[User]
-Użytkownik
-[Chat #]
-Czat #
-[&Invite user...]
-&Zaproś użytkownika...
-[&Leave chat session]
-&Opuść pokój
-[User &details]
-&Dane kontaktu
-[User &history]
-&Historia użytkownika
-[&Kick user]
-&Wyrzuć użytkownika
-[&Op user]
-&Mianuj opem
-[&Deop user]
-&zdejmij opa
-;file \protocols\MSN\src\msn_commands.cpp
-[%I64u bytes]
-
-[MSN Alert]
-Alert MSN
-;file \protocols\MSN\src\msn_errors.cpp
-[User not online]
-Użytkownik jest rozłączony
-;file \protocols\MSN\src\msn_lists.cpp
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-Kontakt %s został usunięty z serwera.\nCzy chciałbyś pozostawić go na liście jako kontakt lokalny w celu zachowania historii?
-[%s protocol]
-Protokół %s
-;file \protocols\MSN\src\msn_mail.cpp
-[Subject: %s]
-Temat: %s
-[Hotmail from %s (%S)]
-Hotmail od %s (%S)
-[Hotmail from %s]
-Hotmail od %s
-[Unread mail is available: %d in Inbox and %d in other folders.]
-Dostępna jest nieprzeczytana poczta (%d w skrzynce odbiorczej oraz %d w innych folderach)
-;file \protocols\MSN\src\msn_menu.cpp
-[&Unblock]
-&Odblokuj
-[&Block]
-&Zablokuj
-[Open &Hotmail Inbox]
-Otwórz skrzynkę &Hotmail
-[Send &Hotmail E-mail]
-Wyślij e-mail &Hotmail
-[Create &Chat]
-Utwórz &czat
-[Display &Hotmail Inbox]
-Wyświetl skrzynkę &Hotmail
-[View &Profile]
-Pokaż &profil
-[Setup Live &Alerts]
-Ustaw &alerty live
-;file \protocols\MSN\src\msn_misc.cpp
-[Custom Smileys]
-Własne uśmieszki
-[Notifications]
-Powiadomienia
-[Errors]
-Błędy
-[MSN Protocol]
-Protokół MSN
-;file \protocols\MSN\src\msn_opts.cpp
-[Protocol icon]
-Ikona protokołu
-[Hotmail Inbox]
-Skrzynka Hotmail
-[Profile]
-Profil
-[MSN Services]
-Usługi MSN
-[Block user]
-Zablokuj użytkownika
-[Invite to chat]
-Zaproś do czatu
-[Start Netmeeting]
-Uruchom Netmeeting
-[Contact list]
-Lista kontaktów
-[Allowed list]
-Dozwolona lista
-[Blocked list]
-Lista zablokowanych
-[Relative list]
-Powiązana lista
-[Local list]
-Lista lokalna
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-Import grup z serwera może zmienić układ twojej listy kontaktów po następnym zalogowaniu. Chcesz wczytać grupy z serwera?
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-Te zmiany zostaną wprowadzone gdy ponownie połączysz się z siecią MSN Messenger.
-[MSN options]
-Opcje MSN
-[Automatically obtain host/port]
-Automatycznie ustaw host/port
-[Manually specify host/port]
-Ręcznie ustaw host/port
-[Disable]
-Wyłącz
-[IP info available only after login]
-Informacje o IP jest dostępne tylko po zalogowaniu
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-Protokół MSN wymaga, by czas oczekiwania wiadomości był większy niż 60 s. Popraw ustawienia.
-[Network]
-Protokoły
-[Account]
-Konto
-[Connection]
-Połączenie
-[Server list]
-Lista na serwerze
-;file \protocols\MSN\src\msn_proto.cpp
-[Live Mail]
-E-mail - MSN
-[Live Alert]
-Alarm - MSN
-[%s plugin connections]
-Połączenie %s
-[Contact already in your contact list]
-Kontakt jest już na liście kontaktów
-[Protocol is offline]
-Protokół jest rozłączony
-[You cannot send message to yourself]
-Nie możesz wysłać wiadomości do samego siebie
-[Message is too long: SMS page limited to 133 UTF8 chars]
-Wiadomość jest za długa: SMS-y są ograniczone do 133 znaków UTF-8
-[Message is too long: MSN messages are limited by 1202 UTF8 chars]
-Wiadomość jest za długa: Wiadomości MSN są ograniczone do 1202 znaków UTF-8
-[Offline messaging is not allowed for LCS contacts]
-Wysyłanie wiadomości Offline nie jest dozwolone dla kontaktów LCS
-;file \protocols\MSN\src\msn_svcs.cpp
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-MSN wymaga, aby limit czasu wysyłania wiadomości w opcjach wtyczki okna rozmowy nie był mniejszy niż 60 sekund. Proszę ustawić poprawną wartość.
-[Convert to Chat]
-Konwertuj do czatu
+#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
+;============================================================
+; File: MSN.dll
+; Plugin: MSN protocol
+; Version: 0.95.11.1
+; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
+;============================================================
+[Microsoft Network (MSN) protocol support for Miranda NG.]
+Zapewnia obsługę protokołu Microsoft Network (MSN).
+;file \protocols\MSN\res\msn.rc
+[Live ID:]
+Identyfikator Live:
+[Password:]
+Hasło:
+[Nickname:]
+Nick:
+[Create a new Windows Live account]
+Utwórz nowe konto Windows Live
+[Expert]
+Zaawansowane
+[Send message font color/size info inside messages]
+Wyślij informacje o kolorze/rozmiarze czcionki w wiadomościach
+[Disable all contacts not included into my contact list]
+Wyłącz wszystkie kontakty nieznajdujące się na mojej liście
+[Manage server groups]
+Zarządzaj grupami serwera
+[Allow people on my contact list send messages to mobile device]
+Zezwalaj osobom z mojej listy na wysyłanie wiadomości na urządzenie mobilne
+[Run the following application when new Hotmail arrives]
+Uruchom następującą aplikację po otrzymaniu Hotmaila
+[Connection settings]
+Ustawienia połączenia
+[Direct:]
+Bezpośrednie:
+[Gateway:]
+Bramka:
+[Reset]
+Domyślne
+[Notify me when a message delivery has failed]
+Powiadom mnie jeśli nie uda się dostarczyć wiadomości
+[Incoming file transfers]
+Przychodzące transfery
+[Your host (or router):]
+Twój host(lub router):
+[Server List Manager]
+Zarządzanie listą na serwerze
+[Contact is on your local list]
+Kontakt znajduje się na lokalnej liście
+[Contact is included into your server list]
+Kontakt znajduje się na twojej liście na serwerze
+[Allowed (active) contact]
+Dozwolony (aktywny) kontakt
+[Blocked contact]
+Zablokowany kontakt
+[Somebody included you in his/her server list]
+Ktoś dodał cię do swojej listy na serwerze
+[Refresh]
+Odśwież
+[Enable Popup notifications]
+Włącz powiadomienia
+[Enable Contact List notifications]
+Włącz powiadomienia listy kontaktów
+[Enable Tray notifications]
+Włącz powiadomienia w zasobniku
+[Ignore new messages not in Inbox folder]
+Ignoruj nowe wiadomości nie będące w skrzynce odbiorczej
+[Other]
+Inne
+[Display errors using popups]
+Wyświetlaj błędy za pomocą popupów
+[Enable 'Chat Session Established' popup]
+Włącz popup "nawiązano sesję czatu"
+[Enable 'Contact left channel' popup]
+Włącz popup "kontakt opuścił kanał"
+[Set Nickname]
+Edytuj nick
+[Cancel]
+Anuluj
+[Mobile Device (used for SMS)]
+Urządzenie przenośne (używane do SMS)
+[Spouse/Partner]
+Małżonek(ka)/Partner
+[Middle Name]
+Drugie imię
+[First Name]
+Imię
+[Last Name]
+Nazwisko
+[Anniversary]
+Rocznica
+[Birthday]
+Urodziny
+[Nickname]
+Nick
+[Place:]
+Miejsce:
+[MSN Delete Contact]
+MSN usuń kontakt
+[Remove from Hotmail Address book]
+Usuń z książki adresowej Hotmail
+[Block Contact]
+Zablokuj kontakt
+[Invite Contact To Chat]
+Zaproś kontakt do czatu
+[Live ID]
+Live ID
+[&Invite]
+&Zaproś
+[&Cancel]
+&Anuluj
+[Add]
+Dodaj
+;file \protocols\MSN\src\msn_chat.cpp
+[Admin]
+Admin
+[User]
+Użytkownik
+[Chat #]
+Czat #
+[&Invite user...]
+&Zaproś użytkownika...
+[&Leave chat session]
+&Opuść pokój
+[User &details]
+&Dane kontaktu
+[User &history]
+&Historia użytkownika
+[&Kick user]
+&Wyrzuć użytkownika
+[&Op user]
+&Mianuj opem
+[&Deop user]
+&zdejmij opa
+;file \protocols\MSN\src\msn_commands.cpp
+[%I64u bytes]
+
+[MSN Alert]
+Alert MSN
+;file \protocols\MSN\src\msn_errors.cpp
+[User not online]
+Użytkownik jest rozłączony
+;file \protocols\MSN\src\msn_lists.cpp
+[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
+Kontakt %s został usunięty z serwera.\nCzy chciałbyś pozostawić go na liście jako kontakt lokalny w celu zachowania historii?
+[%s protocol]
+Protokół %s
+;file \protocols\MSN\src\msn_mail.cpp
+[Subject: %s]
+Temat: %s
+[Hotmail from %s (%S)]
+Hotmail od %s (%S)
+[Hotmail from %s]
+Hotmail od %s
+[Unread mail is available: %d in Inbox and %d in other folders.]
+Dostępna jest nieprzeczytana poczta (%d w skrzynce odbiorczej oraz %d w innych folderach)
+;file \protocols\MSN\src\msn_menu.cpp
+[&Unblock]
+&Odblokuj
+[&Block]
+&Zablokuj
+[Open &Hotmail Inbox]
+Otwórz skrzynkę &Hotmail
+[Send &Hotmail E-mail]
+Wyślij e-mail &Hotmail
+[Create &Chat]
+Utwórz &czat
+[Display &Hotmail Inbox]
+Wyświetl skrzynkę &Hotmail
+[View &Profile]
+Pokaż &profil
+[Setup Live &Alerts]
+Ustaw &alerty live
+;file \protocols\MSN\src\msn_misc.cpp
+[Custom Smileys]
+Własne uśmieszki
+[Notifications]
+Powiadomienia
+[Errors]
+Błędy
+[MSN Protocol]
+Protokół MSN
+;file \protocols\MSN\src\msn_opts.cpp
+[Protocol icon]
+Ikona protokołu
+[Hotmail Inbox]
+Skrzynka Hotmail
+[Profile]
+Profil
+[MSN Services]
+Usługi MSN
+[Block user]
+Zablokuj użytkownika
+[Invite to chat]
+Zaproś do czatu
+[Start Netmeeting]
+Uruchom Netmeeting
+[Contact list]
+Lista kontaktów
+[Allowed list]
+Dozwolona lista
+[Blocked list]
+Lista zablokowanych
+[Relative list]
+Powiązana lista
+[Local list]
+Lista lokalna
+[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
+Import grup z serwera może zmienić układ twojej listy kontaktów po następnym zalogowaniu. Chcesz wczytać grupy z serwera?
+[These changes will take effect the next time you connect to the MSN Messenger network.]
+Te zmiany zostaną wprowadzone gdy ponownie połączysz się z siecią MSN Messenger.
+[MSN options]
+Opcje MSN
+[Automatically obtain host/port]
+Automatycznie ustaw host/port
+[Manually specify host/port]
+Ręcznie ustaw host/port
+[Disable]
+Wyłącz
+[IP info available only after login]
+Informacje o IP jest dostępne tylko po zalogowaniu
+[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
+Protokół MSN wymaga, by czas oczekiwania wiadomości był większy niż 60 s. Popraw ustawienia.
+[Network]
+Protokoły
+[Account]
+Konto
+[Connection]
+Połączenie
+[Server list]
+Lista na serwerze
+;file \protocols\MSN\src\msn_proto.cpp
+[Live Mail]
+E-mail - MSN
+[Live Alert]
+Alarm - MSN
+[%s plugin connections]
+Połączenie %s
+[Contact already in your contact list]
+Kontakt jest już na liście kontaktów
+[Protocol is offline]
+Protokół jest rozłączony
+[You cannot send message to yourself]
+Nie możesz wysłać wiadomości do samego siebie
+[Message is too long: SMS page limited to 133 UTF8 chars]
+Wiadomość jest za długa: SMS-y są ograniczone do 133 znaków UTF-8
+[Message is too long: MSN messages are limited by 1202 UTF8 chars]
+Wiadomość jest za długa: Wiadomości MSN są ograniczone do 1202 znaków UTF-8
+[Offline messaging is not allowed for LCS contacts]
+Wysyłanie wiadomości Offline nie jest dozwolone dla kontaktów LCS
+;file \protocols\MSN\src\msn_svcs.cpp
+[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
+MSN wymaga, aby limit czasu wysyłania wiadomości w opcjach wtyczki okna rozmowy nie był mniejszy niż 60 sekund. Proszę ustawić poprawną wartość.
+[Convert to Chat]
+Konwertuj do czatu
diff --git a/langpacks/polish/Untranslated/MSN.txt b/langpacks/polish/Untranslated/MSN.txt
deleted file mode 100644
index 81ffe30cc9..0000000000
--- a/langpacks/polish/Untranslated/MSN.txt
+++ /dev/null
@@ -1 +0,0 @@
-[%I64u bytes]
diff --git a/langpacks/russian/Plugins/MSN.txt b/langpacks/russian/Deprecated/MSN.txt
index 1e57498ea9..35e0071256 100644
--- a/langpacks/russian/Plugins/MSN.txt
+++ b/langpacks/russian/Deprecated/MSN.txt
@@ -1,254 +1,254 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-Поддержка протокола Microsoft Network (MSN) в Miranda NG.
-;file \protocols\MSN\res\msn.rc
-[Live ID:]
-Live ID:
-[Password:]
-Пароль:
-[Nickname:]
-Ник:
-[Create a new Windows Live account]
-Создать новую учётную запись Windows Live
-[Expert]
-Эксперт
-[Send message font color/size info inside messages]
-Отправлять информацию о шрифте/цвете в сообщении
-[Disable all contacts not included into my contact list]
-Отключить все контакты не в списке контактов
-[Manage server groups]
-Управлять группами на сервере
-[Allow people on my contact list send messages to mobile device]
-Разрешить контактам из списка отправлять сообщения на мобильный телефон
-[Run the following application when new Hotmail arrives]
-Запустить приложение при появлении новой почты
-[Connection settings]
-Настройки подключения
-[Direct:]
-Сервер:
-[Gateway:]
-Шлюз:
-[Reset]
-Сброс
-[Notify me when a message delivery has failed]
-Уведомлять о неудачной доставке сообщений
-[Incoming file transfers]
-Приём файлов
-[Your host (or router):]
-Ваш хост (или роутер):
-[Server List Manager]
-Управление списком на сервере
-[Contact is on your local list]
-Контакт в вашем локальном списке
-[Contact is included into your server list]
-Контакт в вашем списке на сервере
-[Allowed (active) contact]
-Разрешённый контакт
-[Blocked contact]
-Блокированный
-[Somebody included you in his/her server list]
-Вы в списке контакта на сервере
-[Refresh]
-Обновить
-[Enable Popup notifications]
-Включить уведомления всплывающими окнами
-[Enable Contact List notifications]
-Включить уведомления в списке контактов
-[Enable Tray notifications]
-Включить уведомления в трее
-[Ignore new messages not in Inbox folder]
-Игнорировать новые письма не из "Входящих"
-[Other]
-Другое
-[Display errors using popups]
-Показывать ошибки в окнах
-[Enable 'Chat Session Established' popup]
-Всплывающее окно 'Чат сессия установлена'
-[Enable 'Contact left channel' popup]
-Всплывающее окно 'Контакт покинул канал'
-[Set Nickname]
-Ввод ника
-[Cancel]
-Отмена
-[Mobile Device (used for SMS)]
-Мобильное устройство (SMS)
-[Spouse/Partner]
-Супруг(а)/Партнёр
-[Middle Name]
-Отчество
-[First Name]
-Имя
-[Last Name]
-Фамилия
-[Anniversary]
-Праздник
-[Birthday]
-День рождения
-[Nickname]
-Ник
-[Place:]
-Место:
-[MSN Delete Contact]
-Удаление MSN-контакта
-[Remove from Hotmail Address book]
-Удалить из адресной книги Hotmail
-[Block Contact]
-Заблокировать
-[Invite Contact To Chat]
-Пригласить контакт в чат
-[Live ID]
-Live ID
-[&Invite]
-&Пригласить
-[&Cancel]
-О&тмена
-[Add]
-Добавить
-;file \protocols\MSN\src\msn_chat.cpp
-[Admin]
-Админ
-[User]
-Пользователь
-[Chat #]
-Чат #
-[&Invite user...]
-П&ригласить пользователя...
-[&Leave chat session]
-&Покинуть чат
-[User &details]
-&Информация
-[User &history]
-&История пользователя
-[&Kick user]
-&Выкинуть пользователя
-[&Op user]
-&Сделать пользователя админом
-[&Deop user]
-&Снять с пользователя админ права
-;file \protocols\MSN\src\msn_commands.cpp
-[%I64u bytes]
-%I64u байт(а)
-[MSN Alert]
-MSN уведомление
-;file \protocols\MSN\src\msn_errors.cpp
-[User not online]
-Пользователь не в сети
-;file \protocols\MSN\src\msn_lists.cpp
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-Контакт %s был удалён с сервера.\nХотите ли вы оставить его в локальном списке, чтобы сохранить историю?
-[%s protocol]
-Протокол %s
-;file \protocols\MSN\src\msn_mail.cpp
-[Subject: %s]
-Тема: %s
-[Hotmail from %s (%S)]
-Почта от %s (%S)
-[Hotmail from %s]
-Почта Hotmail от %s
-[Unread mail is available: %d in Inbox and %d in other folders.]
-Имеется непрочитанная почта: %d входящих писем и %d в других папках.
-;file \protocols\MSN\src\msn_menu.cpp
-[&Unblock]
-&Разблокировать
-[&Block]
-&Блокировать
-[Open &Hotmail Inbox]
-Открыть ящик &Hotmail
-[Send &Hotmail E-mail]
-Отправить почту &Hotmail
-[Create &Chat]
-Создать &чат
-[Display &Hotmail Inbox]
-Показать ящик &Hotmail
-[View &Profile]
-Просмотреть &профиль
-[Setup Live &Alerts]
-Настройки Live &Alerts
-;file \protocols\MSN\src\msn_misc.cpp
-[Custom Smileys]
-Смайлы
-[Notifications]
-Уведомления
-[Errors]
-Ошибки
-[MSN Protocol]
-Протокол MSN
-;file \protocols\MSN\src\msn_opts.cpp
-[Protocol icon]
-Значок протокола
-[Hotmail Inbox]
-Входящие Hotmail
-[Profile]
-Профиль
-[MSN Services]
-Службы MSN
-[Block user]
-Заблокировать
-[Invite to chat]
-Пригласить в чат
-[Start Netmeeting]
-Запустить Netmeeting
-[Contact list]
-Список контактов
-[Allowed list]
-Список разрешённых
-[Blocked list]
-Список заблокированных
-[Relative list]
-Список "вы в списке"
-[Local list]
-Локальный список
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-Импорт групп с сервера может изменить расположение контактов после следующего входа. Загрузить группы на сервер?
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-Эти изменения вступят в силу при следующем подключении к сети MSN Messenger.
-[MSN options]
-Настройки MSN
-[Automatically obtain host/port]
-Автоматически получать хост/порт
-[Manually specify host/port]
-Указывать хост/порт
-[Disable]
-Выключить
-[IP info available only after login]
-Информация о IP доступна после входа
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-Протокол MSN требует таймаута отправки сообщения не менее 60 секунд. Исправьте настройки.
-[Network]
-Сеть
-[Account]
-Учётная запись
-[Connection]
-Подключение
-[Server list]
-Список на сервере
-;file \protocols\MSN\src\msn_proto.cpp
-[Live Mail]
-Почта
-[Live Alert]
-Уведомление
-[%s plugin connections]
-%s подключение к серверу
-[Contact already in your contact list]
-Контакт уже в вашем списке контактов
-[Protocol is offline]
-Протокол не в сети
-[You cannot send message to yourself]
-Вы не можете отправлять сообщения самому себе
-[Message is too long: SMS page limited to 133 UTF-8 chars]
-Слишком большое сообщение: максимум 133 символа UTF-8
-[Message is too long: MSN messages are limited by 1202 UTF-8 chars]
-Слишком большое сообщение: максимум 1202 символа UTF-8
-[Offline messaging is not allowed for LCS contacts]
-Сообщения отключённым LCS контактам невозможны
-;file \protocols\MSN\src\msn_svcs.cpp
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-Для сети MSN таймаут отправления сообщения должен быть не менее, чем 60 секунд. Пожалуйста, настройте свой плагин сообщений.
-[Convert to Chat]
-Конвертировать в чат
+#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
+;============================================================
+; File: MSN.dll
+; Plugin: MSN protocol
+; Version: 0.95.11.1
+; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
+;============================================================
+[Microsoft Network (MSN) protocol support for Miranda NG.]
+Поддержка протокола Microsoft Network (MSN) в Miranda NG.
+;file \protocols\MSN\res\msn.rc
+[Live ID:]
+Live ID:
+[Password:]
+Пароль:
+[Nickname:]
+Ник:
+[Create a new Windows Live account]
+Создать новую учётную запись Windows Live
+[Expert]
+Эксперт
+[Send message font color/size info inside messages]
+Отправлять информацию о шрифте/цвете в сообщении
+[Disable all contacts not included into my contact list]
+Отключить все контакты не в списке контактов
+[Manage server groups]
+Управлять группами на сервере
+[Allow people on my contact list send messages to mobile device]
+Разрешить контактам из списка отправлять сообщения на мобильный телефон
+[Run the following application when new Hotmail arrives]
+Запустить приложение при появлении новой почты
+[Connection settings]
+Настройки подключения
+[Direct:]
+Сервер:
+[Gateway:]
+Шлюз:
+[Reset]
+Сброс
+[Notify me when a message delivery has failed]
+Уведомлять о неудачной доставке сообщений
+[Incoming file transfers]
+Приём файлов
+[Your host (or router):]
+Ваш хост (или роутер):
+[Server List Manager]
+Управление списком на сервере
+[Contact is on your local list]
+Контакт в вашем локальном списке
+[Contact is included into your server list]
+Контакт в вашем списке на сервере
+[Allowed (active) contact]
+Разрешённый контакт
+[Blocked contact]
+Блокированный
+[Somebody included you in his/her server list]
+Вы в списке контакта на сервере
+[Refresh]
+Обновить
+[Enable Popup notifications]
+Включить уведомления всплывающими окнами
+[Enable Contact List notifications]
+Включить уведомления в списке контактов
+[Enable Tray notifications]
+Включить уведомления в трее
+[Ignore new messages not in Inbox folder]
+Игнорировать новые письма не из "Входящих"
+[Other]
+Другое
+[Display errors using popups]
+Показывать ошибки в окнах
+[Enable 'Chat Session Established' popup]
+Всплывающее окно 'Чат сессия установлена'
+[Enable 'Contact left channel' popup]
+Всплывающее окно 'Контакт покинул канал'
+[Set Nickname]
+Ввод ника
+[Cancel]
+Отмена
+[Mobile Device (used for SMS)]
+Мобильное устройство (SMS)
+[Spouse/Partner]
+Супруг(а)/Партнёр
+[Middle Name]
+Отчество
+[First Name]
+Имя
+[Last Name]
+Фамилия
+[Anniversary]
+Праздник
+[Birthday]
+День рождения
+[Nickname]
+Ник
+[Place:]
+Место:
+[MSN Delete Contact]
+Удаление MSN-контакта
+[Remove from Hotmail Address book]
+Удалить из адресной книги Hotmail
+[Block Contact]
+Заблокировать
+[Invite Contact To Chat]
+Пригласить контакт в чат
+[Live ID]
+Live ID
+[&Invite]
+&Пригласить
+[&Cancel]
+О&тмена
+[Add]
+Добавить
+;file \protocols\MSN\src\msn_chat.cpp
+[Admin]
+Админ
+[User]
+Пользователь
+[Chat #]
+Чат #
+[&Invite user...]
+П&ригласить пользователя...
+[&Leave chat session]
+&Покинуть чат
+[User &details]
+&Информация
+[User &history]
+&История пользователя
+[&Kick user]
+&Выкинуть пользователя
+[&Op user]
+&Сделать пользователя админом
+[&Deop user]
+&Снять с пользователя админ права
+;file \protocols\MSN\src\msn_commands.cpp
+[%I64u bytes]
+%I64u байт(а)
+[MSN Alert]
+MSN уведомление
+;file \protocols\MSN\src\msn_errors.cpp
+[User not online]
+Пользователь не в сети
+;file \protocols\MSN\src\msn_lists.cpp
+[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
+Контакт %s был удалён с сервера.\nХотите ли вы оставить его в локальном списке, чтобы сохранить историю?
+[%s protocol]
+Протокол %s
+;file \protocols\MSN\src\msn_mail.cpp
+[Subject: %s]
+Тема: %s
+[Hotmail from %s (%S)]
+Почта от %s (%S)
+[Hotmail from %s]
+Почта Hotmail от %s
+[Unread mail is available: %d in Inbox and %d in other folders.]
+Имеется непрочитанная почта: %d входящих писем и %d в других папках.
+;file \protocols\MSN\src\msn_menu.cpp
+[&Unblock]
+&Разблокировать
+[&Block]
+&Блокировать
+[Open &Hotmail Inbox]
+Открыть ящик &Hotmail
+[Send &Hotmail E-mail]
+Отправить почту &Hotmail
+[Create &Chat]
+Создать &чат
+[Display &Hotmail Inbox]
+Показать ящик &Hotmail
+[View &Profile]
+Просмотреть &профиль
+[Setup Live &Alerts]
+Настройки Live &Alerts
+;file \protocols\MSN\src\msn_misc.cpp
+[Custom Smileys]
+Смайлы
+[Notifications]
+Уведомления
+[Errors]
+Ошибки
+[MSN Protocol]
+Протокол MSN
+;file \protocols\MSN\src\msn_opts.cpp
+[Protocol icon]
+Значок протокола
+[Hotmail Inbox]
+Входящие Hotmail
+[Profile]
+Профиль
+[MSN Services]
+Службы MSN
+[Block user]
+Заблокировать
+[Invite to chat]
+Пригласить в чат
+[Start Netmeeting]
+Запустить Netmeeting
+[Contact list]
+Список контактов
+[Allowed list]
+Список разрешённых
+[Blocked list]
+Список заблокированных
+[Relative list]
+Список "вы в списке"
+[Local list]
+Локальный список
+[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
+Импорт групп с сервера может изменить расположение контактов после следующего входа. Загрузить группы на сервер?
+[These changes will take effect the next time you connect to the MSN Messenger network.]
+Эти изменения вступят в силу при следующем подключении к сети MSN Messenger.
+[MSN options]
+Настройки MSN
+[Automatically obtain host/port]
+Автоматически получать хост/порт
+[Manually specify host/port]
+Указывать хост/порт
+[Disable]
+Выключить
+[IP info available only after login]
+Информация о IP доступна после входа
+[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
+Протокол MSN требует таймаута отправки сообщения не менее 60 секунд. Исправьте настройки.
+[Network]
+Сеть
+[Account]
+Учётная запись
+[Connection]
+Подключение
+[Server list]
+Список на сервере
+;file \protocols\MSN\src\msn_proto.cpp
+[Live Mail]
+Почта
+[Live Alert]
+Уведомление
+[%s plugin connections]
+%s подключение к серверу
+[Contact already in your contact list]
+Контакт уже в вашем списке контактов
+[Protocol is offline]
+Протокол не в сети
+[You cannot send message to yourself]
+Вы не можете отправлять сообщения самому себе
+[Message is too long: SMS page limited to 133 UTF-8 chars]
+Слишком большое сообщение: максимум 133 символа UTF-8
+[Message is too long: MSN messages are limited by 1202 UTF-8 chars]
+Слишком большое сообщение: максимум 1202 символа UTF-8
+[Offline messaging is not allowed for LCS contacts]
+Сообщения отключённым LCS контактам невозможны
+;file \protocols\MSN\src\msn_svcs.cpp
+[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
+Для сети MSN таймаут отправления сообщения должен быть не менее, чем 60 секунд. Пожалуйста, настройте свой плагин сообщений.
+[Convert to Chat]
+Конвертировать в чат
diff --git a/langpacks/spanish/Plugins/MSN.txt b/langpacks/spanish/Plugins/MSN.txt
deleted file mode 100644
index 851c974834..0000000000
--- a/langpacks/spanish/Plugins/MSN.txt
+++ /dev/null
@@ -1,254 +0,0 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-
-;file \protocols\MSN\res\msn.rc
-[Live ID:]
-
-[Password:]
-Contraseña:
-[Nickname:]
-Apodo:
-[Create a new Windows Live account]
-
-[Expert]
-Experto
-[Send message font color/size info inside messages]
-
-[Disable all contacts not included into my contact list]
-
-[Manage server groups]
-
-[Allow people on my contact list send messages to mobile device]
-
-[Run the following application when new Hotmail arrives]
-
-[Connection settings]
-
-[Direct:]
-
-[Gateway:]
-
-[Reset]
-Reiniciar
-[Notify me when a message delivery has failed]
-
-[Incoming file transfers]
-
-[Your host (or router):]
-
-[Server List Manager]
-
-[Contact is on your local list]
-
-[Contact is included into your server list]
-
-[Allowed (active) contact]
-
-[Blocked contact]
-
-[Somebody included you in his/her server list]
-
-[Refresh]
-Refrescar
-[Enable Popup notifications]
-
-[Enable Contact List notifications]
-
-[Enable Tray notifications]
-
-[Ignore new messages not in Inbox folder]
-
-[Other]
-Otro
-[Display errors using popups]
-
-[Enable 'Chat Session Established' popup]
-
-[Enable 'Contact left channel' popup]
-
-[Set Nickname]
-
-[Cancel]
-Cancelar
-[Mobile Device (used for SMS)]
-
-[Spouse/Partner]
-
-[Middle Name]
-
-[First Name]
-
-[Last Name]
-
-[Anniversary]
-
-[Birthday]
-
-[Nickname]
-Apodo
-[Place:]
-Lugar:
-[MSN Delete Contact]
-
-[Remove from Hotmail Address book]
-
-[Block Contact]
-
-[Invite Contact To Chat]
-
-[Live ID]
-
-[&Invite]
-
-[&Cancel]
-&Cancelar
-[Add]
-Añadir
-;file \protocols\MSN\src\msn_chat.cpp
-[Admin]
-
-[User]
-
-[Chat #]
-
-[&Invite user...]
-&Invitar usuario...
-[&Leave chat session]
-&Abandonar sesión de charla
-[User &details]
-&Detalles del usuario
-[User &history]
-&Historial del usuario
-[&Kick user]
-
-[&Op user]
-
-[&Deop user]
-
-;file \protocols\MSN\src\msn_commands.cpp
-[%I64u bytes]
-
-[MSN Alert]
-
-;file \protocols\MSN\src\msn_errors.cpp
-[User not online]
-
-;file \protocols\MSN\src\msn_lists.cpp
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-
-[%s protocol]
-
-;file \protocols\MSN\src\msn_mail.cpp
-[Subject: %s]
-
-[Hotmail from %s (%S)]
-
-[Hotmail from %s]
-
-[Unread mail is available: %d in Inbox and %d in other folders.]
-
-;file \protocols\MSN\src\msn_menu.cpp
-[&Unblock]
-
-[&Block]
-
-[Open &Hotmail Inbox]
-
-[Send &Hotmail E-mail]
-
-[Create &Chat]
-
-[Display &Hotmail Inbox]
-
-[View &Profile]
-
-[Setup Live &Alerts]
-
-;file \protocols\MSN\src\msn_misc.cpp
-[Custom Smileys]
-
-[Notifications]
-Notificaciones
-[Errors]
-Errores
-[MSN Protocol]
-
-;file \protocols\MSN\src\msn_opts.cpp
-[Protocol icon]
-
-[Hotmail Inbox]
-
-[Profile]
-Perfil
-[MSN Services]
-
-[Block user]
-
-[Invite to chat]
-
-[Start Netmeeting]
-
-[Contact list]
-Lista de contactos
-[Allowed list]
-
-[Blocked list]
-
-[Relative list]
-
-[Local list]
-
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-
-[MSN options]
-
-[Automatically obtain host/port]
-
-[Manually specify host/port]
-
-[Disable]
-Deshabilitar
-[IP info available only after login]
-
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-
-[Network]
-Red
-[Account]
-Cuenta
-[Connection]
-Conexión
-[Server list]
-
-;file \protocols\MSN\src\msn_proto.cpp
-[Live Mail]
-
-[Live Alert]
-
-[%s plugin connections]
-
-[Contact already in your contact list]
-
-[Protocol is offline]
-
-[You cannot send message to yourself]
-
-[Message is too long: SMS page limited to 133 UTF8 chars]
-
-[Message is too long: MSN messages are limited by 1202 UTF8 chars]
-
-[Offline messaging is not allowed for LCS contacts]
-
-;file \protocols\MSN\src\msn_svcs.cpp
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-
-[Convert to Chat]
-
diff --git a/langpacks/spanish/Untranslated/MSN.txt b/langpacks/spanish/Untranslated/MSN.txt
deleted file mode 100644
index 5f8bf2cfec..0000000000
--- a/langpacks/spanish/Untranslated/MSN.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-[Live ID:]
-[Create a new Windows Live account]
-[Send message font color/size info inside messages]
-[Disable all contacts not included into my contact list]
-[Manage server groups]
-[Allow people on my contact list send messages to mobile device]
-[Run the following application when new Hotmail arrives]
-[Connection settings]
-[Direct:]
-[Gateway:]
-[Notify me when a message delivery has failed]
-[Incoming file transfers]
-[Your host (or router):]
-[Server List Manager]
-[Contact is on your local list]
-[Contact is included into your server list]
-[Allowed (active) contact]
-[Blocked contact]
-[Somebody included you in his/her server list]
-[Enable Popup notifications]
-[Enable Contact List notifications]
-[Enable Tray notifications]
-[Ignore new messages not in Inbox folder]
-[Display errors using popups]
-[Enable 'Chat Session Established' popup]
-[Enable 'Contact left channel' popup]
-[Set Nickname]
-[Mobile Device (used for SMS)]
-[Spouse/Partner]
-[Middle Name]
-[First Name]
-[Last Name]
-[Anniversary]
-[Birthday]
-[MSN Delete Contact]
-[Remove from Hotmail Address book]
-[Block Contact]
-[Invite Contact To Chat]
-[Live ID]
-[&Invite]
-[Admin]
-[User]
-[Chat #]
-[&Kick user]
-[&Op user]
-[&Deop user]
-[%I64u bytes]
-[MSN Alert]
-[User not online]
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-[%s protocol]
-[Subject: %s]
-[Hotmail from %s (%S)]
-[Hotmail from %s]
-[Unread mail is available: %d in Inbox and %d in other folders.]
-[&Unblock]
-[&Block]
-[Open &Hotmail Inbox]
-[Send &Hotmail E-mail]
-[Create &Chat]
-[Display &Hotmail Inbox]
-[View &Profile]
-[Setup Live &Alerts]
-[Custom Smileys]
-[MSN Protocol]
-[Protocol icon]
-[Hotmail Inbox]
-[MSN Services]
-[Block user]
-[Invite to chat]
-[Start Netmeeting]
-[Allowed list]
-[Blocked list]
-[Relative list]
-[Local list]
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-[MSN options]
-[Automatically obtain host/port]
-[Manually specify host/port]
-[IP info available only after login]
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-[Server list]
-[Live Mail]
-[Live Alert]
-[%s plugin connections]
-[Contact already in your contact list]
-[Protocol is offline]
-[You cannot send message to yourself]
-[Message is too long: SMS page limited to 133 UTF8 chars]
-[Message is too long: MSN messages are limited by 1202 UTF8 chars]
-[Offline messaging is not allowed for LCS contacts]
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-[Convert to Chat]
diff --git a/langpacks/ukrainian/Plugins/MSN.txt b/langpacks/ukrainian/Deprecated/MSN.txt
index 9c1cafa0a7..cb1ef53e5c 100644
--- a/langpacks/ukrainian/Plugins/MSN.txt
+++ b/langpacks/ukrainian/Deprecated/MSN.txt
@@ -1,254 +1,254 @@
-#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
-;============================================================
-; File: MSN.dll
-; Plugin: MSN protocol
-; Version: 0.95.11.1
-; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
-;============================================================
-[Microsoft Network (MSN) protocol support for Miranda NG.]
-Підтримка протоколу Microsoft Network (MSN) у Miranda NG.
-;file \protocols\MSN\res\msn.rc
-[Live ID:]
-
-[Password:]
-Пароль:
-[Nickname:]
-Нік:
-[Create a new Windows Live account]
-Створити новий обліковий запис Windows Live
-[Expert]
-Експерт
-[Send message font color/size info inside messages]
-Відправляти інформацію про шрифт/колір у повідомленні
-[Disable all contacts not included into my contact list]
-Відключити всі контакти не в списку контактів
-[Manage server groups]
-Керувати групами на сервері
-[Allow people on my contact list send messages to mobile device]
-Дозволити контактам зі списку відправляти повідомлення на мобільний
-[Run the following application when new Hotmail arrives]
-Запуск програми при появі нової пошти
-[Connection settings]
-Налаштування підключення
-[Direct:]
-Сервер:
-[Gateway:]
-Шлюз:
-[Reset]
-Скинути
-[Notify me when a message delivery has failed]
-Сповіщати про невдалу доставку повідомлень
-[Incoming file transfers]
-Прийом файлів
-[Your host (or router):]
-Ваш хост (або роутер):
-[Server List Manager]
-Керування списком на сервері
-[Contact is on your local list]
-Контакт у вашому локальному списку
-[Contact is included into your server list]
-Контакт у вашому списку на сервері
-[Allowed (active) contact]
-Дозволений контакт
-[Blocked contact]
-Заблокований контакт
-[Somebody included you in his/her server list]
-Вас додали до списку контактів на сервері
-[Refresh]
-Оновити
-[Enable Popup notifications]
-Увімкнути сповіщення в спливаючих вікнах
-[Enable Contact List notifications]
-Увімкнути сповіщення в списку контактів
-[Enable Tray notifications]
-Увімкнути сповіщення в треї
-[Ignore new messages not in Inbox folder]
-Ігнорувати нові листи не з "Вхідних"
-[Other]
-Інше
-[Display errors using popups]
-Показувати помилки у вікнах
-[Enable 'Chat Session Established' popup]
-Спливаюче вікно "Чат-сесія встановлена"
-[Enable 'Contact left channel' popup]
-Спливаюче вікно "Контакт покинув канал"
-[Set Nickname]
-Введення ніка
-[Cancel]
-Скасувати
-[Mobile Device (used for SMS)]
-Мобільний пристрій (SMS)
-[Spouse/Partner]
-Чоловік/Партнер
-[Middle Name]
-По батькові
-[First Name]
-Ім'я
-[Last Name]
-Прізвище
-[Anniversary]
-Свято
-[Birthday]
-День народження
-[Nickname]
-Нік
-[Place:]
-Місце:
-[MSN Delete Contact]
-Видалення контакту MSN
-[Remove from Hotmail Address book]
-Видалити з адресної книги Hotmail
-[Block Contact]
-Заблокувати
-[Invite Contact To Chat]
-Запросити контакт у чат
-[Live ID]
-
-[&Invite]
-&Запросити
-[&Cancel]
-&Скасувати
-[Add]
-Додати
-;file \protocols\MSN\src\msn_chat.cpp
-[Admin]
-Адмін
-[User]
-Користувач
-[Chat #]
-Чат #
-[&Invite user...]
-З&апросити користувача...
-[&Leave chat session]
-&Покинути сеанс
-[User &details]
-Дані &контакту
-[User &history]
-Історія користувача
-[&Kick user]
-&Вигнати
-[&Op user]
-Зробити користувача &адміном
-[&Deop user]
-&Забрати права адміністратора
-;file \protocols\MSN\src\msn_commands.cpp
-[%I64u bytes]
-
-[MSN Alert]
-Сповіщення MSN
-;file \protocols\MSN\src\msn_errors.cpp
-[User not online]
-Користувач не в мережі
-;file \protocols\MSN\src\msn_lists.cpp
-[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
-Контакт %s був видалений з сервера.\nХочете залишити його в локальному списку, щоб зберегти історію?
-[%s protocol]
-Протокол %s
-;file \protocols\MSN\src\msn_mail.cpp
-[Subject: %s]
-Тема: %s
-[Hotmail from %s (%S)]
-Пошта від %s (%S)
-[Hotmail from %s]
-Пошта Hotmail від %s
-[Unread mail is available: %d in Inbox and %d in other folders.]
-Непрочитана пошта: %d вхідних листів і %d в інших папках.
-;file \protocols\MSN\src\msn_menu.cpp
-[&Unblock]
-&Розблокувати
-[&Block]
-&Блокувати
-[Open &Hotmail Inbox]
-Відкрити скриньку &Hotmail
-[Send &Hotmail E-mail]
-Відправити пошту &Hotmail
-[Create &Chat]
-Створити &чат
-[Display &Hotmail Inbox]
-Показати скриньки &Hotmail
-[View &Profile]
-Переглянути &профіль
-[Setup Live &Alerts]
-Налаштування Live &Alerts
-;file \protocols\MSN\src\msn_misc.cpp
-[Custom Smileys]
-Користувацькі смайли
-[Notifications]
-Сповіщення
-[Errors]
-Помилки
-[MSN Protocol]
-Протокол MSN
-;file \protocols\MSN\src\msn_opts.cpp
-[Protocol icon]
-Значок протоколу
-[Hotmail Inbox]
-Вхідні Hotmail
-[Profile]
-Профіль
-[MSN Services]
-Служби MSN
-[Block user]
-Заблокувати
-[Invite to chat]
-Запросити в чат
-[Start Netmeeting]
-Запустити Netmeeting
-[Contact list]
-Список контактів
-[Allowed list]
-Список дозволених
-[Blocked list]
-Список заблокованих
-[Relative list]
-Список "ви у списку"
-[Local list]
-Локальний список
-[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
-Імпорт груп з сервера може змінити розташування контактів після наступного входу. Завантажити групи на сервер?
-[These changes will take effect the next time you connect to the MSN Messenger network.]
-Зміни наберуть чинності при наступному вході в мережу MSN.
-[MSN options]
-Налаштування MSN
-[Automatically obtain host/port]
-Автоматично отримувати хост/порт
-[Manually specify host/port]
-Вказати хост/порт
-[Disable]
-Вимкнути
-[IP info available only after login]
-Інформація про IP доступна після входу
-[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
-Протокол MSN вимагає таймауту відправки повідомлення не менше 60 секунд. Виправте налаштування.
-[Network]
-Мережа
-[Account]
-Обліковий запис
-[Connection]
-Підключення
-[Server list]
-Список на сервері
-;file \protocols\MSN\src\msn_proto.cpp
-[Live Mail]
-Пошта Live
-[Live Alert]
-Сповіщення Live
-[%s plugin connections]
-З'єднання з сервером %s
-[Contact already in your contact list]
-Контакт у вашому списку
-[Protocol is offline]
-Протокол не в мережі
-[You cannot send message to yourself]
-Ви не можете надсилати повідомлення самому собі
-[Message is too long: SMS page limited to 133 UTF8 chars]
-Занадто велике повідомлення, максимум 133 символи UTF8
-[Message is too long: MSN messages are limited by 1202 UTF8 chars]
-Повідомлення MSN обмежені 1202 символами UTF-8
-[Offline messaging is not allowed for LCS contacts]
-Повідомлення відключеним LCS-контактам неможливі
-;file \protocols\MSN\src\msn_svcs.cpp
-[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
-Для мережі MSN таймаут відправлення повідомлення повинен бути не менш ніж 60 секунд. Будь ласка, налаштуйте свій плагін повідомлень.
-[Convert to Chat]
-Конвертувати в чат
+#muuid {97724af9-f3fb-47d3-a3bf-eaa935c74e6d}
+;============================================================
+; File: MSN.dll
+; Plugin: MSN protocol
+; Version: 0.95.11.1
+; Authors: Boris Krasnovskiy, George Hazan, Richard Hughes, leecher
+;============================================================
+[Microsoft Network (MSN) protocol support for Miranda NG.]
+Підтримка протоколу Microsoft Network (MSN) у Miranda NG.
+;file \protocols\MSN\res\msn.rc
+[Live ID:]
+
+[Password:]
+Пароль:
+[Nickname:]
+Нік:
+[Create a new Windows Live account]
+Створити новий обліковий запис Windows Live
+[Expert]
+Експерт
+[Send message font color/size info inside messages]
+Відправляти інформацію про шрифт/колір у повідомленні
+[Disable all contacts not included into my contact list]
+Відключити всі контакти не в списку контактів
+[Manage server groups]
+Керувати групами на сервері
+[Allow people on my contact list send messages to mobile device]
+Дозволити контактам зі списку відправляти повідомлення на мобільний
+[Run the following application when new Hotmail arrives]
+Запуск програми при появі нової пошти
+[Connection settings]
+Налаштування підключення
+[Direct:]
+Сервер:
+[Gateway:]
+Шлюз:
+[Reset]
+Скинути
+[Notify me when a message delivery has failed]
+Сповіщати про невдалу доставку повідомлень
+[Incoming file transfers]
+Прийом файлів
+[Your host (or router):]
+Ваш хост (або роутер):
+[Server List Manager]
+Керування списком на сервері
+[Contact is on your local list]
+Контакт у вашому локальному списку
+[Contact is included into your server list]
+Контакт у вашому списку на сервері
+[Allowed (active) contact]
+Дозволений контакт
+[Blocked contact]
+Заблокований контакт
+[Somebody included you in his/her server list]
+Вас додали до списку контактів на сервері
+[Refresh]
+Оновити
+[Enable Popup notifications]
+Увімкнути сповіщення в спливаючих вікнах
+[Enable Contact List notifications]
+Увімкнути сповіщення в списку контактів
+[Enable Tray notifications]
+Увімкнути сповіщення в треї
+[Ignore new messages not in Inbox folder]
+Ігнорувати нові листи не з "Вхідних"
+[Other]
+Інше
+[Display errors using popups]
+Показувати помилки у вікнах
+[Enable 'Chat Session Established' popup]
+Спливаюче вікно "Чат-сесія встановлена"
+[Enable 'Contact left channel' popup]
+Спливаюче вікно "Контакт покинув канал"
+[Set Nickname]
+Введення ніка
+[Cancel]
+Скасувати
+[Mobile Device (used for SMS)]
+Мобільний пристрій (SMS)
+[Spouse/Partner]
+Чоловік/Партнер
+[Middle Name]
+По батькові
+[First Name]
+Ім'я
+[Last Name]
+Прізвище
+[Anniversary]
+Свято
+[Birthday]
+День народження
+[Nickname]
+Нік
+[Place:]
+Місце:
+[MSN Delete Contact]
+Видалення контакту MSN
+[Remove from Hotmail Address book]
+Видалити з адресної книги Hotmail
+[Block Contact]
+Заблокувати
+[Invite Contact To Chat]
+Запросити контакт у чат
+[Live ID]
+
+[&Invite]
+&Запросити
+[&Cancel]
+&Скасувати
+[Add]
+Додати
+;file \protocols\MSN\src\msn_chat.cpp
+[Admin]
+Адмін
+[User]
+Користувач
+[Chat #]
+Чат #
+[&Invite user...]
+З&апросити користувача...
+[&Leave chat session]
+&Покинути сеанс
+[User &details]
+Дані &контакту
+[User &history]
+Історія користувача
+[&Kick user]
+&Вигнати
+[&Op user]
+Зробити користувача &адміном
+[&Deop user]
+&Забрати права адміністратора
+;file \protocols\MSN\src\msn_commands.cpp
+[%I64u bytes]
+
+[MSN Alert]
+Сповіщення MSN
+;file \protocols\MSN\src\msn_errors.cpp
+[User not online]
+Користувач не в мережі
+;file \protocols\MSN\src\msn_lists.cpp
+[Contact %s has been removed from the server.\nWould you like to keep it as "Local Only" contact to preserve history?]
+Контакт %s був видалений з сервера.\nХочете залишити його в локальному списку, щоб зберегти історію?
+[%s protocol]
+Протокол %s
+;file \protocols\MSN\src\msn_mail.cpp
+[Subject: %s]
+Тема: %s
+[Hotmail from %s (%S)]
+Пошта від %s (%S)
+[Hotmail from %s]
+Пошта Hotmail від %s
+[Unread mail is available: %d in Inbox and %d in other folders.]
+Непрочитана пошта: %d вхідних листів і %d в інших папках.
+;file \protocols\MSN\src\msn_menu.cpp
+[&Unblock]
+&Розблокувати
+[&Block]
+&Блокувати
+[Open &Hotmail Inbox]
+Відкрити скриньку &Hotmail
+[Send &Hotmail E-mail]
+Відправити пошту &Hotmail
+[Create &Chat]
+Створити &чат
+[Display &Hotmail Inbox]
+Показати скриньки &Hotmail
+[View &Profile]
+Переглянути &профіль
+[Setup Live &Alerts]
+Налаштування Live &Alerts
+;file \protocols\MSN\src\msn_misc.cpp
+[Custom Smileys]
+Користувацькі смайли
+[Notifications]
+Сповіщення
+[Errors]
+Помилки
+[MSN Protocol]
+Протокол MSN
+;file \protocols\MSN\src\msn_opts.cpp
+[Protocol icon]
+Значок протоколу
+[Hotmail Inbox]
+Вхідні Hotmail
+[Profile]
+Профіль
+[MSN Services]
+Служби MSN
+[Block user]
+Заблокувати
+[Invite to chat]
+Запросити в чат
+[Start Netmeeting]
+Запустити Netmeeting
+[Contact list]
+Список контактів
+[Allowed list]
+Список дозволених
+[Blocked list]
+Список заблокованих
+[Relative list]
+Список "ви у списку"
+[Local list]
+Локальний список
+[Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?]
+Імпорт груп з сервера може змінити розташування контактів після наступного входу. Завантажити групи на сервер?
+[These changes will take effect the next time you connect to the MSN Messenger network.]
+Зміни наберуть чинності при наступному вході в мережу MSN.
+[MSN options]
+Налаштування MSN
+[Automatically obtain host/port]
+Автоматично отримувати хост/порт
+[Manually specify host/port]
+Вказати хост/порт
+[Disable]
+Вимкнути
+[IP info available only after login]
+Інформація про IP доступна після входу
+[MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value.]
+Протокол MSN вимагає таймауту відправки повідомлення не менше 60 секунд. Виправте налаштування.
+[Network]
+Мережа
+[Account]
+Обліковий запис
+[Connection]
+Підключення
+[Server list]
+Список на сервері
+;file \protocols\MSN\src\msn_proto.cpp
+[Live Mail]
+Пошта Live
+[Live Alert]
+Сповіщення Live
+[%s plugin connections]
+З'єднання з сервером %s
+[Contact already in your contact list]
+Контакт у вашому списку
+[Protocol is offline]
+Протокол не в мережі
+[You cannot send message to yourself]
+Ви не можете надсилати повідомлення самому собі
+[Message is too long: SMS page limited to 133 UTF8 chars]
+Занадто велике повідомлення, максимум 133 символи UTF8
+[Message is too long: MSN messages are limited by 1202 UTF8 chars]
+Повідомлення MSN обмежені 1202 символами UTF-8
+[Offline messaging is not allowed for LCS contacts]
+Повідомлення відключеним LCS-контактам неможливі
+;file \protocols\MSN\src\msn_svcs.cpp
+[MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value.]
+Для мережі MSN таймаут відправлення повідомлення повинен бути не менш ніж 60 секунд. Будь ласка, налаштуйте свій плагін повідомлень.
+[Convert to Chat]
+Конвертувати в чат
diff --git a/langpacks/ukrainian/Untranslated/MSN.txt b/langpacks/ukrainian/Untranslated/MSN.txt
deleted file mode 100644
index 5ea913bf50..0000000000
--- a/langpacks/ukrainian/Untranslated/MSN.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-[Live ID:]
-[Live ID]
-[%I64u bytes]
diff --git a/plugins/ExternalAPI/delphi/m_ieview.inc b/plugins/ExternalAPI/delphi/m_ieview.inc
index c0e203241c..23993ffe76 100644
--- a/plugins/ExternalAPI/delphi/m_ieview.inc
+++ b/plugins/ExternalAPI/delphi/m_ieview.inc
@@ -178,7 +178,7 @@ type
// u can use your own protocol name. Smiley add will
// automatically select the smileypack that is
// defined for your protocol. Or, use "Standard" for
- // standard smiley set. Or "ICQ", "MSN" if you
+ // standard smiley set. Or "ICQ" if you
// prefer those icons. If not found or NULL:
// "Standard" will be used
xPosition : int; // Postition to place the selectwindow
diff --git a/plugins/ExternalAPI/delphi/m_smileyadd.inc b/plugins/ExternalAPI/delphi/m_smileyadd.inc
index 0cc064ea8f..0f54f3f989 100644
--- a/plugins/ExternalAPI/delphi/m_smileyadd.inc
+++ b/plugins/ExternalAPI/delphi/m_smileyadd.inc
@@ -36,7 +36,7 @@ type
Protocolname :PAnsiChar; // protocol to use... if you have defined a
// protocol, u can use your own protocol name. SmileyAdd will
// automatically select the smileypack that is defined for your protocol.
- // Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ // Or, use "Standard" for standard smiley set. Or "ICQ"
// if you prefer those icons.
// If not found or NULL, "Standard" will be used
flags :uint; // Flags (SAFLRE_*) that define the behaivior
@@ -60,7 +60,7 @@ type
Protocolname : PAnsiChar; // protocol to use... if you have defined a protocol,
// you can use your own protocol name. Smiley add will automatically
// select the smileypack that is defined for your protocol.
- // Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ // Or, use "Standard" for standard smiley set. Or "ICQ"
// if you prefer those icons.
// If not found or NULL: "Standard" will be used
xPosition : int; // Postition to place the selectwindow
@@ -120,7 +120,7 @@ type
Protocolname:PAnsiChar; // protocol to use... if you have defined a protocol, u can
// use your own protocol name. Smiley add wil automatically
// select the smileypack that is defined for your protocol.
- // Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ // Or, use "Standard" for standard smiley set. Or "ICQ"
// if you prefer those icons.
// If not found or NULL: "Standard" will be used
str :TChar; // String to parse
diff --git a/plugins/ExternalAPI/m_smileyadd.h b/plugins/ExternalAPI/m_smileyadd.h
index f878cf8bf7..667ac2fea3 100644
--- a/plugins/ExternalAPI/m_smileyadd.h
+++ b/plugins/ExternalAPI/m_smileyadd.h
@@ -35,7 +35,7 @@ typedef struct
const char* Protocolname; //protocol to use... if you have defined a protocol, u can
//use your own protocol name. SmileyAdd will automatically
//select the smileypack that is defined for your protocol.
- //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //Or, use "Standard" for standard smiley set. Or "ICQ"
//if you prefer those icons.
//If not found or NULL, "Standard" will be used
unsigned flags; //Flags (SAFLRE_*) that define the behaivior
@@ -56,8 +56,8 @@ typedef struct
char* Protocolname; //protocol to use... if you have defined a protocol, you can
//use your own protocol name. Smiley add will automatically
//select the smileypack that is defined for your protocol.
- //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
- //if you prefer those icons.
+ //Or, use "Standard" for standard smiley set. Or "ICQ"
+ //if you prefer those icons.
//If not found or NULL: "Standard" will be used
int xPosition; //Postition to place the selectwindow
int yPosition; // "
@@ -120,7 +120,7 @@ typedef struct
const char* Protocolname; //protocol to use... if you have defined a protocol, u can
//use your own protocol name. Smiley add wil automatically
//select the smileypack that is defined for your protocol.
- //Or, use "Standard" for standard smiley set. Or "ICQ", "MSN"
+ //Or, use "Standard" for standard smiley set. Or "ICQ"
//if you prefer those icons.
//If not found or NULL: "Standard" will be used
union {
diff --git a/plugins/FingerprintNG/iconpacks/res/MSN/MSN Mac.ico b/plugins/FingerprintNG/iconpacks/res/MSN/MSN Mac.ico
deleted file mode 100644
index 4be8abe317..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/MSN/MSN Mac.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/MSN/MSN v4.5-v5.x.ico b/plugins/FingerprintNG/iconpacks/res/MSN/MSN v4.5-v5.x.ico
deleted file mode 100644
index 2f1bb589d4..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/MSN/MSN v4.5-v5.x.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/MSN/MSN v6.x.ico b/plugins/FingerprintNG/iconpacks/res/MSN/MSN v6.x.ico
deleted file mode 100644
index d4829d9294..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/MSN/MSN v6.x.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/MSN/MSN v7.x.ico b/plugins/FingerprintNG/iconpacks/res/MSN/MSN v7.x.ico
deleted file mode 100644
index 960f8d36eb..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/MSN/MSN v7.x.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/MSN/MSN v8.x.ico b/plugins/FingerprintNG/iconpacks/res/MSN/MSN v8.x.ico
deleted file mode 100644
index bbe052ed65..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/MSN/MSN v8.x.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/MSN/MSN.ico b/plugins/FingerprintNG/iconpacks/res/MSN/MSN.ico
deleted file mode 100644
index 959950e703..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/MSN/MSN.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/MSN/WLM10-11.ico b/plugins/FingerprintNG/iconpacks/res/MSN/WLM10-11.ico
deleted file mode 100644
index 5f6e68d9ad..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/MSN/WLM10-11.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/MSN/WLM9.ico b/plugins/FingerprintNG/iconpacks/res/MSN/WLM9.ico
deleted file mode 100644
index 0ccef8c3b1..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/MSN/WLM9.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/MSN/WebMessenger.ico b/plugins/FingerprintNG/iconpacks/res/MSN/WebMessenger.ico
deleted file mode 100644
index 94909a4ce0..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/MSN/WebMessenger.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/MSN/aMSN.ico b/plugins/FingerprintNG/iconpacks/res/MSN/aMSN.ico
deleted file mode 100644
index 7bb8276bc5..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/MSN/aMSN.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/Overlays/overlay_proto_msn.ico b/plugins/FingerprintNG/iconpacks/res/Overlays/overlay_proto_msn.ico
deleted file mode 100644
index 9e28bf4e9e..0000000000
--- a/plugins/FingerprintNG/iconpacks/res/Overlays/overlay_proto_msn.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/FingerprintNG/iconpacks/res/fp_icons.rc b/plugins/FingerprintNG/iconpacks/res/fp_icons.rc
index a116ca8a91..a2337b0882 100644
--- a/plugins/FingerprintNG/iconpacks/res/fp_icons.rc
+++ b/plugins/FingerprintNG/iconpacks/res/fp_icons.rc
@@ -445,16 +445,6 @@ IDI_ATOM3 ICON "rss\\Atom 3.ico"
IDI_RSS09 ICON "rss\\RSS 0.9.ico"
IDI_RSS1 ICON "rss\\RSS 1.ico"
IDI_RSS2 ICON "rss\\RSS 2.ico"
-IDI_AMSN ICON "MSN\\aMSN.ico"
-IDI_MSN_MAC ICON "MSN\\MSN Mac.ico"
-IDI_MSN_45 ICON "MSN\\MSN v4.5-v5.x.ico"
-IDI_MSN_6 ICON "MSN\\MSN v6.x.ico"
-IDI_MSN_7 ICON "MSN\\MSN v7.x.ico"
-IDI_MSN_8 ICON "MSN\\MSN v8.x.ico"
-IDI_MSN ICON "MSN\\MSN v8.x.ico"
-IDI_WEBMESSENGER ICON "MSN\\WebMessenger.ico"
-IDI_WLM_9 ICON "MSN\\wlm9.ico"
-IDI_WLM_10 ICON "MSN\\WLM10-11.ico"
IDI_GG ICON "GG\\Gadu-Gadu.ico"
IDI_GG8_OVERLAY ICON "GG\\overlay_GG_v8.ico"
IDI_GG9_OVERLAY ICON "GG\\overlay_GG_v9.ico"
@@ -491,7 +481,6 @@ IDI_ICQ_OVERLAY ICON "overlays\\overlay_proto_ICQ.ico
IDI_IRC_OVERLAY ICON "overlays\\overlay_proto_IRC.ico"
IDI_JABBER_OVERLAY ICON "overlays\\overlay_proto_Jabber.ico"
IDI_JGTALK_OVERLAY ICON "overlays\\overlay_proto_JGTalk.ico"
-IDI_MSN_OVERLAY ICON "overlays\\overlay_proto_MSN.ico"
IDI_VK_OVERLAY ICON "overlays\\overlay_proto_VK.ico"
IDI_SKYPE_OVERLAY ICON "overlays\\overlay_proto_skype.ico"
IDI_DEBUG_OVERLAY ICON "overlays\\overlay_resource_debug.ico"
diff --git a/plugins/FingerprintNG/res/resource.rc b/plugins/FingerprintNG/res/resource.rc
index bf2519d7d5..172afacd70 100644
--- a/plugins/FingerprintNG/res/resource.rc
+++ b/plugins/FingerprintNG/res/resource.rc
@@ -82,7 +82,6 @@ BEGIN
CONTROL "ICQ clients",IDC_GROUP_ICQ,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,110,120,10
CONTROL "IRC clients",IDC_GROUP_IRC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,120,120,10
CONTROL "Jabber clients",IDC_GROUP_JABBER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,130,120,10
- CONTROL "MSN clients",IDC_GROUP_MSN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,150,120,10
CONTROL "RSS clients",IDC_GROUP_RSS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,170,120,10
CONTROL "VKontakte clients",IDC_GROUP_VK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,180,120,10
CONTROL "Weather clients",IDC_GROUP_WEATHER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,190,120,10
diff --git a/plugins/FingerprintNG/src/finger_groups.h b/plugins/FingerprintNG/src/finger_groups.h
index 685fafb1f2..19dbcf4fc9 100644
--- a/plugins/FingerprintNG/src/finger_groups.h
+++ b/plugins/FingerprintNG/src/finger_groups.h
@@ -38,11 +38,6 @@ case JABBER_CASE:
return LPGENW("Client icons") L"/" LPGENW("Jabber clients");
break;
-case MSN_CASE:
- if (g_plugin.getByte("GroupMSN", 1))
- return LPGENW("Client icons") L"/" LPGENW("MSN clients");
- break;
-
case RSS_CASE:
if (g_plugin.getByte("GroupRSS", 1))
return LPGENW("Client icons") L"/" LPGENW("RSS clients");
diff --git a/plugins/FingerprintNG/src/masks.cpp b/plugins/FingerprintNG/src/masks.cpp
index 57830d60d1..7e4be9c495 100644
--- a/plugins/FingerprintNG/src/masks.cpp
+++ b/plugins/FingerprintNG/src/masks.cpp
@@ -475,21 +475,6 @@ KN_FP_MASK def_kn_fp_mask[] =
{ "client_IRCUnknown", L"*IRC*", L"Unknown IRC client", IDI_IRC, IRC_CASE, TRUE },
//#########################################################################################################################################################################
- //################################# MSN ###############################################################################################################################
- //#########################################################################################################################################################################
- { "client_WLM11", L"WLM*2011*", L"Windows Live 11", IDI_WLM_10, MSN_CASE, TRUE },
- { "client_WLM10", L"WLM*2010*", L"Windows Live 10", IDI_WLM_10, MSN_CASE, TRUE },
- { "client_WLM9", L"WLM*9*", L"Windows Live v9.x", IDI_WLM_9, MSN_CASE, TRUE },
- { "client_MSN8", L"|WLM*8.*|MSN*8.*", L"Windows Live v8.x", IDI_MSN_8, MSN_CASE, TRUE },
- { "client_MSN7x", L"MSN*7.*", L"MSN Messenger v7.x", IDI_MSN_7, MSN_CASE, TRUE },
- { "client_MSN6x", L"MSN*6.*", L"MSN Messenger v6.x", IDI_MSN_6, MSN_CASE, TRUE },
- { "client_MSN45", L"MSN*4.x-5.x", L"MSN Messenger v4.x-5.x", IDI_MSN_45, MSN_CASE, TRUE },
- { "client_MSN4Mac", L"MSN*Mac*", L"MSN for Mac", IDI_MSN_MAC, MSN_CASE, TRUE },
- { "client_aMSN", L"*aMSN*", L"aMSN", IDI_AMSN, MSN_CASE, TRUE },
- { "client_MSN_Web", L"WebMessenger*", L"WebMessenger", IDI_WEBMESSENGER, MSN_CASE, TRUE },
- { "client_MSN", L"|WLM*|MSN*|Windows Live*", L"MSN", IDI_MSN, MSN_CASE, TRUE },
-
- //#########################################################################################################################################################################
//################################# WEATHER ###########################################################################################################################
//#########################################################################################################################################################################
{ "client_accu", L"*accuweather*", L"AccuWeather", IDI_ACCU, WEATHER_CASE, TRUE },
@@ -628,7 +613,6 @@ KN_FP_MASK def_kn_fp_overlays_mask[] =
{ "client_JGmail_overlay", L"*JGmail*", LPGENW("JGmail overlay"), IDI_GMAIL_OVERLAY, OVERLAYS_PROTO_CASE },
{ "client_JGTalk_overlay", L"*JGTalk*", LPGENW("JGTalk overlay"), IDI_JGTALK_OVERLAY, OVERLAYS_PROTO_CASE },
{ "client_Jabber_overlay", L"|^jabber*|Miranda*Jabber*|py*jabb*", LPGENW("Jabber overlay"), IDI_JABBER_OVERLAY, OVERLAYS_PROTO_CASE },
- { "client_MSN_overlay", L"|^MSN*|*Miranda*MSN*", LPGENW("MSN overlay"), IDI_MSN_OVERLAY, OVERLAYS_PROTO_CASE },
{ "client_VK_overlay", L"|Miranda*VKontakte*", LPGENW("VK overlay"), IDI_VK_OVERLAY, OVERLAYS_PROTO_CASE },
{ "client_Skype_overlay", L"|Miranda*Skype*", LPGENW("Skype overlay"), IDI_SKYPE_OVERLAY, OVERLAYS_PROTO_CASE },
diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp
index 9344497aa2..c1e5f780e7 100644
--- a/plugins/FingerprintNG/src/options.cpp
+++ b/plugins/FingerprintNG/src/options.cpp
@@ -37,7 +37,6 @@ static settings[] =
{ IDC_GROUP_ICQ, TRUE, "GroupICQ" },
{ IDC_GROUP_IRC, TRUE, "GroupIRC" },
{ IDC_GROUP_JABBER, TRUE, "GroupJabber" },
- { IDC_GROUP_MSN, TRUE, "GroupMSN" },
{ IDC_GROUP_RSS, TRUE, "GroupRSS" },
{ IDC_GROUP_WEATHER, TRUE, "GroupWeather" },
{ IDC_GROUP_FACEBOOK, TRUE, "GroupFacebook" },
@@ -57,7 +56,7 @@ static settings[] =
class COptDialog : public CDlgBase
{
CCtrlCheck m_chkMiranda, m_chkMirandaPacks, m_chkMirandaVer, m_chkOverRes, m_chkOverPlatf, m_chkOverProto, m_chkOverUnicode, m_chkOverSecur,
- m_chkFacebbok, m_chkGG, m_chkICQ, m_chkIRC, m_chkJabber, m_chkMSN, m_chkRSS, m_chkVK, m_chkWeather, m_chkMulti, m_chkOthersProto,
+ m_chkFacebbok, m_chkGG, m_chkICQ, m_chkIRC, m_chkJabber, m_chkRSS, m_chkVK, m_chkWeather, m_chkMulti, m_chkOthersProto,
m_chkOthers, m_chkStatusBar;
void LoadDBCheckState(int idCtrl, LPCSTR szSetting, BYTE bDef)
@@ -88,7 +87,6 @@ public:
m_chkICQ(this, IDC_GROUP_ICQ),
m_chkIRC(this, IDC_GROUP_IRC),
m_chkJabber(this, IDC_GROUP_JABBER),
- m_chkMSN(this, IDC_GROUP_MSN),
m_chkRSS(this, IDC_GROUP_RSS),
m_chkVK(this, IDC_GROUP_VK),
m_chkWeather(this, IDC_GROUP_WEATHER),
diff --git a/plugins/FingerprintNG/src/resource.h b/plugins/FingerprintNG/src/resource.h
index a709145cb9..95787aa7b5 100644
--- a/plugins/FingerprintNG/src/resource.h
+++ b/plugins/FingerprintNG/src/resource.h
@@ -59,7 +59,6 @@
#define IDI_IRC_OVERLAY 82
#define IDI_JABBER_OVERLAY 83
#define IDI_JGTALK_OVERLAY 84
-#define IDI_MSN_OVERLAY 86
#define IDI_VK_OVERLAY 90
#define IDI_SKYPE_OVERLAY 91
#define IDI_SECUREIM_OVERLAY 95
@@ -380,16 +379,6 @@
#define IDI_GG9_OVERLAY 726
#define IDI_GG10_OVERLAY 727
#define IDI_GG11_OVERLAY 728
-#define IDI_AMSN 741
-#define IDI_MSN_MAC 742
-#define IDI_MSN_45 743
-#define IDI_MSN_6 744
-#define IDI_MSN_7 745
-#define IDI_MSN_8 746
-#define IDI_MSN 747
-#define IDI_WEBMESSENGER 748
-#define IDI_WLM_9 749
-#define IDI_WLM_10 750
#define IDI_ATOM1 761
#define IDI_ATOM3 762
#define IDI_RSS09 763
@@ -523,7 +512,6 @@
#define IDC_GROUP_ICQ 10032
#define IDC_GROUP_IRC 10033
#define IDC_GROUP_JABBER 10034
-#define IDC_GROUP_MSN 10035
#define IDC_GROUP_RSS 10038
#define IDC_GROUP_WEATHER 10040
#define IDC_GROUP_FACEBOOK 10042
diff --git a/plugins/FingerprintNG/src/stdafx.h b/plugins/FingerprintNG/src/stdafx.h
index ae7d2dfdd4..a41b4c7a0a 100644
--- a/plugins/FingerprintNG/src/stdafx.h
+++ b/plugins/FingerprintNG/src/stdafx.h
@@ -82,7 +82,6 @@ struct FOUNDINFO
#define ICQ_CASE 3008 // ICQ clients
#define IRC_CASE 3009 // IRC clients
#define JABBER_CASE 3010 // Jabber clients
-#define MSN_CASE 3012 // MSN clients
#define RSS_CASE 3014 // RSS clients
#define WEATHER_CASE 3016 // Weather clients
#define FACEBOOK_CASE 3018 // Facebook clients
diff --git a/plugins/Nudge/res/NudgeMSN.ico b/plugins/Nudge/res/NudgeMSN.ico
deleted file mode 100644
index 3ebbdcf87f..0000000000
--- a/plugins/Nudge/res/NudgeMSN.ico
+++ /dev/null
Binary files differ
diff --git a/plugins/Nudge/res/resource.rc b/plugins/Nudge/res/resource.rc
index 071d5b48f3..1d76fa5601 100644
--- a/plugins/Nudge/res/resource.rc
+++ b/plugins/Nudge/res/resource.rc
@@ -181,7 +181,6 @@ END
IDI_NUDGE ICON "Nudge.ico"
IDI_NUGDE_YAHOO ICON "NudgeYahoo.ico"
IDI_NUDGE_IRC ICON "NudgeIRC.ico"
-IDI_NUDGE_MSN ICON "NudgeMSN.ico"
IDI_NUDGE_META ICON "NudgeMeta.ico"
#endif // Neutral resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Nudge/src/resource.h b/plugins/Nudge/src/resource.h
index 34b0d091fd..fbca447b46 100644
--- a/plugins/Nudge/src/resource.h
+++ b/plugins/Nudge/src/resource.h
@@ -6,7 +6,6 @@
#define IDI_NUDGE 102
#define IDI_NUGDE_YAHOO 107
#define IDI_NUDGE_IRC 109
-#define IDI_NUDGE_MSN 110
#define IDI_NUDGE_META 113
#define IDD_SHAKEOPT 126
#define IDD_OPT_NUDGE 126
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp
index 8a9850804e..37357ceed3 100644
--- a/plugins/PluginUpdater/src/DlgUpdate.cpp
+++ b/plugins/PluginUpdater/src/DlgUpdate.cpp
@@ -569,6 +569,7 @@ static renameTable[] =
{ L"metacontacts.dll", nullptr },
{ L"mra.dll", nullptr },
{ L"modernopt.dll", nullptr },
+ { L"msn.dll", nullptr },
{ L"msvcp100.dll", nullptr },
{ L"msvcr100.dll", nullptr },
{ L"mtextcontrol.dll", nullptr },
diff --git a/plugins/SmileyAdd/smileys/nova/MSN.msl b/plugins/SmileyAdd/smileys/nova/MSN.msl
deleted file mode 100644
index d9c440f742..0000000000
--- a/plugins/SmileyAdd/smileys/nova/MSN.msl
+++ /dev/null
Binary files differ
diff --git a/plugins/SmileyAdd/src/smileys.cpp b/plugins/SmileyAdd/src/smileys.cpp
index 2f8ab68b0a..3264a36e2d 100644
--- a/plugins/SmileyAdd/src/smileys.cpp
+++ b/plugins/SmileyAdd/src/smileys.cpp
@@ -822,8 +822,6 @@ void SmileyCategoryListType::AddAccountAsCategory(PROTOACCOUNT *acc, const CMStr
const char *packnam = acc->szProtoName;
if (mir_strcmp(packnam, "JABBER") == 0)
packnam = "JGMail";
- else if (strstr(packnam, "SIP") != nullptr)
- packnam = "MSN";
wchar_t path[MAX_PATH];
mir_snwprintf(path, L"%s\\Smileys\\nova\\%S.msl", g_plugin.wszDefaultPath, packnam);
@@ -844,8 +842,6 @@ void SmileyCategoryListType::AddProtoAsCategory(char *acc, const CMStringW &defa
const char *packnam = acc;
if (mir_strcmp(packnam, "JABBER") == 0)
packnam = "JGMail";
- else if (strstr(packnam, "SIP") != nullptr)
- packnam = "MSN";
// assemble default path
CMStringW paths(FORMAT, L"%s\\Smileys\\nova\\%S.msl", g_plugin.wszDefaultPath, packnam);
@@ -902,16 +898,12 @@ void SmileyCategoryListType::AddContactTransportAsCategory(MCONTACT hContact, co
_strlwr(trsp);
const char *packname = nullptr;
- if (strstr(trsp, "msn") != nullptr)
- packname = "msn";
- else if (strstr(trsp, "icq") != nullptr)
+ if (strstr(trsp, "icq") != nullptr)
packname = "icq";
else if (strstr(trsp, "yahoo") != nullptr)
packname = "yahoo";
else if (strstr(trsp, "aim") != nullptr)
packname = "aim";
- else if (strstr(trsp, "lcs") != nullptr)
- packname = "msn";
mir_free(trsp);
diff --git a/plugins/Variables/src/stdafx.h b/plugins/Variables/src/stdafx.h
index c124a6df5b..f7978e52b1 100644
--- a/plugins/Variables/src/stdafx.h
+++ b/plugins/Variables/src/stdafx.h
@@ -112,7 +112,7 @@ This will not parse the given string, any function, field or special character i
This will add a comment in the formatting string. Everything from the # character to the end of the line will be removed. Example: %dbprofile% #this is a useless comment.\r\n\r\n\r\n\
--- Contacts ---\r\n\r\n\
Whenever a functions requires a contact as an argument, you can specify it in two ways:\r\n\r\n\
-(1) Using a unique ID (UIN for ICQ, email for MSN) or, a protocol ID followed by a unique ID in the form <PROTOID:UNIQUEID>, for example <MSN:miranda@hotmail.com> or <ICQ:123456789>.\r\n\r\n\
+(1) Using a unique ID (UIN for ICQ, JID for Jabber) or, a protocol ID followed by a unique ID in the form <PROTOID:UNIQUEID>, for example <JABBER:miranda@jabber.com> or <ICQ:123456789>.\r\n\r\n\
(2) Using the contact function:\r\n\
?contact(x,y)\r\n\
A contact will be searched which will have value x for its property y, y can be one of the following:\r\n\
diff --git a/protocols/CMakeLists.txt b/protocols/CMakeLists.txt
index 67d251f504..182f85ee47 100644
--- a/protocols/CMakeLists.txt
+++ b/protocols/CMakeLists.txt
@@ -8,7 +8,6 @@ add_subdirectory(ICQ-WIM)
add_subdirectory(IRCG)
add_subdirectory(JabberG)
#add_subdirectory(MinecraftDynmap)
-add_subdirectory(MSN)
#add_subdirectory(Omegle)
#add_subdirectory(Sametime)
add_subdirectory(SkypeWeb)
diff --git a/protocols/Dummy/src/main.cpp b/protocols/Dummy/src/main.cpp
index cbb09493b0..41d0f276dd 100644
--- a/protocols/Dummy/src/main.cpp
+++ b/protocols/Dummy/src/main.cpp
@@ -112,3 +112,12 @@ struct CMPluginWhatsapp : public ACCPROTOPLUGIN<CDummyProto>
}
}
static g_pluginWhatsapp;
+
+struct CMPluginMsn : public ACCPROTOPLUGIN<CDummyProto>
+{
+ CMPluginMsn() : ACCPROTOPLUGIN<CDummyProto>("MSN", pluginInfoEx)
+ {
+ SetUniqueId("wlid");
+ }
+}
+static g_pluginMsn;
diff --git a/protocols/MSN/CMakeLists.txt b/protocols/MSN/CMakeLists.txt
deleted file mode 100644
index 58e247810b..0000000000
--- a/protocols/MSN/CMakeLists.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-file(GLOB SOURCES "src/*.h" "src/skylogin/*.h" "src/*.cpp" "src/*.c" "src/skylogin/*.c" "res/*.rc")
-set(TARGET MSN)
-include(${CMAKE_SOURCE_DIR}/cmake/plugin.cmake)
-target_link_libraries(${TARGET} libjson ${OPENSSL_LIBRARIES} comctl32.lib)
-add_subdirectory(proto_msn) \ No newline at end of file
diff --git a/protocols/MSN/docs/gpl.txt b/protocols/MSN/docs/gpl.txt
deleted file mode 100644
index 45645b4b53..0000000000
--- a/protocols/MSN/docs/gpl.txt
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- 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
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/protocols/MSN/docs/history.txt b/protocols/MSN/docs/history.txt
deleted file mode 100644
index b3f08ab339..0000000000
--- a/protocols/MSN/docs/history.txt
+++ /dev/null
@@ -1,529 +0,0 @@
-Legend:
-[+] added
-[*] changed
-[-] deleted
-[!] bug fixed
-
-Version 0.7.1.0
-===============
-[+] All bitmap processing routines were removed in honour of the loadavatars plugin
-
-Version 0.7.0.1
-===============
-[+] IcoLib Integration
-
-Version 0.5.0.3
-===============
-[+] added support for custom smileys
-[!] bug 0001996 fixed: No Contact Idetification When an Unsupport Feature Even Occurs
-
-Version 0.5.0.1
-===============
-[!] bug 0002083 fixed: Filetransfer suddenly stops
-[!] bug 0002067 fixed: MSN connection fails in gateway mode through http-proxy (with authentication)
-[!] bug 0001584 fixed: Crash when sender cancels file send
-
-Version 0.4.3.1
-===============
-[!] bug 0001887 fixed: Sometimes getting Error 540 from server then disconnect.
-[!] fix for the invalid chars in the MSN chat
-
-Version 0.4.3.0
-===============
-[+] first Unicode version of the MSN plugin
-[!] wish 0001015: nudges (thanks Tweetie for a patch)
-[!] bug 0001532 fixed: Hotmail does not open from miranda
-[!] bug 0001536 fixed: Contacts displayed as online while MSN isn't connected yet
-
-Version 0.4.1.3
-===============
-[+] support for dropping idle switchboards was added
-
-Version 0.4.1.2
-===============
-[+] Unicode in the nicknames and groups. Requires clistw & Miranda
-0.4.3 bld. 32 or later
-[*] avatar setting dialog was moved to View/Change User Details section
-[!] fix for initial email notification in the MSNP11 mode
-[!] fix for the "User is already in your contact list" error
-[!] bug 0001427 fixed: Error 540 during login on slow connections
-[!] bug 0001468 fixed: MSN 7.5 users cannot load Miranda users avatar.
-[!] BYE command was handled incorrectly
-[!] fix for the old MSN file transfers: a received file cannot be opened
-
-Version 0.4.1.1
-===============
-[!] fixed a bug when Miranda hangs up on exit, when the
-clist_modern plugin is installed
-
-Version 0.4.0.4
-===============
-[!] important bugfix: MSNP11 status messages may block the login
-process.
-[!] fix for the problems with the keep-alive thread
-[*] numerous minor changes and bugfixes.
-
-Version 0.4.0.3
-===============
-[+] MSNP11 support added
-[+] wish #0001239 fixed: MSN Personal Status Messages
-[+] WebMessenger detection added
-[!] fix for the GPF on exit
-
-Version 0.4.0.2
-===============
-[!] bug #0000913 fixed: no zero-termination after _snprintf (potential
-security issue)
-[!] bug #0001176 fixed: can't send messages to the MSN WebMessenger
-[!] bug #0001202 fixed: Can't delete received file directory
-[!] various memory leaks
-
-Version 0.4.0.1
-===============
-[+] wish #0000971 fixed: Block & Unblock actions must be separated
-[+] wish #0000966 fixed: to show the warning when a contact tries
-to establish a audio/video/webcam conference with you.
-[-] removed support for old versions of Miranda.
-[!] bug #0000996 fixed: File transfer fails when auto-accept is on
-and file already exists in destination directory
-[!] fixes for minor string allocation problems.
-
-WARNING!!! All versions since this one require Miranda 0.4.x core.
-This is required by the project admins.
-
-Version 0.1.7.11
-================
-[+] full support for server-side groups and contacts
-[+] wish #0000142 fixed: a popup for session disconnection
-[+] wish #0000149 fixed: CHAT.DLL support was added for groupchats (thanks noname)
-[!] bug #0000458 fixed: Messages disappear when sending to MSN.
-[!] bug #0000684 fixed: a file with the Unicode name fails to open after
-the successful transfer.
-[!] bug #0000761 fixed: apply button in options->popups->msn enabled on
-first showing of page
-[!] minor fix for P2P file transfers over NAT
-
-Version 0.1.7.10
-================
-[!] multiple bugfixes for gateways & P2P file transfers
-[*] login rules were changed a bit: now Miranda assigns its own
-proxy address to SSL connection when the 'Use IE proxy settings'
-option is turned off. If you don't use a proxy, nothing gets
-changed.
-[!] bug #0000580 fixed: the large messages disappear being sent.
-[!] bug #0000601 fixed: files with incorrect file names aren't
-saved during P2P file transfers.
-[!] bug #0000565 fixed: avatar file names becomes different after
-using the dbtool, that's why the MSN folder may have the same
-avatars several times.
-[!] bug #0000437 fixed: expert must have an option to choose the
-needed status translation schema for Away, BRB & N/A statuses.
-[!] bug #0000541 fixed: if Miranda asks to overwrite a file
-during the f/t, a crash can occur when user cancels it.
-[*] translation file modification.
-
-Version 0.1.7.9a
-================
-[!] bug #0000564 fixed: MSN Messenger doesn't confirm a file
-transfer from Miranda when it goes via the server
-
-Version 0.1.7.9
-===============
-[+] wish #000519: the ability to create avatars from PNG images.
-[+] contact's phone numbers support was added
-[+] options dialog was changed to allow a user to see his own avatar.
-[-] mSN protocol v.9 support code was removed
-[!] option 'File Transfers -> If a file already exists -> Rename'
-doesn't work for MSN P2P transfers.
-[!] bug #0000092 fixed: 'User Is Typing' event delay is too slow.
-[!] bug #0000423 fixed: Send Message To Offline User Return Message Time
-Out message
-[!] bug #0000444 fixed: the passive P2P transfer fails if MSN Messenger
-returns bad IP address
-[!] bug #0000554 fixed: fake Hotmail notifications are shown, even
-when there's no new mail available
-[*] translation file modification.
-
-Version 0.1.7.8
-===============
-[+] 'View MSN services status' menu item was added to the main menu
-[+] Massive improvements for P2P file transfers
-
-Version 0.1.7.7
-===============
-[!] fixed some bugs with file transfer cancellation.
-[*] minor changes in MSN object id handling.
-[*] internal changes to the threading mechanism to make it more stable
-
-Version 0.1.7.6
-===============
-[+] the support for v10 P2P incoming passive direct connections was
-added. DC are used when a sender reports the 'Direct-Connect'
-connection type in the 'Conn-Type' request fiels.
-[+] the support for newly added avatar notifications was added
-(works only under 0.3.4+ core).
-[+] the MSN/GetAvatarInformation service was added to support the
-external avatar readers like tabSRMM etc.
-[*] incoming file transfers now use the standard settings for
-ports: via Options -> Network, MSN plugin connections. The existing
-settings are transferred, but you can use port ranges now to
-establish several transfers (one transfer for each contact)
-[-] the 'Incoming port' setting was deleted from MSN network options.
-[*] blocked contacts from the server lists aren't temporary anymore.
-It also avoids the contact list flickering during login.
-[!] bugfix (error #0000331): incoming file transfers seem to fail
-being initiated from the MSN Messenger;
-[!] bugfix (error #0000333): contacts aren't deleted from server when
-you press Del key in the contact list
-
-Version 0.1.7.5
-===============
-[+] full avatars support added: you can set your own avatar
-and transfer it to another people.
-[!] bugfix for error 0000319: MSN server list manager shall not display
-contacts of another protocols, groups also shouldn't be displayed.
-[!] bugfix: MSN plugin adds a contact to CL during a search by e-mail.
-[!] bugfix: massive fixes for authorization, both for v.9 and v.10
-
-Version 0.1.7.4
-===============
-[+] server lists manager was added to Options -> Network
-[!] bugfix for timeouts caused by User-Is-Typing notifications.
-[!] bugfix (error #000305): MSN protocol freezes Miranda under
-Windows 98/ME after login (many thanks to Hilary Cheng for a solution)
-
-Version 0.1.7.3
-===============
-[!] bugfix for file transfers: the incorrect address was used
-during sending a file.
-[+] added a 'View profile' contacts popup menu item (thanks koobs for an idea)
-[*] numerous fixes for MSN v10.
-
-Version 0.1.7.2
-===============
-[!] bugfix (error #0000222): you can add yourself using Find/Add contacts.
-[!] bugfix (error #0000123): Away and N/A modes are switched.
-[!] bugfix: e-mail, password and nickname can't be saved into the
-empty profile database.
-[!] bugfix: Cancel button does not close the png2dib d/l dialog.
-
-Version 0.1.7.1
-===============
-[!] critical bugfix (err.#50): typing notification can result to
-the infinite timeouts during message sending.
-
-Version 0.1.7.0
-===============
-[*] plugin lost its compatibility with Miranda 0.2.x due to stability
-reasons, version 0.3.x is required.
-[+] first version of MSN avatars (user-defined pictures).
-[+] added an option to support avatars and d/l the DLL.
-[*] PNG support was moved from IE components to libpng.
-[+] added an option not to get the nickname from a server, to allow
-a user to identify his/her location via a nick.
-[!] fixed a problem with the lack of diagnostics on error 715.
-[!] some minor bugfixes to file transfers.
-[-] support for MSNP v.8 was removed.
-[*] translation file was slightly modified.
-
-Version 0.1.6.8
-===============
-[!] rarely occurred GPF fixed during file transfers
-[!] MSN gateway access without a proxy breaks connections
-when 'user-is-typing' messages are transferred first.
-[!] MSN server closes connection if a PNG command is send to
-a switchboard thread
-[!] PNG command is not send when a proxy exists.
-
-Version 0.1.6.7
-===============
-Official version for Miranda 0.3.3 release
-[!] minor interface fixes in the options dialog.
-
-Version 0.1.6.6 (requires SRMM Unicode 1.0.1.3!!!)
-===============
-[*] keep-alive support was redesigned to avoid threading problems
-[!] bugfix: rare GPF fixed after reconnecting to the MSN server
-[!] bugfix for all plugins like AwaySys for sending non-Unicode
-messages.
-
-Version 0.1.6.5
-===============
-[!] bugfix: file receiving was broken.
-
-Version 0.1.6.4
-===============
-[*] gateway support redesigned to provide the gateway access
-without both proxies and MSN Gateway plugin.
-[!] a few minor memory leaks were fixed.
-[*] minor interface changes in the options dialogs, translation
-file was synchronized with the current options dialogs.
-
-Version 0.1.6.3
-===============
-[!] bugfix: if both built-in gateway and 'Keep connection alive' checkbox
-are enabled, disconnection occurs every 2 minutes.
-[!] bugfix: a blocked contact becomes unblocked after relogin, if it's
-not deleted.
-
-Version 0.1.6.2
-===============
-[+] option "Use IE proxy settings" was added to simplify life for
-users of the MSN Gateway plugin.
-[*] options page was divided into two ones: general MSN options and
-network options.
-[!] bugfix: option 'Disable all contacts not included...' could not be changed
-[!] bugfix: GPF sometimes occurred when starting an external mailer
-(thanks Daniel for kind cooperation)
-
-Version 0.1.6.1
-===============
-[+] built-in gateway added (requires Miranda 0.3.3 or later)
-[+] 'User is typing' support added (requires SRMM or SRMM MOD plugin)
-[+] Full Unicode support for messages was added (requires SRMM MOD Unicode)
-[+] MSN main menu item is created in the same section with all
-another protocols
-[*] 'block/unlock' feature is integrated with Options->Status->Visible
-[!] bugfix: a port remains opened after the file trasnfer cancel.
-[!] bugfix: if a contact list is very long, all contacts can be
-shown in the Offline mode.
-[!] a whole bunch of minor bugfixes, changes and improvements.
-
-Version 0.1.5.11
-================
-[+] Netmeeting support added
-[-] MSNP7 support is deleted and this option is locked
-[+] option was added to launch a specific program when the new
-Hotmail arrives.
-[+] option was added to display errors as popups to avoid the
-interface locking.
-[*] additional diagnostics was added to handle the case when
-Internet Explorer is in the Offline mode (thanks to Jonas Svensson).
-[*] numerous minor changes in option dialogs and debug messages.
-
-Version 0.1.5.10
-================
-[!] bug fixed: the "Use MSN protocol v.8" option is not saved
-correctly after pressing Apply/Ok in the options dialog if this
-option was never saved in the database before.
-[*] the source code was changed to allow the compilation without
-the Platform SDK.
-
-Version 0.1.5.9
-===============
-[!] bug in new URL encode mechanism prevents messages from being sent
-if the contact's email contains underscores.
-
-Version 0.1.5.8
-===============
-[+] new MSN Menu item was added to edit user's MSN profile in a browser
-[!] bug fixed: authorization problems when many MSN accounts are
-used in the same Miranda installation.
-[!] bug fixed: if a password contains non-alphabetical characters
-(like punctuation, ampersand, plus, etc) the MSNP8 login could return
-error 401 Unauthorized. MSNP7 login works Ok.
-[!] bug fixed: if a contact changes its status to Invisible, it's
-not possible to send messages to him/her anymore.
-[*] the popup displaying procedure was changed to avoid so called
-'frozen popups'effect.
-[*] the "Use MSN protocol v.8" option is now turned on by default.
-
-Version 0.1.5.7
-===============
-[*] the SSL autorization procedure was changed: now it uses
-Internet Explorer's proxy settings to log in. It also resolves
-problems with proxies that require authorization (previously you
-could see the error 407 in the network log when trying to logon).
-In this case MSN plugin tries automatically to apply the login and
-the password from the Options -> Network -> MSN.
-[*] cookies usage had been turned off, it means that you can logon
-automatically into MSN Messenger and simultaneously logon using
-Miranda under different account.
-[*] error diagnostic has been slightly enhanced.
-[*] WinInet.dll now gets unloaded from memory after login to use
-less memory.
-[!] bug fixed: attemp to find/add a contact that already exists in
-your contact list resulted to strange error message.
-
-Version 0.1.5.6
-===============
-[+] added the external IP autodetection if the protocol v.8 is
-used. It can significantly simplify life if you have the dynamic
-external IP address.
-[*] minor fixes in the Options dialog
-
-Version 0.1.5.5
-===============
-[!] bug fixed: 'Cancel' button does not stop the file transfer
-[!] bug fixed: contacts with leading digits in the e-mail are not
-processed properly.
-[!] bug fixed: you cannot send messages to a person if you tried to
-send the first message in the Invisible mode.
-
-Version 0.1.5.4
-===============
-[*] the file senging does not require to talk anymore
-[!] bug fixed: fast sending of two or more messages results to the GPF
-
-Version 0.1.5.3
-===============
-[!] bug fixed: memory corruption in multichat mode
-
-Version 0.1.5.2
-===============
-[!] bug fixed: LastSeen plugin shows the incorrect time of contact's logout.
-[!] bug fixed: you cannot block a contact if it's offline (even if you're online).
-[!] bug fixed: when MSNP8 is used, some contacts are skipped at all during
-the synchronization procedure.
-
-Version 0.1.5.1
-===============
-[!] bug fixed: 'Display menu' option does not really disable the MSN menu
-[*] translate-msn.txt updated.
-[+] minor changes in the options dialog
-
-Version 0.1.5.0
-===============
-[+] MSN Protocol v.8 support added.
-[+] a "Invite to chat" contact menu item is added.
-[*] multichat support is fully redesigned and fixed.
-[*] multiple file transfers are fully redesigned and fixed.
-[!] bug fixed: when you set your own nickname with spaces, it appears in
-the options dialog URL-encoded (with %20 instead of a space char).
-[!] bug fixed: opened switchboard sessions weren't closed when you go
-offline without closing Miranda.
-
-Version 0.1.4.12
-================
-[!] bug fixed: Hotmail inbox is not shown after a clicking on a Hotmail
-popup under Windows 9x
-[!] bug fixed: a user's own nickname is not properly saved after changing.
-
-Version 0.1.4.11
-================
-[*] changed blocked user visualization method: nickname is never got
-corrupted anymore, visibility mode is used now. M will show blocked
-contacts in italic by default, but you can tune the font/color/style of
-the 'invisible' users at the Options/Contact List/List text tab, for item
-called "Online contacts for whom you have a different visibility".
-[!] bug fixed: an authorization is rerequested after deleting a contact.
-[!] bug fixed: the very long nickname can be set, and then cut off when
-saving to the database or the server
-[!] bug fixed: when viewing the user options, an 'Updating...' string is
-blinking all the time.
-
-Version 0.1.4.10
-================
-[+] option added to block all another MSN contacts. Attention: you
-must be online to edit this option.
-[!] search-by-email mechanism fixed.
-[!] bug fixed: user email is shown in popups instead of nickname
-[!] bug fixed: when migrating from previous versions of MSN plugin
-a lot of authorization requests are shown.
-
-Version 0.1.4.9 (May Day Build :)
-===============
-[!] bug fixed: "First message delivered" displayed as a message
-box if the Popup plugin is not installed.
-[!] bug fixed: contact's e-mail is shown instead of a user's
-nick name when "First message delivered" popup is shown
-
-Version 0.1.4.8
-===============
-[!] bug fixed: the first message get lost when another message
-editor window is opened.
-[+] "First message delivered" popup can be enabled separately.
-
-Version 0.1.4.7
-===============
-[+] separate timeout for Hotmail popups added
-[*] options layout changed: all popup options are grouped on the
-separate options page: Options/Popups/MSN.
-[!] bug fixed: Hotmail popups got 'frozen' after being clicked
-
-Version 0.1.4.6
-===============
-[!] bug fixed: offline messages are get lost without notification
-
-Version 0.1.4.5
-===============
-[*] first message sending routine is changed to release message editor immediately.
-This does not fix the delay problem completely, but user will never see the timeout
-dialog again. If the Popup plugin is installed, user will be notified using a popup
-message when the first message will be really delivered.
-[!] bugfix: when you go offline from the online mode, both modes are disabled in
-the plugin's statuses menu.
-[!] minor interface bugfixes in the options dialog
-
-Version 0.1.4.4
-===============
-MSN plugin is added as a protocol to the Miranda's sources CVS tree.
-[!] fixed a problem with sending raw data to the HTTP proxy.
-[+] new option: popup timeouts. Requires Popup plugin v. 1.0.1.9 or later
-[*] popups interface changed not to call Web browser when 'typing' popups are clicked
-[*] FAQ is added to the readme.txt
-
-Version 0.1.4.3
-===============
-[+] new option: display 'user is typing' messages as popups if an appropriate plugin is installed
-[+] new option: send a font color/style alongside with messages. This
-option also fixes a problem with displaying messages in the standard
-Windows Messenger using an ugly/incorrect font/size/style.
-[!] fixed a memory leak when calling popups.
-
-Version 0.1.4.2
-===============
-
-A couple of bugfixes from Pixador (thank him for a patch):
-[!] multiple MSN plugins do not work together.
-[!] GPF when user presses Block/Unblock several times;
-
-Version 0.1.4.1
-===============
-
-Numerous bugfixes:
-[!] file sending/receiving almost works now, excluding multi-file sending from Miranda to WM.
-[!] a lot of memory leaks, double deletions, memory corruptions etc. fixed.
-
-Version 0.1.4.0
-===============
-
-Entering next major release:
-[+] proxy support added;
-[+] network traffic logging added;
-[!] fixed bug with 100% processor usage;
-[!] fixed bug with displaying incorrect file names in the file accept dialog.
-
-Version 0.1.3.4
-===============
-
-[*] code of Authorization/Deny changed to show an authorization request only once;
-[!] memory corruption fixed;
-[!] GPF with blocking/unblocking fixed.
-
-Version 0.1.3.3
-===============
-
-[*] language of plugin is changed to C++;
-[!] bug with offline authorization fixed;
-
-Version 0.1.3.0
-===============
-
-[!] fixed a bug with GPF on exit;
-[!] fixed a bug with contacts blocking/unblocking;
-[!] fixed a bug with strange crashes time to time;
-[!] fixed a memory leak;
-[!] fixed the ANSI <-> UTF conversion scheme to avoid problems with old versions of Windows (like 95 OSR2).
-
-Version 0.1.2.1
-===============
-
-Written by Rako Shizuka.
-The second version with extended functionality: file transfers, blocking etc.
-
-Version 0.1.2.0
-===============
-
-Written by Richard Hughes aka cyreve.
-The first version with basic functionality
diff --git a/protocols/MSN/docs/readme.txt b/protocols/MSN/docs/readme.txt
deleted file mode 100644
index 8c0a035958..0000000000
--- a/protocols/MSN/docs/readme.txt
+++ /dev/null
@@ -1,125 +0,0 @@
-Protocol for the Miranda IM for communicating with users of
-the MSN Messenger protocol.
-
-Copyright (C) 2003-5 George Hazan (ghazan@postman.ru)
-Copyright (C) 2001-3 Richard Hughes (original version),
-
-Miranda IM: the free icq client for MS Windows
-Copyright (C) 2002-5 Martin Oberg, Robert Rainwater, Sam Kothari, Lyon Lim
-Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede
-
-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.
-
-================================================================================
-Useful plugins which can help you to work with the MSN protocol
-================================================================================
-
-Popup 1.0.1.9
-(http://miranda-im.org/download/details.php?action=viewfile&id=299)
-Popup Plus 2.0.3.8
-(http://miranda-im.org/download/details.php?action=viewfile&id=1170)
-----------------------
-All notifications in the MSN plugin are made using the Popup
-plugin. After the Popup plugin installation there will be some
-options available for tuning, you will find them in
-Options/Popups/MSN tab.
-
-Chat 0.2.0.2
-(http://miranda-im.org/download/details.php?action=viewfile&id=1309)
-----------------------
-This plugin allows you to support group chats with many MSN users. Without
-that plugin you can't leave a chat been being invited, so if you plan to
-use groupchats, this plugin is essential.
-
-SRMM (Unicode) 1.0.4.3
-(http://miranda-im.org/download/details.php?action=viewfile&id=1136)
-tabSRMM (Unicode) 0.9.9.95
-(http://hell.at.eu.org/forums)
-----------------------
-They both are true Unicode-aware message editors. Using them you can
-send/receive Unicode messages, so you won't be dependent on the
-codepages, encodings etc. They work only under NT4/Win2k/XP/2003.
-
-Unicode History Viewer
-(http://miranda-im.org/download/details.php?action=viewfile&id=1109)
-----------------------
-If you work under NT4/Win2k/XP/2003, and you can send/receive messages
-in Unicode, the standard history viewer will show question-marks when
-Unicode characters cannot be mapped to the current codepage. In this
-case you can use this plugin to have no problems at all.
-
-================================================================================
-Frequently asked questions.
-================================================================================
-
-Q1. I want to use the OpenSSL libraries, but plugin can't find or load
-them. Where can I find the valid DLLs for Win32?
-
-A1. http://www.slproweb.com/products/Win32OpenSSL.html
-Use the latest stable version.
-
-----------------------------------------------------------------
-
-Q2. I get strange errors with connection, proxies, file sending/
-receiving. How can I find the reason of the problem?
-
-A2. Some useful information is grouped in the networking-msn.txt.
-If it does not help, try to create a network log. Go to
-Options/Network and press a "Log Options" button (the only button
-in the upper-right corner). Very often this log helps users to
-find a hidden diagnostic messages, or simply understand what is
-happening concretely. If a problem persists, you can contact me,
-and upon request, send me (zipped!) a piece of this log.
-
-----------------------------------------------------------------
-
-Q3. My Miranda logged into the MSN network successfully, but I
-cannot send a message, and a contact's menu item 'Message' is blocked.
-
-A3. The problem is in the Conversation Style Messaging plugin.
-CSM plugin is incompatible with the MSN plugin because of the
-error in it. Disable it and/or delete, if you want to use the MSN
-protocol
-
-----------------------------------------------------------------
-
-Q4. I want to compile your sources, but got a lot of errors.
-
-A4. First, you should download new Miranda's SDK sources, and
-place the MSN plugin's sources into Protocol\MSN subdirectory
-(accordingly to the Miranda's directory tree). Notice that MSN is
-not a plugin anymore, it's stored among another protocols. Look at
-http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/miranda-icq to
-view the complete directory structure.
-
-Then download the Popup plugin, and unzip header file m_popup.h
-to the SDK\headers_c directory. Then you should be able to compile
-MSN plugin without problems.
-
-Installation of Microsoft Platform SDK is not required to
-compile MSN plugin sources
-
-----------------------------------------------------------------
-
-Q5. When I receive an authorization request, my own nickname is
-shown in the contact list. Is it a bug?
-
-A5. Yes, it is, but it cannot be solved now. Miranda uses UINs
-to identify a contact, but because MSN protocol have no UINs,
-your own nickname (as a default one) is shown.
-
-----------------------------------------------------------------
-
-WMBR, George Hazan (ghazan@postman.ru).
diff --git a/protocols/MSN/docs/todo.txt b/protocols/MSN/docs/todo.txt
deleted file mode 100644
index 627c0ae56b..0000000000
--- a/protocols/MSN/docs/todo.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-There're most important problems and known bugs:
-
-1. File transfers:
-- problems with the multihomed machines.
-- better diagnostics.
-
-If you know a problem that is not listed here, report it via e-mail.
-
-WMBR, George Hazan
-ghazan@postman.ru
diff --git a/protocols/MSN/msn.vcxproj b/protocols/MSN/msn.vcxproj
deleted file mode 100644
index 67ec5aa81b..0000000000
--- a/protocols/MSN/msn.vcxproj
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectName>MSN</ProjectName>
- <ProjectGuid>{7B0F213E-C15E-4219-8AE5-49DD3D3D553D}</ProjectGuid>
- </PropertyGroup>
- <ImportGroup Label="PropertySheets">
- <Import Project="$(ProjectDir)..\..\build\vc.common\plugin.props" />
- </ImportGroup>
- <ItemDefinitionGroup>
- <Link>
- <AdditionalDependencies>libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="src\skylogin\*.c">
- <PrecompiledHeader>NotUsing</PrecompiledHeader>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\libs\libjson\libjson.vcxproj">
- <Project>{f6a9340e-b8d9-4c75-be30-47dc66d0abc7}</Project>
- </ProjectReference>
- </ItemGroup>
-</Project>
diff --git a/protocols/MSN/msn.vcxproj.filters b/protocols/MSN/msn.vcxproj.filters
deleted file mode 100644
index 7ef90967de..0000000000
--- a/protocols/MSN/msn.vcxproj.filters
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(ProjectDir)..\..\build\vc.common\common.filters" />
- <ItemGroup>
- <ClInclude Include="src\*.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClCompile Include="src\*.cpp;src\*.cxx">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ResourceCompile Include="res\*.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- <None Include="res\*.ico;res\*.bmp;res\*.cur">
- <Filter>Resource Files</Filter>
- </None>
- </ItemGroup>
-</Project>
diff --git a/protocols/MSN/proto_msn/CMakeLists.txt b/protocols/MSN/proto_msn/CMakeLists.txt
deleted file mode 100644
index 7df814f1c5..0000000000
--- a/protocols/MSN/proto_msn/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-set(TARGET Proto_MSN)
-include(${CMAKE_SOURCE_DIR}/cmake/icons.cmake) \ No newline at end of file
diff --git a/protocols/MSN/proto_msn/Proto_MSN.vcxproj b/protocols/MSN/proto_msn/Proto_MSN.vcxproj
deleted file mode 100644
index 24dc5a353d..0000000000
--- a/protocols/MSN/proto_msn/Proto_MSN.vcxproj
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectName>Proto_MSN</ProjectName>
- <ProjectGuid>{7BC6C3E7-2B17-4718-A82E-084798710E14}</ProjectGuid>
- </PropertyGroup>
- <ImportGroup Label="PropertySheets">
- <Import Project="$(ProjectDir)..\..\..\build\vc.common\icons.props" />
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/protocols/MSN/proto_msn/Proto_MSN.vcxproj.filters b/protocols/MSN/proto_msn/Proto_MSN.vcxproj.filters
deleted file mode 100644
index 1ed30e13d0..0000000000
--- a/protocols/MSN/proto_msn/Proto_MSN.vcxproj.filters
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(ProjectDir)..\..\..\build\vc.common\common.filters" />
- <ItemGroup>
- <ClInclude Include="src\*.h">
- <Filter>Header Files</Filter>
- </ClInclude>
- <ClCompile Include="src\*.cpp;src\*.cxx">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ResourceCompile Include="res\*.rc">
- <Filter>Resource Files</Filter>
- </ResourceCompile>
- <None Include="res\*.ico;res\*.bmp;res\*.cur">
- <Filter>Resource Files</Filter>
- </None>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/protocols/MSN/proto_msn/res/Away.ico b/protocols/MSN/proto_msn/res/Away.ico
deleted file mode 100644
index 861c161ed1..0000000000
--- a/protocols/MSN/proto_msn/res/Away.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/proto_msn/res/Invisible.ico b/protocols/MSN/proto_msn/res/Invisible.ico
deleted file mode 100644
index 382e3bf50d..0000000000
--- a/protocols/MSN/proto_msn/res/Invisible.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/proto_msn/res/Occupied.ico b/protocols/MSN/proto_msn/res/Occupied.ico
deleted file mode 100644
index 47c63a4214..0000000000
--- a/protocols/MSN/proto_msn/res/Occupied.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/proto_msn/res/Offline.ico b/protocols/MSN/proto_msn/res/Offline.ico
deleted file mode 100644
index d52328aa47..0000000000
--- a/protocols/MSN/proto_msn/res/Offline.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/proto_msn/res/Online.ico b/protocols/MSN/proto_msn/res/Online.ico
deleted file mode 100644
index 7388d3928f..0000000000
--- a/protocols/MSN/proto_msn/res/Online.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/proto_msn/res/Proto_MSN.rc b/protocols/MSN/proto_msn/res/Proto_MSN.rc
deleted file mode 100644
index c35fd121b9..0000000000
--- a/protocols/MSN/proto_msn/res/Proto_MSN.rc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "..\src\resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Russian (Russia) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
-LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "..\\src\\resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_ICON1 ICON "Offline.ico"
-IDI_ICON2 ICON "Online.ico"
-IDI_ICON3 ICON "Away.ico"
-IDI_ICON4 ICON "Invisible.ico"
-IDI_ICON6 ICON "Occupied.ico"
-
-#endif // Russian (Russia) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/protocols/MSN/proto_msn/src/resource.h b/protocols/MSN/proto_msn/src/resource.h
deleted file mode 100644
index 72c197a868..0000000000
--- a/protocols/MSN/proto_msn/src/resource.h
+++ /dev/null
@@ -1,20 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by Proto_MSN.rc
-//
-#define IDI_ICON1 105
-#define IDI_ICON2 104
-#define IDI_ICON3 128
-#define IDI_ICON4 130
-#define IDI_ICON6 159
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 109
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1001
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/protocols/MSN/res/inbox.ico b/protocols/MSN/res/inbox.ico
deleted file mode 100644
index 7a5e461f6f..0000000000
--- a/protocols/MSN/res/inbox.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/invite.ico b/protocols/MSN/res/invite.ico
deleted file mode 100644
index 25bd23be86..0000000000
--- a/protocols/MSN/res/invite.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/list_al.ico b/protocols/MSN/res/list_al.ico
deleted file mode 100644
index 05bd93fac4..0000000000
--- a/protocols/MSN/res/list_al.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/list_bl.ico b/protocols/MSN/res/list_bl.ico
deleted file mode 100644
index 58d39b6fcf..0000000000
--- a/protocols/MSN/res/list_bl.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/list_fl.ico b/protocols/MSN/res/list_fl.ico
deleted file mode 100644
index fb77874fc4..0000000000
--- a/protocols/MSN/res/list_fl.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/list_ph.ico b/protocols/MSN/res/list_ph.ico
deleted file mode 100644
index da5a991a0c..0000000000
--- a/protocols/MSN/res/list_ph.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/list_rl.ico b/protocols/MSN/res/list_rl.ico
deleted file mode 100644
index 1e22656d1d..0000000000
--- a/protocols/MSN/res/list_rl.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/msn.ico b/protocols/MSN/res/msn.ico
deleted file mode 100644
index 818824f3a0..0000000000
--- a/protocols/MSN/res/msn.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/msn.rc b/protocols/MSN/res/msn.rc
deleted file mode 100644
index a59f01f92e..0000000000
--- a/protocols/MSN/res/msn.rc
+++ /dev/null
@@ -1,368 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "..\src\resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include <windows.h>
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Neutral resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-#pragma code_page(1252)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_OPT_MSN DIALOGEX 0, 0, 304, 176
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- GROUPBOX "MSN",IDC_STMSNGROUP,5,0,298,84,WS_GROUP
- RTEXT "Live ID:",IDC_STATIC,16,20,52,8
- EDITTEXT IDC_HANDLE,72,18,100,12,ES_AUTOHSCROLL
- RTEXT "Password:",IDC_STATIC,16,36,52,8
- EDITTEXT IDC_PASSWORD,72,34,100,12,ES_PASSWORD | ES_AUTOHSCROLL
- RTEXT "Nickname:",IDC_STATIC,16,52,52,8,NOT WS_VISIBLE
- EDITTEXT IDC_HANDLE2,72,50,100,12,ES_AUTOHSCROLL | NOT WS_VISIBLE
- CONTROL "Create a new Windows Live account",IDC_NEWMSNACCOUNTLINK,
- "Hyperlink",WS_TABSTOP,21,68,208,8
- GROUPBOX "Expert",IDC_STATIC,4,84,298,88,WS_GROUP
- CONTROL "Send message font color/size info inside messages",IDC_SENDFONTINFO,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,95,280,10
- CONTROL "Disable all contacts not included into my contact list",IDC_DISABLE_ANOTHER_CONTACTS,
- "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,12,106,280,10
- CONTROL "Manage server groups",IDC_MANAGEGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,116,280,10
- CONTROL "Allow people on my contact list send messages to mobile device",IDC_MOBILESEND,
- "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,12,126,280,10
- CONTROL "Run the following application when new Hotmail arrives",IDC_RUN_APP_ON_HOTMAIL,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,137,280,10
- EDITTEXT IDC_MAILER_APP,22,153,237,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_ENTER_MAILER_APP,265,153,15,12
-END
-
-IDD_OPT_MSN_CONN DIALOGEX 0, 0, 304, 127
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- GROUPBOX "Connection settings",IDC_STATIC,4,3,298,64
- RTEXT "Direct:",IDC_STATIC,10,18,52,8
- EDITTEXT IDC_DIRECTSERVER,68,16,135,12,ES_AUTOHSCROLL
- LTEXT " 443",IDC_STATIC,209,16,28,12,SS_SUNKEN
- RTEXT "Gateway:",IDC_STATIC,10,32,52,8
- EDITTEXT IDC_GATEWAYSERVER,68,30,135,12,ES_AUTOHSCROLL
- CONTROL " 443",IDC_STATIC,"Static",SS_SIMPLE | SS_SUNKEN | WS_GROUP,209,30,28,12
- PUSHBUTTON "Reset",IDC_RESETSERVER,244,16,48,12
- CONTROL "Notify me when a message delivery has failed",IDC_SLOWSEND,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,49,285,8
- GROUPBOX "Incoming file transfers",IDC_STATIC,4,74,298,48
- COMBOBOX IDC_HOSTOPT,10,86,285,30,CBS_DROPDOWNLIST | WS_TABSTOP
- RTEXT "Your host (or router):",IDC_STATIC,10,103,90,8
- EDITTEXT IDC_YOURHOST,105,102,190,12,ES_AUTOHSCROLL
-END
-
-IDD_LISTSMGR DIALOGEX 0, 0, 304, 228
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- GROUPBOX "Server List Manager",IDC_STATIC,4,0,298,224
- CONTROL "",IDC_LIST,"CListControl",WS_TABSTOP | 0x1f3,9,12,287,169,WS_EX_CLIENTEDGE
- ICON "",IDC_ICON_LC,10,184,20,20,SS_REALSIZEIMAGE
- LTEXT "Contact is on your local list",IDC_STATIC,28,184,144,8
- ICON "",IDC_ICON_FL,10,197,20,20,SS_REALSIZEIMAGE
- LTEXT "Contact is included into your server list",IDC_STATIC,28,197,144,8
- ICON "",IDC_ICON_AL,187,184,20,20,SS_REALSIZEIMAGE
- LTEXT "Allowed (active) contact",IDC_STATIC,204,184,82,8
- ICON "",IDC_ICON_BL,187,196,20,20,SS_REALSIZEIMAGE
- LTEXT "Blocked contact",IDC_STATIC,204,196,82,8
- ICON "",IDC_ICON_RL,10,209,21,20,SS_REALSIZEIMAGE
- LTEXT "Somebody included you in his/her server list",IDC_STATIC,28,209,144,8
- PUSHBUTTON "Refresh",IDC_LISTREFRESH,218,209,80,13
-END
-
-IDD_OPT_NOTIFY DIALOGEX 0, 0, 289, 126
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- GROUPBOX "Hotmail",IDC_STATIC,5,7,262,60
- CONTROL "Enable Popup notifications",IDC_DISABLEHOTMAILPOPUP,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,18,245,10
- CONTROL "Enable Contact List notifications",IDC_DISABLEHOTMAILCL,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,30,245,10
- CONTROL "Enable Tray notifications",IDC_DISABLEHOTMAILTRAY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,41,245,10
- CONTROL "Ignore new messages not in Inbox folder",IDC_DISABLEHOTJUNK,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,52,245,10
- GROUPBOX "Other",IDC_STATIC,5,68,262,49
- CONTROL "Display errors using popups",IDC_ERRORS_USING_POPUPS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,79,245,10
- CONTROL "Enable 'Chat Session Established' popup",IDC_NOTIFY_FIRSTMSG,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,92,245,10
- CONTROL "Enable 'Contact left channel' popup",IDC_NOTIFY_ENDSESSION,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,105,245,8
-END
-
-IDD_SETNICKNAME DIALOGEX 0, 0, 187, 42
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Set Nickname"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- EDITTEXT IDC_NICKNAME,5,5,177,12,ES_AUTOHSCROLL
- DEFPUSHBUTTON "OK",IDOK,36,23,50,14
- PUSHBUTTON "Cancel",IDCANCEL,102,23,50,14
-END
-
-IDD_USEROPTS DIALOGEX 0, 0, 224, 132
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- CONTROL "",IDC_CCARD_TAB1,"SysTabControl32",0x0,0,0,223,117
-END
-
-IDD_CARD_GEN DIALOGEX 0, 0, 278, 130
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_SYSMENU
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- LTEXT "Mobile Device (used for SMS)",IDC_STATIC,7,8,126,8
- EDITTEXT IDC_CARD_GEN_PHONE,7,17,122,12,ES_AUTOHSCROLL
- EDITTEXT IDC_CARD_GEN_IM2,7,73,125,13,ES_AUTOHSCROLL
- LTEXT "Spouse/Partner",IDC_STATIC,7,64,122,8
- EDITTEXT IDC_EDIT5,143,18,121,12,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT6,145,74,118,12,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT7,144,46,119,12,ES_AUTOHSCROLL
- LTEXT "Middle Name",IDC_STATIC,145,35,117,8
- LTEXT "First Name",IDC_STATIC,143,8,120,8
- LTEXT "Last Name",IDC_STATIC,145,63,116,8
- COMBOBOX IDC_COMBO1,7,100,67,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_COMBO2,77,100,28,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- EDITTEXT IDC_CARD_GEN_IM3,105,100,25,12,ES_AUTOHSCROLL
- COMBOBOX IDC_COMBO3,144,100,67,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- COMBOBOX IDC_COMBO4,212,100,28,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
- EDITTEXT IDC_CARD_GEN_IM4,240,100,25,12,ES_AUTOHSCROLL
- LTEXT "Anniversary",IDC_STATIC,7,91,123,8
- LTEXT "Birthday",IDC_STATIC,145,91,123,8
- EDITTEXT IDC_CARD_GEN_IM5,7,47,125,13,ES_AUTOHSCROLL
- LTEXT "Nickname",IDC_STATIC,7,38,94,8
-END
-
-IDD_CARD_CONTACT DIALOGEX 0, 0, 344, 156
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_SYSMENU
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- EDITTEXT IDC_EDIT1,7,19,107,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT2,7,48,107,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT3,7,77,107,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT4,7,102,107,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT5,7,123,107,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT6,130,18,107,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT7,130,46,107,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT8,130,74,107,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT9,130,100,107,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT10,130,121,107,14,ES_AUTOHSCROLL
- LTEXT "Middle Name",IDC_STATIC,129,7,41,8
- LTEXT "First Name",IDC_STATIC,7,7,35,8
- LTEXT "Last Name",IDC_STATIC,7,36,34,8
-END
-
-IDD_ACCMGRUI DIALOGEX 0, 0, 186, 134
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- LTEXT "Live ID:",IDC_STATIC,0,0,53,12
- EDITTEXT IDC_HANDLE,54,0,131,12,ES_AUTOHSCROLL
- LTEXT "Password:",IDC_STATIC,0,16,53,12
- EDITTEXT IDC_PASSWORD,54,16,131,12,ES_PASSWORD | ES_AUTOHSCROLL
- CONTROL "Create a new Windows Live account",IDC_NEWMSNACCOUNTLINK,
- "Hyperlink",WS_TABSTOP,0,60,183,12
- LTEXT "Place:",IDC_STATIC,0,31,53,12
- EDITTEXT IDC_PLACE,54,31,131,12,ES_AUTOHSCROLL
-END
-
-IDD_DELETECONTACT DIALOGEX 0, 0, 213, 76
-STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION
-CAPTION "MSN Delete Contact"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- DEFPUSHBUTTON "OK",IDOK,82,55,50,14
- CONTROL "Remove from Hotmail Address book",IDC_REMOVEHOT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,32,199,10
- CONTROL "Block Contact",IDC_REMOVEBLOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,18,199,10
-END
-
-IDD_CHATROOM_INVITE DIALOGEX 0, 0, 190, 179
-STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_TOPMOST
-CAPTION "Invite Contact To Chat"
-FONT 8, "MS Shell Dlg", 0, 0, 0x0
-BEGIN
- LTEXT "Live ID",-1,7,128,43,9
- PUSHBUTTON "&Invite",IDOK,29,159,46,14
- PUSHBUTTON "&Cancel",IDCANCEL,112,159,45,14
- CONTROL "",IDC_CCLIST,"CListControl",WS_TABSTOP | 0x16f,7,4,174,119,WS_EX_CLIENTEDGE
- EDITTEXT IDC_EDITSCR,7,138,121,12,ES_AUTOHSCROLL
- PUSHBUTTON "Add",IDC_ADDSCR,133,136,49,14
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_OPT_MSN, DIALOG
- BEGIN
- VERTGUIDE, 12
- VERTGUIDE, 292
- END
-
- IDD_OPT_MSN_CONN, DIALOG
- BEGIN
- VERTGUIDE, 10
- VERTGUIDE, 68
- VERTGUIDE, 203
- VERTGUIDE, 209
- VERTGUIDE, 237
- VERTGUIDE, 295
- END
-
- IDD_LISTSMGR, DIALOG
- BEGIN
- END
-
- IDD_OPT_NOTIFY, DIALOG
- BEGIN
- RIGHTMARGIN, 276
- VERTGUIDE, 5
- VERTGUIDE, 14
- VERTGUIDE, 259
- VERTGUIDE, 267
- BOTTOMMARGIN, 123
- END
-
- IDD_SETNICKNAME, DIALOG
- BEGIN
- END
-
- IDD_USEROPTS, DIALOG
- BEGIN
- END
-
- IDD_CARD_GEN, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 271
- TOPMARGIN, 7
- BOTTOMMARGIN, 123
- END
-
- IDD_CARD_CONTACT, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 337
- TOPMARGIN, 7
- BOTTOMMARGIN, 149
- END
-
- IDD_ACCMGRUI, DIALOG
- BEGIN
- RIGHTMARGIN, 183
- TOPMARGIN, 7
- BOTTOMMARGIN, 106
- END
-
- IDD_DELETECONTACT, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 206
- TOPMARGIN, 7
- BOTTOMMARGIN, 69
- END
-
- IDD_CHATROOM_INVITE, DIALOG
- BEGIN
- RIGHTMARGIN, 188
- TOPMARGIN, 4
- BOTTOMMARGIN, 173
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_MSN ICON "msn.ico"
-IDI_MSNBLOCK ICON "msnblock.ico"
-IDI_SERVICES ICON "services.ico"
-IDI_INBOX ICON "inbox.ico"
-IDI_INVITE ICON "invite.ico"
-IDI_NETMEETING ICON "netmeeting.ico"
-IDI_PROFILE ICON "profile.ico"
-IDI_LIST_FL ICON "list_fl.ico"
-IDI_LIST_AL ICON "list_al.ico"
-IDI_LIST_BL ICON "list_bl.ico"
-IDI_LIST_RL ICON "list_rl.ico"
-IDI_LIST_LC ICON "list_ph.ico"
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "..\\src\\resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include <windows.h>\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // Neutral resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/protocols/MSN/res/msnblock.ico b/protocols/MSN/res/msnblock.ico
deleted file mode 100644
index 26c0a6d040..0000000000
--- a/protocols/MSN/res/msnblock.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/netmeeting.ico b/protocols/MSN/res/netmeeting.ico
deleted file mode 100644
index 40e341ec16..0000000000
--- a/protocols/MSN/res/netmeeting.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/profile.ico b/protocols/MSN/res/profile.ico
deleted file mode 100644
index 2056f57798..0000000000
--- a/protocols/MSN/res/profile.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/services.ico b/protocols/MSN/res/services.ico
deleted file mode 100644
index 2aca9a8bb4..0000000000
--- a/protocols/MSN/res/services.ico
+++ /dev/null
Binary files differ
diff --git a/protocols/MSN/res/version.rc b/protocols/MSN/res/version.rc
deleted file mode 100644
index 5a5ddd63ed..0000000000
--- a/protocols/MSN/res/version.rc
+++ /dev/null
@@ -1,9 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#ifdef APSTUDIO_INVOKED
-#error this file is not editable by Microsoft Visual C++
-#endif //APSTUDIO_INVOKED
-
-#include "..\src\version.h"
-
-#include "..\..\build\Version.rc"
diff --git a/protocols/MSN/src/ezxml.c b/protocols/MSN/src/ezxml.c
deleted file mode 100644
index 6f13194177..0000000000
--- a/protocols/MSN/src/ezxml.c
+++ /dev/null
@@ -1,969 +0,0 @@
-/* ezxml.c
- *
- * Copyright 2004-2006 Aaron Voisine <aaron@voisine.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#if defined(_DEBUG) && !defined(__GNUC__)
- #define _CRTDBG_MAP_ALLOC
- #include <stdlib.h>
- #include <crtdbg.h>
-#else
- #include <stdlib.h>
-#endif
-
-#include <limits.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <ctype.h>
-
-#include "ezxml.h"
-
-#ifndef SIZE_MAX
-#define SIZE_MAX UINT_MAX
-#endif
-
-#pragma warning(disable:4706)
-
-#define EZXML_WS "\t\r\n " // whitespace
-#define EZXML_ERRL 128 // maximum error string length
-
-typedef struct ezxml_root *ezxml_root_t;
-struct ezxml_root { // additional data for the root tag
- struct ezxml xml; // is a super-struct built on top of ezxml struct
- ezxml_t cur; // current xml tree insertion point
- char *m; // original xml string
- size_t len; // length of allocated memory for mmap, -1 for malloc
- char *u; // UTF-8 conversion of string if original was UTF-16
- char *s; // start of work area
- char *e; // end of work area
- char **ent; // general entities (ampersand sequences)
- char ***attr; // default attributes
- char ***pi; // processing instructions
- short standalone; // non-zero if <?xml standalone="yes"?>
- char err[EZXML_ERRL]; // error string
-};
-
-char *EZXML_NIL[] = { NULL }; // empty, null terminated array of strings
-
-// returns the first child tag with the given name or NULL if not found
-ezxml_t ezxml_child(ezxml_t xml, const char *name)
-{
- xml = (xml) ? xml->child : NULL;
- while (xml && strcmp(name, xml->name)) xml = xml->sibling;
- return xml;
-}
-
-// returns the Nth tag with the same name in the same subsection or NULL if not
-// found
-ezxml_t ezxml_idx(ezxml_t xml, int idx)
-{
- for (; xml && idx; idx--) xml = xml->next;
- return xml;
-}
-
-// returns the value of the requested tag attribute or NULL if not found
-const char *ezxml_attr(ezxml_t xml, const char *attr)
-{
- int i = 0, j = 1;
- ezxml_root_t root = (ezxml_root_t)xml;
-
- if (! xml || ! xml->attr) return NULL;
- while (xml->attr[i] && strcmp(attr, xml->attr[i])) i += 2;
- if (xml->attr[i]) return xml->attr[i + 1]; // found attribute
-
- while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag
- for (i = 0; root->attr[i] && strcmp(xml->name, root->attr[i][0]); i++);
- if (! root->attr[i]) return NULL; // no matching default attributes
- while (root->attr[i][j] && strcmp(attr, root->attr[i][j])) j += 3;
- return (root->attr[i][j]) ? root->attr[i][j + 1] : NULL; // found default
-}
-
-// same as ezxml_get but takes an already initialized va_list
-ezxml_t ezxml_vget(ezxml_t xml, va_list ap)
-{
- char *name = va_arg(ap, char *);
- int idx = -1;
-
- if (name && *name) {
- idx = va_arg(ap, int);
- xml = ezxml_child(xml, name);
- }
- return (idx < 0) ? xml : ezxml_vget(ezxml_idx(xml, idx), ap);
-}
-
-// Traverses the xml tree to retrieve a specific subtag. Takes a variable
-// length list of tag names and indexes. The argument list must be terminated
-// by either an index of -1 or an empty string tag name. Example:
-// title = ezxml_get(library, "shelf", 0, "book", 2, "title", -1);
-// This retrieves the title of the 3rd book on the 1st shelf of library.
-// Returns NULL if not found.
-ezxml_t ezxml_get(ezxml_t xml, ...)
-{
- va_list ap;
- ezxml_t r;
-
- va_start(ap, xml);
- r = ezxml_vget(xml, ap);
- va_end(ap);
- return r;
-}
-
-// returns a null terminated array of processing instructions for the given
-// target
-const char **ezxml_pi(ezxml_t xml, const char *target)
-{
- ezxml_root_t root = (ezxml_root_t)xml;
- int i = 0;
-
- if (! root) return (const char **)EZXML_NIL;
- while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag
- while (root->pi[i] && strcmp(target, root->pi[i][0])) i++; // find target
- return (const char **)((root->pi[i]) ? root->pi[i] + 1 : EZXML_NIL);
-}
-
-// set an error string and return root
-ezxml_t ezxml_err(ezxml_root_t root, char *s, const char *err, ...)
-{
- va_list ap;
- int line = 1;
- char *t, fmt[EZXML_ERRL];
-
- for (t = root->s; t < s; t++) if (*t == '\n') line++;
- _snprintf(fmt, EZXML_ERRL, "[error near line %d]: %s", line, err);
-
- va_start(ap, err);
- _vsnprintf(root->err, EZXML_ERRL, fmt, ap);
- va_end(ap);
-
- return &root->xml;
-}
-
-// Recursively decodes entity and character references and normalizes new lines
-// ent is a null terminated array of alternating entity names and values. set t
-// to '&' for general entity decoding, '%' for parameter entity decoding, 'c'
-// for cdata sections, ' ' for attribute normalization, or '*' for non-cdata
-// attribute normalization. Returns s, or if the decoded string is longer than
-// s, returns a malloced string that must be freed.
-char *ezxml_decode(char *s, char **ent, char t)
-{
- char *e, *r = s, *m = s;
- long b, c, d, l;
-/*
- for (; *s; s++) { // normalize line endings
- while (*s == '\r') {
- *(s++) = '\n';
- if (*s == '\n') memmove(s, (s + 1), strlen(s));
- }
- }
-*/
- for (s = r; ; ) {
- while (*s && *s != '&' && (*s != '%' || t != '%') && (*s & 0x80 || !isspace(*s))) s++;
-
- if (! *s) break;
- else if (t != 'c' && ! strncmp(s, "&#", 2)) { // character reference
- if (s[2] == 'x') c = strtol(s + 3, &e, 16); // base 16
- else c = strtol(s + 2, &e, 10); // base 10
- if (! c || *e != ';') { s++; continue; } // not a character ref
-
- if (c < 0x80) *(s++) = (char)c; // US-ASCII subset
- else { // multi-byte UTF-8 sequence
- for (b = 0, d = c; d; d /= 2) b++; // number of bits in c
- b = (b - 2) / 5; // number of bytes in payload
- *(s++) = (char)((0xFF << (7 - b)) | (c >> (6 * b))); // head
- while (b) *(s++) = (char)(0x80 | ((c >> (6 * --b)) & 0x3F)); // payload
- }
-
- memmove(s, strchr(s, ';') + 1, strlen(strchr(s, ';')));
- }
- else if ((*s == '&' && (t == '&' || t == ' ' || t == '*')) ||
- (*s == '%' && t == '%')) { // entity reference
- for (b = 0; ent[b] && strncmp(s + 1, ent[b], strlen(ent[b]));
- b += 2); // find entity in entity list
-
- if (ent[b++]) { // found a match
- if ((c = (long)strlen(ent[b])) - 1 > (e = strchr(s, ';')) - s) {
- l = (d = (long)(s - r)) + c + (long)strlen(e); // new length
- r = (r == m) ? strcpy(malloc(l), r) : realloc(r, l);
- e = strchr((s = r + d), ';'); // fix up pointers
- }
-
- memmove(s + c, e + 1, strlen(e)); // shift rest of string
- strncpy(s, ent[b], c); // copy in replacement text
- }
- else s++; // not a known entity
- }
- else if ((t == ' ' || t == '*') && isspace(*s)) *(s++) = ' ';
- else s++; // no decoding needed
- }
-
- if (t == '*') { // normalize spaces for non-cdata attributes
- for (s = r; *s; s++) {
- if ((l = (long)strspn(s, " "))) memmove(s, s + l, strlen(s + l) + 1);
- while (*s && *s != ' ') s++;
- }
- if (--s >= r && *s == ' ') *s = '\0'; // trim any trailing space
- }
- return r;
-}
-
-// called when parser finds start of new tag
-void ezxml_open_tag(ezxml_root_t root, char *name, char **attr)
-{
- ezxml_t xml = root->cur;
-
- if (xml->name) xml = ezxml_add_child(xml, name, strlen(xml->txt));
- else xml->name = name; // first open tag
-
- xml->attr = attr;
- root->cur = xml; // update tag insertion point
-}
-
-// called when parser finds character content between open and closing tag
-void ezxml_char_content(ezxml_root_t root, char *s, size_t len, char t)
-{
- ezxml_t xml = root->cur;
- char *m = s;
- size_t l;
-
- if (! xml || ! xml->name || ! len) return; // sanity check
-
- s[len] = '\0'; // null terminate text (calling functions anticipate this)
- len = strlen(s = ezxml_decode(s, root->ent, t)) + 1;
-
- if (! *(xml->txt)) xml->txt = s; // initial character content
- else { // allocate our own memory and make a copy
- xml->txt = (xml->flags & EZXML_TXTM) // allocate some space
- ? realloc(xml->txt, (l = strlen(xml->txt)) + len)
- : strcpy(malloc((l = strlen(xml->txt)) + len), xml->txt);
- strcpy(xml->txt + l, s); // add new char content
- if (s != m) free(s); // free s if it was malloced by ezxml_decode()
- }
-
- if (xml->txt != m) ezxml_set_flag(xml, EZXML_TXTM);
-}
-
-// called when parser finds closing tag
-ezxml_t ezxml_close_tag(ezxml_root_t root, char *name, char *s)
-{
- if (! root->cur || ! root->cur->name || strcmp(name, root->cur->name))
- return ezxml_err(root, s, "unexpected closing tag </%s>", name);
-
- root->cur = root->cur->parent;
- return NULL;
-}
-
-// checks for circular entity references, returns non-zero if no circular
-// references are found, zero otherwise
-int ezxml_ent_ok(char *name, char *s, char **ent)
-{
- int i;
-
- for (; ; s++) {
- while (*s && *s != '&') s++; // find next entity reference
- if (! *s) return 1;
- if (! strncmp(s + 1, name, strlen(name))) return 0; // circular ref.
- for (i = 0; ent[i] && strncmp(ent[i], s + 1, strlen(ent[i])); i += 2);
- if (ent[i] && ! ezxml_ent_ok(name, ent[i + 1], ent)) return 0;
- }
-}
-
-// called when the parser finds a processing instruction
-void ezxml_proc_inst(ezxml_root_t root, char *s, size_t len)
-{
- int i = 0, j = 1;
- char *target = s;
-
- s[len] = '\0'; // null terminate instruction
- if (*(s += strcspn(s, EZXML_WS))) {
- *s = '\0'; // null terminate target
- s += strspn(s + 1, EZXML_WS) + 1; // skip whitespace after target
- }
-
- if (! strcmp(target, "xml")) { // <?xml ... ?>
- if ((s = strstr(s, "standalone")) && ! strncmp(s + strspn(s + 10,
- EZXML_WS "='\"") + 10, "yes", 3)) root->standalone = 1;
- return;
- }
-
- if (! root->pi[0]) *(root->pi = malloc(sizeof(char **))) = NULL; //first pi
-
- while (root->pi[i] && strcmp(target, root->pi[i][0])) i++; // find target
- if (! root->pi[i]) { // new target
- root->pi = realloc(root->pi, sizeof(char **) * (i + 2));
- root->pi[i] = malloc(sizeof(char *) * 3);
- root->pi[i][0] = target;
- root->pi[i][1] = (char *)(root->pi[i + 1] = NULL); // terminate pi list
- root->pi[i][2] = _strdup(""); // empty document position list
- }
-
- while (root->pi[i][j]) j++; // find end of instruction list for this target
- root->pi[i] = realloc(root->pi[i], sizeof(char *) * (j + 3));
- root->pi[i][j + 2] = realloc(root->pi[i][j + 1], j + 1);
- strcpy(root->pi[i][j + 2] + j - 1, (root->xml.name) ? ">" : "<");
- root->pi[i][j + 1] = NULL; // null terminate pi list for this target
- root->pi[i][j] = s; // set instruction
-}
-
-// called when the parser finds an internal doctype subset
-short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len)
-{
- char q, *c, *t, *n = NULL, *v, **ent, **pe;
- int i, j;
-
- pe = memcpy(malloc(sizeof(EZXML_NIL)), EZXML_NIL, sizeof(EZXML_NIL));
-
- for (s[len] = '\0'; s; ) {
- while (*s && *s != '<' && *s != '%') s++; // find next declaration
-
- if (! *s) break;
- else if (! strncmp(s, "<!ENTITY", 8)) { // parse entity definitions
- c = s += strspn(s + 8, EZXML_WS) + 8; // skip white space separator
- n = s + strspn(s, EZXML_WS "%"); // find name
- *(s = n + strcspn(n, EZXML_WS)) = ';'; // append ; to name
-
- v = s + strspn(s + 1, EZXML_WS) + 1; // find value
- if ((q = *(v++)) != '"' && q != '\'') { // skip externals
- s = strchr(s, '>');
- continue;
- }
-
- for (i = 0, ent = (*c == '%') ? pe : root->ent; ent[i]; i++);
- ent = realloc(ent, (i + 3) * sizeof(char *)); // space for next ent
- if (*c == '%') pe = ent;
- else root->ent = ent;
-
- *(++s) = '\0'; // null terminate name
- if ((s = strchr(v, q))) *(s++) = '\0'; // null terminate value
- ent[i + 1] = ezxml_decode(v, pe, '%'); // set value
- ent[i + 2] = NULL; // null terminate entity list
- if (! ezxml_ent_ok(n, ent[i + 1], ent)) { // circular reference
- if (ent[i + 1] != v) free(ent[i + 1]);
- ezxml_err(root, v, "circular entity declaration &%s", n);
- break;
- }
- else ent[i] = n; // set entity name
- }
- else if (! strncmp(s, "<!ATTLIST", 9)) { // parse default attributes
- t = s + strspn(s + 9, EZXML_WS) + 9; // skip whitespace separator
- if (! *t) { ezxml_err(root, t, "unclosed <!ATTLIST"); break; }
- if (*(s = t + strcspn(t, EZXML_WS ">")) == '>') continue;
- else *s = '\0'; // null terminate tag name
- for (i = 0; root->attr[i] && strcmp(n, root->attr[i][0]); i++);
-
- while (*(n = s + 1 + strspn(s + 1, EZXML_WS)) && *n != '>') {
- if (*(s = n + strcspn(n, EZXML_WS))) *s = '\0'; // attr name
- else { ezxml_err(root, t, "malformed <!ATTLIST"); break; }
-
- s += strspn(s + 1, EZXML_WS) + 1; // find next token
- c = (strncmp(s, "CDATA", 5)) ? "*" : " "; // is it cdata?
- if (! strncmp(s, "NOTATION", 8))
- s += strspn(s + 8, EZXML_WS) + 8;
- s = (*s == '(') ? strchr(s, ')') : s + strcspn(s, EZXML_WS);
- if (! s) { ezxml_err(root, t, "malformed <!ATTLIST"); break; }
-
- s += strspn(s, EZXML_WS ")"); // skip white space separator
- if (! strncmp(s, "#FIXED", 6))
- s += strspn(s + 6, EZXML_WS) + 6;
- if (*s == '#') { // no default value
- s += strcspn(s, EZXML_WS ">") - 1;
- if (*c == ' ') continue; // cdata is default, nothing to do
- v = NULL;
- }
- else if ((*s == '"' || *s == '\'') && // default value
- (s = strchr(v = s + 1, *s))) *s = '\0';
- else { ezxml_err(root, t, "malformed <!ATTLIST"); break; }
-
- if (! root->attr[i]) { // new tag name
- root->attr = (! i) ? malloc(2 * sizeof(char **))
- : realloc(root->attr,
- (i + 2) * sizeof(char **));
- root->attr[i] = malloc(2 * sizeof(char *));
- root->attr[i][0] = t; // set tag name
- root->attr[i][1] = (char *)(root->attr[i + 1] = NULL);
- }
-
- for (j = 1; root->attr[i][j]; j += 3); // find end of list
- root->attr[i] = realloc(root->attr[i],
- (j + 4) * sizeof(char *));
-
- root->attr[i][j + 3] = NULL; // null terminate list
- root->attr[i][j + 2] = c; // is it cdata?
- root->attr[i][j + 1] = (v) ? ezxml_decode(v, root->ent, *c)
- : NULL;
- root->attr[i][j] = n; // attribute name
- }
- }
- else if (! strncmp(s, "<!--", 4)) s = strstr(s + 4, "-->"); // comments
- else if (! strncmp(s, "<?", 2)) { // processing instructions
- if ((s = strstr(c = s + 2, "?>")))
- ezxml_proc_inst(root, c, s++ - c);
- }
- else if (*s == '<') s = strchr(s, '>'); // skip other declarations
- else if (*(s++) == '%' && ! root->standalone) break;
- }
-
- free(pe);
- return ! *root->err;
-}
-
-// Converts a UTF-16 string to UTF-8. Returns a new string that must be freed
-// or NULL if no conversion was needed.
-char *ezxml_str2utf8(char **s, size_t *len)
-{
- char *u;
- size_t l = 0, sl, max = *len;
- long c, d;
- int b, be = (**s == '\xFE') ? 1 : (**s == '\xFF') ? 0 : -1;
-
- if (be == -1) return NULL; // not UTF-16
-
- u = malloc(max);
- for (sl = 2; sl < *len - 1; sl += 2) {
- c = (be) ? (((*s)[sl] & 0xFF) << 8) | ((*s)[sl + 1] & 0xFF) //UTF-16BE
- : (((*s)[sl + 1] & 0xFF) << 8) | ((*s)[sl] & 0xFF); //UTF-16LE
- if (c >= 0xD800 && c <= 0xDFFF && (sl += 2) < *len - 1) { // high-half
- d = (be) ? (((*s)[sl] & 0xFF) << 8) | ((*s)[sl + 1] & 0xFF)
- : (((*s)[sl + 1] & 0xFF) << 8) | ((*s)[sl] & 0xFF);
- c = (((c & 0x3FF) << 10) | (d & 0x3FF)) + 0x10000;
- }
-
- while (l + 6 > max) u = realloc(u, max += EZXML_BUFSIZE);
- if (c < 0x80) u[l++] = (char)c; // US-ASCII subset
- else { // multi-byte UTF-8 sequence
- for (b = 0, d = c; d; d /= 2) b++; // bits in c
- b = (b - 2) / 5; // bytes in payload
- u[l++] = (char)((0xFF << (7 - b)) | (c >> (6 * b))); // head
- while (b) u[l++] = (char)(0x80 | ((c >> (6 * --b)) & 0x3F)); // payload
- }
- }
- return *s = realloc(u, *len = l);
-}
-
-// frees a tag attribute list
-void ezxml_free_attr(char **attr) {
- int i = 0;
- char *m;
-
- if (! attr || attr == EZXML_NIL) return; // nothing to free
- while (attr[i]) i += 2; // find end of attribute list
- m = attr[i + 1]; // list of which names and values are malloced
- for (i = 0; m[i]; i++) {
- if (m[i] & EZXML_NAMEM) free(attr[i * 2]);
- if (m[i] & EZXML_TXTM) free(attr[(i * 2) + 1]);
- }
- free(m);
- free(attr);
-}
-
-// parse the given xml string and return an ezxml structure
-ezxml_t ezxml_parse_str(char *s, size_t len)
-{
- ezxml_root_t root = (ezxml_root_t)ezxml_new(NULL);
- char q, e, *d, **attr, **a = NULL; // initialize a to avoid compile warning
- int l, i, j;
-
- root->m = s;
- if (! len) return ezxml_err(root, NULL, "root tag missing");
- root->u = ezxml_str2utf8(&s, &len); // convert utf-16 to utf-8
- root->e = (root->s = s) + len; // record start and end of work area
-
- e = s[len - 1]; // save end char
- s[len - 1] = '\0'; // turn end char into null terminator
-
- while (*s && *s != '<') s++; // find first tag
- if (! *s) return ezxml_err(root, s, "root tag missing");
-
- for (; ; ) {
- attr = (char **)EZXML_NIL;
- d = ++s;
-
- if (isalpha(*s) || *s == '_' || *s == ':' || *s < '\0') { // new tag
- if (! root->cur)
- return ezxml_err(root, d, "markup outside of root element");
-
- s += strcspn(s, EZXML_WS "/>");
- while (isspace(*s)) *(s++) = '\0'; // null terminate tag name
-
- if (*s && *s != '/' && *s != '>') // find tag in default attr list
- for (i = 0; (a = root->attr[i]) && strcmp(a[0], d); i++);
-
- for (l = 0; *s && *s != '/' && *s != '>'; l += 2) { // new attrib
- attr = (l) ? realloc(attr, (l + 4) * sizeof(char *))
- : malloc(4 * sizeof(char *)); // allocate space
- attr[l + 3] = (l) ? realloc(attr[l + 1], (l / 2) + 2)
- : malloc(2); // mem for list of maloced vals
- strcpy(attr[l + 3] + (l / 2), " "); // value is not malloced
- attr[l + 2] = NULL; // null terminate list
- attr[l + 1] = ""; // temporary attribute value
- attr[l] = s; // set attribute name
-
- s += strcspn(s, EZXML_WS "=/>");
- if (*s == '=' || isspace(*s)) {
- *(s++) = '\0'; // null terminate tag attribute name
- q = *(s += strspn(s, EZXML_WS "="));
- if (q == '"' || q == '\'') { // attribute value
- attr[l + 1] = ++s;
- while (*s && *s != q) s++;
- if (*s) *(s++) = '\0'; // null terminate attribute val
- else {
- ezxml_free_attr(attr);
- return ezxml_err(root, d, "missing %c", q);
- }
-
- for (j = 1; a && a[j] && strcmp(a[j], attr[l]); j +=3);
- attr[l + 1] = ezxml_decode(attr[l + 1], root->ent,
- (char)((a && a[j]) ? *a[j + 2] : ' '));
- if (attr[l + 1] < d || attr[l + 1] > s)
- attr[l + 3][l / 2] = EZXML_TXTM; // value malloced
- }
- }
- while (isspace(*s)) s++;
- }
-
- if (*s == '/') { // self closing tag
- *(s++) = '\0';
- if ((*s && *s != '>') || (! *s && e != '>')) {
- if (l) ezxml_free_attr(attr);
- return ezxml_err(root, d, "missing >");
- }
- ezxml_open_tag(root, d, attr);
- ezxml_close_tag(root, d, s);
- }
- else if ((q = *s) == '>' || (! *s && e == '>')) { // open tag
- *s = '\0'; // temporarily null terminate tag name
- ezxml_open_tag(root, d, attr);
- *s = q;
- }
- else {
- if (l) ezxml_free_attr(attr);
- return ezxml_err(root, d, "missing >");
- }
- }
- else if (*s == '/') { // close tag
- s += strcspn(d = s + 1, EZXML_WS ">") + 1;
- if (! (q = *s) && e != '>') return ezxml_err(root, d, "missing >");
- *s = '\0'; // temporarily null terminate tag name
- if (ezxml_close_tag(root, d, s)) return &root->xml;
- if (isspace(*s = q)) s += strspn(s, EZXML_WS);
- }
- else if (! strncmp(s, "!--", 3)) { // xml comment
- if (! (s = strstr(s + 3, "--")) || (*(s += 2) != '>' && *s) ||
- (! *s && e != '>')) return ezxml_err(root, d, "unclosed <!--");
- }
- else if (! strncmp(s, "![CDATA[", 8)) { // cdata
- if ((s = strstr(s, "]]>")))
- ezxml_char_content(root, d + 8, (s += 2) - d - 10, 'c');
- else return ezxml_err(root, d, "unclosed <![CDATA[");
- }
- else if (! strncmp(s, "!DOCTYPE", 8)) { // dtd
- for (l = 0; *s && ((! l && *s != '>') || (l && (*s != ']' ||
- *(s + strspn(s + 1, EZXML_WS) + 1) != '>')));
- l = (*s == '[') ? 1 : l) s += strcspn(s + 1, "[]>") + 1;
- if (! *s && e != '>')
- return ezxml_err(root, d, "unclosed <!DOCTYPE");
- d = (l) ? strchr(d, '[') + 1 : d;
- if (l && ! ezxml_internal_dtd(root, d, s++ - d)) return &root->xml;
- }
- else if (*s == '?') { // <?...?> processing instructions
- do { s = strchr(s, '?'); } while (s && *(++s) && *s != '>');
- if (! s || (! *s && e != '>'))
- return ezxml_err(root, d, "unclosed <?");
- else ezxml_proc_inst(root, d + 1, s - d - 2);
- }
- else return ezxml_err(root, d, "unexpected <");
-
- if (! s || ! *s) break;
- *s = '\0';
- d = ++s;
- if (*s && *s != '<') { // tag character content
- while (*s && *s != '<') s++;
- if (*s) ezxml_char_content(root, d, s - d, '&');
- else break;
- }
- else if (! *s) break;
- }
-
- if (! root->cur) return &root->xml;
- else if (! root->cur->name) return ezxml_err(root, d, "root tag missing");
- else return ezxml_err(root, d, "unclosed tag <%s>", root->cur->name);
-}
-
-// Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire
-// stream into memory and then parses it. For xml files, use ezxml_parse_file()
-// or ezxml_parse_fd()
-ezxml_t ezxml_parse_fp(FILE *fp)
-{
- ezxml_root_t root;
- size_t l, len = 0;
- char *s;
-
- if (! (s = malloc(EZXML_BUFSIZE))) return NULL;
- do {
- len += (l = fread((s + len), 1, EZXML_BUFSIZE, fp));
- if (l == EZXML_BUFSIZE) s = realloc(s, len + EZXML_BUFSIZE);
- } while (s && l == EZXML_BUFSIZE);
-
- if (! s) return NULL;
- root = (ezxml_root_t)ezxml_parse_str(s, len);
- root->len = SIZE_MAX; // so we know to free s in ezxml_free()
- return &root->xml;
-}
-
-// Encodes ampersand sequences appending the results to *dst, reallocating *dst
-// if length excedes max. a is non-zero for attribute encoding. Returns *dst
-char *ezxml_ampencode(const char *s, size_t len, char **dst, size_t *dlen,
- size_t *max, short a)
-{
- const char *e;
-
- for (e = s + len; s != e; s++) {
- while (*dlen + 10 > *max) *dst = realloc(*dst, *max += EZXML_BUFSIZE);
-
- switch (*s) {
- case '\0': return *dst;
- case '&': *dlen += sprintf(*dst + *dlen, "&amp;"); break; //!!!!!!!!!!!!!!
- case '<': *dlen += sprintf(*dst + *dlen, "&lt;"); break; //!!!!!!!!!!!!!!
- case '>': *dlen += sprintf(*dst + *dlen, "&gt;"); break; //!!!!!!!!!!!!!!
- case '"': *dlen += sprintf(*dst + *dlen, (a) ? "&quot;" : "\""); break; //!!!!!!!!!!!!!!
-// case '\n': *dlen += sprintf(*dst + *dlen, (a) ? "&#xA;" : "\n"); break; //!!!!!!!!!!!!!!
- case '\t': *dlen += sprintf(*dst + *dlen, (a) ? "&#x9;" : "\t"); break; //!!!!!!!!!!!!!!
-// case '\r': *dlen += sprintf(*dst + *dlen, "&#xD;"); break; //!!!!!!!!!!!!!!
- default: (*dst)[(*dlen)++] = *s;
- }
- }
- return *dst;
-}
-
-// Recursively converts each tag to xml appending it to *s. Reallocates *s if
-// its length excedes max. start is the location of the previous tag in the
-// parent tag's character content. Returns *s.
-char *ezxml_toxml_r(ezxml_t xml, char **s, size_t *len, size_t *max,
- size_t start, char ***attr)
-{
- int i, j;
- char *txt = (xml->parent) ? xml->parent->txt : "";
- size_t off = 0;
-
- // parent character content up to this tag
- *s = ezxml_ampencode(txt + start, xml->off - start, s, len, max, 0);
-
- while (*len + strlen(xml->name) + 4 > *max) // reallocate s
- *s = realloc(*s, *max += EZXML_BUFSIZE);
-
- *len += sprintf(*s + *len, "<%s", xml->name); // open tag //!!!!!!!!!!!!!!
- for (i = 0; xml->attr[i]; i += 2) { // tag attributes
- if (ezxml_attr(xml, xml->attr[i]) != xml->attr[i + 1]) continue;
- while (*len + strlen(xml->attr[i]) + 7 > *max) // reallocate s
- *s = realloc(*s, *max += EZXML_BUFSIZE);
-
- *len += sprintf(*s + *len, " %s=\"", xml->attr[i]); //!!!!!!!!!!!!!!
- ezxml_ampencode(xml->attr[i + 1], SIZE_MAX, s, len, max, 1);
- *len += sprintf(*s + *len, "\""); //!!!!!!!!!!!!!!
- }
-
- for (i = 0; attr[i] && strcmp(attr[i][0], xml->name); i++);
- for (j = 1; attr[i] && attr[i][j]; j += 3) { // default attributes
- if (! attr[i][j + 1] || ezxml_attr(xml, attr[i][j]) != attr[i][j + 1])
- continue; // skip duplicates and non-values
- while (*len + strlen(attr[i][j]) + 7 > *max) // reallocate s
- *s = realloc(*s, *max += EZXML_BUFSIZE);
-
- *len += sprintf(*s + *len, " %s=\"", attr[i][j]); //!!!!!!!!!!!!!!
- ezxml_ampencode(attr[i][j + 1], SIZE_MAX, s, len, max, 1);
- *len += sprintf(*s + *len, "\""); //!!!!!!!!!!!!!!
- }
- if (xml->attr != EZXML_NIL && xml->child == NULL && xml->txt[0] == 0)
- *len += sprintf(*s + *len, "/>"); //!!!!!!!!!!!!!!
- else
- {
- *len += sprintf(*s + *len, ">"); //!!!!!!!!!!!!!!
-
- *s = (xml->child) ? ezxml_toxml_r(xml->child, s, len, max, 0, attr) //child
- : ezxml_ampencode(xml->txt, SIZE_MAX, s, len, max, 0); //data
-
- while (*len + strlen(xml->name) + 4 > *max) // reallocate s
- *s = realloc(*s, *max += EZXML_BUFSIZE);
-
- *len += sprintf(*s + *len, "</%s>", xml->name); // close tag //!!!!!!!!!!!!!!
- }
-
- while (txt[off] && off < xml->off) off++; // make sure off is within bounds
- return (xml->ordered) ? ezxml_toxml_r(xml->ordered, s, len, max, off, attr)
- : ezxml_ampencode(txt + off, SIZE_MAX, s, len, max, 0);
-}
-
-// Converts an ezxml structure back to xml. Returns a string of xml data that
-// must be freed.
-char *ezxml_toxml(ezxml_t xml, int addhdr)
-{
- ezxml_t p = (xml) ? xml->parent : NULL, o = (xml) ? xml->ordered : NULL;
- ezxml_root_t root = (ezxml_root_t)xml;
- size_t len, max = EZXML_BUFSIZE;
- char *s, *t, *n;
- int i, j, k;
-
- s = strcpy(malloc(max), addhdr ? "<?xml version=\"1.0\" encoding=\"utf-8\"?>" : "");
- len = strlen(s);
-
- if (! xml || ! xml->name) return realloc(s, len + 1);
- while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag
-
- for (i = 0; ! p && root->pi[i]; i++) { // pre-root processing instructions
- for (k = 2; root->pi[i][k - 1]; k++);
- for (j = 1; (n = root->pi[i][j]); j++) {
- if (root->pi[i][k][j - 1] == '>') continue; // not pre-root
- while (len + strlen(t = root->pi[i][0]) + strlen(n) + 7 > max)
- s = realloc(s, max += EZXML_BUFSIZE);
- len += sprintf(s + len, "<?%s%s%s?>\n", t, *n ? " " : "", n); //!!!!!!!!!!!!!!
- }
- }
-
- xml->parent = xml->ordered = NULL;
- s = ezxml_toxml_r(xml, &s, &len, &max, 0, root->attr);
- xml->parent = p;
- xml->ordered = o;
-
- for (i = 0; ! p && root->pi[i]; i++) { // post-root processing instructions
- for (k = 2; root->pi[i][k - 1]; k++);
- for (j = 1; (n = root->pi[i][j]); j++) {
- if (root->pi[i][k][j - 1] == '<') continue; // not post-root
- while (len + strlen(t = root->pi[i][0]) + strlen(n) + 7 > max)
- s = realloc(s, max += EZXML_BUFSIZE);
- len += sprintf(s + len, "\n<?%s%s%s?>", t, *n ? " " : "", n); //!!!!!!!!!!!!!!
- }
- }
- return realloc(s, len + 1);
-}
-
-// free the memory allocated for the ezxml structure
-void ezxml_free(ezxml_t xml)
-{
- ezxml_root_t root = (ezxml_root_t)xml;
- int i, j;
- char **a, *s;
-
- if (! xml) return;
- ezxml_free(xml->child);
- ezxml_free(xml->ordered);
-
- if (! xml->parent) { // free root tag allocations
- for (i = 10; root->ent[i]; i += 2) // 0 - 9 are default entites (<>&"')
- if ((s = root->ent[i + 1]) < root->s || s > root->e) free(s);
- free(root->ent); // free list of general entities
-
- for (i = 0; (a = root->attr[i]); i++) {
- for (j = 1; a[j++]; j += 2) // free malloced attribute values
- if (a[j] && (a[j] < root->s || a[j] > root->e)) free(a[j]);
- free(a);
- }
- if (root->attr[0]) free(root->attr); // free default attribute list
-
- for (i = 0; root->pi[i]; i++) {
- for (j = 1; root->pi[i][j]; j++);
- free(root->pi[i][j + 1]);
- free(root->pi[i]);
- }
- if (root->pi[0]) free(root->pi); // free processing instructions
-
- if (root->len == SIZE_MAX) free(root->m); // malloced xml data
- if (root->u) free(root->u); // utf8 conversion
- }
-
- ezxml_free_attr(xml->attr); // tag attributes
- if ((xml->flags & EZXML_TXTM)) free(xml->txt); // character content
- if ((xml->flags & EZXML_NAMEM)) free(xml->name); // tag name
- free(xml);
-}
-
-// return parser error message or empty string if none
-const char *ezxml_error(ezxml_t xml)
-{
- while (xml && xml->parent) xml = xml->parent; // find root tag
- return (xml) ? ((ezxml_root_t)xml)->err : "";
-}
-
-// returns a new empty ezxml structure with the given root tag name
-ezxml_t ezxml_new(const char *name)
-{
- static char *ent[] = { "lt;", "&#60;", "gt;", "&#62;", "quot;", "&#34;",
- "apos;", "&#39;", "amp;", "&#38;", NULL };
- ezxml_root_t root = (ezxml_root_t)memset(malloc(sizeof(struct ezxml_root)),
- '\0', sizeof(struct ezxml_root));
- root->xml.name = (char *)name;
- root->cur = &root->xml;
- strcpy(root->err, root->xml.txt = "");
- root->ent = memcpy(malloc(sizeof(ent)), ent, sizeof(ent));
- root->attr = root->pi = (char ***)(root->xml.attr = EZXML_NIL);
- return &root->xml;
-}
-
-// inserts an existing tag into an ezxml structure
-ezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off)
-{
- ezxml_t cur, prev, head;
-
- xml->next = xml->sibling = xml->ordered = NULL;
- xml->off = off;
- xml->parent = dest;
-
- if ((head = dest->child)) { // already have sub tags
- if (head->off <= off) { // not first subtag
- for (cur = head; cur->ordered && cur->ordered->off <= off;
- cur = cur->ordered);
- xml->ordered = cur->ordered;
- cur->ordered = xml;
- }
- else { // first subtag
- xml->ordered = head;
- dest->child = xml;
- }
-
- for (cur = head, prev = NULL; cur && strcmp(cur->name, xml->name);
- prev = cur, cur = cur->sibling); // find tag type
- if (cur && cur->off <= off) { // not first of type
- while (cur->next && cur->next->off <= off) cur = cur->next;
- xml->next = cur->next;
- cur->next = xml;
- }
- else { // first tag of this type
- if (prev && cur) prev->sibling = cur->sibling; // remove old first
- xml->next = cur; // old first tag is now next
- for (cur = head, prev = NULL; cur && cur->off <= off;
- prev = cur, cur = cur->sibling); // new sibling insert point
- xml->sibling = cur;
- if (prev) prev->sibling = xml;
- }
- }
- else dest->child = xml; // only sub tag
-
- return xml;
-}
-
-// Adds a child tag. off is the offset of the child tag relative to the start
-// of the parent tag's character content. Returns the child tag.
-ezxml_t ezxml_add_child(ezxml_t xml, const char *name, size_t off)
-{
- ezxml_t child;
-
- if (! xml) return NULL;
- child = (ezxml_t)memset(malloc(sizeof(struct ezxml)), '\0',
- sizeof(struct ezxml));
- child->name = (char *)name;
- child->attr = EZXML_NIL;
- child->txt = "";
-
- return ezxml_insert(child, xml, off);
-}
-
-// sets the character content for the given tag and returns the tag
-ezxml_t ezxml_set_txt(ezxml_t xml, const char *txt)
-{
- if (! xml) return NULL;
- if (xml->flags & EZXML_TXTM) free(xml->txt); // existing txt was malloced
- xml->flags &= ~EZXML_TXTM;
- xml->txt = (char *)txt;
- return xml;
-}
-
-// Sets the given tag attribute or adds a new attribute if not found. A value
-// of NULL will remove the specified attribute. Returns the tag given.
-ezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value)
-{
- int l = 0, c;
-
- if (! xml) return NULL;
- while (xml->attr[l] && strcmp(xml->attr[l], name)) l += 2;
- if (! xml->attr[l]) { // not found, add as new attribute
- if (! value) return xml; // nothing to do
- if (xml->attr == EZXML_NIL) { // first attribute
- xml->attr = malloc(4 * sizeof(char *));
- xml->attr[1] = _strdup(""); // empty list of malloced names/vals
- }
- else xml->attr = realloc(xml->attr, (l + 4) * sizeof(char *));
-
- xml->attr[l] = (char *)name; // set attribute name
- xml->attr[l + 2] = NULL; // null terminate attribute list
- xml->attr[l + 3] = realloc(xml->attr[l + 1],
- (c = (int)strlen(xml->attr[l + 1])) + 2);
- strcpy(xml->attr[l + 3] + c, " "); // set name/value as not malloced
- if (xml->flags & EZXML_DUP) xml->attr[l + 3][c] = (unsigned char)EZXML_NAMEM;
- }
- else if (xml->flags & EZXML_DUP) free((char *)name); // name was strduped
-
- for (c = l; xml->attr[c]; c += 2); // find end of attribute list
- if (xml->attr[c + 1][l / 2] & EZXML_TXTM) free(xml->attr[l + 1]); //old val
- if (xml->flags & EZXML_DUP) xml->attr[c + 1][l / 2] |= EZXML_TXTM;
- else xml->attr[c + 1][l / 2] &= ~EZXML_TXTM;
-
- if (value) xml->attr[l + 1] = (char *)value; // set attribute value
- else { // remove attribute
- if (xml->attr[c + 1][l / 2] & EZXML_NAMEM) free(xml->attr[l]);
- memmove(xml->attr + l, xml->attr + l + 2, (c - l + 2) * sizeof(char*));
- xml->attr = realloc(xml->attr, (c + 2) * sizeof(char *));
- memmove(xml->attr[c + 1] + (l / 2), xml->attr[c + 1] + (l / 2) + 1,
- (c / 2) - (l / 2)); // fix list of which name/vals are malloced
- }
- xml->flags &= ~EZXML_DUP; // clear strdup() flag
- return xml;
-}
-
-// sets a flag for the given tag and returns the tag
-ezxml_t ezxml_set_flag(ezxml_t xml, short flag)
-{
- if (xml) xml->flags |= flag;
- return xml;
-}
-
-// removes a tag along with its subtags without freeing its memory
-ezxml_t ezxml_cut(ezxml_t xml)
-{
- ezxml_t cur;
-
- if (! xml) return NULL; // nothing to do
- if (xml->next) xml->next->sibling = xml->sibling; // patch sibling list
-
- if (xml->parent) { // not root tag
- cur = xml->parent->child; // find head of subtag list
- if (cur == xml) xml->parent->child = xml->ordered; // first subtag
- else { // not first subtag
- while (cur->ordered != xml) cur = cur->ordered;
- cur->ordered = cur->ordered->ordered; // patch ordered list
-
- cur = xml->parent->child; // go back to head of subtag list
- if (strcmp(cur->name, xml->name)) { // not in first sibling list
- while (strcmp(cur->sibling->name, xml->name))
- cur = cur->sibling;
- if (cur->sibling == xml) { // first of a sibling list
- cur->sibling = (xml->next) ? xml->next
- : cur->sibling->sibling;
- }
- else cur = cur->sibling; // not first of a sibling list
- }
-
- while (cur->next && cur->next != xml) cur = cur->next;
- if (cur->next) cur->next = cur->next->next; // patch next list
- }
- }
- xml->ordered = xml->sibling = xml->next = NULL;
- return xml;
-}
diff --git a/protocols/MSN/src/ezxml.h b/protocols/MSN/src/ezxml.h
deleted file mode 100644
index 37a0385541..0000000000
--- a/protocols/MSN/src/ezxml.h
+++ /dev/null
@@ -1,165 +0,0 @@
-/* ezxml.h
- *
- * Copyright 2004-2006 Aaron Voisine <aaron@voisine.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _EZXML_H
-#define _EZXML_H
-
-#include <stdio.h>
-#include <stdarg.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define EZXML_BUFSIZE 1024 // size of internal memory buffers
-#define EZXML_NAMEM 0x80 // name is malloced
-#define EZXML_TXTM 0x40 // txt is malloced
-#define EZXML_DUP 0x20 // attribute name and value are strduped
-
-typedef struct ezxml *ezxml_t;
-struct ezxml {
- char *name; // tag name
- char **attr; // tag attributes { name, value, name, value, ... NULL }
- char *txt; // tag character content, empty string if none
- size_t off; // tag offset from start of parent tag character content
- ezxml_t next; // next tag with same name in this section at this depth
- ezxml_t sibling; // next tag with different name in same section and depth
- ezxml_t ordered; // next tag, same section and depth, in original order
- ezxml_t child; // head of sub tag list, NULL if none
- ezxml_t parent; // parent tag, NULL if current tag is root tag
- short flags; // additional information
-};
-
-// Given a string of xml data and its length, parses it and creates an ezxml
-// structure. For efficiency, modifies the data by adding null terminators
-// and decoding ampersand sequences. If you don't want this, copy the data and
-// pass in the copy. Returns NULL on failure.
-ezxml_t ezxml_parse_str(char *s, size_t len);
-
-// A wrapper for ezxml_parse_str() that accepts a file descriptor. First
-// attempts to mem map the file. Failing that, reads the file into memory.
-// Returns NULL on failure.
-ezxml_t ezxml_parse_fd(int fd);
-
-// a wrapper for ezxml_parse_fd() that accepts a file name
-ezxml_t ezxml_parse_file(const char *file);
-
-// Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire
-// stream into memory and then parses it. For xml files, use ezxml_parse_file()
-// or ezxml_parse_fd()
-ezxml_t ezxml_parse_fp(FILE *fp);
-
-// returns the first child tag (one level deeper) with the given name or NULL
-// if not found
-ezxml_t ezxml_child(ezxml_t xml, const char *name);
-
-// returns the next tag of the same name in the same section and depth or NULL
-// if not found
-#define ezxml_next(xml) ((xml) ? xml->next : NULL)
-
-// Returns the Nth tag with the same name in the same section at the same depth
-// or NULL if not found. An index of 0 returns the tag given.
-ezxml_t ezxml_idx(ezxml_t xml, int idx);
-
-// returns the name of the given tag
-#define ezxml_name(xml) ((xml) ? xml->name : NULL)
-
-// returns the given tag's character content or empty string if none
-#define ezxml_txt(xml) ((xml) ? xml->txt : "")
-
-// returns the value of the requested tag attribute, or NULL if not found
-const char *ezxml_attr(ezxml_t xml, const char *attr);
-
-// Traverses the ezxml sturcture to retrieve a specific subtag. Takes a
-// variable length list of tag names and indexes. The argument list must be
-// terminated by either an index of -1 or an empty string tag name. Example:
-// title = ezxml_get(library, "shelf", 0, "book", 2, "title", -1);
-// This retrieves the title of the 3rd book on the 1st shelf of library.
-// Returns NULL if not found.
-ezxml_t ezxml_get(ezxml_t xml, ...);
-
-// Converts an ezxml structure back to xml. Returns a string of xml data that
-// must be freed.
-char *ezxml_toxml(ezxml_t xml, int addhdr);
-
-// returns a NULL terminated array of processing instructions for the given
-// target
-const char **ezxml_pi(ezxml_t xml, const char *target);
-
-// frees the memory allocated for an ezxml structure
-void ezxml_free(ezxml_t xml);
-
-// returns parser error message or empty string if none
-const char *ezxml_error(ezxml_t xml);
-
-// returns a new empty ezxml structure with the given root tag name
-ezxml_t ezxml_new(const char *name);
-
-// wrapper for ezxml_new() that strdup()s name
-#define ezxml_new_d(name) ezxml_set_flag(ezxml_new(strdup(name)), EZXML_NAMEM)
-
-// Adds a child tag. off is the offset of the child tag relative to the start
-// of the parent tag's character content. Returns the child tag.
-ezxml_t ezxml_add_child(ezxml_t xml, const char *name, size_t off);
-
-// wrapper for ezxml_add_child() that strdup()s name
-#define ezxml_add_child_d(xml, name, off) \
- ezxml_set_flag(ezxml_add_child(xml, strdup(name), off), EZXML_NAMEM)
-
-// sets the character content for the given tag and returns the tag
-ezxml_t ezxml_set_txt(ezxml_t xml, const char *txt);
-
-// wrapper for ezxml_set_txt() that strdup()s txt
-#define ezxml_set_txt_d(xml, txt) \
- ezxml_set_flag(ezxml_set_txt(xml, strdup(txt)), EZXML_TXTM)
-
-// Sets the given tag attribute or adds a new attribute if not found. A value
-// of NULL will remove the specified attribute. Returns the tag given.
-ezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value);
-
-// Wrapper for ezxml_set_attr() that strdup()s name/value. Value cannot be NULL
-#define ezxml_set_attr_d(xml, name, value) \
- ezxml_set_attr(ezxml_set_flag(xml, EZXML_DUP), strdup(name), strdup(value))
-
-// sets a flag for the given tag and returns the tag
-ezxml_t ezxml_set_flag(ezxml_t xml, short flag);
-
-// removes a tag along with its subtags without freeing its memory
-ezxml_t ezxml_cut(ezxml_t xml);
-
-// inserts an existing tag into an ezxml structure
-ezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off);
-
-// Moves an existing tag to become a subtag of dest at the given offset from
-// the start of dest's character content. Returns the moved tag.
-#define ezxml_move(xml, dest, off) ezxml_insert(ezxml_cut(xml), dest, off)
-
-// removes a tag along with all its subtags
-#define ezxml_remove(xml) ezxml_free(ezxml_cut(xml))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _EZXML_H
diff --git a/protocols/MSN/src/msn.cpp b/protocols/MSN/src/msn.cpp
deleted file mode 100644
index c2f3a306b0..0000000000
--- a/protocols/MSN/src/msn.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-#include "version.h"
-
-CMPlugin g_plugin;
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Global variables
-
-bool g_bTerminated = false;
-int avsPresent = -1;
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static const PLUGININFOEX pluginInfoEx =
-{
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
- __DESCRIPTION,
- __AUTHOR,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- // {97724AF9-F3FB-47d3-A3BF-EAA935C74E6D}
- {0x97724af9, 0xf3fb, 0x47d3, {0xa3, 0xbf, 0xea, 0xa9, 0x35, 0xc7, 0x4e, 0x6d}}
-};
-
-CMPlugin::CMPlugin() :
- ACCPROTOPLUGIN<CMsnProto>("MSN", pluginInfoEx)
-{
- ::DisableThreadLibraryCalls(m_hInst);
- SetUniqueId("wlid");
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MirandaInterfaces - returns the protocol interface to the core
-
-extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// OnModulesLoaded - finalizes plugin's configuration on load
-
-static int OnModulesLoaded(WPARAM, LPARAM)
-{
- avsPresent = ServiceExists(MS_AV_SETMYAVATARW) != 0;
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Performs a primary set of actions upon plugin loading
-
-int CMPlugin::Load()
-{
- HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
-
- MsnInitIcons();
- MSN_InitContactMenu();
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Unload a plugin
-
-int CMPlugin::Unload()
-{
- MSN_RemoveContactMenus();
- return 0;
-}
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp
deleted file mode 100644
index edfd81452f..0000000000
--- a/protocols/MSN/src/msn_auth.cpp
+++ /dev/null
@@ -1,1233 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2007-2012 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include <WinInet.h>
-#include "msn_proto.h"
-#include "msn_ieembed.h"
-
-#include <openssl\des.h>
-
-extern "C"
-{
- #include "skylogin/skylogin.h"
-};
-
-#define LOGIN_POST_PARAMS "client_id=00000000480BC46C&scope=service%3A%3Askype.com%3A%3AMBI_SSL&response_type=token&redirect_uri=https%3A%2F%2Flogin.live.com%2Foauth20_desktop.srf"
-#define AUTH_URL "https://login.live.com/oauth20_authorize.srf?"LOGIN_POST_PARAMS
-#define POST_URL "https://login.live.com/ppsecure/post.srf?"LOGIN_POST_PARAMS
-
-
-/* WinINET delayloading */
-typedef BOOL (*pfnInternetGetCookieExA)(LPCSTR, LPCSTR, LPSTR, LPDWORD, DWORD, LPVOID);
-pfnInternetGetCookieExA fpInternetGetCookieExA = nullptr;
-
-#define LOAD_FN(name) (##name = (pfn##name)GetProcAddress(hLibSkylogin, #name))
-
-static const char defaultPassportUrl[] = "https://login.live.com/RST2.srf";
-
-static const char authPacket[] =
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
-"<s:Envelope"
- " xmlns:s=\"http://www.w3.org/2003/05/soap-envelope\""
- " xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\""
- " xmlns:saml=\"urn:oasis:names:tc:SAML:1.0:assertion\""
- " xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\""
- " xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\""
- " xmlns:wsa=\"http://www.w3.org/2005/08/addressing\""
- " xmlns:wssc=\"http://schemas.xmlsoap.org/ws/2005/02/sc\""
- " xmlns:wst=\"http://schemas.xmlsoap.org/ws/2005/02/trust\">"
- "<s:Header>"
- "<wsa:Action s:mustUnderstand=\"1\">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</wsa:Action>"
- "<wsa:To s:mustUnderstand=\"1\">HTTPS://login.live.com:443//RST2.srf</wsa:To>"
- "<wsa:MessageID>%u</wsa:MessageID>"
- "<ps:AuthInfo xmlns:ps=\"http://schemas.microsoft.com/Passport/SoapServices/PPCRL\" Id=\"PPAuthInfo\">"
- "<ps:HostingApp>{7108E71A-9926-4FCB-BCC9-9A9D3F32E423}</ps:HostingApp>"
- "<ps:BinaryVersion>5</ps:BinaryVersion>"
- "<ps:UIVersion>1</ps:UIVersion>"
- "<ps:Cookies />"
- "<ps:RequestParams>AQAAAAIAAABsYwQAAAAxMDMz</ps:RequestParams>"
- "</ps:AuthInfo>"
- "<wsse:Security>"
- "<wsse:UsernameToken wsu:Id=\"user\">"
- "<wsse:Username>%s</wsse:Username>"
- "<wsse:Password>%s</wsse:Password>"
- "</wsse:UsernameToken>"
- "<wsu:Timestamp Id=\"Timestamp\">"
- "<wsu:Created>%S</wsu:Created>"
- "<wsu:Expires>%S</wsu:Expires>"
- "</wsu:Timestamp>"
- "</wsse:Security>"
- "</s:Header>"
- "<s:Body>"
- "<ps:RequestMultipleSecurityTokens xmlns:ps=\"http://schemas.microsoft.com/Passport/SoapServices/PPCRL\" Id=\"RSTS\">"
- "<wst:RequestSecurityToken Id=\"RST0\">"
- "<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>"
- "<wsp:AppliesTo>"
- "<wsa:EndpointReference>"
- "<wsa:Address>http://Passport.NET/tb</wsa:Address>"
- "</wsa:EndpointReference>"
- "</wsp:AppliesTo>"
- "</wst:RequestSecurityToken>"
- "<wst:RequestSecurityToken Id=\"RST1\">"
- "<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>"
- "<wsp:AppliesTo>"
- "<wsa:EndpointReference>"
- "<wsa:Address>chatservice.live.com</wsa:Address>"
- "</wsa:EndpointReference>"
- "</wsp:AppliesTo>"
- "<wsp:PolicyReference URI=\"MBI_SSL\" />"
- "</wst:RequestSecurityToken>"
- "<wst:RequestSecurityToken Id=\"RST2\">"
- "<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>"
- "<wsp:AppliesTo>"
- "<wsa:EndpointReference>"
- "<wsa:Address>messenger.msn.com</wsa:Address>"
- "</wsa:EndpointReference>"
- "</wsp:AppliesTo>"
- "<wsp:PolicyReference URI=\"?id=507\" />"
- "</wst:RequestSecurityToken>"
- "<wst:RequestSecurityToken Id=\"RST3\">"
- "<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>"
- "<wsp:AppliesTo>"
- "<wsa:EndpointReference>"
- "<wsa:Address>messengersecure.live.com</wsa:Address>"
- "</wsa:EndpointReference>"
- "</wsp:AppliesTo>"
- "<wsp:PolicyReference URI=\"MBI_SSL\" />"
- "</wst:RequestSecurityToken>"
- "<wst:RequestSecurityToken Id=\"RST4\">"
- "<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>"
- "<wsp:AppliesTo>"
- "<wsa:EndpointReference>"
- "<wsa:Address>contacts.msn.com</wsa:Address>"
- "</wsa:EndpointReference>"
- "</wsp:AppliesTo>"
- "<wsp:PolicyReference URI=\"MBI\" />"
- "</wst:RequestSecurityToken>"
- "<wst:RequestSecurityToken Id=\"RST5\">"
- "<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>"
- "<wsp:AppliesTo>"
- "<wsa:EndpointReference>"
- "<wsa:Address>storage.msn.com</wsa:Address>"
- "</wsa:EndpointReference>"
- "</wsp:AppliesTo>"
- "<wsp:PolicyReference URI=\"MBI\" />"
- "</wst:RequestSecurityToken>"
- "<wst:RequestSecurityToken Id=\"RST6\">"
- "<wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Issue</wst:RequestType>"
- "<wsp:AppliesTo>"
- "<wsa:EndpointReference>"
- "<wsa:Address>sup.live.com</wsa:Address>"
- "</wsa:EndpointReference>"
- "</wsp:AppliesTo>"
- "<wsp:PolicyReference URI=\"MBI\" />"
- "</wst:RequestSecurityToken>"
- "</ps:RequestMultipleSecurityTokens>"
- "</s:Body>"
-"</s:Envelope>";
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Tokens, tokens, tokens.....
-GenericToken::GenericToken(const char *pszTokenName) :
- m_pszTokenName(pszTokenName),
- m_pszToken(nullptr),
- m_tExpires(0),
- m_proto(nullptr)
-{
-}
-
-GenericToken::~GenericToken()
-{
- mir_free(m_pszToken);
-}
-
-bool GenericToken::Load()
-{
- DBVARIANT dbv;
- char szTokenName[64];
-
- mir_snprintf(szTokenName, sizeof(szTokenName), "%sToken", m_pszTokenName);
- if (m_proto->getString(szTokenName, &dbv) == 0) {
- replaceStr(m_pszToken, dbv.pszVal);
- db_free(&dbv);
-
- mir_snprintf(szTokenName, sizeof(szTokenName), "%sExpiretime", m_pszTokenName);
- m_tExpires = m_proto->getDword(szTokenName, 0);
-
- return true;
- }
- return false;
-}
-
-void GenericToken::Save()
-{
- char szTokenName[64];
-
- mir_snprintf(szTokenName, sizeof(szTokenName), "%sToken", m_pszTokenName);
- m_proto->setString(szTokenName, m_pszToken);
- mir_snprintf(szTokenName, sizeof(szTokenName), "%sExpiretime", m_pszTokenName);
- m_proto->setDword(szTokenName, m_tExpires);
-}
-
-bool GenericToken::Expired(time_t t)
-{
- return t + 3600 >= m_tExpires;
-}
-
-void GenericToken::SetToken(const char *pszToken, time_t tExpires)
-{
- replaceStr(m_pszToken, pszToken);
- m_tExpires = tExpires;
- Save();
-}
-
-const char *GenericToken::Token()
-{
- Refresh();
- return m_pszToken;
-}
-
-void GenericToken::Clear()
-{
- char szTokenName[64];
-
- mir_free(m_pszToken);
- m_pszToken = nullptr;
- m_tExpires = 0;
- mir_snprintf(szTokenName, sizeof(szTokenName), "%sToken", m_pszTokenName);
- m_proto->delSetting(szTokenName);
- mir_snprintf(szTokenName, sizeof(szTokenName), "%sExpiretime", m_pszTokenName);
- m_proto->delSetting(szTokenName);
-}
-
-OAuthToken::OAuthToken(const char *pszTokenName, const char *pszService, bool bPrependT) :
- GenericToken(pszTokenName),
- m_pszService(pszService),
- m_bPreprendT(bPrependT)
-{
-}
-
-bool OAuthToken::Refresh(bool bForce)
-{
- if ((!bForce && !Expired()) || !m_proto->authRefreshToken)
- return false;
-
- time_t tExpires;
- CMStringA szToken, szRefreshToken;
- if (!m_proto->RefreshOAuth(m_proto->authRefreshToken, m_pszService, &szToken, &szRefreshToken, &tExpires))
- return false;
- if (m_bPreprendT)
- szToken.Insert(0, "t=");
-
- replaceStr(m_proto->authRefreshToken, szRefreshToken);
- m_proto->setString("authRefreshToken", szRefreshToken);
- SetToken(szToken, tExpires);
- return true;
-}
-
-SkypeToken::SkypeToken(const char *pszTokenName) :
- GenericToken(pszTokenName)
-{
-}
-
-bool SkypeToken::Refresh(bool bForce)
-{
- if (!bForce && !Expired())
- return false;
-
- NETLIBHTTPHEADER headers[1] = { { "User-Agent", (char*)MSN_USER_AGENT } };
-
- NETLIBHTTPREQUEST nlhr = { 0 };
- nlhr.cbSize = sizeof(nlhr);
- nlhr.requestType = REQUEST_POST;
- nlhr.flags = NLHRF_HTTP11 | NLHRF_DUMPASTEXT | NLHRF_PERSISTENT | NLHRF_REDIRECT;
- nlhr.nlc = m_proto->hHttpsConnection;
- nlhr.headersCount = _countof(headers);
- nlhr.headers = headers;
-
- CMStringA szPOST;
- if (m_proto->MyOptions.netId == NETID_SKYPE) {
- BYTE digest[16];
- char szPassword[100] = { 0 };
-
- int cbPasswd = mir_snprintf(szPassword, sizeof(szPassword), "%s\nskyper\n", m_proto->MyOptions.szEmail);
- if (db_get_static(NULL, m_proto->m_szModuleName, "Password", szPassword + cbPasswd, sizeof(szPassword) - cbPasswd - 1))
- return false;
- mir_md5_hash((BYTE*)szPassword, mir_strlen(szPassword), digest);
- mir_base64_encodebuf(digest, sizeof(digest), szPassword, sizeof(szPassword));
- nlhr.szUrl = "https://api.skype.com/login/skypetoken";
- szPOST.Format("scopes=client&clientVersion=%s&username=%s&passwordHash=%s", msnProductVer, m_proto->MyOptions.szEmail, szPassword);
- }
- else {
- // Get skype_token
- nlhr.szUrl = "https://api.skype.com/rps/skypetoken";
- szPOST.Format("scopes=client&clientVersion=%s&access_token=%s&partner=999", msnProductVer, m_proto->authSkypeComToken.Token());
- }
-
- nlhr.dataLength = szPOST.GetLength();
- nlhr.pData = szPOST.GetBuffer();
-
- m_proto->mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_proto->m_hNetlibUser, &nlhr));
- m_proto->mHttpsTS = clock();
-
- if (nlhrReply) {
- m_proto->hHttpsConnection = nlhrReply->nlc;
-
- if (nlhrReply->resultCode == 200 && nlhrReply->pData) {
- JSONROOT root(nlhrReply->pData);
- if (root) {
- CMStringA szToken((*root)["skypetoken"].as_mstring());
- if (!szToken.IsEmpty()) {
- time_t tExpires = (*root)["expiresIn"].as_int();
- if (tExpires == 0)
- tExpires = 86400;
- SetToken("skype_token " + szToken, time(0) + tExpires);
- return true;
- }
- }
- }
- }
- else m_proto->hHttpsConnection = nullptr;
- return false;
-}
-
-const char* SkypeToken::XSkypetoken()
-{
- Refresh();
- if (m_pszToken) {
- char *pszRet = strchr(m_pszToken, ' ');
- if (pszRet) return pszRet + 1;
- }
- return nullptr;
-}
-
-
-int debugLogSkyLoginA(void *Pproto, LPCSTR szFormat, ...)
-{
- CMsnProto *pProto = (CMsnProto *)Pproto;
-
- va_list args;
- va_start(args, szFormat);
- CMStringA body; body.FormatV(szFormat, args);
- va_end(args);
- pProto->debugLogA("%s", body.c_str());
- return 1;
-}
-
-// Performs the MSN Passport login via TLS
-int CMsnProto::MSN_GetPassportAuth(void)
-{
- int retVal = -1;
-
- if (!bPassportAuth && authRefreshToken) {
- // Slow authentication required by fetching multiple tokens, i.e. 2-factor auth :(
- MSN_RefreshOAuthTokens(false);
- return 0;
- }
-
- char szPassword[100];
- if (db_get_static(NULL, m_szModuleName, "Password", szPassword, sizeof(szPassword)))
- return 0;
-
- szPassword[99] = 0;
-
- time_t ts = time(0);
-
- wchar_t szTs1[64], szTs2[64];
- TimeZone_PrintTimeStamp(UTC_TIME_HANDLE, ts, L"I", szTs1, _countof(szTs1), 0);
- TimeZone_PrintTimeStamp(UTC_TIME_HANDLE, ts + 20 * 60, L"I", szTs2, _countof(szTs2), 0);
-
- CMStringA szAuthInfo(FORMAT, authPacket, int(ts), MyOptions.szEmail, ptrA(HtmlEncode(szPassword)), szTs1, szTs2);
-
- char* szPassportHost = (char*)mir_alloc(256);
- if (db_get_static(NULL, m_szModuleName, "MsnPassportHost", szPassportHost, 256))
- mir_strcpy(szPassportHost, defaultPassportUrl);
-
- bool defaultUrlAllow = mir_strcmp(szPassportHost, defaultPassportUrl) != 0;
- char *tResult = nullptr;
-
- while (retVal == -1) {
- unsigned status;
-
- tResult = getSslResult(&szPassportHost, szAuthInfo, nullptr, status);
- if (tResult == nullptr) {
- if (defaultUrlAllow) {
- mir_strcpy(szPassportHost, defaultPassportUrl);
- defaultUrlAllow = false;
- continue;
- }
- else {
- retVal = 4;
- break;
- }
- }
-
- switch (status) {
- case 200:
- const char *errurl;
- {
- errurl = nullptr;
- ezxml_t xml = ezxml_parse_str(tResult, mir_strlen(tResult));
-
- ezxml_t tokr = ezxml_get(xml, "S:Body", 0,
- "wst:RequestSecurityTokenResponseCollection", 0,
- "wst:RequestSecurityTokenResponse", -1);
-
- while (tokr != nullptr) {
- ezxml_t toks = ezxml_get(tokr, "wst:RequestedSecurityToken", 0,
- "wsse:BinarySecurityToken", -1);
-
- const char* addr = ezxml_txt(ezxml_get(tokr, "wsp:AppliesTo", 0,
- "wsa:EndpointReference", 0, "wsa:Address", -1));
-
- ezxml_t xml_expires = ezxml_get(tokr, "wst:Lifetime", 0, "wsu:Expires", -1);
- time_t expires;
- expires = xml_expires ? IsoToUnixTime(ezxml_txt(xml_expires)) : time(0) + 86400;
-
-
- if (mir_strcmp(addr, "http://Passport.NET/tb") == 0) {
- ezxml_t node = ezxml_get(tokr, "wst:RequestedSecurityToken", 0, "EncryptedData", -1);
- free(hotAuthToken);
- hotAuthToken = ezxml_toxml(node, 0);
- setString("hotAuthToken", hotAuthToken);
-
- node = ezxml_get(tokr, "wst:RequestedProofToken", 0, "wst:BinarySecret", -1);
- replaceStr(hotSecretToken, ezxml_txt(node));
- setString("hotSecretToken", hotSecretToken);
- }
- else if (mir_strcmp(addr, "chatservice.live.com") == 0) {
- ezxml_t node = ezxml_get(tokr, "wst:RequestedProofToken", 0,
- "wst:BinarySecret", -1);
- if (toks) {
- authStrToken.SetToken(ezxml_txt(toks), expires);
- replaceStr(authSecretToken, ezxml_txt(node));
- retVal = 0;
- }
- else {
- errurl = ezxml_txt(ezxml_get(tokr, "S:Fault", 0, "psf:pp", 0, "psf:flowurl", -1));
- }
- }
- else if (mir_strcmp(addr, "messenger.msn.com") == 0 && toks) {
- const char* tok = ezxml_txt(toks);
- char* ch = (char*)strchr(tok, '&');
- *ch = 0;
- replaceStr(tAuthToken, tok + 2);
- replaceStr(pAuthToken, ch + 3);
- *ch = '&';
- }
- else if (mir_strcmp(addr, "contacts.msn.com") == 0 && toks)
- authContactToken.SetToken(ezxml_txt(toks), expires);
- else if (mir_strcmp(addr, "messengersecure.live.com") == 0 && toks) {
- replaceStr(oimSendToken, ezxml_txt(toks));
- }
- else if (mir_strcmp(addr, "storage.msn.com") == 0 && toks)
- authStorageToken.SetToken(ezxml_txt(toks), expires);
-
- tokr = ezxml_next(tokr);
- }
-
- if (retVal != 0) {
- if (errurl) {
- debugLogA("Starting URL: '%s'", errurl);
- Utils_OpenUrl(errurl);
- }
-
- ezxml_t tokf = ezxml_get(xml, "S:Body", 0, "S:Fault", 0, "S:Detail", -1);
- ezxml_t tokrdr = ezxml_child(tokf, "psf:redirectUrl");
- if (tokrdr != nullptr) {
- mir_strcpy(szPassportHost, ezxml_txt(tokrdr));
- debugLogA("Redirected to '%s'", szPassportHost);
- }
- else {
- const char* szFault = ezxml_txt(ezxml_get(tokf, "psf:error", 0, "psf:value", -1));
- retVal = mir_strcmp(szFault, "0x80048821") == 0 ? 3 : (tokf ? 5 : 7);
- if (retVal != 3 && defaultUrlAllow) {
- mir_strcpy(szPassportHost, defaultPassportUrl);
- defaultUrlAllow = false;
- retVal = -1;
- }
- else if (retVal != 3 && retVal != 7) {
- char err[512];
- mir_snprintf(err, "Unknown Authentication error: %s", szFault);
- MSN_ShowError(err);
- }
- }
- }
-
- ezxml_free(xml);
- }
- break;
-
- default:
- if (defaultUrlAllow) {
- mir_strcpy(szPassportHost, defaultPassportUrl);
- defaultUrlAllow = false;
- }
- else
- retVal = 6;
- }
- mir_free(tResult);
- }
-
- if (retVal != 0) {
- if (!g_bTerminated) {
- switch (retVal) {
- case 3:
- MSN_ShowError("Your username or password is incorrect");
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_WRONGPASSWORD);
- break;
-
- case 5:
- break;
-
- default:
- MSN_ShowError("Unable to contact MS Passport servers check proxy/firewall settings");
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NOSERVER);
- break;
- }
- }
- }
- else setString("MsnPassportHost", szPassportHost);
-
- mir_free(szPassportHost);
- debugLogA("MSN_CheckRedirector exited with errorCode = %d", retVal);
- return retVal;
-}
-
-static void derive_key(BYTE* der, unsigned char* key, size_t keylen, unsigned char* data, size_t datalen)
-{
- BYTE hash1[MIR_SHA1_HASH_SIZE], hash2[MIR_SHA1_HASH_SIZE],
- hash3[MIR_SHA1_HASH_SIZE], hash4[MIR_SHA1_HASH_SIZE];
-
- const size_t buflen = MIR_SHA1_HASH_SIZE + datalen;
- BYTE* buf = (BYTE*)alloca(buflen);
-
- unsigned int len;
- HMAC(EVP_sha1(), key, (int)keylen, data, (int)datalen, hash1, &len);
- HMAC(EVP_sha1(), key, (int)keylen, hash1, MIR_SHA1_HASH_SIZE, hash3, &len);
-
- memcpy(buf, hash1, MIR_SHA1_HASH_SIZE);
- memcpy(buf + MIR_SHA1_HASH_SIZE, data, datalen);
- HMAC(EVP_sha1(), key, (int)keylen, buf, buflen, hash2, &len);
-
- memcpy(buf, hash3, MIR_SHA1_HASH_SIZE);
- memcpy(buf + MIR_SHA1_HASH_SIZE, data, datalen);
- HMAC(EVP_sha1(), key, (int)keylen, buf, buflen, hash4, &len);
-
- memcpy(der, hash2, MIR_SHA1_HASH_SIZE);
- memcpy(der + MIR_SHA1_HASH_SIZE, hash4, 4);
-}
-
-CMStringA CMsnProto::HotmailLogin(const char* url)
-{
- unsigned char nonce[24];
- Utils_GetRandom(nonce, sizeof(nonce));
-
- size_t key1len;
- mir_ptr<BYTE> key1((BYTE*)mir_base64_decode(hotSecretToken, &key1len));
-
- static const unsigned char encdata[] = "WS-SecureConversation";
- const size_t data1len = sizeof(nonce) + sizeof(encdata) - 1;
-
- unsigned char* data1 = (unsigned char*)alloca(data1len);
- memcpy(data1, encdata, sizeof(encdata) - 1);
- memcpy(data1 + sizeof(encdata) - 1, nonce, sizeof(nonce));
-
- unsigned char key2[MIR_SHA1_HASH_SIZE + 4];
- derive_key(key2, key1, key1len, data1, data1len);
-
- CMStringA result;
- result.Format("%s&da=%s&nonce=", url, mir_urlEncode(hotAuthToken).c_str());
-
- ptrA noncenc(mir_base64_encode(nonce, sizeof(nonce)));
- result.Append(mir_urlEncode(noncenc));
-
- BYTE hash[MIR_SHA1_HASH_SIZE];
- unsigned int len;
- HMAC(EVP_sha1(), key2, sizeof(key2), (BYTE*)result.GetString(), result.GetLength(), hash, &len);
- ptrA szHash(mir_base64_encode(hash, sizeof(hash)));
- result.AppendFormat("&hash=%s", mir_urlEncode(szHash).c_str());
- return result;
-}
-
-/* 1 - Login successful
- 0 - Login failed
- -1 - Loading Skylogin library failed
- -2 - Functions cannot be loaded from Skylogin library
- -3 - Initializing Skylogin library failed
- */
-int CMsnProto::MSN_SkypeAuth(const char *pszNonce, char *pszUIC)
-{
- int iRet = -1;
-
- // Perform login
- SkyLogin hLogin = SkyLogin_Init();
- if (hLogin) {
- iRet = 0;
-
- char szPassword[100];
- SkyLogin_SetLogFunction(hLogin, debugLogSkyLoginA, this);
- if (!db_get_static(NULL, m_szModuleName, "Password", szPassword, sizeof(szPassword))) {
- if (SkyLogin_LoadCredentials(hLogin, MyOptions.szEmail) ||
- SkyLogin_PerformLogin(hLogin, MyOptions.szEmail, szPassword)) {
- if (SkyLogin_CreateUICString(hLogin, pszNonce, pszUIC))
- iRet = 1;
- }
-
- SkyLogin_Exit(hLogin);
- }
- }
-
- return iRet;
-}
-
-/* 1 - Login successful
- 0 - Login failed
-*/
-
-int CMsnProto::LoginSkypeOAuth(const char *pRefreshToken)
-{
- int iRet = 0;
-
- // Perform login
- SkyLogin hLogin = SkyLogin_Init();
- if (hLogin) {
- CMStringA szLoginToken;
- SkyLogin_SetLogFunction(hLogin, debugLogSkyLoginA, this);
- if (RefreshOAuth(pRefreshToken, "service::login.skype.com::MBI_SSL", &szLoginToken, nullptr, nullptr) &&
- SkyLogin_PerformLoginOAuth(hLogin, szLoginToken)) {
- char szUIC[1024];
- if (SkyLogin_GetCredentialsUIC(hLogin, szUIC)) {
- char *pszPartner;
-
- replaceStr(authUIC, szUIC);
- iRet = 1;
- if (pszPartner = SkyLogin_GetUser(hLogin))
- setString("SkypePartner", pszPartner);
- }
- }
- else
- iRet = 0;
- SkyLogin_Exit(hLogin);
- }
-
- return iRet;
-}
-
-static int CopyCookies(NETLIBHTTPREQUEST *nlhrReply, NETLIBHTTPHEADER *hdr)
-{
- int i, nSize = 1;
- char *p;
-
- if (hdr) {
- hdr->szName = "Cookie";
- *hdr->szValue = 0;
- }
- for (i = 0; i < nlhrReply->headersCount; i++) {
- if (mir_strcmpi(nlhrReply->headers[i].szName, "Set-Cookie"))
- continue;
- if (p = strchr(nlhrReply->headers[i].szValue, ';')) *p = 0;
- if (hdr) {
- if (*hdr->szValue) mir_strcat(hdr->szValue, "; ");
- mir_strcat(hdr->szValue, nlhrReply->headers[i].szValue);
- }
- else nSize += (int)mir_strlen(nlhrReply->headers[i].szValue) + 2;
- }
- return nSize;
-}
-
-/*
- pszService:
- service::login.skype.com::MBI_SSL - For LoginSkypeOAuth
- service::ssl.live.com::MBI_SSL - For ssl-compact-ticket
- service::contacts.msn.com::MBI_SSL - Contact SOAP service -> authContactToken
- service::m.hotmail.com::MBI_SSL - ActiveSync contactlist, not used by us
- service::storage.live.com::MBI_SSL - Storage service (authStorageToken)
- service::skype.com::MBI_SSL - Root of all OAuth tokens
- service::skype.net::MBI_SSL - ?
-*/
-bool CMsnProto::RefreshOAuth(const char *pszRefreshToken, const char *pszService, CMStringA *pszAccessToken, CMStringA *pszOutRefreshToken, time_t *ptExpires)
-{
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[3];
- bool bRet = false;
- CMStringA post;
-
- if (!authCookies) return false;
-
- // initialize the netlib request
- nlhr.cbSize = sizeof(nlhr);
- nlhr.requestType = REQUEST_POST;
- nlhr.flags = NLHRF_HTTP11 | NLHRF_DUMPASTEXT | NLHRF_PERSISTENT | NLHRF_REDIRECT;
- nlhr.nlc = hHttpsConnection;
- nlhr.headersCount = 3;
- nlhr.headers = headers;
- nlhr.headers[0].szName = "User-Agent";
- nlhr.headers[0].szValue = (char*)MSN_USER_AGENT;
- nlhr.headers[1].szName = "Content-Type";
- nlhr.headers[1].szValue = "application/x-www-form-urlencoded";
- nlhr.headers[2].szName = "Cookie";
- nlhr.headers[2].szValue = authCookies;
- post.Format("client_id=00000000480BC46C&scope=%s&grant_type=refresh_token&refresh_token=%s", mir_urlEncode(pszService).c_str(), pszRefreshToken);
-
- nlhr.pData = (char*)(const char*)post;
- nlhr.dataLength = (int)mir_strlen(nlhr.pData);
- nlhr.szUrl = "https://login.live.com/oauth20_token.srf";
-
- // Query
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
- if (nlhrReply->resultCode == 200 && nlhrReply->pData) {
- JSONROOT root(nlhrReply->pData);
- if (root) {
- bRet = true;
-
- if (pszAccessToken) {
- *pszAccessToken = (*root)["access_token"].as_mstring();
- if (pszAccessToken->IsEmpty())
- bRet = false;
- }
-
- if (pszOutRefreshToken) {
- *pszOutRefreshToken = (*root)["refresh_token"].as_mstring();
- if (pszOutRefreshToken->IsEmpty())
- bRet = false;
- }
-
- if (ptExpires) {
- *ptExpires = (*root)["expires_in"].as_int();
- if (*ptExpires == 0)
- bRet = false;
- else
- *ptExpires += time(0);
- }
- }
- }
- }
- else hHttpsConnection = nullptr;
- return bRet;
-}
-
-void CMsnProto::LoadAuthTokensDB(void)
-{
- DBVARIANT dbv;
-
- authSkypeComToken.Load();
- authMethod = getDword("authMethod", 0);
- bPassportAuth = getBool("PassportAuth", true);
- if (getString("authUser", &dbv) == 0) {
- replaceStr(authUser, dbv.pszVal);
- db_free(&dbv);
- }
- authSSLToken.Load();
- authContactToken.Load();
- if (getString("authUIC", &dbv) == 0) {
- replaceStr(authUIC, dbv.pszVal);
- db_free(&dbv);
- }
- if (getString("authCookies", &dbv) == 0) {
- replaceStr(authCookies, dbv.pszVal);
- db_free(&dbv);
- }
- authStrToken.Load();
- if (getString("hotSecretToken", &dbv) == 0) {
- replaceStr(hotSecretToken, dbv.pszVal);
- db_free(&dbv);
- }
- if (getString("hotAuthToken", &dbv) == 0) {
- free(hotAuthToken);
- hotAuthToken = strdup(dbv.pszVal);
- db_free(&dbv);
- }
- authStorageToken.Load();
- if (getString("authRefreshToken", &dbv) == 0) {
- replaceStr(authRefreshToken, dbv.pszVal);
- db_free(&dbv);
- }
- authSkypeToken.Load();
-}
-
-void CMsnProto::SaveAuthTokensDB(void)
-{
- setDword("authMethod", authMethod);
- setString("authUser", authUser);
- setString("authUIC", authUIC);
- setString("authCookies", authCookies);
- setString("authRefreshToken", authRefreshToken);
-}
-
-typedef struct
-{
- /* Internal */
- IEEmbed *pEmbed;
- /* Input */
- CMsnProto *pProto;
- NETLIBHTTPREQUEST *nlhr;
- NETLIBHTTPREQUEST *nlhrReply;
- /* Output */
- char *pszURL;
- char *pszCookies;
-} IEAUTH_PARAM;
-
-LRESULT CALLBACK AuthWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
- switch (uMsg) {
- case WM_SIZE:
- {
- IEAUTH_PARAM *pAuth = (IEAUTH_PARAM*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (pAuth && pAuth->pEmbed) pAuth->pEmbed->ResizeBrowser();
- return(0);
- }
-
- case WM_CREATE:
- {
- IEAUTH_PARAM *pAuth = (IEAUTH_PARAM*)((LPCREATESTRUCT)lParam)->lpCreateParams;
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pAuth);
- pAuth->pEmbed = new IEEmbed(hwnd);
- WCHAR *pwszCookies = mir_a2u(pAuth->nlhr->headers[1].szValue);
- pAuth->pEmbed->addCookie(pwszCookies);
- pAuth->pEmbed->navigate(AUTH_URL);
- mir_free(pwszCookies);
- return(0);
- }
-
- case UM_DOCCOMPLETE:
- {
- if (!lParam) return 1;
- IEAUTH_PARAM *pAuth = (IEAUTH_PARAM*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
-
- if (wcsstr((WCHAR*)lParam, L"oauth20_authorize")) {
- char *pszDoc = pAuth->pEmbed->GetHTMLDoc();
- CMStringA post;
-
- if (pszDoc) {
- if (pAuth->pProto->parseLoginPage(pszDoc, pAuth->nlhr, &post)) {
- pAuth->pEmbed->navigate(pAuth->nlhr);
- }
- mir_free(pszDoc);
- }
- }
- else if (wcsstr((WCHAR*)lParam, L"access_token=")) {
- DWORD cbCookie = 0;
-
- pAuth->pszURL = mir_u2a((WCHAR*)lParam);
-
- /* get_cookie doesn't give us all the necessary cookies, therefore we need to use
- * InternetGetCookieExA
- */
- if (!fpInternetGetCookieExA) {
- HMODULE hMod = LoadLibrary(L"wininet.dll");
- if (hMod) fpInternetGetCookieExA = (pfnInternetGetCookieExA)GetProcAddress(hMod, "InternetGetCookieExA");
- }
- if (fpInternetGetCookieExA &&
- fpInternetGetCookieExA("https://login.live.com", nullptr, nullptr, &cbCookie, INTERNET_COOKIE_HTTPONLY, nullptr) &&
- (pAuth->pszCookies = (char*)mir_alloc(cbCookie))) {
- fpInternetGetCookieExA("https://login.live.com", nullptr, pAuth->pszCookies, &cbCookie, INTERNET_COOKIE_HTTPONLY, nullptr);
- }
- else pAuth->pszCookies = mir_u2a(pAuth->pEmbed->getCookies());
- PostMessage(hwnd, WM_CLOSE, 0, 0);
- }
- else if (wcsstr((WCHAR*)lParam, L"res=cancel") || wcsstr((WCHAR*)lParam, L"access_denied")) {
- PostMessage(hwnd, WM_CLOSE, 0, 0);
- }
- return(0);
- }
-
- case WM_CLOSE:
- DestroyWindow(hwnd);
- PostQuitMessage(0);
- break;
-
- case WM_DESTROY:
- {
- IEAUTH_PARAM *pAuth = (IEAUTH_PARAM*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (pAuth && pAuth->pEmbed) delete pAuth->pEmbed;
- return(0);
- }
-
- }
-
- return(DefWindowProc(hwnd, uMsg, wParam, lParam));
-}
-
-
-void __cdecl CMsnProto::msn_IEAuthThread(void *pParam)
-{
- HWND hWnd;
- MSG msg;
- WNDCLASSEX wc = { 0 };
- static const wchar_t *ClassName = L"SkypeLoginWindow";
-
- CoInitialize(nullptr);
-
- wc.cbSize = sizeof(WNDCLASSEX);
- wc.cbWndExtra = sizeof(void*);
- wc.hInstance = g_plugin.getInst();
- wc.lpfnWndProc = AuthWindowProc;
- wc.lpszClassName = ClassName;
- RegisterClassEx(&wc);
-
- if ((hWnd = CreateWindowEx(0, ClassName, L"MSN Login", WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, CW_USEDEFAULT, 640, 480,
- HWND_DESKTOP, nullptr, g_plugin.getInst(), pParam))) {
- ShowWindow(hWnd, SW_SHOW);
- UpdateWindow(hWnd);
-
- while (GetMessage(&msg, nullptr, 0, 0)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
-
- UnregisterClass(ClassName, g_plugin.getInst());
- CoUninitialize();
-}
-
-bool CMsnProto::parseLoginPage(char *pszHTML, NETLIBHTTPREQUEST *nlhr, CMStringA *post)
-{
- char *pPPFT, *pEnd;
-
- /* Get PPFT */
- if ((pPPFT = strstr(pszHTML, "name=\"PPFT\"")) && (pPPFT = strstr(pPPFT, "value=\"")) && (pEnd = strchr(pPPFT + 7, '"'))) {
- *pEnd = 0;
- pPPFT += 7;
-
- /* Get POST URL if available */
- if ((nlhr->szUrl = strstr(pszHTML, "urlPost:'")) && (pEnd = strchr(nlhr->szUrl + 9, '\''))) {
- *pEnd = 0;
- nlhr->szUrl += 9;
- }
- else nlhr->szUrl = POST_URL;
-
- /* Create POST data */
- char szPassword[100];
- if (db_get_static(NULL, m_szModuleName, "Password", szPassword, sizeof(szPassword)))
- return false;
- szPassword[99] = 0;
- post->Format("PPFT=%s&login=%s&passwd=%s", mir_urlEncode(pPPFT).c_str(), mir_urlEncode(MyOptions.szEmail).c_str(), mir_urlEncode(szPassword).c_str());
-
- /* Do the login and get the required tokens */
- nlhr->dataLength = post->GetLength();
- nlhr->pData = (char*)post->GetString();
- return true;
- }
- return false;
-}
-
-// -1 - Refresh failed
-// 0 - No need to refresh
-// 1 - Refresh succeeded
-int CMsnProto::MSN_RefreshOAuthTokens(bool bJustCheck)
-{
- time_t t;
- int i = authMethod == 2 ? 0 : 1, iRet;
- OAuthToken *tokens[] = { &authStrToken, &authContactToken, &authStorageToken, &authSSLToken, &authSkypeComToken };
-
- time(&t);
- if (bJustCheck) {
- for (; i < sizeof(tokens) / sizeof(tokens[0]); i++)
- if (tokens[i]->Expired(t)) return 1;
- return 0;
- }
-
- for (iRet = 0; i < sizeof(tokens) / sizeof(tokens[0]); i++) {
- if (tokens[i]->Expired())
- iRet = tokens[i]->Refresh(true) ? 1 : -1;
- }
- return iRet;
-}
-
-void CMsnProto::MSN_SendATH(ThreadData *info)
-{
- if (MyOptions.netId != NETID_SKYPE) {
- /* MSN account login */
-
- switch (authMethod) {
- case 1:
- info->sendPacketPayload("ATH", "CON\\USER",
- "<user><ssl-compact-ticket>t=%s</ssl-compact-ticket>"
- "<uic>%s</uic>"
- "<id>%s</id><alias>%s</alias></user>\r\n",
- (const char*)authSSLToken ? ptrA(HtmlEncode(authSSLToken)).get() : "",
- authUIC,
- GetMyUsername(NETID_MSN), GetMyUsername(NETID_SKYPE));
- break;
-
- case 2:
- info->sendPacketPayload("ATH", "CON\\USER",
- "<user><ssl-compact-ticket>%s</ssl-compact-ticket>"
- "<uic>%s</uic>"
- "<ssl-site-name>chatservice.live.com</ssl-site-name>"
- "</user>\r\n",
- (const char*)authStrToken ? ptrA(HtmlEncode(authStrToken)).get() : "",
- authUIC);
- break;
- }
-
- }
- else {
- info->sendPacketPayload("ATH", "CON\\USER",
- "<user><uic>%s</uic><id>%s</id></user>\r\n",
- authUIC, MyOptions.szEmail);
- }
-}
-
-// -1 - Error on login sequence
-// 0 - Login failed (invalid username?)
-// 1 - Login via Skype login server succeeded
-// 2 - Login via Skypeweb succeeded
-int CMsnProto::MSN_AuthOAuth(void)
-{
- int retVal = -1;
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[3];
-
- if (bAskingForAuth) return 0;
-
- // Is there already a valid token and we can skip this?
- if (!authSkypeComToken.Expired() && !mir_strcmp(authUser, MyOptions.szEmail)) {
- MSN_RefreshOAuthTokens(false);
- return authMethod;
- }
-
- // initialize the netlib request
- nlhr.cbSize = sizeof(nlhr);
- nlhr.requestType = REQUEST_GET;
- nlhr.flags = NLHRF_HTTP11 | NLHRF_DUMPASTEXT | NLHRF_PERSISTENT | NLHRF_REDIRECT;
- nlhr.nlc = hHttpsConnection;
- nlhr.headersCount = 1;
- nlhr.headers = headers;
- nlhr.headers[0].szName = "User-Agent";
- nlhr.headers[0].szValue = (char*)MSN_USER_AGENT;
-
- // Get oauth20 login data
- nlhr.szUrl = AUTH_URL;
- mHttpsTS = clock();
- NETLIBHTTPREQUEST *nlhrReply = Netlib_HttpTransaction(m_hNetlibUser, &nlhr);
- mHttpsTS = clock();
-
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
-
- if (nlhrReply->resultCode == 200 && nlhrReply->pData) {
- CMStringA post;
-
- /* Get POST-Data and URL */
- if (parseLoginPage(nlhrReply->pData, &nlhr, &post)) {
- /* Get Cookies */
- nlhr.headers[1].szValue = (char*)alloca(CopyCookies(nlhrReply, nullptr));
- CopyCookies(nlhrReply, &nlhr.headers[1]);
- if (*nlhr.headers[1].szValue) nlhr.headersCount++;
-
- /* Setup headers */
- nlhr.headers[nlhr.headersCount].szName = "Content-Type";
- nlhr.headers[nlhr.headersCount++].szValue = "application/x-www-form-urlencoded";
-
- /* Do the login and get the required tokens */
- nlhr.requestType = REQUEST_POST;
- nlhr.flags &= (~NLHRF_REDIRECT);
- mHttpsTS = clock();
- nlhr.nlc = hHttpsConnection;
- NETLIBHTTPREQUEST *nlhrReply2 = Netlib_HttpTransaction(m_hNetlibUser, &nlhr);
- mHttpsTS = clock();
- if (nlhrReply2) {
- char *pszURL = nullptr, *pAccessToken, *pEnd;
-
- hHttpsConnection = nlhrReply2->nlc;
- bPassportAuth = true;
-
- if (nlhrReply2->resultCode == 302) {
- /* Extract access_token from Location can be found */
- pszURL = Netlib_GetHeader(nlhrReply2, "Location");
- }
- else {
- /* There may be a problem with login, i.e. M$ security measures. Open up browser
- * window in order to let user login there. May also be used for 2-factor auth */
- if (nlhrReply2->resultCode == 200 && nlhrReply2->pData) {
- UINT uThreadId;
- IEAUTH_PARAM param = { nullptr, this, &nlhr, nlhrReply2, nullptr, nullptr };
-
- bAskingForAuth = true;
- WaitForSingleObject(ForkThreadEx(&CMsnProto::msn_IEAuthThread, &param, &uThreadId), INFINITE);
- pszURL = param.pszURL;
- mir_free(authCookies);
- authCookies = nlhr.headers[1].szValue = param.pszCookies;
- Netlib_FreeHttpRequest(nlhrReply2);
- nlhrReply2 = nullptr;
- bAskingForAuth = false;
- bPassportAuth = false;
- }
- }
- setByte("PassportAuth", bPassportAuth);
- Netlib_FreeHttpRequest(nlhrReply);
- nlhrReply = nlhrReply2;
-
- if (pszURL &&
- (pAccessToken = strstr(pszURL, "access_token=")) &&
- (pEnd = strchr(pAccessToken + 13, '&'))) {
- char *pRefreshToken, *pExpires;
- bool bLogin = false;
-
- pRefreshToken = strstr(pszURL, "refresh_token=");
- pExpires = strstr(pszURL, "expires_in=");
-
- *pEnd = 0;
- pAccessToken += 13;
-
- /* Extract refresh token */
- if (pRefreshToken && (pEnd = strchr(pRefreshToken + 14, '&'))) {
- *pEnd = 0;
- pRefreshToken += 14;
- }
- replaceStr(authRefreshToken, pRefreshToken);
-
- /* Extract expire time */
- time_t authTokenExpiretime;
- time(&authTokenExpiretime);
- if (pExpires && (pEnd = strchr(pExpires + 11, '&'))) {
- *pEnd = 0;
- pExpires += 11;
- authTokenExpiretime += atoi(pExpires);
- }
- else authTokenExpiretime += 86400;
- authSkypeComToken.SetToken(mir_urlDecode(pAccessToken), authTokenExpiretime);
-
- /* Copy auth Cookies to class for other web requests like contact list fetching to avoid ActiveSync */
- if (nlhrReply) {
- mir_free(authCookies);
- authCookies = nlhr.headers[1].szValue = (char*)mir_alloc(CopyCookies(nlhrReply, nullptr));
- CopyCookies(nlhrReply, &nlhr.headers[1]);
- }
-
- int loginRet;
- /* Do Login via Skype login server, if not possible switch to SkypeWebExperience login */
- if ((loginRet = LoginSkypeOAuth(pRefreshToken)) < 1) {
- retVal = 0;
- }
- else {
- /* SkyLogin succeeded, request required tokens */
- if (authSSLToken.Refresh(true)) {
- replaceStr(authUser, MyOptions.szEmail);
- authMethod = retVal = 1;
- }
- }
- authSkypeToken.Clear();
-
-
- /* If you need Skypewebexperience login, as i.e. skylogin.dll is not available, we do this here */
- if (bLogin) {
- /* Prepare headers*/
- nlhr.headers[2].szValue = "application/json";
- nlhr.pData = "{\"trouterurl\":\"https://\",\"connectionid\":\"a\"}";
- nlhr.dataLength = (int)mir_strlen(nlhr.pData);
- nlhr.szUrl = "https://skypewebexperience.live.com/v1/User/Initialization";
- nlhr.nlc = hHttpsConnection;
-
- /* Request MappingContainer */
- mHttpsTS = clock();
- if (nlhrReply)
- Netlib_FreeHttpRequest(nlhrReply);
- nlhrReply = Netlib_HttpTransaction(m_hNetlibUser, &nlhr);
- mHttpsTS = clock();
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
-
- if (nlhrReply->resultCode == 200 && nlhrReply->pData) {
- /* Parse JSON stuff for MappingContainer */
- char *pMappingContainer;
-
- if ((pMappingContainer = strstr(nlhrReply->pData, "\"MappingContainer\":\"")) &&
- (pEnd = strchr(pMappingContainer + 20, '"'))) {
- *pEnd = 0;
- pMappingContainer += 20;
-
- replaceStr(authUIC, mir_urlDecode(pMappingContainer));
- replaceStr(authUser, MyOptions.szEmail);
- authMethod = retVal = 2;
- }
- else retVal = 0;
- }
- else retVal = 0;
- }
- else hHttpsConnection = nullptr;
- }
- }
- }
- else hHttpsConnection = nullptr;
- }
- }
- if (nlhrReply)
- Netlib_FreeHttpRequest(nlhrReply);
- }
- else hHttpsConnection = nullptr;
-
- if (retVal <= 0) authSkypeComToken.Clear(); else {
- if (bPassportAuth) {
- // Fast authentication with just 1 SOAP call supported :)
- MSN_GetPassportAuth();
- }
- else {
- // Slow authentication required by fetching multiple tokens, i.e. 2-factor auth :(
- if (authMethod == 2) authStrToken.Refresh();
- authContactToken.Refresh();
- authStorageToken.Refresh();
- }
- SaveAuthTokensDB();
- }
- return retVal;
-}
-
-int CMsnProto::GetMyNetID(void)
-{
- return strchr(MyOptions.szEmail, '@') ? NETID_MSN : NETID_SKYPE;
-}
-
-const char *CMsnProto::GetMyUsername(int netId)
-{
- static char szPartner[128];
-
- if (netId == NETID_SKYPE) {
- if (MyOptions.netId == NETID_MSN) {
- if (db_get_static(NULL, m_szModuleName, "SkypePartner", szPartner, sizeof(szPartner)) == 0)
- return szPartner;
- }
- }
- return MyOptions.szEmail;
-}
-
-void CMsnProto::FreeAuthTokens(void)
-{
- mir_free(pAuthToken);
- mir_free(tAuthToken);
- mir_free(oimSendToken);
- mir_free(authSecretToken);
- mir_free(hotSecretToken);
- mir_free(authUIC);
- mir_free(authCookies);
- mir_free(authUser);
- mir_free(authRefreshToken);
- free(hotAuthToken);
-}
diff --git a/protocols/MSN/src/msn_avatar.cpp b/protocols/MSN/src/msn_avatar.cpp
deleted file mode 100644
index 29cf96add0..0000000000
--- a/protocols/MSN/src/msn_avatar.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
-Plugin for Miranda NG for communicating with users of the MSN Messenger protocol.
-
-Copyright (C) 2012-20 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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-void CMsnProto::AvatarQueue_Init()
-{
- hevAvatarQueue = ::CreateSemaphore(nullptr, 0, 255, nullptr);
-
- ForkThread(&CMsnProto::MSN_AvatarsThread, nullptr);
-}
-
-void CMsnProto::AvatarQueue_Uninit()
-{
- ::CloseHandle(hevAvatarQueue);
-}
-
-void CMsnProto::pushAvatarRequest(MCONTACT hContact, LPCSTR pszUrl)
-{
- ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, nullptr);
-
- if (pszUrl != nullptr && *pszUrl != 0) {
- mir_cslock lck(csAvatarQueue);
-
- for (auto &it : lsAvatarQueue)
- if (it->hContact == hContact)
- return;
-
- lsAvatarQueue.insert(new AvatarQueueEntry(hContact, pszUrl));
- ReleaseSemaphore(hevAvatarQueue, 1, nullptr);
- }
-}
-
-bool CMsnProto::loadHttpAvatar(AvatarQueueEntry *p)
-{
- NETLIBHTTPHEADER nlbhHeaders[1];
- nlbhHeaders[0].szName = "User-Agent";
- nlbhHeaders[0].szValue = (char*)MSN_USER_AGENT;
-
- NETLIBHTTPREQUEST nlhr = { sizeof(nlhr) };
- nlhr.requestType = REQUEST_GET;
- nlhr.flags = NLHRF_HTTP11 | NLHRF_REDIRECT;
- nlhr.szUrl = p->pszUrl;
- nlhr.headers = (NETLIBHTTPHEADER*)&nlbhHeaders;
- nlhr.headersCount = 1;
-
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- if (nlhrReply == nullptr)
- return false;
-
- if (nlhrReply->resultCode != 200 || nlhrReply->dataLength == 0)
- return false;
-
- const wchar_t *szExt;
- int fmt = ProtoGetBufferFormat(nlhrReply->pData, &szExt);
- if (fmt == PA_FORMAT_UNKNOWN)
- return false;
-
- PROTO_AVATAR_INFORMATION ai = { 0 };
- ai.format = fmt;
- ai.hContact = p->hContact;
- MSN_GetAvatarFileName(ai.hContact, ai.filename, _countof(ai.filename), szExt);
- _wremove(ai.filename);
-
- int fileId = _wopen(ai.filename, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
- if (fileId == -1)
- return false;
-
- _write(fileId, nlhrReply->pData, (unsigned)nlhrReply->dataLength);
- _close(fileId);
-
- ProtoBroadcastAck(p->hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &ai);
- return true;
-}
-
-void __cdecl CMsnProto::MSN_AvatarsThread(void*)
-{
- while (true) {
- if (WaitForSingleObject(hevAvatarQueue, INFINITE) != WAIT_OBJECT_0)
- break;
-
- if (g_bTerminated)
- break;
-
- AvatarQueueEntry *p = nullptr;
- {
- mir_cslock lck(csAvatarQueue);
- if (lsAvatarQueue.getCount() > 0) {
- p = lsAvatarQueue[0];
- lsAvatarQueue.remove(0);
- }
- }
-
- if (p == nullptr)
- continue;
-
- if (!loadHttpAvatar(p))
- ProtoBroadcastAck(p->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, nullptr);
- delete p;
- }
-
- mir_cslock lck(csAvatarQueue);
- for (auto &it : lsAvatarQueue)
- delete it;
- lsAvatarQueue.destroy();
-}
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp
deleted file mode 100644
index e38fbac244..0000000000
--- a/protocols/MSN/src/msn_chat.cpp
+++ /dev/null
@@ -1,605 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-
-#include "stdafx.h"
-#include "msn_proto.h"
-#include <m_history.h>
-
-static const wchar_t *m_ptszRoles[] = {
- LPGENW("Admin"),
- LPGENW("User")
-};
-
-MCONTACT CMsnProto::MSN_GetChatInernalHandle(MCONTACT hContact)
-{
- MCONTACT result = hContact;
- if (isChatRoom(hContact)) {
- DBVARIANT dbv;
- if (getString(hContact, "ChatRoomID", &dbv) == 0) {
- result = (MCONTACT)(-atol(dbv.pszVal));
- db_free(&dbv);
- }
- }
- return result;
-}
-
-int CMsnProto::MSN_ChatInit(GCThreadData *info, const char *pszID, const char *pszTopic)
-{
- char *szNet, *szEmail;
-
- wcsncpy(info->mChatID, _A2T(pszID), _countof(info->mChatID));
- parseWLID(NEWSTR_ALLOCA(pszID), &szNet, &szEmail, nullptr);
- info->netId = atoi(szNet);
- strncpy(info->szEmail, szEmail, sizeof(info->szEmail));
-
- wchar_t szName[512];
- InterlockedIncrement(&m_chatID);
- if (*pszTopic)
- wcsncpy(szName, _A2T(pszTopic), _countof(szName));
- else mir_snwprintf(szName, L"%s %s%d",
- m_tszUserName, TranslateT("Chat #"), m_chatID);
-
- SESSION_INFO *si = Chat_NewSession(GCW_CHATROOM, m_szModuleName, info->mChatID, szName);
- if (!si)
- return 1;
-
- for (auto &it : m_ptszRoles)
- Chat_AddGroup(si, TranslateW(it));
-
- Chat_Control(m_szModuleName, info->mChatID, SESSION_INITDONE);
- Chat_Control(m_szModuleName, info->mChatID, SESSION_ONLINE);
- Chat_Control(m_szModuleName, info->mChatID, WINDOW_VISIBLE);
- return 0;
-}
-
-void CMsnProto::MSN_ChatStart(ezxml_t xmli)
-{
- if (!mir_strcmp(xmli->txt, "thread"))
- return;
-
- // If Chat ID already exists, don'T create a new one
- const char *pszID = ezxml_txt(ezxml_child(xmli, "id"));
- GCThreadData* info = MSN_GetThreadByChatId(_A2T(pszID));
- if (info == nullptr) {
- info = new GCThreadData;
- {
- mir_cslock lck(m_csThreads);
- m_arGCThreads.insert(info);
- }
-
- MSN_ChatInit(info, pszID, ezxml_txt(ezxml_get(xmli, "properties", 0, "topic", -1)));
- MSN_StartStopTyping(info, false);
- }
- else Chat_Control(m_szModuleName, info->mChatID, SESSION_ONLINE);
-
- const char *pszCreator = ezxml_txt(ezxml_get(xmli, "properties", 0, "creator", -1));
-
- for (ezxml_t memb = ezxml_get(xmli, "members", 0, "member", -1); memb != nullptr; memb = ezxml_next(memb)) {
- const char *mri = ezxml_txt(ezxml_child(memb, "mri"));
- const char *role = ezxml_txt(ezxml_child(memb, "role"));
- GCUserItem *gcu = nullptr;
-
- for (auto &it : info->mJoinedContacts)
- if (!mir_strcmp(it->WLID, mri)) {
- gcu = it;
- break;
- }
-
- if (!gcu) {
- gcu = new GCUserItem;
- info->mJoinedContacts.insert(gcu);
- strncpy(gcu->WLID, mri, sizeof(gcu->WLID));
- }
- mir_wstrcpy(gcu->role, _A2T(role));
-
- if (pszCreator && !mir_strcmp(mri, pszCreator)) info->mCreator = gcu;
- char* szEmail, *szNet;
- parseWLID(NEWSTR_ALLOCA(mri), &szNet, &szEmail, nullptr);
- if (!mir_strcmpi(szEmail, GetMyUsername(atoi(szNet))))
- info->mMe = gcu;
- gcu->btag = 1;
- }
-
- // Remove contacts not on list (not tagged)
- for (auto &it : info->mJoinedContacts.rev_iter()) {
- if (!it->btag)
- info->mJoinedContacts.removeItem(&it);
- else
- it->btag = 0;
- }
-}
-
-void CMsnProto::MSN_KillChatSession(const wchar_t* id)
-{
- Chat_Control(m_szModuleName, id, SESSION_OFFLINE);
- Chat_Terminate(m_szModuleName, id, true);
-}
-
-void CMsnProto::MSN_Kickuser(GCHOOK *gch)
-{
- GCThreadData *thread = MSN_GetThreadByChatId(gch->si->ptszID);
- msnNsThread->sendPacketPayload("DEL", "MSGR\\THREAD",
- "<thread><id>%d:%s</id><members><member><mri>%s</mri></member></members></thread>",
- thread->netId, thread->szEmail, _T2A(gch->ptszUID).get());
-}
-
-void CMsnProto::MSN_Promoteuser(GCHOOK *gch, const char *pszRole)
-{
- GCThreadData *thread = MSN_GetThreadByChatId(gch->si->ptszID);
- msnNsThread->sendPacketPayload("PUT", "MSGR\\THREAD",
- "<thread><id>%d:%s</id><members><member><mri>%s</mri><role>%s</role></member></members></thread>",
- thread->netId, thread->szEmail, _T2A(gch->ptszUID).get(), pszRole);
-}
-
-const wchar_t *CMsnProto::MSN_GCGetRole(GCThreadData* thread, const char *pszWLID)
-{
- if (thread)
- for (auto &it : thread->mJoinedContacts)
- if (!mir_strcmp(it->WLID, pszWLID))
- return it->role;
-
- return nullptr;
-}
-
-void CMsnProto::MSN_GCProcessThreadActivity(ezxml_t xmli, const wchar_t *mChatID)
-{
- if (!mir_strcmp(xmli->name, "topicupdate")) {
- ezxml_t initiator = ezxml_child(xmli, "initiator");
- GCEVENT gce = { m_szModuleName, 0, GC_EVENT_TOPIC };
- gce.pszID.w = mChatID;
- gce.dwFlags = GCEF_ADDTOLOG;
- gce.time = MsnTSToUnixtime(ezxml_txt(ezxml_child(xmli, "eventtime")));
- gce.pszUID.w = initiator ? mir_a2u(initiator->txt) : nullptr;
- MCONTACT hContInitiator = MSN_HContactFromEmail(initiator ? initiator->txt : nullptr);
- gce.pszNick.w = GetContactNameT(hContInitiator);
- gce.pszText.w = mir_a2u(ezxml_txt(ezxml_child(xmli, "value")));
- Chat_Event(&gce);
- mir_free((wchar_t*)gce.pszUID.w);
- mir_free((wchar_t*)gce.pszText.w);
- }
- else if (ezxml_t target = ezxml_child(xmli, "target")) {
- MCONTACT hContInitiator = NULL;
- GCEVENT gce = { m_szModuleName, 0, 0 };
- gce.pszID.w = mChatID;
- gce.dwFlags = GCEF_ADDTOLOG;
-
- if (!mir_strcmp(xmli->name, "deletemember")) {
- gce.iType = GC_EVENT_PART;
- if (ezxml_t initiator = ezxml_child(xmli, "initiator")) {
- if (mir_strcmp(initiator->txt, target->txt)) {
- hContInitiator = MSN_HContactFromEmail(initiator->txt);
- gce.pszStatus.w = GetContactNameT(hContInitiator);
- gce.iType = GC_EVENT_KICK;
- }
- }
- }
- else if (!mir_strcmp(xmli->name, "addmember")) {
- gce.iType = GC_EVENT_JOIN;
- }
- else if (!mir_strcmp(xmli->name, "roleupdate")) {
- gce.iType = GC_EVENT_ADDSTATUS;
- if (ezxml_t initiator = ezxml_child(xmli, "initiator")) {
- hContInitiator = MSN_HContactFromEmail(initiator->txt);
- gce.pszText.w= GetContactNameT(hContInitiator);
- }
- gce.pszStatus.w = L"admin";
- }
-
- if (gce.iType) {
- gce.time = MsnTSToUnixtime(ezxml_txt(ezxml_child(xmli, "eventtime")));
- const char *pszTarget = nullptr;
-
- while (target) {
- switch (gce.iType) {
- case GC_EVENT_JOIN:
- gce.pszStatus.w = MSN_GCGetRole(MSN_GetThreadByChatId(mChatID), target->txt);
- __fallthrough;
-
- case GC_EVENT_KICK:
- case GC_EVENT_PART:
- pszTarget = target->txt;
- break;
- case GC_EVENT_ADDSTATUS:
- case GC_EVENT_REMOVESTATUS:
- gce.iType = mir_strcmp(ezxml_txt(ezxml_child(target, "role")), "admin") == 0 ? GC_EVENT_ADDSTATUS : GC_EVENT_REMOVESTATUS;
- pszTarget = ezxml_txt(ezxml_child(target, "id"));
- break;
- }
- char *szEmail, *szNet;
- parseWLID(NEWSTR_ALLOCA(pszTarget), &szNet, &szEmail, nullptr);
- gce.bIsMe = !mir_strcmpi(szEmail, GetMyUsername(atoi(szNet)));
- gce.pszUID.w = mir_a2u(pszTarget);
- MCONTACT hContTarget = MSN_HContactFromEmail(pszTarget);
- gce.pszNick.w = GetContactNameT(hContTarget);
- Chat_Event(&gce);
- mir_free((wchar_t*)gce.pszUID.w);
- if ((gce.iType == GC_EVENT_PART || gce.iType == GC_EVENT_KICK) && gce.bIsMe) {
- Chat_Control(m_szModuleName, mChatID, SESSION_OFFLINE);
- break;
- }
- target = ezxml_next(target);
- }
- }
- }
-}
-
-void CMsnProto::MSN_GCRefreshThreadsInfo(void)
-{
- CMStringA buf;
- int nThreads = 0;
-
- for (auto &hContact : AccContacts()) {
- if (isChatRoom(hContact) != 0) {
- DBVARIANT dbv;
- if (getString(hContact, "ChatRoomID", &dbv) == 0) {
- buf.AppendFormat("<thread><id>%s</id></thread>", dbv.pszVal);
- nThreads++;
- db_free(&dbv);
- }
- }
- }
- if (nThreads)
- msnNsThread->sendPacketPayload("GET", "MSGR\\THREADS", "<threads>%s</threads>", buf.c_str());
-}
-
-void CMsnProto::MSN_GCAddMessage(wchar_t *mChatID, MCONTACT hContact, char *email, time_t ts, bool sentMsg, char *msgBody)
-{
- GCEVENT gce = { m_szModuleName, 0, GC_EVENT_MESSAGE };
- gce.pszID.w = mChatID;
- gce.dwFlags = GCEF_ADDTOLOG;
- gce.pszUID.w = mir_a2u(email);
- gce.pszNick.w = GetContactNameT(hContact);
- gce.time = ts;
- gce.bIsMe = sentMsg;
-
- wchar_t* p = mir_utf8decodeW(msgBody);
- gce.pszText.w = EscapeChatTags(p);
- mir_free(p);
-
- Chat_Event(&gce);
- mir_free((void*)gce.pszUID.w);
- mir_free((void*)gce.pszText.w);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static void ChatInviteUser(ThreadData *thread, GCThreadData* info, const char* wlid)
-{
- if (info->mJoinedContacts.getCount())
- for (auto &it : info->mJoinedContacts)
- if (!_stricmp(it->WLID, wlid))
- return;
-
- thread->sendPacketPayload("PUT", "MSGR\\THREAD",
- "<thread><id>%d:%s</id><members><member><mri>%s</mri><role>user</role></member></members></thread>",
- info->netId, info->szEmail, wlid);
-}
-
-static void ChatInviteSend(HANDLE hItem, HWND hwndList, STRLIST &str, CMsnProto *ppro)
-{
- if (hItem == nullptr)
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
-
- while (hItem) {
- if (IsHContactGroup(hItem)) {
- HANDLE hItemT = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT) ChatInviteSend(hItemT, hwndList, str, ppro);
- }
- else {
- int chk = SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
- if (chk) {
- if (IsHContactInfo(hItem)) {
- wchar_t buf[128] = L"";
- SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
-
- if (buf[0]) str.insert(mir_u2a(buf));
- }
- else {
- MsnContact *msc = ppro->Lists_Get((UINT_PTR)hItem);
- if (msc) {
- char szContact[MSN_MAX_EMAIL_LEN];
-
- sprintf(szContact, "%d:%s", msc->netId, msc->email);
- str.insertn(szContact);
- }
- }
- }
- }
- hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
- }
-}
-
-static void ChatValidateContact(MCONTACT hItem, HWND hwndList, CMsnProto* ppro)
-{
- if (!ppro->MSN_IsMyContact(hItem) || ppro->isChatRoom(hItem) || ppro->MSN_IsMeByContact(hItem))
- SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0);
-}
-
-static void ChatPrepare(MCONTACT hItem, HWND hwndList, CMsnProto* ppro)
-{
- if (hItem == NULL)
- hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
-
- while (hItem) {
- MCONTACT hItemN = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
-
- if (IsHContactGroup(hItem)) {
- MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT)
- ChatPrepare(hItemT, hwndList, ppro);
- }
- else if (IsHContactContact(hItem))
- ChatValidateContact(hItem, hwndList, ppro);
-
- hItem = hItemN;
- }
-}
-
-INT_PTR CALLBACK DlgInviteToChat(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- InviteChatParam *param = (InviteChatParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
-
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- param = (InviteChatParam*)lParam;
- break;
-
- case WM_CLOSE:
- EndDialog(hwndDlg, 0);
- break;
-
- case WM_NCDESTROY:
- delete param;
- break;
-
- case WM_NOTIFY:
- NMCLISTCONTROL* nmc;
- {
- nmc = (NMCLISTCONTROL*)lParam;
- if (nmc->hdr.idFrom == IDC_CCLIST) {
- switch (nmc->hdr.code) {
- case CLN_NEWCONTACT:
- if (param && (nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0)
- ChatValidateContact((UINT_PTR)nmc->hItem, nmc->hdr.hwndFrom, param->ppro);
- break;
-
- case CLN_LISTREBUILT:
- if (param)
- ChatPrepare(NULL, nmc->hdr.hwndFrom, param->ppro);
- break;
- }
- }
- }
- break;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_ADDSCR:
- if (param->ppro->msnLoggedIn) {
- wchar_t email[MSN_MAX_EMAIL_LEN];
- GetDlgItemText(hwndDlg, IDC_EDITSCR, email, _countof(email));
-
- CLCINFOITEM cii = { 0 };
- cii.cbSize = sizeof(cii);
- cii.flags = CLCIIF_CHECKBOX | CLCIIF_BELOWCONTACTS;
- cii.pszText = wcslwr(email);
-
- HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CCLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
- SendDlgItemMessage(hwndDlg, IDC_CCLIST, CLM_SETCHECKMARK, (LPARAM)hItem, 1);
- }
- break;
-
- case IDCANCEL:
- EndDialog(hwndDlg, IDCANCEL);
- break;
-
- case IDOK:
- char tEmail[MSN_MAX_EMAIL_LEN]; tEmail[0] = 0;
- GCThreadData *info = nullptr;
- if (param->id)
- info = param->ppro->MSN_GetThreadByChatId(param->id);
-
- HWND hwndList = GetDlgItem(hwndDlg, IDC_CCLIST);
- STRLIST *cont = new STRLIST;
- ChatInviteSend(nullptr, hwndList, *cont, param->ppro);
-
- if (info) {
- for (auto &it : *cont)
- ChatInviteUser(param->ppro->msnNsThread, info, it);
- delete cont;
- }
- else {
- /* Group chats only work for Skype users */
- CMStringA buf;
- buf.AppendFormat("<thread><id></id><members><member><mri>%d:%s</mri><role>admin</role></member>",
- NETID_SKYPE, param->ppro->GetMyUsername(NETID_SKYPE));
- for (auto &it : *cont) {
- // TODO: Add support for assigning role in invite dialog maybe?
- buf.AppendFormat("<member><mri>%s</mri><role>user</role></member>", it);
- }
- buf.Append("</members></thread>");
- param->ppro->msnNsThread->sendPacketPayload("PUT", "MSGR\\THREAD", buf);
- }
-
- EndDialog(hwndDlg, IDOK);
- }
- break;
- }
- return FALSE;
-}
-
-int CMsnProto::MSN_GCEventHook(WPARAM, LPARAM lParam)
-{
- GCHOOK *gch = (GCHOOK*)lParam;
- if (!gch)
- return 0;
-
- if (_stricmp(gch->si->pszModule, m_szModuleName)) return 0;
-
- switch (gch->iType) {
- case GC_SESSION_TERMINATE:
- {
- GCThreadData* thread = MSN_GetThreadByChatId(gch->si->ptszID);
- if (thread == nullptr)
- break;
-
- m_arGCThreads.remove(thread);
- for (auto &it : thread->mJoinedContacts)
- delete it;
- delete thread;
- }
- break;
-
- case GC_USER_MESSAGE:
- if (gch->ptszText && gch->ptszText[0]) {
- GCThreadData* thread = MSN_GetThreadByChatId(gch->si->ptszID);
- if (thread) {
- wchar_t* pszMsg = Chat_UnescapeTags(NEWWSTR_ALLOCA(gch->ptszText));
- rtrimw(pszMsg); // remove the ending linebreak
- msnNsThread->sendMessage('N', thread->szEmail, thread->netId, UTF8(pszMsg), 0);
-
- DBVARIANT dbv;
- int bError = getWString("Nick", &dbv);
-
- GCEVENT gce = { m_szModuleName, 0, GC_EVENT_MESSAGE };
- gce.pszID.w = gch->si->ptszID;
- gce.dwFlags = GCEF_ADDTOLOG;
- gce.pszNick.w = bError ? L"" : dbv.pwszVal;
- gce.pszUID.w = mir_a2u(MyOptions.szEmail);
- gce.time = time(0);
- gce.pszText.w = gch->ptszText;
- gce.bIsMe = TRUE;
- Chat_Event(&gce);
-
- mir_free((void*)gce.pszUID.w);
- if (!bError)
- db_free(&dbv);
- }
- }
- break;
-
- case GC_USER_CHANMGR:
- DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CHATROOM_INVITE), nullptr, DlgInviteToChat,
- LPARAM(new InviteChatParam(gch->si->ptszID, NULL, this)));
- break;
-
- case GC_USER_PRIVMESS:
- CallService(MS_MSG_SENDMESSAGE, MSN_HContactFromEmail(_T2A(gch->ptszUID)), 0);
- break;
-
- case GC_USER_LOGMENU:
- switch (gch->dwData) {
- case 10:
- DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CHATROOM_INVITE), nullptr, DlgInviteToChat,
- LPARAM(new InviteChatParam(gch->si->ptszID, NULL, this)));
- break;
-
- case 20:
- MSN_KillChatSession(gch->si->ptszID);
- break;
- }
- break;
-
- case GC_USER_NICKLISTMENU:
- switch (gch->dwData) {
- case 10:
- CallService(MS_USERINFO_SHOWDIALOG, MSN_HContactFromEmail(_T2A(gch->ptszUID)), 0);
- break;
-
- case 20:
- CallService(MS_HISTORY_SHOWCONTACTHISTORY, MSN_HContactFromEmail(_T2A(gch->ptszUID)), 0);
- break;
-
- case 30:
- MSN_Kickuser(gch);
- break;
-
- case 110:
- MSN_KillChatSession(gch->si->ptszID);
- break;
-
- case 40:
- const wchar_t *pszRole = MSN_GCGetRole(MSN_GetThreadByChatId(gch->si->ptszID), _T2A(gch->ptszUID));
- MSN_Promoteuser(gch, (pszRole && !mir_wstrcmp(pszRole, L"admin")) ? "user" : "admin");
- break;
- }
- break;
- }
-
- return 1;
-}
-
-int CMsnProto::MSN_GCMenuHook(WPARAM, LPARAM lParam)
-{
- GCMENUITEMS *gcmi = (GCMENUITEMS*)lParam;
-
- if (gcmi == nullptr || _stricmp(gcmi->pszModule, m_szModuleName)) return 0;
-
- if (gcmi->Type == MENU_ON_LOG) {
- static const struct gc_item Items[] =
- {
- { LPGENW("&Invite user..."), 10, MENU_ITEM, FALSE },
- { LPGENW("&Leave chat session"), 20, MENU_ITEM, FALSE }
- };
- Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, &g_plugin);
- }
- else if (gcmi->Type == MENU_ON_NICKLIST) {
- char *email = mir_u2a(gcmi->pszUID);
- if (!_stricmp(GetMyUsername(NETID_SKYPE), email)) {
- static const struct gc_item Items[] =
- {
- { LPGENW("User &details"), 10, MENU_ITEM, FALSE },
- { LPGENW("User &history"), 20, MENU_ITEM, FALSE },
- { L"", 100, MENU_SEPARATOR, FALSE },
- { LPGENW("&Leave chat session"), 110, MENU_ITEM, FALSE }
- };
- Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, &g_plugin);
- }
- else {
- static struct gc_item Items[] =
- {
- { LPGENW("User &details"), 10, MENU_ITEM, FALSE },
- { LPGENW("User &history"), 20, MENU_ITEM, FALSE },
- { LPGENW("&Kick user") , 30, MENU_ITEM, FALSE },
- { LPGENW("&Op user") , 40, MENU_ITEM, FALSE }
- };
- GCThreadData* thread = MSN_GetThreadByChatId(gcmi->pszID);
- if (thread && thread->mMe && mir_wstrcmpi(thread->mMe->role, L"admin")) {
- Items[2].bDisabled = TRUE;
- Items[3].bDisabled = TRUE;
- }
- else {
- const wchar_t *pszRole = MSN_GCGetRole(thread, email);
- if (pszRole && !mir_wstrcmpi(pszRole, L"admin"))
- Items[3].pszDesc = LPGENW("&Deop user");
- }
- Chat_AddMenuItems(gcmi->hMenu, _countof(Items), Items, &g_plugin);
- }
- mir_free(email);
- }
-
- return 0;
-}
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp
deleted file mode 100644
index 993534d646..0000000000
--- a/protocols/MSN/src/msn_commands.cpp
+++ /dev/null
@@ -1,1219 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-void CMsnProto::MSN_SetMirVer(MCONTACT hContact, MsnPlace *place)
-{
- static const char* MirVerStr[] =
- {
- "Messenger (Windows)",
- "Web",
- "Windows Phone",
- "Xbox",
- "Zune",
- "Messenger (iPhone) ",
- "Messenger (Mac)",
- "Messenger (SMS)",
- "Messenger (Modern)",
- "Skype",
- "Skype (Windows)",
- "Skype (Windows 8)",
- "Skype (Mac)",
- "Skype (Linux)",
- "Skype (Windows Phone)",
- "Skype (iOS)",
- "Skype (Android)",
- "Skype"
- };
-
- char szVersion[64];
-
- if (!place || !place->client) return;
- mir_snprintf(szVersion, sizeof(szVersion), "%s (%s)",
- MirVerStr[place->client >= sizeof(MirVerStr) / sizeof(MirVerStr[0]) ? 9 : place->client - 1], place->szClientVer);
- setString(hContact, "MirVer", szVersion);
- setByte(hContact, "StdMirVer", 1);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_ReceiveMessage - receives message or a file from the server
-
-void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* params)
-{
- union
- {
- char* tWords[6];
- struct { char *fromEmail, *fromNick, *strMsgBytes; } data;
- struct { char *fromEmail, *fromNetId, *toEmail, *toNetId, *typeId, *strMsgBytes; } datau;
- struct { char *typeId, *strMsgBytes; } datas;
- };
-
- if (sttDivideWords(params, _countof(tWords), tWords) < 2) {
- debugLogA("Invalid %.3s command, ignoring", cmdString);
- return;
- }
-
- int msgBytes;
- char *nick = nullptr, *email = nullptr;
- wchar_t *mChatID = nullptr;
- bool ubmMsg = strncmp(cmdString, "UBM", 3) == 0;
- bool sdgMsg = strncmp(cmdString, "SDG", 3) == 0;
- bool nfyMsg = strncmp(cmdString, "NFY", 3) == 0;
- bool sentMsg = false;
-
- if (sdgMsg) {
- msgBytes = atol(datas.strMsgBytes);
- if (mir_strcmpi(datas.typeId, "MSGR"))
- return;
- }
- else if (nfyMsg) {
- msgBytes = atol(datas.strMsgBytes);
- if (mir_strcmpi(datas.typeId, "MSGR\\HOTMAIL"))
- return;
- }
- else {
- if (ubmMsg) {
- msgBytes = atol(datau.strMsgBytes);
- nick = datau.fromEmail;
- email = datau.fromEmail;
- }
- else {
- msgBytes = atol(data.strMsgBytes);
- nick = data.fromNick;
- email = data.fromEmail;
- mir_urlDecode(nick);
- }
- stripBBCode(nick);
- stripColorCode(nick);
- }
-
- char* msg = (char*)alloca(msgBytes + 1);
-
- HReadBuffer buf(info, 0);
- BYTE* msgb = buf.surelyRead(msgBytes);
- if (msgb == nullptr) return;
-
- memcpy(msg, msgb, msgBytes);
- msg[msgBytes] = 0;
-
- debugLogA("Message:\n%s", msg);
-
- MimeHeaders tHeader;
- char* msgBody = tHeader.readFromBuffer(msg);
-
- if (sdgMsg) {
- if (tHeader["Ack-Id"]) {
- CMStringA szBody;
- szBody.AppendFormat("Ack-Id: %s\r\n", tHeader["Ack-Id"]);
- if (msnRegistration) szBody.AppendFormat("Registration: %s\r\n", msnRegistration);
- szBody.AppendFormat("\r\n");
- msnNsThread->sendPacket("ACK", "MSGR %d\r\n%s", szBody.GetLength(), szBody.c_str());
- }
- msgBody = tHeader.readFromBuffer(msgBody);
- if (!(email = NEWSTR_ALLOCA(tHeader["From"]))) return;
- mChatID = mir_a2u(tHeader["To"]);
- if (wcsncmp(mChatID, L"19:", 3)) mChatID[0] = 0; // NETID_THREAD
- msgBody = tHeader.readFromBuffer(msgBody);
- msgBody = tHeader.readFromBuffer(msgBody);
- nick = NEWSTR_ALLOCA(tHeader["IM-Display-Name"]);
- if (!mir_strcmp(tHeader["Message-Type"], "RichText")) {
- msgBody = NEWSTR_ALLOCA(msgBody);
- stripHTML(msgBody);
- HtmlDecode(msgBody);
- }
- }
- else if (nfyMsg) msgBody = tHeader.readFromBuffer(msgBody);
- else mChatID = info->mChatID;
-
- const char* tMsgId = tHeader["Message-ID"];
- if (tMsgId) lastMsgId = _atoi64(tMsgId);
-
- // Chunked message
- char* newbody = nullptr;
- if (!sdgMsg && tMsgId) {
- int idx;
- const char* tChunks = tHeader["Chunks"];
- if (tChunks)
- idx = addCachedMsg(tMsgId, msg, 0, msgBytes, atol(tChunks), true);
- else
- idx = addCachedMsg(tMsgId, msgBody, 0, mir_strlen(msgBody), 0, true);
-
- size_t newsize;
- if (!getCachedMsg(idx, newbody, newsize)) return;
- msgBody = tHeader.readFromBuffer(newbody);
- }
-
- // message from the server (probably)
- if (!ubmMsg && !sdgMsg && !nfyMsg && strchr(email, '@') == nullptr && _stricmp(email, "Hotmail"))
- return;
-
- const char* tContentType = tHeader["Content-Type"];
- if (tContentType == nullptr)
- return;
-
- if (nfyMsg)
- msgBody = tHeader.readFromBuffer(msgBody);
-
- if (!_strnicmp(tContentType, "text/x-clientcaps", 17)) {
- MimeHeaders tFileInfo;
- tFileInfo.readFromBuffer(msgBody);
- info->firstMsgRecv = true;
-
- MCONTACT hContact = MSN_HContactFromEmail(email);
- const char* mirver = tFileInfo["Client-Name"];
- if (hContact != NULL && mirver != nullptr) {
- setString(hContact, "MirVer", mirver);
- delSetting(hContact, "StdMirVer");
- }
- }
- else if (!ubmMsg && !sdgMsg && !nfyMsg && !info->firstMsgRecv) {
- info->firstMsgRecv = true;
- MsnContact *cont = Lists_Get(email);
- if (cont && cont->hContact != NULL && cont->places.getCount() > 0)
- MSN_SetMirVer(cont->hContact, &cont->places[0]);
- }
-
- if (!_strnicmp(tContentType, "text/plain", 10) ||
- (!_strnicmp(tContentType, "application/user+xml", 10) && tHeader["Message-Type"] && !strncmp(tHeader["Message-Type"], "RichText", 8))) {
- MCONTACT hContact = strncmp(email, "19:", 3) ? MSN_HContactFromEmail(email, nick, true, true) : NULL;
-
- if (!_stricmp(tHeader["Message-Type"], "RichText/UriObject") || !_stricmp(tHeader["Message-Type"], "RichText/Media_GenericFile")) {
- ezxml_t xmli = ezxml_parse_str(msgBody, strlen(msgBody));
- if (xmli) {
- MSN_ProcessURIObject(hContact, xmli);
- ezxml_free(xmli);
- }
- }
- else if (!_stricmp(tHeader["Message-Type"], "RichText/Contacts")) {
- ezxml_t xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody));
- if (xmli) {
- if (!mir_strcmp(xmli->name, "contacts")) {
- ezxml_t c;
- int cnt;
- PROTOSEARCHRESULT **psr;
-
- for (c = ezxml_child(xmli, "c"), cnt = 0; c; c = c->next) cnt++;
- if (psr = (PROTOSEARCHRESULT**)mir_calloc(sizeof(PROTOSEARCHRESULT*) * cnt)) {
- cnt = 0;
- for (c = ezxml_child(xmli, "c"); c; c = c->next) {
- const char *t = ezxml_attr(c, "t"), *wlid;
- if (t && (wlid = ezxml_attr(c, t))) {
- switch (*t) {
- case 's':
- case 'p':
- psr[cnt] = (PROTOSEARCHRESULT*)mir_calloc(sizeof(PROTOSEARCHRESULT));
- psr[cnt]->cbSize = sizeof(psr);
- psr[cnt]->flags = PSR_UNICODE;
- psr[cnt]->id.w = psr[cnt]->nick.w = psr[cnt]->email.w = mir_a2u(wlid);
- cnt++;
- }
- }
- }
- if (cnt) {
- PROTORECVEVENT pre = { 0 };
- pre.timestamp = (DWORD)time(0);
- pre.szMessage = (char *)psr;
- pre.lParam = cnt;
- ProtoChainRecv(hContact, PSR_CONTACTS, 0, (LPARAM)&pre);
- for (cnt = 0; cnt < pre.lParam; cnt++) {
- mir_free(psr[cnt]->email.w);
- mir_free(psr[cnt]);
- }
- }
- mir_free(psr);
- }
- }
- ezxml_free(xmli);
- }
- }
- else if (!_stricmp(tHeader["Message-Type"], "Control/Typing"))
- CallService(MS_PROTO_CONTACTISTYPING, hContact, 7);
- else if (!_stricmp(tHeader["Message-Type"], "Control/ClearTyping"))
- CallService(MS_PROTO_CONTACTISTYPING, hContact, 0);
- else {
- const char* p = tHeader["X-MMS-IM-Format"];
- bool isRtl = p != nullptr && strstr(p, "RL=1") != nullptr;
-
- /*if (info->mJoinedContactsWLID.getCount() > 1)
- MSN_ChatStart(info);
- else */ {
- char *szNet, *szEmail;
- parseWLID(NEWSTR_ALLOCA(email), &szNet, &szEmail, nullptr);
- sentMsg = _stricmp(szEmail, GetMyUsername(atoi(szNet))) == 0;
- if (sentMsg)
- hContact = ubmMsg ? MSN_HContactFromEmail(datau.toEmail, nick) : info->getContactHandle();
- }
-
- const char* tP4Context = tHeader["P4-Context"];
- if (tP4Context) {
- size_t newlen = mir_strlen(msgBody) + mir_strlen(tP4Context) + 4;
- char* newMsgBody = (char*)mir_alloc(newlen);
- mir_snprintf(newMsgBody, newlen, "[%s] %s", tP4Context, msgBody);
- mir_free(newbody);
- msgBody = newbody = newMsgBody;
- }
-
- if (mChatID[0]) {
- if (!_strnicmp(tHeader["Message-Type"], "ThreadActivity/", 15)) {
- ezxml_t xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody));
- if (xmli) {
- MSN_GCProcessThreadActivity(xmli, mChatID);
- ezxml_free(xmli);
- }
- }
- else MSN_GCAddMessage(mChatID, hContact, email, time(0), sentMsg, msgBody);
- }
- else if (hContact) {
- if (!sentMsg) {
- CallService(MS_PROTO_CONTACTISTYPING, WPARAM(hContact), 0);
-
- PROTORECVEVENT pre = { 0 };
- pre.szMessage = (char*)msgBody;
- pre.flags = (isRtl ? PREF_RTL : 0);
- pre.timestamp = (DWORD)time(0);
- pre.lParam = 0;
- ProtoChainRecvMsg(hContact, &pre);
- }
- else {
- bool haveWnd = MSN_MsgWndExist(hContact);
-
- DBEVENTINFO dbei = {};
- dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.flags = DBEF_SENT | DBEF_UTF | (haveWnd ? 0 : DBEF_READ) | (isRtl ? DBEF_RTL : 0);
- dbei.szModule = m_szModuleName;
- dbei.timestamp = time(0);
- dbei.cbBlob = (unsigned)mir_strlen(msgBody) + 1;
- dbei.pBlob = (PBYTE)msgBody;
- db_event_add(hContact, &dbei);
- }
- }
- }
- }
- else if (!_strnicmp(tContentType, "text/x-msmsgsprofile", 20)) {
- replaceStr(msnExternalIP, tHeader["ClientIP"]);
- abchMigrated = atol(tHeader["ABCHMigrated"]);
- langpref = atol(tHeader["lang_preference"]);
- emailEnabled = atol(tHeader["EmailEnabled"]) != 0;
-
- if (!MSN_RefreshContactList()) {
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NOSERVER);
- info->sendTerminate();
- }
- else {
- MSN_SetServerStatus(m_iDesiredStatus);
- MSN_EnableMenuItems(true);
- }
- }
- else if (!_strnicmp(tContentType, "text/x-msmsgscontrol", 20) ||
- (sdgMsg && !_strnicmp(tContentType, "Application/Message", 19))) {
- const char* tTypingUser = sdgMsg ? email : tHeader["TypingUser"];
-
- if (tTypingUser != nullptr && info->mChatID[0] == 0 && _stricmp(email, MyOptions.szEmail)) {
- MCONTACT hContact = MSN_HContactFromEmail(tTypingUser, tTypingUser);
- CallService(MS_PROTO_CONTACTISTYPING, hContact,
- sdgMsg && !_stricmp(tHeader["Message-Type"], "Control/ClearTyping") ? 0 : 7);
- }
- }
- else if (!_strnicmp(tContentType, "text/x-msnmsgr-datacast", 23)) {
- //if (info->mJoinedContactsWLID.getCount()) {
- MCONTACT tContact;
-
- if (mChatID[0]) {
- GC_INFO gci = { 0 };
- gci.Flags = GCF_HCONTACT;
- gci.pszModule = m_szModuleName;
- gci.pszID = mChatID;
- Chat_GetInfo(&gci);
- tContact = gci.hContact;
- }
- else tContact = MSN_HContactFromEmail(email, nick, true, true);
- if (!mir_strcmp(tHeader["Message-Type"], "Nudge"))
- NotifyEventHooks(hMSNNudge, (WPARAM)tContact, 0);
- /* Other msg types:
- * Wink
- * Voice
- * Data
- */
- }
- else if (!_strnicmp(tContentType, "text/x-msmsgsemailnotification", 30))
- sttNotificationMessage(msgBody, false);
- else if (!_strnicmp(tContentType, "text/x-msmsgsinitialemailnotification", 37))
- sttNotificationMessage(msgBody, true);
- else if (!_strnicmp(tContentType, "text/x-msmsgsactivemailnotification", 35))
- sttNotificationMessage(msgBody, false);
- else if (!_strnicmp(tContentType, "text/x-msmsgsinitialmdatanotification", 37))
- sttNotificationMessage(msgBody, true);
- else if (!_strnicmp(tContentType, "text/x-msmsgsoimnotification", 28))
- sttNotificationMessage(msgBody, false);
-
- mir_free(mChatID);
- mir_free(newbody);
-}
-
-void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli)
-{
- const char *pszSkypeToken;
-
- if ((pszSkypeToken = authSkypeToken.Token()) && xmli) {
- /* FIXME: As soon as core has functions to POST images in a conversation AND gives the possibility to supply a
- * callback for fetching that image, this may be possible, but currently due to required Auth-Header, this
- * is not possible and we just send an incoming file transfer
- const char *thumb = ezxml_attr(xmli, "url_thumbnail");
- if (thumb && ServiceExists("IEVIEW/NewWindow")) {
- // Supply callback to detch thumb with auth-header and embed [img] BB-code?
- }
- */
- char *uri = (char*)ezxml_attr(xmli, "uri");
- if (uri) {
- // First get HTTP header of file to get content length
- unsigned __int64 fileSize = 0;
- NETLIBHTTPHEADER nlbhHeaders[2] = {};
- nlbhHeaders[0].szName = "User-Agent"; nlbhHeaders[0].szValue = (LPSTR)MSN_USER_AGENT;
- nlbhHeaders[1].szName = "Authorization"; nlbhHeaders[1].szValue = (char*)pszSkypeToken;
-
- NETLIBHTTPREQUEST nlhr = {};
- nlhr.cbSize = sizeof(nlhr);
- nlhr.requestType = REQUEST_GET;
- nlhr.flags = NLHRF_PERSISTENT;
- nlhr.szUrl = uri;
- nlhr.headers = (NETLIBHTTPHEADER*)&nlbhHeaders;
- nlhr.headersCount = _countof(nlbhHeaders);
- nlhr.nlc = hHttpsConnection;
-
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
- if (nlhrReply->resultCode == 200) {
- char *pLength, *pEnd;
-
- if ((pLength = strstr(nlhrReply->pData, "\"contents\":")) &&
- (pLength = strstr(pLength, "\"length\":")) && (pEnd = strchr(pLength + 9, ','))) {
- pLength += 9;
- *pEnd = 0;
- fileSize = _atoi64(pLength);
- }
- }
- }
- else hHttpsConnection = nullptr;
-
- if (fileSize) {
- filetransfer* ft = new filetransfer(this);
- const char *pszFile = "", *pszType;
- ezxml_t originalName, desc;
-
- ft->std.hContact = hContact;
- ft->tType = SERVER_HTTP;
- mir_free(ft->std.szCurrentFile.w);
- if (!((originalName = ezxml_child(xmli, "OriginalName")) && (pszFile = (char*)ezxml_attr(originalName, "v"))))
- if ((originalName = ezxml_child(xmli, "meta")))
- pszFile = ezxml_attr(originalName, "originalName");
-
- if (!pszFile || !*pszFile) {
- if ((originalName = ezxml_child(xmli, "meta")) && (pszFile = (char*)ezxml_attr(originalName, "type")))
- if (!mir_strcmp(pszFile, "photo"))
- pszFile = "IMG00001.JPG";
-
- if (!pszFile || !*pszFile)
- pszFile = "file";
- }
-
- const char *p;
- if ((p = strrchr(pszFile, '\\')) || (p = strrchr(pszFile, '/')))
- pszFile = p + 1;
-
- ft->std.szCurrentFile.w = mir_utf8decodeW(pszFile);
- ft->std.totalBytes = ft->std.currentFileSize = fileSize;
- ft->std.totalFiles = 1;
- ft->szInvcookie = (char*)mir_calloc(strlen(uri) + 16);
- if ((pszType = (char*)ezxml_attr(xmli, "type")) && !mir_strcmp(pszType, "File.1"))
- sprintf(ft->szInvcookie, "%s/content/original", uri);
- else
- sprintf(ft->szInvcookie, "%s/content/imgpsh", uri);
-
- char tComment[40];
- mir_snprintf(tComment, TranslateU("%I64u bytes"), ft->std.currentFileSize);
-
- PROTORECVFILE pre = { 0 };
- pre.fileCount = 1;
- pre.timestamp = time(0);
- pre.descr.a = (desc = ezxml_child(xmli, "Description")) ? desc->txt : tComment;
- pre.files.a = &pszFile;
- pre.lParam = (LPARAM)ft;
- ProtoChainRecvFile(ft->std.hContact, &pre);
- }
- else uri = nullptr;
- }
-
- if (uri == nullptr) {
- // Fallback: Just filter out the link and post it as a message
- CallService(MS_PROTO_CONTACTISTYPING, WPARAM(hContact), 0);
-
- PROTORECVEVENT pre = { 0 };
- CMStringA msgtxt((char*)ezxml_txt(xmli));
- ezxml_t urllnk;
- if (urllnk = ezxml_child(xmli, "a")) msgtxt.AppendFormat(" %s", ezxml_txt(urllnk));
- pre.szMessage = (char*)(const char*)msgtxt;
- pre.timestamp = (DWORD)time(0);
- ProtoChainRecvMsg(hContact, &pre);
- }
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Process Yahoo Find
-
-void CMsnProto::MSN_ProcessYFind(char* buf, size_t len)
-{
- if (buf == nullptr) return;
- ezxml_t xmli = ezxml_parse_str(buf, len);
-
- ezxml_t dom = ezxml_child(xmli, "d");
- const char* szDom = ezxml_attr(dom, "n");
-
- ezxml_t cont = ezxml_child(dom, "c");
- const char* szCont = ezxml_attr(cont, "n");
-
- char szEmail[128];
- mir_snprintf(szEmail, "%s@%s", szCont, szDom);
-
- const char *szNetId = ezxml_attr(cont, "t");
- if (msnSearchId != nullptr) {
- if (szNetId != nullptr) {
- ptrW szEmailT(mir_utf8decodeW(szEmail));
-
- PROTOSEARCHRESULT psr = { 0 };
- psr.cbSize = sizeof(psr);
- psr.flags = PSR_UNICODE;
- psr.id.w = szEmailT;
- psr.nick.w = szEmailT;
- psr.email.w = szEmailT;
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, msnSearchId, (LPARAM)&psr);
- }
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, msnSearchId);
-
- msnSearchId = nullptr;
- }
- else {
- if (szNetId != nullptr) {
- int netId = atol(szNetId);
- MCONTACT hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false);
- if (MSN_AddUser(hContact, szEmail, netId, LIST_FL)) {
- MSN_AddUser(hContact, szEmail, netId, LIST_PL + LIST_REMOVE);
- MSN_AddUser(hContact, szEmail, netId, LIST_BL + LIST_REMOVE);
- MSN_AddUser(hContact, szEmail, netId, LIST_AL);
- Contact_Hide(hContact, false);
- }
- MSN_SetContactDb(hContact, szEmail);
- }
- }
-
- ezxml_free(xmli);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_HandleCommands - process commands from the server
-
-void CMsnProto::MSN_ProcessNLN(const char *userStatus, const char *wlid, char *userNick, const char *objid, char *cmdstring)
-{
- if (userNick) {
- mir_urlDecode(userNick);
- stripBBCode(userNick);
- stripColorCode(userNick);
- }
-
- bool isMe = false;
- char* szEmail, *szNet, *szInst;
- parseWLID(NEWSTR_ALLOCA(wlid), &szNet, &szEmail, &szInst);
- if (!mir_strcmpi(szEmail, GetMyUsername(atoi(szNet)))) {
- if (!*userStatus) return;
- isMe = true;
- int newStatus = MSNStatusToMiranda(userStatus);
- if (newStatus != m_iStatus && newStatus != ID_STATUS_IDLE) {
- int oldMode = m_iStatus;
- m_iDesiredStatus = m_iStatus = newStatus;
- ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldMode, m_iStatus);
- }
- }
-
- WORD lastStatus = ID_STATUS_OFFLINE;
-
- MsnContact *cont = Lists_Get(szEmail);
-
- MCONTACT hContact = NULL;
- if (!cont && !isMe) {
- hContact = MSN_HContactFromEmail(wlid, userNick, true, true);
- cont = Lists_Get(szEmail);
- }
- if (cont) hContact = cont->hContact;
-
- if (hContact != NULL) {
- if (userNick) setStringUtf(hContact, "Nick", userNick);
- lastStatus = getWord(hContact, "Status", ID_STATUS_OFFLINE);
- if (lastStatus == ID_STATUS_OFFLINE || lastStatus == ID_STATUS_INVISIBLE)
- db_unset(hContact, "CList", "StatusMsg");
-
- int newStatus = MSNStatusToMiranda(userStatus);
- setWord(hContact, "Status", newStatus != ID_STATUS_IDLE ? newStatus : ID_STATUS_AWAY);
- setDword(hContact, "IdleTS", newStatus != ID_STATUS_IDLE ? 0 : time(0));
- }
-
- if (cont) {
- if (objid) {
- char* end = nullptr;
- cont->cap1 = strtoul(objid, &end, 10);
- cont->cap2 = end && *end == ':' ? strtoul(end + 1, nullptr, 10) : 0;
- }
-
- if (szInst) MSN_SetMirVer(hContact, cont->places.find((MsnPlace*)&szInst));
-
- char *pszUrl, *pszAvatarHash;
- if (cmdstring && *cmdstring && mir_strcmp(cmdstring, "0") &&
- (pszAvatarHash = MSN_GetAvatarHash(cmdstring, &pszUrl))) {
- setString(hContact, "PictContext", cmdstring);
- setString(hContact, "AvatarHash", pszAvatarHash);
- if (pszUrl)
- setString(hContact, "AvatarUrl", pszUrl);
- else
- delSetting(hContact, "AvatarUrl");
-
- if (hContact != NULL) {
- char szSavedHash[64] = "";
- if (!db_get_static(hContact, m_szModuleName, "AvatarSavedHash", szSavedHash, sizeof(szSavedHash))) {
- if (mir_strcmpi(szSavedHash, pszAvatarHash))
- pushAvatarRequest(hContact, pszUrl);
- else {
- char szSavedContext[64];
- int result = db_get_static(hContact, m_szModuleName, "PictSavedContext", szSavedContext, sizeof(szSavedContext));
- if (result || mir_strcmp(szSavedContext, cmdstring))
- pushAvatarRequest(hContact, pszUrl);
- }
- }
- }
- mir_free(pszAvatarHash);
- mir_free(pszUrl);
- }
- else {
- delSetting(hContact, "AvatarHash");
- delSetting(hContact, "AvatarSavedHash");
- delSetting(hContact, "AvatarUrl");
- delSetting(hContact, "PictContext");
- delSetting(hContact, "PictSavedContext");
-
- ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, nullptr);
- }
- }
- else if (lastStatus == ID_STATUS_OFFLINE)
- delSetting(hContact, "MirVer");
-}
-
-void CMsnProto::MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid)
-{
- MCONTACT hContact = MSN_HContactFromEmail(wlid);
- if (hContact == NULL) return;
-
- char* szEmail, *szNetId, *szInst;
- parseWLID(NEWSTR_ALLOCA(wlid), &szNetId, &szEmail, &szInst);
-
- bool bHasPSM = false;
- char* szStatMsg = nullptr;
-
- for (ezxml_t s = ezxml_child(xmli, "s"); s; s = s->next) {
- const char *n = ezxml_attr(s, "n");
- if (!mir_strcmp(n, "SKP")) {
- szStatMsg = ezxml_txt(ezxml_child(s, "Mood"));
- if (*szStatMsg) db_set_utf(hContact, "CList", "StatusMsg", szStatMsg);
- else if (!bHasPSM) db_unset(hContact, "CList", "StatusMsg");
- }
- else if (!mir_strcmp(n, "PE")) {
- szStatMsg = ezxml_txt(ezxml_child(s, "PSM"));
- if (*szStatMsg) {
- stripBBCode((char*)szStatMsg);
- stripColorCode((char*)szStatMsg);
- db_set_utf(hContact, "CList", "StatusMsg", szStatMsg);
- bHasPSM = true;
- }
- else db_unset(hContact, "CList", "StatusMsg");
- }
- }
-
- // Add endpoints
- for (ezxml_t endp = ezxml_child(xmli, "sep"); endp; endp = ezxml_next(endp)) {
- const char *n = ezxml_attr(endp, "n");
- if (!mir_strcmp(n, "IM")) {
- const char *id = ezxml_attr(endp, "epid");
- const char *caps = ezxml_txt(ezxml_child(endp, "Capabilities"));
- char* end = nullptr;
- unsigned cap1 = caps ? strtoul(caps, &end, 10) : 0;
- unsigned cap2 = end && *end == ':' ? strtoul(end + 1, nullptr, 10) : 0;
-
- Lists_AddPlace(szEmail, id, cap1, cap2);
- }
- else if (!mir_strcmp(n, "PE")) {
- MsnPlace *place = Lists_GetPlace(szEmail, ezxml_attr(endp, "epid"));
- if (place) {
- place->client = atoi(ezxml_txt(ezxml_child(endp, "TYP")));
- mir_strncpy(place->szClientVer, ezxml_txt(ezxml_child(endp, "VER")), sizeof(place->szClientVer));
- }
- }
- }
-
- if (szInst)
- MSN_SetMirVer(hContact, Lists_GetPlace(szEmail, szInst));
- else {
- MsnContact *cont = Lists_Get(hContact);
- if (cont->places.getCount() > 0)
- MSN_SetMirVer(hContact, &cont->places[0]);
- }
- ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, nullptr, ptrW(mir_utf8decodeW(szStatMsg)));
-}
-
-void CMsnProto::MSN_ProcessNotificationMessage(char* buf, size_t len)
-{
- if (buf == nullptr) return;
- ezxml_t xmlnot = ezxml_parse_str(buf, len);
-
- if (mir_strcmp(ezxml_attr(xmlnot, "siteid"), "0") == 0) {
- ezxml_free(xmlnot);
- return;
- }
-
- ezxml_t xmlmsg = ezxml_child(xmlnot, "MSG");
- ezxml_t xmlact = ezxml_child(xmlmsg, "ACTION");
- ezxml_t xmlbdy = ezxml_child(xmlmsg, "BODY");
- ezxml_t xmltxt = ezxml_child(xmlbdy, "TEXT");
-
- if (xmltxt != nullptr) {
- char fullurl[1024];
- size_t sz = 0;
-
- const char* acturl = ezxml_attr(xmlact, "url");
- if (acturl == nullptr || strstr(acturl, "://") == nullptr)
- sz += mir_snprintf((fullurl + sz), (_countof(fullurl) - sz), "%s", ezxml_attr(xmlnot, "siteurl"));
-
- sz += mir_snprintf((fullurl + sz), (_countof(fullurl) - sz), "%s", acturl);
- if (sz != 0 && fullurl[sz - 1] != '?')
- sz += mir_snprintf((fullurl + sz), (_countof(fullurl) - sz), "?");
-
- mir_snprintf((fullurl + sz), (_countof(fullurl) - sz), "notification_id=%s&message_id=%s",
- ezxml_attr(xmlnot, "id"), ezxml_attr(xmlmsg, "id"));
-
- Skin_PlaySound(alertsoundname);
-
- wchar_t* alrt = mir_utf8decodeW(ezxml_txt(xmltxt));
- MSN_ShowPopup(TranslateT("MSN Alert"), alrt, MSN_ALERT_POPUP | MSN_ALLOW_MSGBOX, fullurl);
- mir_free(alrt);
- }
- else if (xmlbdy) {
- const char *txt = ezxml_txt(xmlbdy);
- if (strstr(txt, "ABCHInternal")) {
- MSN_SharingFindMembership(true);
- MSN_ABFind("ABFindContactsPaged", nullptr, true);
- MSN_StoreGetProfile();
- }
- }
- ezxml_free(xmlnot);
-}
-
-int CMsnProto::MSN_HandleCommands(ThreadData* info, char* cmdString)
-{
- char* params = "";
- int trid = -1;
-
- if (cmdString[3]) {
- if (isdigit((BYTE)cmdString[4])) {
- trid = strtol(cmdString + 4, &params, 10);
- switch (*params) {
- case ' ': case '\0': case '\t': case '\n':
- while (*params == ' ' || *params == '\t')
- params++;
- break;
-
- default:
- params = cmdString + 4;
- }
- }
- else params = cmdString + 4;
- }
-
- switch ((*(PDWORD)cmdString & 0x00FFFFFF) | 0x20000000) {
-
- case ' SBS':
- break;
-
- case ' HTA': //********* ATH: MSNP21+ Authentication
- {
- union
- {
- char* tWords[2];
- struct { char *typeId, *strMsgBytes; } data;
- };
-
- if (sttDivideWords(params, _countof(tWords), tWords) < 2) {
-LBL_InvalidCommand:
- debugLogA("Invalid %.3s command, ignoring", cmdString);
- break;
- }
-
- HReadBuffer buf(info, 0);
- buf.surelyRead(atol(data.strMsgBytes));
-
- if (!bIgnoreATH) {
- if (!bSentBND) {
- info->sendPacketPayload("BND", "CON\\MSGR",
- "<msgr><ver>%d</ver>%s<client><name>%s</name><ver>%s</ver></client>"
- "<epid>%.*s</epid></msgr>\r\n",
- msnP24Ver, (msnP24Ver > 1 ? "<altVersions><ver>1</ver></altVersions>" : ""),
- msnStoreAppId, msnProductVer,
- mir_strlen(MyOptions.szMachineGuid) - 2, MyOptions.szMachineGuid + 1);
- bSentBND = true;
- }
- else {
- msnLoggedIn = true;
- isConnectSuccess = true;
- emailEnabled = MyOptions.netId == NETID_MSN; // Let's assume it?
- MSN_SetServerStatus(m_iDesiredStatus);
- MSN_EnableMenuItems(true);
- // Fork refreshing and populating contact list to the background
- ForkThread(&CMsnProto::msn_loginThread, nullptr);
- }
- }
- else bIgnoreATH = false;
- }
- break;
-
- case ' DNB': //********* BND: MSNP21+ bind request answer?
- {
- union
- {
- char* tWords[2];
- struct { char *typeId, *strMsgBytes; } data;
- };
-
- if (sttDivideWords(params, _countof(tWords), tWords) < 2)
- goto LBL_InvalidCommand;
-
- MimeHeaders tHeader;
- HReadBuffer buf(info, 0);
- BYTE *msgb = buf.surelyRead(atol(data.strMsgBytes));
- if (!msgb) break;
- char* msgBody = tHeader.readFromBuffer((char*)msgb);
-
- replaceStr(msnRegistration, tHeader["Set-Registration"]);
- if (!mir_strcmp(data.typeId, "CON")) {
- ezxml_t xmlbnd = ezxml_parse_str(msgBody, mir_strlen(msgBody));
- ezxml_t xmlbdy = ezxml_child(xmlbnd, "nonce");
- if (xmlbdy) {
- char dgst[64];
- MSN_MakeDigest(xmlbdy->txt, dgst);
- info->sendPacketPayload("PUT", "MSGR\\CHALLENGE",
- "<challenge><appId>%s</appId><response>%s</response></challenge>\r\n",
- msnProductID, dgst);
- }
- ezxml_free(xmlbnd);
- }
- }
- break;
-
- case ' TNC': //********* CNT: Connect, MSNP21+ Authentication
- {
- union
- {
- char* tWords[2];
- struct { char *typeId, *strMsgBytes; } data;
- };
-
- if (sttDivideWords(params, _countof(tWords), tWords) < 2)
- goto LBL_InvalidCommand;
-
- HReadBuffer buf(info, 0);
- char* msgBody = (char*)buf.surelyRead(atol(data.strMsgBytes));
- if (mir_strcmp(data.typeId, "CON")) break;
-
- if (MyOptions.netId != NETID_SKYPE) {
- /* MSN account login */
-
- if (MSN_AuthOAuth() < 1) {
- m_iDesiredStatus = ID_STATUS_OFFLINE;
- return 1;
- }
-
- }
- else {
- /* Skype username/pass login */
- if (!msgBody) break;
- ezxml_t xmlcnt = ezxml_parse_str(msgBody, mir_strlen(msgBody));
- ezxml_t xmlnonce = ezxml_child(xmlcnt, "nonce");
- if (xmlnonce) {
- char szUIC[1024] = { 0 };
-
- MSN_SkypeAuth(xmlnonce->txt, szUIC);
- replaceStr(authUIC, szUIC);
- }
- ezxml_free(xmlcnt);
- }
- MSN_SendATH(info);
-
- bSentBND = false;
- if (!hKeepAliveThreadEvt)
- ForkThread(&CMsnProto::msn_keepAliveThread, nullptr);
- }
- break;
-
- case ' TEG': //********* GET: MSNP21+ GET reply
- {
- union
- {
- char* tWords[2];
- struct { char *typeId, *strMsgBytes; } data;
- };
-
- if (sttDivideWords(params, _countof(tWords), tWords) < 2)
- goto LBL_InvalidCommand;
-
- MimeHeaders tHeader;
- HReadBuffer buf(info, 0);
- BYTE *msgb = buf.surelyRead(atol(data.strMsgBytes));
- if (!msgb) break;
- char* msgBody = tHeader.readFromBuffer((char*)msgb);
- ezxml_t xmli;
-
- if (tHeader["Set-Registration"]) replaceStr(msnRegistration, tHeader["Set-Registration"]);
- if (xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody))) {
- if (!mir_strcmp(xmli->name, "recentconversations-response")) {
- for (ezxml_t conv = ezxml_get(xmli, "conversations", 0, "conversation", -1); conv != nullptr; conv = ezxml_next(conv)) {
- ezxml_t id;
- MCONTACT hContact;
- MEVENT hDbEvent;
- DWORD ts = 1;
-
- if (ezxml_get(conv, "messages", 0, "message", -1) && (id = ezxml_child(conv, "id"))) {
- if (strncmp(id->txt, "19:", 3) == 0) {
- /* This is a thread (Groupchat)
- * Find out about its current state on the server */
- hContact = MSN_HContactFromChatID(id->txt);
- msnNsThread->sendPacketPayload("GET", "MSGR\\THREADS",
- "<threads><thread><id>%s</id></thread></threads>", id->txt);
- }
- else hContact = MSN_HContactFromEmail(id->txt, nullptr, false, false);
-
- if (hContact) {
- // There are messages to be fetched
- if (hDbEvent = db_event_last(hContact)) {
- DBEVENTINFO dbei = {};
- db_event_get(hDbEvent, &dbei);
- ts = dbei.timestamp;
- }
- db_set_dw(hContact, m_szModuleName, "syncTS", ts);
- }
- msnNsThread->sendPacketPayload("GET", "MSGR\\MESSAGESBYCONVERSATION",
- "<messagesbyconversation><id>%s</id><start>%llu</start><pagesize>100</pagesize></messagesbyconversation>",
- id->txt, ((unsigned __int64)ts) * 1000);
- }
- }
- }
- else if (!mir_strcmp(xmli->name, "messagesbyconversation-response")) {
- ezxml_t id;
- MCONTACT hContact;
-
- if ((id = ezxml_child(xmli, "id"))) {
- bool bIsChat = strncmp(id->txt, "19:", 3) == 0;
- bool bHasMore = mir_strcmpi(ezxml_txt(ezxml_child(xmli, "hasmore")), "true") == 0;
- ezxml_t syncstate;
- hContact = MSN_HContactFromEmail(id->txt, nullptr, false, false);
- if (!bHasMore && hContact) db_unset(hContact, m_szModuleName, "syncTS");
-
- /* We have to traverse the list in reverse order as newest events are on top (which is the opposite direction of Groupchat) */
- LIST<ezxml> msgs(10, PtrKeySortT);
- for (ezxml_t msg = ezxml_get(xmli, "messages", 0, "message", -1); msg != nullptr; msg = ezxml_next(msg)) msgs.insert(msg, 0);
- for (auto &msg : msgs) {
- ezxml_t arrtime = ezxml_child(msg, "originalarrivaltime"), from = ezxml_child(msg, "from"),
- msgtype = ezxml_child(msg, "messagetype"), content = ezxml_child(msg, "content");
- time_t ts;
- char *netId, *email, *message;
- bool sentMsg;
-
- if (!arrtime || !from || !content) continue;
- ts = IsoToUnixTime(arrtime->txt);
- parseWLID(NEWSTR_ALLOCA(from->txt), &netId, &email, nullptr);
- message = content->txt;
- sentMsg = mir_strcmpi(email, GetMyUsername(atoi(netId))) == 0;
- if (msgtype) {
- if (!mir_strcmp(msgtype->txt, "RichText")) {
- message = NEWSTR_ALLOCA(message);
- stripHTML(message);
- HtmlDecode(message);
- }
- else if (!strncmp(msgtype->txt, "ThreadActivity/", 15)) {
- if (ezxml_t xmlact = ezxml_parse_str(content->txt, mir_strlen(content->txt))) {
- MSN_GCProcessThreadActivity(xmlact, _A2T(id->txt));
- ezxml_free(xmlact);
- }
- continue;
- }
- else if (!mir_strcmp(msgtype->txt, "RichText/UriObject") || !mir_strcmp(msgtype->txt, "RichText/Media_GenericFile")) {
- if (ezxml_t xmlact = ezxml_parse_str(content->txt, mir_strlen(content->txt))) {
- MSN_ProcessURIObject(hContact, xmlact);
- ezxml_free(xmlact);
- }
- continue;
- }
- else if (mir_strcmp(msgtype->txt, "Text")) continue; /* TODO: Implement i.e. RichText/Files for announcement of file transfers */
- }
-
- if (bIsChat) {
- hContact = MSN_HContactFromEmail(from->txt, nullptr, false, false);
- if (hContact)
- db_unset(hContact, m_szModuleName, "syncTS");
- MSN_GCAddMessage(_A2T(id->txt), hContact, email, ts, sentMsg, message);
- }
- else if (hContact) {
- /* Protect against double sync (Miranda MSGs only have granularity in seconds) */
- MEVENT hDbEvent;
- bool bDuplicate = false;
- DBEVENTINFO dbei = {};
- DWORD cbBlob = (DWORD)mir_strlen(message);
- dbei.cbBlob = cbBlob;
- BYTE *pszMsgBuf = (BYTE*)mir_calloc(cbBlob);
- if (pszMsgBuf) {
- dbei.pBlob = pszMsgBuf;
- for ((hDbEvent = db_event_last(hContact));
- !bDuplicate && hDbEvent;
- hDbEvent = db_event_prev(hContact, hDbEvent)) {
- if (db_event_get(hDbEvent, &dbei) || dbei.timestamp > ts + 1 || dbei.timestamp < ts) break;
- if (!memcmp((char*)dbei.pBlob, message, cbBlob)) bDuplicate = true;
- dbei.cbBlob = cbBlob;
- }
- mir_free(pszMsgBuf);
- if (bDuplicate) continue;
- }
-
- if (!sentMsg) {
- PROTORECVEVENT pre = { 0 };
- pre.szMessage = (char*)message;
- pre.timestamp = (DWORD)ts;
- ProtoChainRecvMsg(hContact, &pre);
- }
- else {
- memset(&dbei, 0, sizeof(dbei));
- dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.flags = DBEF_SENT | DBEF_UTF;
- dbei.szModule = m_szModuleName;
- dbei.timestamp = ts;
- dbei.cbBlob = (unsigned)mir_strlen(message) + 1;
- dbei.pBlob = (PBYTE)message;
- db_event_add(hContact, &dbei);
- }
- }
- }
- /* In groupchat it wouldn't make much sense to sync more as older messages are coming now and that would jumble our log */
- if (!bIsChat && bHasMore && (syncstate = ezxml_child(xmli, "messagessyncstate"))) {
- msnNsThread->sendPacketPayload("GET", "MSGR\\MESSAGESBYCONVERSATION",
- "<messagesbyconversation><id>%s</id><start>%llu</start><messagessyncstate>%s</messagessyncstate><pagesize>100</pagesize></messagesbyconversation>",
- id->txt, ((unsigned __int64)db_get_dw(hContact, m_szModuleName, "syncTS", 1000)) * 1000, syncstate->txt);
- }
- msgs.destroy();
- }
- }
- else if (!mir_strcmp(xmli->name, "threads-response")) {
- for (ezxml_t thread = ezxml_get(xmli, "threads", 0, "thread", -1); thread != nullptr; thread = ezxml_next(thread))
- MSN_ChatStart(thread);
- }
- ezxml_free(xmli);
- }
-
- }
- break;
-
- case ' YFN': //********* NFY: MSNP21+ Notifications
- {
- union
- {
- char* tWords[2];
- struct { char *typeId, *strMsgBytes; } data;
- };
-
- if (sttDivideWords(params, _countof(tWords), tWords) < 2)
- goto LBL_InvalidCommand;
-
- HReadBuffer buf(info, 0);
- char* msgBody = (char*)buf.surelyRead(atol(data.strMsgBytes));
- if (msgBody == nullptr) break;
- if (!mir_strcmp(data.typeId, "MSGR\\HOTMAIL")) {
- char szParam[128];
- mir_snprintf(szParam, sizeof(szParam), "%s %s", data.typeId, data.strMsgBytes);
- MSN_ReceiveMessage(info, cmdString, szParam);
- break;
- }
- else if (!mir_strcmp(data.typeId, "MSGR\\ABCH")) {
- MimeHeaders tHeader;
- msgBody = tHeader.readFromBuffer(msgBody);
- MSN_ProcessNotificationMessage(msgBody, mir_strlen(msgBody));
- break;
- }
-
- if (!mir_strcmp(data.typeId, "MSGR\\PUT") || !mir_strcmp(data.typeId, "MSGR\\DEL")) {
- MimeHeaders tHeader;
-
- int i;
- for (i = 0; i < 2; i++) msgBody = tHeader.readFromBuffer(msgBody);
- char *pszTo = nullptr, *pszToNet;
- if (tHeader["To"]) parseWLID(NEWSTR_ALLOCA(tHeader["To"]), &pszToNet, &pszTo, nullptr);
- const char *pszFrom = tHeader["From"];
- for (i = 0; i < 2; i++) msgBody = tHeader.readFromBuffer(msgBody);
-
- if (pszFrom) {
- ezxml_t xmli;
- if (xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody))) {
- if (!mir_strcmp(xmli->name, "user")) {
- ezxml_t xmlstatus = ezxml_get(xmli, "s", 0, "Status", -1);
- /* FIXME: MSGR\DEL: Instance of user with given EPID disconnected, not
- * sure if this implies that contact is offline now... */
- if (xmlstatus || !mir_strcmp(data.typeId, "MSGR\\DEL")) {
- // These capabilities seem to be something different than in previous MSNP versions?
- //ezxml_t xmlcaps = ezxml_get(xmli, "sep", 0, "Capabilities", -1);
- ezxml_t usertile = ezxml_get(xmli, "s", 1, "UserTileLocation", -1);
- MSN_ProcessNLN(ezxml_txt(xmlstatus), pszFrom, nullptr, nullptr, usertile ? usertile->txt : nullptr);
- }
- MSN_ProcessStatusMessage(xmli, pszFrom);
- }
- ezxml_free(xmli);
- }
- }
- }
- else if (!mir_strcmp(data.typeId, "MSGR\\THREAD")) {
- MimeHeaders tHeader;
- char *szBody = tHeader.readFromBuffer(info->mData);
- ezxml_t xmli = ezxml_parse_str(szBody, mir_strlen(szBody));
- if (xmli) {
- MSN_ChatStart(xmli);
- ezxml_free(xmli);
- }
- }
- }
- break;
-
- case ' TUP': //******** MSNP21+: PUT notifications
- case ' GNP': //******** MSNP21+: PNG reply
- {
- union
- {
- char* tWords[2];
- struct { char *typeId, *strMsgBytes; } data;
- };
-
- if (sttDivideWords(params, _countof(tWords), tWords) < 2)
- goto LBL_InvalidCommand;
-
- MimeHeaders tHeader;
- HReadBuffer buf(info, 0);
- BYTE *msgb = buf.surelyRead(atol(data.strMsgBytes));
- if (!msgb) break;
- char* msgBody = tHeader.readFromBuffer((char*)msgb);
-
- if (tHeader["Set-Registration"]) replaceStr(msnRegistration, tHeader["Set-Registration"]);
- if (cmdString[1] == 'N') { // PNG
- if (ezxml_t xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody))) {
- if (ezxml_t wait = ezxml_child(xmli, "wait")) {
- msnPingTimeout = atoi(ezxml_txt(wait));
- if (msnPingTimeout && hKeepAliveThreadEvt != nullptr)
- SetEvent(hKeepAliveThreadEvt);
- }
- ezxml_free(xmli);
- }
- }
- else { // PUT
- ezxml_t xmli;
- if (*msgBody && (xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody)))) {
- if (!mir_strcmp(xmli->name, "presence-response")) {
- ezxml_t user, from;
- if ((user = ezxml_child(xmli, "user")) && (from = ezxml_child(xmli, "from"))) {
- if (ezxml_t xmlstatus = ezxml_get(user, "s", 0, "Status", -1)) {
- ezxml_t usertile = ezxml_get(user, "s", 1, "UserTileLocation", -1);
- MSN_ProcessNLN(ezxml_txt(xmlstatus), from->txt, nullptr, nullptr, usertile ? usertile->txt : nullptr);
- }
- else {
- int oldMode = m_iStatus;
- m_iStatus = m_iDesiredStatus;
- ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldMode, m_iStatus);
- }
- MSN_ProcessStatusMessage(user, from->txt);
- }
- }
- ezxml_free(xmli);
- }
- }
- }
- break;
-
- case ' GDS': // SDG: MSNP21+ Messaging
- MSN_ReceiveMessage(info, cmdString, params);
- break;
-
- case ' RFX': //******** XFR: sections 7.4 Referral, 8.1 Referral to Switchboard
- {
- union
- {
- char* tWords[2];
- struct { char *typeId, *strMsgBytes; } data;
- };
-
- if (sttDivideWords(params, _countof(tWords), tWords) < 2)
- goto LBL_InvalidCommand;
-
- MimeHeaders tHeader;
- HReadBuffer buf(info, 0);
- BYTE *msgb = buf.surelyRead(atol(data.strMsgBytes));
- if (!msgb) break;
- char* msgBody = tHeader.readFromBuffer((char*)msgb);
- if (!mir_strcmp(data.typeId, "CON")) {
- ezxml_t xmlxfr = ezxml_parse_str(msgBody, mir_strlen(msgBody));
- ezxml_t xmltgt = ezxml_child(xmlxfr, "target");
- if (xmltgt) {
- ThreadData* newThread = new ThreadData;
- mir_strcpy(newThread->mServer, xmltgt->txt);
- mir_strcpy(newThread->mState, ezxml_txt(ezxml_child(xmlxfr, "state")));
- newThread->mType = SERVER_NOTIFICATION;
- newThread->mTrid = info->mTrid;
- newThread->mIsMainThread = true;
- info->mIsMainThread = false;
-
- debugLogA("Switching to notification server '%s'...", xmltgt->txt);
- newThread->startThread(&CMsnProto::MSNServerThread, this);
- ezxml_free(xmlxfr);
- return 1; //kill the old thread
- }
- ezxml_free(xmlxfr);
- }
- }
- break;
-
- default:
- debugLogA("Unrecognised message: %s", cmdString);
- break;
- }
-
- return 0;
-}
diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp
deleted file mode 100644
index 80ac094b31..0000000000
--- a/protocols/MSN/src/msn_contact.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-MCONTACT CMsnProto::MSN_HContactFromEmail(const char* wlid, const char* msnNick, bool addIfNeeded, bool temporary)
-{
- MCONTACT hContact = NULL;
-
- char *szEmail, *szNet = nullptr;
- parseWLID(NEWSTR_ALLOCA(wlid), &szNet, &szEmail, nullptr);
-
- MsnContact *msc = Lists_Get(szEmail);
- if (msc && msc->hContact)
- hContact = msc->hContact;
-
- if (hContact == NULL && addIfNeeded) {
- int netId = (msc && msc->netId)?msc->netId:(szNet?atoi(szNet):NETID_MSN);
- hContact = db_add_contact();
- Proto_AddToContact(hContact, m_szModuleName);
- if (netId != NETID_SKYPE)
- setString(hContact, "e-mail", szEmail);
- setStringUtf(hContact, "Nick", msnNick ? msnNick : szEmail);
- setWord(hContact, "netId", netId);
- setString(hContact, "wlid", szEmail);
- if (temporary)
- Contact_RemoveFromList(hContact);
-
- Lists_Add(0, szNet?atoi(szNet):NETID_MSN, szEmail, hContact);
- }
-
- return hContact;
-}
-
-MCONTACT CMsnProto::MSN_HContactFromChatID(const char* wlid)
-{
- for (auto &hContact : AccContacts()) {
- if (isChatRoom(hContact) != 0) {
- DBVARIANT dbv;
- if (getString(hContact, "ChatRoomID", &dbv) == 0) {
- if (mir_strcmp(dbv.pszVal, wlid) == 0) {
- db_free(&dbv);
- return hContact;
- }
- db_free(&dbv);
- }
- }
- }
- return NULL;
-}
-
-
-void CMsnProto::MSN_SetContactDb(MCONTACT hContact, const char *szEmail)
-{
- MsnContact *cont = Lists_Get(szEmail);
- if (cont == nullptr)
- return;
- const int listId = cont->list;
-
- if (listId & LIST_FL) {
- if (!Contact_OnList(hContact)) {
- Contact_PutOnList(hContact);
- Contact_Hide(hContact, false);
- }
-
- if (listId & (LIST_BL | LIST_AL)) {
- WORD tApparentMode = getWord(hContact, "ApparentMode", 0);
- if ((listId & LIST_BL) && tApparentMode == 0)
- setWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
- else if ((listId & LIST_AL) && tApparentMode != 0)
- delSetting(hContact, "ApparentMode");
- }
-
- if (cont->netId == NETID_MOB) {
- setWord(hContact, "Status", ID_STATUS_ONLINE);
- setString(hContact, "MirVer", "SMS");
- }
- }
- if (listId & LIST_LL)
- setByte(hContact, "LocalList", 1);
- else
- delSetting(hContact, "LocalList");
-}
-
-
-void CMsnProto::AddDelUserContList(const char* email, const int list, const int netId, const bool del)
-{
- if (del)
- Lists_Remove(list, email);
- else
- Lists_Add(list, netId, email);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_AddUser - adds a e-mail address to one of the MSN server lists
-
-bool CMsnProto::MSN_AddUser(MCONTACT hContact, const char* email, int netId, int flags, const char *msg)
-{
- bool needRemove = (flags & LIST_REMOVE) != 0;
- bool leaveHotmail = (flags & LIST_REMOVENH) == LIST_REMOVENH;
- flags &= 0xFF;
-
- if (needRemove != Lists_IsInList(flags, email))
- return true;
-
- bool res = false;
- if (MyOptions.netId == NETID_SKYPE) {
- if (flags & LIST_BL) {
- if (needRemove) return MSN_SKYABBlockContact(email, "unblock");
- return MSN_SKYABBlockContact(email, "block");
- }
- else if ((flags & LIST_FL)) {
- if (!needRemove) return MSN_SKYABAuthRq(email, msg);
- if (!leaveHotmail) return MSN_SKYABDeleteContact(email);
- return true;
- }
- else if ((flags & LIST_AL) && !needRemove) return MSN_SKYABAuthRsp(email, "accept");
- else if ((flags & LIST_RL) && !needRemove) return MSN_SKYABAuthRsp(email, "decline");
- } else {
- if (flags == LIST_FL) {
- if (needRemove) {
- if (hContact == NULL) {
- hContact = MSN_HContactFromEmail(email);
- if (hContact == NULL)
- return false;
- }
-
- char id[MSN_GUID_LEN];
- if (!db_get_static(hContact, m_szModuleName, "ID", id, _countof(id))) {
- int netId2 = Lists_GetNetId(email);
- if (leaveHotmail)
- res = MSN_ABAddRemoveContact(id, netId2, false);
- else
- res = MSN_ABAddDelContactGroup(id, nullptr, "ABContactDelete");
- if (res)
- AddDelUserContList(email, flags, netId2, true);
-
- delSetting(hContact, "GroupID");
- delSetting(hContact, "ID");
- MSN_RemoveEmptyGroups();
- }
- }
- else {
- DBVARIANT dbv = { 0 };
- if (!mir_strcmp(email, MyOptions.szEmail))
- getStringUtf("Nick", &dbv);
-
- unsigned res1 = MSN_ABContactAdd(email, dbv.pszVal, netId, msg, false);
- if (netId == NETID_MSN && res1 == 2) {
- netId = NETID_LCS;
- res = MSN_ABContactAdd(email, dbv.pszVal, netId, msg, false) == 0;
- }
- else if (netId == NETID_MSN && res1 == 3) {
- char szContactID[100];
- hContact = MSN_HContactFromEmail(email);
- if (db_get_static(hContact, m_szModuleName, "ID", szContactID, sizeof(szContactID)) == 0) {
- MSN_ABAddRemoveContact(szContactID, netId, true);
- res = true;
- }
- }
- else res = (res1 == 0);
-
- if (res) {
- DBVARIANT dbv2;
- if (!db_get_utf(hContact, "CList", "Group", &dbv2)) {
- MSN_MoveContactToGroup(hContact, dbv2.pszVal);
- db_free(&dbv2);
- }
-
- char szContactID[100];
- if (db_get_static(hContact, m_szModuleName, "ID", szContactID, sizeof(szContactID)) == 0)
- MSN_ABFind("ABFindByContacts", szContactID);
-
- MSN_SharingFindMembership(true);
- AddDelUserContList(email, flags, netId, false);
- }
-
- db_free(&dbv);
- }
- }
- else if (flags == LIST_LL) {
- if (needRemove)
- Lists_Remove(LIST_LL, email);
- else
- Lists_Add(LIST_LL, NETID_MSN, email);
- }
- else {
- if (netId == 0)
- netId = Lists_GetNetId(email);
- res = MSN_SharingAddDelMember(email, flags, netId, needRemove ? "DeleteMember" : "AddMember");
- AddDelUserContList(email, flags, netId, needRemove);
-
- if ((flags & LIST_PL) && needRemove)
- MSN_AddUser(hContact, email, netId, LIST_RL);
- }
- }
- return res;
-}
-
-bool CMsnProto::MSN_RefreshContactList(void)
-{
- Lists_Wipe();
- Lists_Populate();
-
- /*
- if (MyOptions.netId != NETID_SKYPE)
- {
- // Get your own profile info (does not work anymore, byrdr died)
- //MSN_SharingFindMembership();
-
- if (m_iDesiredStatus == ID_STATUS_OFFLINE) return false;
-
- // Get "classic" MSN contacts (does not work anymore, byrdr died)
- // MSN_ABFind("ABFindContactsPaged", NULL);
-
- // Get Skype contacts on linked profiles
- if (!MSN_ABRefreshClist()) return false;
-
- if (m_iDesiredStatus == ID_STATUS_OFFLINE) return false;
-
- // Remove contacts not on server etc.
- MSN_CleanupLists();
-
- if (m_iDesiredStatus == ID_STATUS_OFFLINE) return false;
-
- msnLoggedIn = true;
-
- // Populate Contact list on MSN network to get status updates of contacts
- MSN_CreateContList();
-
- // Read my own profile from SOAP AB (does not work anymore, byrdr died)
- //MSN_StoreGetProfile();
- }
- else
- */
- {
- // Refresh Skype contact list
- MSN_SKYABRefreshClist();
-
- // Populate Contact list on MSN network to get status updates of contacts
- MSN_CreateContList();
- }
-
- // Refresh Threads which are also part of the contact list
- if (msnP24Ver>1) MSN_GCRefreshThreadsInfo();
-
- return true;
-}
diff --git a/protocols/MSN/src/msn_errors.cpp b/protocols/MSN/src/msn_errors.cpp
deleted file mode 100644
index 25cd2ec289..0000000000
--- a/protocols/MSN/src/msn_errors.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-int CMsnProto::MSN_HandleErrors(ThreadData* info, char* cmdString)
-{
- int errorCode, packetID = -1;
- sscanf(cmdString, "%d %d", &errorCode, &packetID);
-
- char* params = "";
- int trid = -1;
-
- if (cmdString[3]) {
- if (isdigit((BYTE)cmdString[4])) {
- trid = strtol(cmdString + 4, &params, 10);
- switch (*params) {
- case ' ': case '\0': case '\t': case '\n':
- while (*params == ' ' || *params == '\t')
- params++;
- break;
-
- default:
- params = cmdString + 4;
- }
- }
- else params = cmdString + 4;
- }
-
- union {
- char* tWords[2];
- struct { char *typeId, *strMsgBytes; } data;
- };
-
- if (sttDivideWords(params, _countof(tWords), tWords) < 2) {
- debugLogA("Invalid %.3s command, ignoring", cmdString);
- return 0;
- }
-
- HReadBuffer buf(info, 0);
- buf.surelyRead(atol(data.strMsgBytes));
- debugLogA("Server error:%s", cmdString);
-
- switch (errorCode) {
- case ERR_INTERNAL_SERVER:
- MSN_ShowError("MSN Services are temporarily unavailable, please try to connect later");
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NOSERVER);
- return 1;
-
- case ERR_SERVER_BUSY:
- case ERR_SERVER_UNAVAILABLE:
- case ERR_TIMEDOUT:
- MSN_ShowError("MSN Services are too busy, please try to connect later");
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NOSERVER);
- return 1;
-
- case ERR_NOT_ALLOWED_WHEN_OFFLINE:
- MSN_ShowError("MSN protocol does not allow you to communicate with others when you are invisible");
- return 0;
-
- case ERR_LIST_FULL:
- MSN_ShowError("MSN plugin cannot add a new contact because the contact list is full");
- return 0;
-
- case ERR_ALREADY_THERE:
- MSN_ShowError("User is already in your contact list");
- return 0;
-
- case ERR_DETAILED_ERR_IN_PAYLOAD:
- case ERR_LIST_UNAVAILABLE:
- case ERR_INVALID_USER:
- char* tErrWords[4];
- if (sttDivideWords(cmdString, _countof(tErrWords), tErrWords) == _countof(tErrWords))
- HReadBuffer(info, 0).surelyRead(atol(tErrWords[3]));
- return 0;
-
- case ERR_NOT_ONLINE:
- if (info->mInitialContactWLID)
- ProtoBroadcastAck(MSN_HContactFromEmail(info->mInitialContactWLID), ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)999999, (LPARAM)TranslateT("User not online"));
- else
- MSN_ShowError("User not online");
-
- return 1;
-
- case ERR_NOT_EXPECTED:
- MSN_ShowError("Your MSN account e-mail is unverified. Goto http://www.passport.com and verify the primary e-mail first");
- return 0;
-
- case ERR_AUTHENTICATION_FAILED:
- MSN_ShowError("Your username or password is incorrect");
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_WRONGPASSWORD);
- return 1;
-
- case 999:
- MSN_ShowError("Unknown error (999) occured, logging off");
- return 1;
-
- default:
- debugLogA("Unprocessed error: %s", cmdString);
- if (errorCode >= 500) //all these errors look fatal-ish
- MSN_ShowError("Unrecognised error %d. The server has closed our connection", errorCode);
-
- break;
- }
- return 0;
-}
diff --git a/protocols/MSN/src/msn_ieembed.cpp b/protocols/MSN/src/msn_ieembed.cpp
deleted file mode 100644
index b34ec7f437..0000000000
--- a/protocols/MSN/src/msn_ieembed.cpp
+++ /dev/null
@@ -1,446 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2007-2012 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include <exdispid.h>
-#include "msn_proto.h"
-#include "msn_ieembed.h"
-
-IEEmbedSink::IEEmbedSink(IEEmbed *smptr)
-{
- ieWindow = smptr;
-}
-
-IEEmbedSink::~IEEmbedSink() {}
-
-STDMETHODIMP IEEmbedSink::QueryInterface(REFIID riid, PVOID *ppv)
-{
- *ppv = nullptr;
- if (IID_IUnknown == riid)
- *ppv = (IUnknown *)this;
-
- if (IID_IDispatch == riid)
- *ppv = (IDispatch *)this;
-
- if (DIID_DWebBrowserEvents2 == riid)
- *ppv = (DWebBrowserEvents2*)this;
-
- if (nullptr != *ppv) {
- ((LPUNKNOWN)*ppv)->AddRef();
- return NOERROR;
- }
- return E_NOINTERFACE;
-}
-
-STDMETHODIMP_(ULONG) IEEmbedSink::AddRef(void)
-{
- ++m_cRef;
- return m_cRef;
-}
-
-STDMETHODIMP_(ULONG) IEEmbedSink::Release(void)
-{
- --m_cRef;
- return m_cRef;
-}
-
-STDMETHODIMP IEEmbedSink::GetTypeInfoCount(UINT *) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbedSink::GetTypeInfo(UINT, LCID, LPTYPEINFO*) { return S_OK; }
-STDMETHODIMP IEEmbedSink::GetIDsOfNames(REFIID, LPOLESTR*, UINT, LCID, DISPID*) { return S_OK; }
-
-STDMETHODIMP IEEmbedSink::Invoke(DISPID dispIdMember, REFIID, LCID, WORD, DISPPARAMS* pDispParams, VARIANT*, EXCEPINFO*, UINT*)
-{
- if (!pDispParams) return E_INVALIDARG;
- switch (dispIdMember) {
- case DISPID_DOCUMENTCOMPLETE:
- DocumentComplete(
- pDispParams->rgvarg[1].pdispVal,
- pDispParams->rgvarg[0].pvarVal);
- return S_OK;
- }
-
- return DISP_E_MEMBERNOTFOUND;
-}
-// DWebBrowserEvents2
-
-void IEEmbedSink::StatusTextChange(BSTR) {}
-void IEEmbedSink::ProgressChange(long, long) {}
-void IEEmbedSink::CommandStateChange(long, VARIANT_BOOL) {}
-void IEEmbedSink::DownloadBegin() {}
-void IEEmbedSink::DownloadComplete() {}
-void IEEmbedSink::TitleChange(BSTR) {}
-void IEEmbedSink::PropertyChange(BSTR) {}
-void IEEmbedSink::BeforeNavigate2(IDispatch*, VARIANT*, VARIANT*, VARIANT*, VARIANT*, VARIANT*, VARIANT_BOOL*) {}
-void IEEmbedSink::NewWindow2(IDispatch**, VARIANT_BOOL*) {}
-void IEEmbedSink::NavigateComplete(IDispatch*, VARIANT*) {}
-void IEEmbedSink::DocumentComplete(IDispatch*, VARIANT* url)
-{
- HWND hWnd;
- ieWindow->GetWindow(&hWnd);
- SendMessage(hWnd, UM_DOCCOMPLETE, 0, (LPARAM)url->bstrVal);
-}
-void IEEmbedSink::OnQuit() {}
-void IEEmbedSink::OnVisible(VARIANT_BOOL) {}
-void IEEmbedSink::OnToolBar(VARIANT_BOOL) {}
-void IEEmbedSink::OnMenuBar(VARIANT_BOOL) {}
-void IEEmbedSink::OnStatusBar(VARIANT_BOOL) {}
-void IEEmbedSink::OnFullScreen(VARIANT_BOOL) {}
-void IEEmbedSink::OnTheaterMode(VARIANT_BOOL) {}
-void IEEmbedSink::WindowSetResizable(VARIANT_BOOL) {}
-void IEEmbedSink::WindowSetLeft(long) {}
-void IEEmbedSink::WindowSetTop(long) {}
-void IEEmbedSink::WindowSetWidth(long) {}
-void IEEmbedSink::WindowSetHeight(long) {}
-void IEEmbedSink::WindowClosing(VARIANT_BOOL, VARIANT_BOOL*) {}
-void IEEmbedSink::ClientToHostWindow(long *, long *) {}
-void IEEmbedSink::SetSecureLockIcon(long) {}
-void IEEmbedSink::FileDownload(VARIANT_BOOL*) {}
-
-static LRESULT CALLBACK IEEmbedServerWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- IEEmbed **view = (IEEmbed **)GetWindowLongPtr(GetParent(GetParent(GetParent(hwnd))), GWLP_USERDATA);
- if (view && *view) {
- switch (message) {
- case WM_KEYDOWN:
- if (LOWORD(wParam) != VK_BACK)
- (*view)->translateAccelerator(message, wParam, lParam);
- break;
- }
-
- return CallWindowProc((*view)->getServerWndProc(), hwnd, message, wParam, lParam);
- }
- return DefWindowProc(hwnd, message, wParam, lParam);
-}
-
-static LRESULT CALLBACK IEEmbedDocWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- IEEmbed **view = (IEEmbed **)GetWindowLongPtr(GetParent(GetParent(hwnd)), GWLP_USERDATA);
- if (view && *view) {
- WNDPROC oldWndProc = (*view)->getDocWndProc();
- if (message == WM_PARENTNOTIFY && wParam == WM_CREATE) {
- SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)oldWndProc);
- (*view)->setServerWndProc((WNDPROC)SetWindowLongPtr((HWND)lParam, GWLP_WNDPROC, (LONG_PTR)IEEmbedServerWindowProcedure));
- }
- return CallWindowProc(oldWndProc, hwnd, message, wParam, lParam);
- }
- return DefWindowProc(hwnd, message, wParam, lParam);
-}
-
-static LRESULT CALLBACK IEEmbedWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- IEEmbed **view = (IEEmbed **)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
- if (view && *view) {
- WNDPROC oldWndProc = (*view)->getMainWndProc();
- if (message == WM_PARENTNOTIFY && wParam == WM_CREATE) {
- SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)oldWndProc);
- (*view)->setDocWndProc((WNDPROC)SetWindowLongPtr((HWND)lParam, GWLP_WNDPROC, (LONG_PTR)IEEmbedDocWindowProcedure));
- }
- return CallWindowProc(oldWndProc, hwnd, message, wParam, lParam);
- }
- return DefWindowProc(hwnd, message, wParam, lParam);
-}
-
-
-IEEmbed::IEEmbed(HWND _parent)
-{
- MSG msg;
- parent = _parent;
- GetClientRect(_parent, &rcClient);
- if (SUCCEEDED(pWebBrowser.CoCreateInstance(CLSID_WebBrowser, nullptr, CLSCTX_INPROC))) {
- CComPtr<IOleObject> pOleObject;
- if (SUCCEEDED(pWebBrowser.QueryInterface(&pOleObject))) {
- pOleObject->SetClientSite(this);
- pOleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, &msg, this, 0, this->parent, &rcClient);
- }
-
- CComPtr<IOleInPlaceObject> pOleInPlace;
- if (SUCCEEDED(pWebBrowser.QueryInterface(&pOleInPlace)))
- pOleInPlace->GetWindow(&hwnd);
-
- //setBorder();
- CComPtr<IConnectionPointContainer> pCPContainer;
- // Step 1: Get a pointer to the connection point container.
- if (SUCCEEDED(pWebBrowser.QueryInterface(&pCPContainer))) {
- // m_pConnectionPoint is defined like this:
- // Step 2: Find the connection point.
- if (SUCCEEDED(pCPContainer->FindConnectionPoint(DIID_DWebBrowserEvents2, &m_pConnectionPoint))) {
- // Step 3: Advise the connection point that you
- // want to sink its events.
- sink = new IEEmbedSink(this);
- m_pConnectionPoint->Advise(sink, &m_dwCookie);
- }
- }
- setMainWndProc((WNDPROC)SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)IEEmbedWindowProcedure));
- SetFocus(hwnd);
- }
-
- pWebBrowser->put_RegisterAsDropTarget(VARIANT_FALSE);
-}
-
-IEEmbed::~IEEmbed()
-{
- CComPtr<IOleObject> pOleObject;
- if (SUCCEEDED(pWebBrowser.QueryInterface(&pOleObject)))
- pOleObject->SetClientSite(nullptr);
-
- if (m_pConnectionPoint != nullptr)
- m_pConnectionPoint->Unadvise(m_dwCookie);
-
- delete sink;
- DestroyWindow(hwnd);
-}
-
-void IEEmbed::ResizeBrowser()
-{
- GetClientRect(parent, &rcClient);
-
- CComPtr<IOleInPlaceObject> pOleInPlace;
- if (SUCCEEDED(pWebBrowser.QueryInterface(&pOleInPlace)))
- pOleInPlace->SetObjectRects(&rcClient, &rcClient);
-}
-
-
-// IUnknown
-STDMETHODIMP IEEmbed::QueryInterface(REFIID riid, PVOID *ppv)
-{
- *ppv = nullptr;
- if (IID_IUnknown == riid)
- *ppv = this;
- if (IID_IOleClientSite == riid)
- *ppv = (IOleClientSite*)this;//Unknown)m_pIOleClientSite;
- if (IID_IOleWindow == riid || IID_IOleInPlaceSite == riid)
- *ppv = (IOleInPlaceSite*)this;//m_pIOleIPSite;
-
- if (nullptr != *ppv) {
- ((LPUNKNOWN)*ppv)->AddRef();
- return NOERROR;
- }
- return E_NOINTERFACE;
-}
-
-STDMETHODIMP_(ULONG) IEEmbed::AddRef(void)
-{
- ++m_cRef;
- return m_cRef;
-}
-
-STDMETHODIMP_(ULONG) IEEmbed::Release(void)
-{
- --m_cRef;
- return m_cRef;
-}
-
-// IDispatch
-STDMETHODIMP IEEmbed::GetTypeInfoCount(UINT *) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::GetTypeInfo(UINT, LCID, LPTYPEINFO*) { return S_OK; }
-STDMETHODIMP IEEmbed::GetIDsOfNames(REFIID, LPOLESTR*, UINT, LCID, DISPID*) { return S_OK; }
-STDMETHODIMP IEEmbed::Invoke(DISPID, REFIID, LCID, WORD, DISPPARAMS*, VARIANT*, EXCEPINFO*, UINT*) { return DISP_E_MEMBERNOTFOUND; }
-
-// IOleWindow
-STDMETHODIMP IEEmbed::GetWindow(HWND *phwnd)
-{
- *phwnd = parent;
- return S_OK;
-}
-
-STDMETHODIMP IEEmbed::ContextSensitiveHelp(BOOL) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::CanInPlaceActivate(void) { return S_OK; }
-STDMETHODIMP IEEmbed::OnInPlaceActivate(void) { return S_OK; }
-STDMETHODIMP IEEmbed::OnUIActivate(void) { return E_NOTIMPL; }
-
-STDMETHODIMP IEEmbed::GetWindowContext(IOleInPlaceFrame **, IOleInPlaceUIWindow **, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO)
-{
- lprcPosRect->left = rcClient.left;
- lprcPosRect->top = rcClient.top;
- lprcPosRect->right = rcClient.right;
- lprcPosRect->bottom = rcClient.bottom;
- lprcClipRect->left = rcClient.left;
- lprcClipRect->top = rcClient.top;
- lprcClipRect->right = rcClient.right;
- lprcClipRect->bottom = rcClient.bottom;
- return S_OK;
-}
-
-STDMETHODIMP IEEmbed::Scroll(SIZE) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::OnUIDeactivate(BOOL) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::OnInPlaceDeactivate(void) { return S_OK; }
-STDMETHODIMP IEEmbed::DiscardUndoState(void) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::DeactivateAndUndo(void) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::OnPosRectChange(LPCRECT) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::SaveObject(void) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::GetMoniker(DWORD, DWORD, IMoniker **) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::GetContainer(IOleContainer **) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::ShowObject(void) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::OnShowWindow(BOOL) { return E_NOTIMPL; }
-STDMETHODIMP IEEmbed::RequestNewObjectLayout(void) { return E_NOTIMPL; }
-
-
-void IEEmbed::setMainWndProc(WNDPROC wndProc)
-{
- mainWndProc = wndProc;
-}
-
-WNDPROC IEEmbed::getMainWndProc()
-{
- return mainWndProc;
-}
-
-void IEEmbed::setDocWndProc(WNDPROC wndProc)
-{
- docWndProc = wndProc;
-}
-
-WNDPROC IEEmbed::getDocWndProc()
-{
- return docWndProc;
-}
-
-void IEEmbed::setServerWndProc(WNDPROC wndProc)
-{
- serverWndProc = wndProc;
-}
-
-WNDPROC IEEmbed::getServerWndProc()
-{
- return serverWndProc;
-}
-
-void IEEmbed::write(const wchar_t *text)
-{
- CComPtr<IHTMLDocument2> document = getDocument();
- if (!document) return;
-
- SAFEARRAY *safe_array = ::SafeArrayCreateVector(VT_VARIANT, 0, 1);
- if (safe_array != nullptr) {
- VARIANT *variant;
- ::SafeArrayAccessData(safe_array, (LPVOID *)&variant);
- variant->vt = VT_BSTR;
- variant->bstrVal = ::SysAllocString(text);
- ::SafeArrayUnaccessData(safe_array);
- document->write(safe_array);
- // ::SysFreeString(bstr); // don't free it !!!!!!!
- ::SafeArrayDestroy(safe_array);
- document->close();
- }
-}
-
-void IEEmbed::addCookie(const wchar_t *cookieString)
-{
- CComPtr<IHTMLDocument2> document = getDocument();
- if (!document) return;
- BSTR cookie = SysAllocString(cookieString);
-
- document->put_cookie(cookie);
-
- SysFreeString(cookie);
-}
-
-BSTR IEEmbed::getCookies()
-{
- CComPtr<IHTMLDocument2> document = getDocument();
- BSTR cookie = nullptr;
-
- if (!document) return nullptr;
- document->get_cookie(&cookie);
- return cookie;
-}
-
-IHTMLDocument2* IEEmbed::getDocument()
-{
- CComPtr<IDispatch> dispatch;
- if (SUCCEEDED(pWebBrowser->get_Document(&dispatch)) && dispatch != nullptr) {
- CComPtr<IHTMLDocument2> document;
- dispatch.QueryInterface(&document);
- return document.Detach();
- }
-
- return nullptr;
-}
-
-void IEEmbed::navigate(const wchar_t *url)
-{
- BSTR tmp = ::SysAllocString(url);
- pWebBrowser->Navigate(tmp, nullptr, nullptr, nullptr, nullptr);
- ::SysFreeString(tmp);
-}
-
-void IEEmbed::navigate(char *url)
-{
- wchar_t *pwszUrl = mir_a2u(url);
- navigate(pwszUrl);
- mir_free(pwszUrl);
-}
-
-void IEEmbed::navigate(NETLIBHTTPREQUEST *nlhr)
-{
- BSTR bstrHeaders = SysAllocString(L"Content-Type: application/x-www-form-urlencoded\r\n");
-
- VARIANT vHeaders = {};
- V_VT(&vHeaders) = VT_BSTR;
- V_BSTR(&vHeaders) = bstrHeaders;
-
- VARIANT vPostData = {};
- VariantInit(&vPostData);
-
- LPSAFEARRAY psa = SafeArrayCreateVector(VT_UI1, 0, nlhr->dataLength);
- LPSTR pPostData;
- SafeArrayAccessData(psa, (LPVOID*)&pPostData);
- memcpy(pPostData, nlhr->pData, nlhr->dataLength);
- SafeArrayUnaccessData(psa);
-
- V_VT(&vPostData) = VT_ARRAY | VT_UI1;
- V_ARRAY(&vPostData) = psa;
- pWebBrowser->Navigate(_A2T(nlhr->szUrl), nullptr, nullptr, &vPostData, &vHeaders);
- SysFreeString(bstrHeaders);
- VariantClear(&vPostData);
-}
-
-char* IEEmbed::GetHTMLDoc()
-{
- CComPtr<IDispatch> spDispDoc;
- char *pszRet = nullptr;
-
- if (SUCCEEDED(pWebBrowser->get_Document(&spDispDoc))) {
- CComPtr<IHTMLDocument3> spDoc;
- if (SUCCEEDED(spDispDoc->QueryInterface(IID_IHTMLDocument3, (void**)&spDoc))) {
- CComPtr<IHTMLElement> spRootElement;
- if (SUCCEEDED(spDoc->get_documentElement(&spRootElement))) {
- BSTR bstrDoc;
- if (SUCCEEDED(spRootElement->get_outerHTML(&bstrDoc))) {
- pszRet = mir_u2a(bstrDoc);
- SysFreeString(bstrDoc);
- }
- }
- }
- }
- return pszRet;
-}
-
-void IEEmbed::translateAccelerator(UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
- CComPtr<IOleInPlaceActiveObject> pIOIPAO;
- if (SUCCEEDED(pWebBrowser.QueryInterface(&pIOIPAO))) {
- MSG msg;
- msg.message = uMsg;
- msg.wParam = wParam;
- msg.lParam = lParam;
- pIOIPAO->TranslateAccelerator(&msg);
- }
-}
diff --git a/protocols/MSN/src/msn_ieembed.h b/protocols/MSN/src/msn_ieembed.h
deleted file mode 100644
index e9b7e1e605..0000000000
--- a/protocols/MSN/src/msn_ieembed.h
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2007-2012 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-class IEEmbed;
-
-#include <mshtmhst.h>
-#include <mshtml.h>
-#include <exdisp.h>
-
-#include <msapi/comptr.h> // CComPtr
-
-#ifndef IEEMBED_INCLUDED
-#define IEEMBED_INCLUDED
-
-#define UM_DOCCOMPLETE (WM_USER+600)
-
-class IEEmbedSink :public DWebBrowserEvents2 {
-private:
- int m_cRef = 0;
- IEEmbed *ieWindow;
-public:
- IEEmbedSink(IEEmbed *);
- virtual ~IEEmbedSink();
- // IDispatch
- STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppv);
- STDMETHODIMP_(ULONG) AddRef(void);
- STDMETHODIMP_(ULONG) Release(void);
-
- STDMETHOD(GetTypeInfoCount)(UINT*);
- STDMETHOD(GetTypeInfo)(UINT, LCID, LPTYPEINFO*);
- STDMETHOD(GetIDsOfNames)(REFIID, LPOLESTR*, UINT, LCID, DISPID*);
- STDMETHOD(Invoke)(DISPID, REFIID, LCID, WORD, DISPPARAMS*, VARIANT*, EXCEPINFO*, UINT*);
- // DWebBrowserEvents2
- STDMETHODIMP_(void)StatusTextChange(BSTR);
- STDMETHODIMP_(void)ProgressChange(long, long);
- STDMETHODIMP_(void)CommandStateChange(long, VARIANT_BOOL);
- STDMETHODIMP_(void)DownloadBegin();
- STDMETHODIMP_(void)DownloadComplete();
- STDMETHODIMP_(void)TitleChange(BSTR Text);
- STDMETHODIMP_(void)PropertyChange(BSTR Text);
- STDMETHODIMP_(void)BeforeNavigate2(IDispatch*, VARIANT*, VARIANT*, VARIANT*, VARIANT*, VARIANT*, VARIANT_BOOL*);
- STDMETHODIMP_(void)NewWindow2(IDispatch**, VARIANT_BOOL*);
- STDMETHODIMP_(void)NavigateComplete(IDispatch*, VARIANT*);
- STDMETHODIMP_(void)DocumentComplete(IDispatch*, VARIANT*);
- STDMETHODIMP_(void)OnQuit();
- STDMETHODIMP_(void)OnVisible(VARIANT_BOOL);
- STDMETHODIMP_(void)OnToolBar(VARIANT_BOOL);
- STDMETHODIMP_(void)OnMenuBar(VARIANT_BOOL);
- STDMETHODIMP_(void)OnStatusBar(VARIANT_BOOL);
- STDMETHODIMP_(void)OnFullScreen(VARIANT_BOOL);
- STDMETHODIMP_(void)OnTheaterMode(VARIANT_BOOL);
- STDMETHODIMP_(void)WindowSetResizable(VARIANT_BOOL);
- STDMETHODIMP_(void)WindowSetLeft(long);
- STDMETHODIMP_(void)WindowSetTop(long);
- STDMETHODIMP_(void)WindowSetWidth(long);
- STDMETHODIMP_(void)WindowSetHeight(long);
- STDMETHODIMP_(void)WindowClosing(VARIANT_BOOL, VARIANT_BOOL*);
- STDMETHODIMP_(void)ClientToHostWindow(long*, long*);
- STDMETHODIMP_(void)SetSecureLockIcon(long);
- STDMETHODIMP_(void)FileDownload(VARIANT_BOOL*);
-};
-
-class IEEmbed :public IDispatch, public IOleClientSite, public IOleInPlaceSite
-{
-private:
- HWND parent;
- HWND hwnd;
- int m_cRef;
- RECT rcClient;
- DWORD m_dwCookie;
- CComPtr<IConnectionPoint> m_pConnectionPoint;
- CComPtr<IWebBrowser2> pWebBrowser;
- IEEmbedSink *sink;
- WNDPROC mainWndProc, docWndProc, serverWndProc;
-
-public:
- // IUnknown
- STDMETHODIMP QueryInterface(REFIID riid, PVOID *ppv);
- STDMETHODIMP_(ULONG) AddRef(void);
- STDMETHODIMP_(ULONG) Release(void);
-
- // IDispatch
- STDMETHOD(GetTypeInfoCount)(UINT*);
- STDMETHOD(GetTypeInfo)(UINT, LCID, LPTYPEINFO*);
- STDMETHOD(GetIDsOfNames)(REFIID, LPOLESTR*, UINT, LCID, DISPID*);
- STDMETHOD(Invoke)(DISPID, REFIID, LCID, WORD, DISPPARAMS*, VARIANT*, EXCEPINFO*, UINT*);
- // IOleWindow
- STDMETHOD(GetWindow)(HWND *phwnd);
- STDMETHOD(ContextSensitiveHelp)(BOOL fEnterMode);
- // IOleInPlace
- STDMETHOD(CanInPlaceActivate)(void);
- STDMETHOD(OnInPlaceActivate)(void);
- STDMETHOD(OnUIActivate)(void);
- STDMETHOD(GetWindowContext)(IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc,
- LPRECT lprcPosRect, LPRECT lprcClipRect,
- LPOLEINPLACEFRAMEINFO lpFrameInfo);
- STDMETHOD(Scroll)(SIZE scrollExtant);
-
- STDMETHOD(OnUIDeactivate)(BOOL fUndoable);
- STDMETHOD(OnInPlaceDeactivate)(void);
- STDMETHOD(DiscardUndoState)(void);
- STDMETHOD(DeactivateAndUndo)(void);
- STDMETHOD(OnPosRectChange)(LPCRECT lprcPosRect);
- // IOleClientSite
- STDMETHOD(SaveObject)(void);
- STDMETHOD(GetMoniker)(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk);
- STDMETHOD(GetContainer)(IOleContainer **ppContainer);
- STDMETHOD(ShowObject)(void);
- STDMETHOD(OnShowWindow)(BOOL fShow);
- STDMETHOD(RequestNewObjectLayout)(void);
-
- IHTMLDocument2 *getDocument();
- IEEmbed(HWND _parent);
- virtual ~IEEmbed();
-
- void setMainWndProc(WNDPROC);
- WNDPROC getMainWndProc();
- void setDocWndProc(WNDPROC);
- WNDPROC getDocWndProc();
- void setServerWndProc(WNDPROC);
- WNDPROC getServerWndProc();
-
- void ResizeBrowser();
- void navigate(const wchar_t *);
- void navigate(char *url);
- void navigate(NETLIBHTTPREQUEST *nlhr);
- void write(const wchar_t *text);
- void addCookie(const wchar_t *cookieString);
- BSTR getCookies();
- char* GetHTMLDoc();
- void translateAccelerator(UINT uMsg, WPARAM wParam, LPARAM lParam);
-};
-#endif
diff --git a/protocols/MSN/src/msn_libstr.cpp b/protocols/MSN/src/msn_libstr.cpp
deleted file mode 100644
index 73483febc7..0000000000
--- a/protocols/MSN/src/msn_libstr.cpp
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-
-static wchar_t* a2tf(const wchar_t* str, bool unicode)
-{
- if (str == nullptr)
- return nullptr;
-
- return unicode ? mir_wstrdup(str) : mir_a2u((char*)str);
-}
-
-void overrideStr(wchar_t*& dest, const wchar_t* src, bool unicode, const wchar_t* def)
-{
- mir_free(dest);
- dest = nullptr;
-
- if (src != nullptr)
- dest = a2tf(src, unicode);
- else if (def != nullptr)
- dest = mir_wstrdup(def);
-}
-
-char* arrayToHex(BYTE* data, size_t datasz)
-{
- char *res = (char*)mir_alloc(2 * datasz + 1);
- bin2hex(data, datasz, res);
- return res;
-}
-
-bool txtParseParam(const char* szData, const char* presearch, const char* start, const char* finish, char* param, const int size)
-{
- const char *cp, *cp1;
- int len;
-
- if (szData == nullptr) return false;
-
- if (presearch != nullptr) {
- cp1 = strstr(szData, presearch);
- if (cp1 == nullptr) return false;
- }
- else cp1 = szData;
-
- cp = strstr(cp1, start);
- if (cp == nullptr) return false;
- cp += mir_strlen(start);
- while (*cp == ' ') ++cp;
-
- if (finish) {
- cp1 = strstr(cp, finish);
- if (cp1 == nullptr) return FALSE;
- while (*(cp1 - 1) == ' ' && cp1 > cp) --cp1;
- }
- else cp1 = strchr(cp, '\0');
-
- len = min(cp1 - cp, size - 1);
- memmove(param, cp, len);
- param[len] = 0;
-
- return true;
-}
-
-void parseWLID(char* wlid, char** net, char** email, char** inst)
-{
- char *col = strchr(wlid, ':');
- if (col && strncmp(wlid, "tel:", 4)) {
- *col = 0;
- if (net) *net = wlid;
- if (email) *email = col + 1;
- ++col;
- wlid=col;
- }
- else {
- if (net) *net = nullptr;
- if (email) *email = wlid;
- }
-
- col = strchr(wlid, ';');
- if (col) {
- *col = 0;
- if (inst) {
- *inst = col + 1;
- if (strncmp(*inst, "epid=", 5)==0) *inst+=5;
- }
- }
- else if (inst)
- *inst = nullptr;
-}
-
-void HtmlDecode(char *str)
-{
- if (str == nullptr)
- return;
-
- char* p, *q;
- for (p = q = str; *p != '\0'; p++, q++) {
- if (*p == '&') {
- if (!strncmp(p, "&amp;", 5)) { *q = '&'; p += 4; }
- else if (!strncmp(p, "&apos;", 6)) { *q = '\''; p += 5; }
- else if (!strncmp(p, "&gt;", 4)) { *q = '>'; p += 3; }
- else if (!strncmp(p, "&lt;", 4)) { *q = '<'; p += 3; }
- else if (!strncmp(p, "&quot;", 6)) { *q = '"'; p += 5; }
- else if (p[1] == '#') {
- int c;
- if (sscanf(p, "&#%d;", &c) == 1) {
- *q = c;
- p = strchr(p, ';');
- }
- else *q = *p;
- }
- else { *q = *p; }
- }
- else *q = *p;
- }
- *q = '\0';
-}
-
-char* HtmlEncode(const char *str)
-{
- char* s, *p, *q;
- int c;
-
- if (str == nullptr)
- return nullptr;
-
- for (c = 0, p = (char*)str; *p != '\0'; p++) {
- switch (*p) {
- case '&': c += 5; break;
- case '\'': c += 6; break;
- case '>': c += 4; break;
- case '<': c += 4; break;
- case '"': c += 6; break;
- default: c++; break;
- }
- }
-
- if ((s = (char*)mir_alloc(c + 1)) != nullptr) {
- for (p = (char*)str, q = s; *p != '\0'; p++) {
- switch (*p) {
- case '&': mir_strcpy(q, "&amp;"); q += 5; break;
- case '\'': mir_strcpy(q, "&apos;"); q += 6; break;
- case '>': mir_strcpy(q, "&gt;"); q += 4; break;
- case '<': mir_strcpy(q, "&lt;"); q += 4; break;
- case '"': mir_strcpy(q, "&quot;"); q += 6; break;
- default: *q = *p; q++; break;
- }
- }
- *q = '\0';
- }
-
- return s;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-void stripBBCode(char* src)
-{
- bool tag = false;
- char *ps = src;
- char *pd = src;
-
- while (*ps != 0) {
- if (!tag && *ps == '[') {
- char ch = ps[1];
- if (ch == '/') ch = ps[2];
- tag = ch == 'b' || ch == 'u' || ch == 'i' || ch == 'c' || ch == 'a' || ch == 's';
- }
- if (!tag) *(pd++) = *ps;
- else tag = *ps != ']';
- ++ps;
- }
- *pd = 0;
-}
-
-void stripColorCode(char* src)
-{
- unsigned char* ps = (unsigned char*)src;
- unsigned char* pd = (unsigned char*)src;
-
- while (*ps != 0) {
- if (ps[0] == 0xc2 && ps[1] == 0xb7) {
- char ch = ps[2];
- switch (ch) {
- case '#':
- case '&':
- case '\'':
- case '@':
- case '0':
- ps += 3;
- continue;
-
- case '$':
- if (isdigit(ps[3])) {
- ps += 3;
- if (isdigit(ps[1]))
- ps += 2;
- else
- ++ps;
-
- if (ps[0] == ',' && isdigit(ps[1])) {
- ps += 2;
- if (isdigit(ps[1]))
- ps += 2;
- else
- ++ps;
- }
- continue;
- }
- else if (ps[3] == '#') {
- ps += 4;
- for (int i = 0; i < 6; ++i) {
- if (isxdigit(*ps)) ++ps;
- else break;
- }
- continue;
- }
- break;
- }
- }
- *(pd++) = *(ps++);
- }
- *pd = 0;
-}
-
-void stripHTML(char* str)
-{
- char *p, *q;
-
- for ( p=q=str; *p!='\0'; p++,q++ )
- {
- if ( *p == '<' )
- {
- if ( !strnicmp( p, "<p>", 3 )) { mir_strcpy(q, "\r\n\r\n"); q += 3; p += 2; }
- else if ( !strnicmp( p, "</p>", 4 )) { mir_strcpy(q, "\r\n\r\n"); q += 3; p += 3; }
- else if ( !strnicmp( p, "<br>", 4 )) { mir_strcpy(q, "\r\n"); ++q; p += 3; }
- else if ( !strnicmp( p, "<br />", 6 )) { mir_strcpy(q, "\r\n"); ++q; p += 5; }
- else if ( !strnicmp( p, "<hr>", 4 )) { mir_strcpy(q, "\r\n"); ++q; p += 3; }
- else if ( !strnicmp( p, "<hr />", 6 )) { mir_strcpy(q, "\r\n"); ++q; p += 5; }
- else {
- char *l = strchr(p, '>');
- if (l) { p = l; --q; } else *q = *p;
- }
- }
- else
- *q = *p;
- }
- *q = '\0';
-}
-
-
-// Process a string, and double all % characters, according to chat.dll's restrictions
-// Returns a pointer to the new string (old one is not freed)
-wchar_t* EscapeChatTags(const wchar_t* pszText)
-{
- int nChars = 0;
- for (const wchar_t* p = pszText; (p = wcschr(p, '%')) != nullptr; p++)
- nChars++;
-
- if (nChars == 0)
- return mir_wstrdup(pszText);
-
- wchar_t *pszNewText = (wchar_t*)mir_alloc(sizeof(wchar_t)*(mir_wstrlen(pszText) + 1 + nChars));
- if (pszNewText == nullptr)
- return mir_wstrdup(pszText);
-
- const wchar_t *s = pszText;
- wchar_t *d = pszNewText;
- while (*s) {
- if (*s == '%')
- *d++ = '%';
- *d++ = *s++;
- }
- *d = 0;
- return pszNewText;
-}
-
-#pragma comment(lib, "Rpcrt4.lib")
-
-char* getNewUuid(void)
-{
- UUID id;
- UuidCreate(&id);
-
- BYTE *p;
- UuidToStringA(&id, &p);
- size_t len = mir_strlen((char*)p) + 3;
- char *result = (char*)mir_alloc(len);
- mir_snprintf(result, len, "{%s}", p);
- _strupr(result);
- RpcStringFreeA(&p);
- return result;
-}
-
-time_t IsoToUnixTime(const char *stamp)
-{
- char date[9];
- int i, y;
-
- if (stamp == nullptr)
- return 0;
-
- char *p = NEWSTR_ALLOCA(stamp);
-
- // skip '-' chars
- int si = 0, sj = 0;
- while (true) {
- if (p[si] == '-')
- si++;
- else if (!(p[sj++] = p[si++]))
- break;
- }
-
- // Get the date part
- for (i = 0; *p != '\0' && i < 8 && isdigit(*p); p++, i++)
- date[i] = *p;
-
- // Parse year
- if (i == 6) {
- // 2-digit year (1970-2069)
- y = (date[0] - '0') * 10 + (date[1] - '0');
- if (y < 70) y += 100;
- }
- else if (i == 8) {
- // 4-digit year
- y = (date[0] - '0') * 1000 + (date[1] - '0') * 100 + (date[2] - '0') * 10 + date[3] - '0';
- y -= 1900;
- }
- else return 0;
-
- struct tm timestamp;
- timestamp.tm_year = y;
-
- // Parse month
- timestamp.tm_mon = (date[i - 4] - '0') * 10 + date[i - 3] - '0' - 1;
-
- // Parse date
- timestamp.tm_mday = (date[i - 2] - '0') * 10 + date[i - 1] - '0';
-
- // Skip any date/time delimiter
- for (; *p != '\0' && !isdigit(*p); p++);
-
- // Parse time
- if (sscanf(p, "%d:%d:%d", &timestamp.tm_hour, &timestamp.tm_min, &timestamp.tm_sec) != 3)
- return (time_t)0;
-
- timestamp.tm_isdst = 0; // DST is already present in _timezone below
- time_t t = mktime(&timestamp);
-
- _tzset();
- t -= _timezone;
- return (t >= 0) ? t : 0;
-}
-
-time_t MsnTSToUnixtime(const char *pszTS)
-{
- char szTS[16];
-
- if (!*pszTS) return time(0);
- strncpy(szTS, pszTS, 10);
- return (time_t)atoi(szTS);
-}
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp
deleted file mode 100644
index c359f4c81d..0000000000
--- a/protocols/MSN/src/msn_lists.cpp
+++ /dev/null
@@ -1,576 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-#include "m_smileyadd.h"
-
-const char sttVoidUid[] = "{00000000-0000-0000-0000-000000000000}";
-
-void CMsnProto::Lists_Uninit(void)
-{
- Lists_Wipe();
-}
-
-void CMsnProto::Lists_Wipe(void)
-{
- mir_cslock lck(m_csLists);
- m_arContacts.destroy();
-}
-
-bool CMsnProto::Lists_IsInList(int list, const char* email)
-{
- mir_cslock lck(m_csLists);
-
- MsnContact *p = m_arContacts.find((MsnContact*)&email);
- if (p == nullptr)
- return false;
- if (list == -1)
- return true;
- return (p->list & list) == list;
-}
-
-MsnContact* CMsnProto::Lists_Get(const char* email)
-{
- mir_cslock lck(m_csLists);
- return m_arContacts.find((MsnContact*)&email);
-}
-
-MsnContact* CMsnProto::Lists_Get(MCONTACT hContact)
-{
- mir_cslock lck(m_csLists);
-
- for (auto &it : m_arContacts)
- if (it->hContact == hContact)
- return it;
-
- return nullptr;
-}
-
-MsnPlace* CMsnProto::Lists_GetPlace(const char* wlid)
-{
- char *szEmail, *szInst;
- parseWLID(NEWSTR_ALLOCA(wlid), nullptr, &szEmail, &szInst);
-
- return Lists_GetPlace(szEmail, szInst);
-}
-
-MsnPlace* CMsnProto::Lists_GetPlace(const char* szEmail, const char *szInst)
-{
- mir_cslock lck(m_csLists);
-
- if (szInst == nullptr)
- szInst = (char*)sttVoidUid;
-
- MsnContact* p = m_arContacts.find((MsnContact*)&szEmail);
- if (p == nullptr)
- return nullptr;
-
- return p->places.find((MsnPlace*)&szInst);
-}
-
-MsnPlace* CMsnProto::Lists_AddPlace(const char* email, const char* id, unsigned cap1, unsigned cap2)
-{
- mir_cslock lck(m_csLists);
-
- MsnContact *p = m_arContacts.find((MsnContact*)&email);
- if (p == nullptr)
- return nullptr;
-
- MsnPlace *pl = p->places.find((MsnPlace*)&id);
- if (pl == nullptr) {
- pl = new MsnPlace;
- pl->id = mir_strdup(id);
- pl->cap1 = cap1;
- pl->cap2 = cap2;
- pl->client = 11;
- *pl->szClientVer = 0;
- pl->p2pMsgId = 0;
- pl->p2pPktNum = 0;
- p->places.insert(pl);
- }
-
- return pl;
-}
-
-MsnContact* CMsnProto::Lists_GetNext(int &i)
-{
- mir_cslock lck(m_csLists);
-
- MsnContact *p = nullptr;
- while (p == nullptr && ++i < m_arContacts.getCount())
- if (m_arContacts[i].hContact)
- p = &m_arContacts[i];
-
- return p;
-}
-
-int CMsnProto::Lists_GetMask(const char* email)
-{
- mir_cslock lck(m_csLists);
-
- MsnContact *p = m_arContacts.find((MsnContact*)&email);
- return p ? p->list : 0;
-}
-
-int CMsnProto::Lists_GetNetId(const char* email)
-{
- if (email[0] == 0) return NETID_UNKNOWN;
-
- mir_cslock lck(m_csLists);
-
- MsnContact *p = m_arContacts.find((MsnContact*)&email);
- return p ? p->netId : NETID_UNKNOWN;
-}
-
-int CMsnProto::Lists_Add(int list, int netId, const char* email, MCONTACT hContact, const char* nick, const char* invite)
-{
- mir_cslock lck(m_csLists);
-
- MsnContact* p = m_arContacts.find((MsnContact*)&email);
- if (p == nullptr) {
- p = new MsnContact;
- p->list = list;
- p->netId = netId;
- p->email = _strlwr(mir_strdup(email));
- p->invite = mir_strdup(invite);
- p->nick = mir_strdup(nick);
- p->hContact = hContact;
- p->p2pMsgId = p->cap1 = p->cap2 = 0;
- m_arContacts.insert(p);
- }
- else {
- p->list |= list;
- if (invite) replaceStr(p->invite, invite);
- if (hContact) p->hContact = hContact;
- if (list & LIST_FL) p->netId = netId;
- if (p->netId == NETID_UNKNOWN && netId != NETID_UNKNOWN)
- p->netId = netId;
- }
- return p->list;
-}
-
-void CMsnProto::Lists_Remove(int list, const char* email)
-{
- mir_cslock lck(m_csLists);
-
- int i = m_arContacts.getIndex((MsnContact*)&email);
- if (i != -1) {
- MsnContact &p = m_arContacts[i];
- p.list &= ~list;
- if (list & LIST_PL) { mir_free(p.invite); p.invite = nullptr; }
- if (p.list == 0 && p.hContact == NULL)
- m_arContacts.remove(i);
- }
-}
-
-
-void CMsnProto::Lists_Populate(void)
-{
- MCONTACT hContact = db_find_first(m_szModuleName);
- while (hContact) {
- MCONTACT hNext = db_find_next(hContact, m_szModuleName);
- char szEmail[MSN_MAX_EMAIL_LEN] = "";
- if (db_get_static(hContact, m_szModuleName, "wlid", szEmail, sizeof(szEmail))) {
- if (db_get_static(hContact, m_szModuleName, "e-mail", szEmail, sizeof(szEmail)) == 0)
- setString(hContact, "wlid", szEmail);
- }
- if (szEmail[0]) {
- bool localList = getByte(hContact, "LocalList", 0) != 0;
- int netId = getWord(hContact, "netId", localList?NETID_MSN:NETID_UNKNOWN);
- if (localList)
- Lists_Add(LIST_LL, netId, szEmail, hContact);
- else
- Lists_Add(0, netId, szEmail, hContact);
- }
- else if (!isChatRoom(hContact)) db_delete_contact(hContact);
- hContact = hNext;
- }
-}
-
-void CMsnProto::MSN_CleanupLists(void)
-{
- for (auto &it : m_arContacts.rev_iter()) {
- if (it->list & LIST_FL)
- MSN_SetContactDb(it->hContact, it->email);
-
- if (it->list & LIST_PL) {
- if (it->list & (LIST_AL | LIST_BL))
- MSN_AddUser(NULL, it->email, it->netId, LIST_PL + LIST_REMOVE);
- else
- MSN_AddAuthRequest(it->email, it->nick, it->invite);
- }
-
- if (it->hContact && !(it->list & (LIST_LL | LIST_FL | LIST_PL)) && it->list != LIST_RL) {
- int count = db_event_count(it->hContact);
- if (count) {
- wchar_t text[256];
- wchar_t *sze = mir_a2u(it->email);
- mir_snwprintf(text, TranslateT("Contact %s has been removed from the server.\nWould you like to keep it as \"Local Only\" contact to preserve history?"), sze);
- mir_free(sze);
-
- wchar_t title[128];
- mir_snwprintf(title, TranslateT("%s protocol"), m_tszUserName);
-
- if (MessageBox(nullptr, text, title, MB_YESNO | MB_ICONQUESTION | MB_SETFOREGROUND) == IDYES) {
- MSN_AddUser(it->hContact, it->email, 0, LIST_LL);
- setByte(it->hContact, "LocalList", 1);
- continue;
- }
- }
-
- if (!(it->list & (LIST_LL | LIST_FL))) {
- db_delete_contact(it->hContact);
- it->hContact = NULL;
- }
- }
-
- if (it->list & (LIST_LL | LIST_FL) && it->hContact) {
- wchar_t path[MAX_PATH];
- MSN_GetCustomSmileyFileName(it->hContact, path, _countof(path), "", 0);
- if (path[0]) {
- SMADD_CONT cont;
- cont.cbSize = sizeof(SMADD_CONT);
- cont.hContact = it->hContact;
- cont.type = 0;
- cont.path = path;
-
- CallService(MS_SMILEYADD_LOADCONTACTSMILEYS, 0, (LPARAM)&cont);
- }
- }
- }
-}
-
-void CMsnProto::MSN_CreateContList(void)
-{
- bool *used = (bool*)mir_calloc(m_arContacts.getCount()*sizeof(bool));
-
- CMStringA cxml;
-
- cxml.AppendFormat("<ml l=\"%d\">", MyOptions.netId == NETID_MSN?1:0);
- {
- mir_cslock lck(m_csLists);
-
- for (int i = 0; i < m_arContacts.getCount(); i++) {
- if (used[i]) continue;
-
- const char* lastds = strchr(m_arContacts[i].email, '@');
- bool newdom = true;
-
- for (int j = 0; j < m_arContacts.getCount(); j++) {
- if (used[j]) continue;
-
- const MsnContact& C = m_arContacts[j];
- if (C.list == LIST_RL || C.list == LIST_PL || C.list == LIST_LL) {
- used[j] = true;
- continue;
- }
-
- const char *dom = strchr(C.email, '@');
- if (dom == nullptr && lastds == nullptr) {
- if (newdom) {
- cxml.Append("<skp>");
- newdom = false;
- }
- int list = C.list & ~(LIST_RL | LIST_LL);
- list = LIST_FL | LIST_AL; /* Seems to be always 3 in Skype... */
- cxml.AppendFormat("<c n=\"%s\" t=\"%d\"><s l=\"%d\" n=\"PE\"/><s l=\"%d\" n=\"IM\"/><s l=\"%d\" n=\"SKP\"/><s l=\"%d\" n=\"PUB\"/></c>", C.email, C.netId, list, list, list, list);
- used[j] = true;
- }
- }
- if (!newdom)
- cxml.Append(lastds ? "</d>" : "</skp>");
- }
- }
-
- cxml.Append("</ml>");
- msnNsThread->sendPacketPayload("PUT", "MSGR\\CONTACTS", "%s", cxml.c_str());
-
- if (msnP24Ver > 1)
- msnNsThread->sendPacketPayload("PUT", "MSGR\\SUBSCRIPTIONS", "<subscribe><presence><buddies><all /></buddies></presence><messaging><im /><conversations /></messaging><notifications><partners>%s<partner>ABCH</partner></partners></notifications></subscribe>",
- MyOptions.netId==NETID_MSN?"<partner>Hotmail</partner>":"");
-
- mir_free(used);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN Server List Manager dialog procedure
-
-static void AddPrivacyListEntries(HWND hwndList, CMsnProto *proto)
-{
- CLCINFOITEM cii = { 0 };
- cii.cbSize = sizeof(cii);
- cii.flags = CLCIIF_BELOWCONTACTS;
-
- // Delete old info
- HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
- while (hItem) {
- HANDLE hItemNext = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
-
- if (IsHContactInfo(hItem))
- SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0);
-
- hItem = hItemNext;
- }
-
- // Add new info
- for (auto &cont : proto->m_arContacts) {
- if (!(cont->list & (LIST_FL | LIST_LL))) {
- cii.pszText = (wchar_t*)cont->email;
- hItem = (HANDLE)SendMessage(hwndList, CLM_ADDINFOITEMA, 0, (LPARAM)&cii);
-
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, (cont->list & LIST_LL) ? 1 : 0));
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, (cont->list & LIST_FL) ? 2 : 0));
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(2, (cont->list & LIST_AL) ? 3 : 0));
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(3, (cont->list & LIST_BL) ? 4 : 0));
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(4, (cont->list & LIST_RL) ? 5 : 0));
- }
- }
-}
-
-static void SetContactIcons(MCONTACT hItem, HWND hwndList, CMsnProto* proto)
-{
- if (!proto->MSN_IsMyContact(hItem)) {
- SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0);
- return;
- }
-
- char szEmail[MSN_MAX_EMAIL_LEN];
- if (db_get_static(hItem, proto->m_szModuleName, "wlid", szEmail, sizeof(szEmail)) &&
- db_get_static(hItem, proto->m_szModuleName, "e-mail", szEmail, sizeof(szEmail))) {
- SendMessage(hwndList, CLM_DELETEITEM, (WPARAM)hItem, 0);
- return;
- }
-
- DWORD dwMask = proto->Lists_GetMask(szEmail);
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, (dwMask & LIST_LL) ? 1 : 0));
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, (dwMask & LIST_FL) ? 2 : 0));
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(2, (dwMask & LIST_AL) ? 3 : 0));
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(3, (dwMask & LIST_BL) ? 4 : 0));
- SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(4, (dwMask & LIST_RL) ? 5 : 0));
-}
-
-static void SetAllContactIcons(MCONTACT hItem, HWND hwndList, CMsnProto* proto)
-{
- if (hItem == NULL)
- hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
-
- while (hItem) {
- MCONTACT hItemN = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
-
- if (IsHContactGroup(hItem)) {
- MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT)
- SetAllContactIcons(hItemT, hwndList, proto);
- }
- else if (IsHContactContact(hItem))
- SetContactIcons(hItem, hwndList, proto);
-
- hItem = hItemN;
- }
-}
-
-static void SaveListItem(MCONTACT hContact, const char* szEmail, int list, int iPrevValue, int iNewValue, CMsnProto* proto)
-{
- if (iPrevValue == iNewValue)
- return;
-
- if (iNewValue == 0) {
- if (list & LIST_FL) {
- DeleteParam param = { proto, hContact };
- DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_DELETECONTACT), nullptr, DlgDeleteContactUI, (LPARAM)&param);
- return;
- }
-
- list |= LIST_REMOVE;
- }
-
- proto->MSN_AddUser(hContact, szEmail, proto->Lists_GetNetId(szEmail), list);
-}
-
-static void SaveSettings(MCONTACT hItem, HWND hwndList, CMsnProto* proto)
-{
- if (hItem == NULL)
- hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_ROOT, 0);
-
- while (hItem) {
- if (IsHContactGroup(hItem)) {
- MCONTACT hItemT = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
- if (hItemT)
- SaveSettings(hItemT, hwndList, proto);
- }
- else {
- char szEmail[MSN_MAX_EMAIL_LEN];
-
- if (IsHContactContact(hItem)) {
- if (db_get_static(hItem, proto->m_szModuleName, "wlid", szEmail, sizeof(szEmail)) &&
- db_get_static(hItem, proto->m_szModuleName, "e-mail", szEmail, sizeof(szEmail)))
- continue;
- }
- else if (IsHContactInfo(hItem)) {
- wchar_t buf[MSN_MAX_EMAIL_LEN];
- SendMessage(hwndList, CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)buf);
- WideCharToMultiByte(CP_ACP, 0, buf, -1, szEmail, sizeof(szEmail), nullptr, nullptr);
-
- }
-
- int dwMask = proto->Lists_GetMask(szEmail);
- SaveListItem(hItem, szEmail, LIST_LL, (dwMask & LIST_LL) ? 1 : 0, SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(0, 0)), proto);
- SaveListItem(hItem, szEmail, LIST_FL, (dwMask & LIST_FL) ? 2 : 0, SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(1, 0)), proto);
- SaveListItem(hItem, szEmail, LIST_AL, (dwMask & LIST_AL) ? 3 : 0, SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(2, 0)), proto);
- SaveListItem(hItem, szEmail, LIST_BL, (dwMask & LIST_BL) ? 4 : 0, SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(3, 0)), proto);
-
- int newMask = proto->Lists_GetMask(szEmail);
- int xorMask = newMask ^ dwMask;
-
- if (xorMask && newMask & (LIST_FL | LIST_LL)) {
- MCONTACT hContact = IsHContactInfo(hItem) ? proto->MSN_HContactFromEmail(szEmail, szEmail, true, false) : hItem;
- proto->MSN_SetContactDb(hContact, szEmail);
- }
-
- if (xorMask & (LIST_FL | LIST_LL) && !(newMask & (LIST_FL | LIST_LL))) {
- if (!IsHContactInfo(hItem)) {
- db_delete_contact(hItem);
- MsnContact* msc = proto->Lists_Get(szEmail);
- if (msc) msc->hContact = NULL;
- }
- }
- }
- hItem = (MCONTACT)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXT, (LPARAM)hItem);
- }
-}
-
-INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- CMsnProto *proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- NMCLISTCONTROL *nmc;
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- {
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
-
- HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 5, 5);
- ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
-
- HICON hIcon = g_plugin.getIcon(IDI_LIST_LC);
- ImageList_AddIcon(hIml, hIcon);
- SendDlgItemMessage(hwndDlg, IDC_ICON_LC, STM_SETICON, (WPARAM)hIcon, 0);
-
- hIcon = g_plugin.getIcon(IDI_LIST_FL);
- ImageList_AddIcon(hIml, hIcon);
- SendDlgItemMessage(hwndDlg, IDC_ICON_FL, STM_SETICON, (WPARAM)hIcon, 0);
-
- hIcon = g_plugin.getIcon(IDI_LIST_AL);
- ImageList_AddIcon(hIml, hIcon);
- SendDlgItemMessage(hwndDlg, IDC_ICON_AL, STM_SETICON, (WPARAM)hIcon, 0);
-
- hIcon = g_plugin.getIcon(IDI_LIST_BL);
- ImageList_AddIcon(hIml, hIcon);
- SendDlgItemMessage(hwndDlg, IDC_ICON_BL, STM_SETICON, (WPARAM)hIcon, 0);
-
- hIcon = g_plugin.getIcon(IDI_LIST_RL);
- ImageList_AddIcon(hIml, hIcon);
- SendDlgItemMessage(hwndDlg, IDC_ICON_RL, STM_SETICON, (WPARAM)hIcon, 0);
-
- HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST);
-
- SendMessage(hwndList, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
- SendMessage(hwndList, CLM_SETEXTRACOLUMNS, 5, 0);
-
- EnableWindow(hwndList, ((CMsnProto*)lParam)->msnLoggedIn);
- }
- return TRUE;
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_LISTREFRESH) {
- HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST);
- SendMessage(hwndList, CLM_AUTOREBUILD, 0, 0);
-
- EnableWindow(hwndList, proto->msnLoggedIn);
- }
- break;
-
- case WM_NOTIFY:
- nmc = (NMCLISTCONTROL*)lParam;
- if (nmc->hdr.idFrom == 0 && nmc->hdr.code == (unsigned)PSN_APPLY) {
- HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST);
- SaveSettings(NULL, hwndList, proto);
- SendMessage(hwndList, CLM_AUTOREBUILD, 0, 0);
- EnableWindow(hwndList, proto->msnLoggedIn);
- }
- else if (nmc->hdr.idFrom == IDC_LIST) {
- switch (nmc->hdr.code) {
- case CLN_NEWCONTACT:
- if ((nmc->flags & (CLNF_ISGROUP | CLNF_ISINFO)) == 0)
- SetContactIcons((UINT_PTR)nmc->hItem, nmc->hdr.hwndFrom, proto);
- break;
-
- case CLN_LISTREBUILT:
- AddPrivacyListEntries(nmc->hdr.hwndFrom, proto);
- SetAllContactIcons(NULL, nmc->hdr.hwndFrom, proto);
- break;
-
- case NM_CLICK:
- // Make sure we have an extra column, also we can't change RL list
- if (nmc->iColumn == -1 || nmc->iColumn == 4)
- break;
-
- // Find clicked item
- DWORD hitFlags;
- HANDLE hItem = (HANDLE)SendMessage(nmc->hdr.hwndFrom, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nmc->pt.x, nmc->pt.y));
- if (hItem == nullptr || !(IsHContactContact(hItem) || IsHContactInfo(hItem)))
- break;
-
- // It was not our extended icon
- if (!(hitFlags & CLCHT_ONITEMEXTRA))
- break;
-
- // Get image in clicked column (0=none, 1=LL, 2=FL, 3=AL, 4=BL, 5=RL)
- int iImage = SendMessage(nmc->hdr.hwndFrom, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nmc->iColumn, 0));
- iImage = iImage ? 0 : nmc->iColumn + 1;
-
- SendMessage(nmc->hdr.hwndFrom, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nmc->iColumn, iImage));
- if (iImage && SendMessage(nmc->hdr.hwndFrom, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nmc->iColumn ^ 1, 0)) != EMPTY_EXTRA_ICON)
- if (nmc->iColumn == 2 || nmc->iColumn == 3)
- SendMessage(nmc->hdr.hwndFrom, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nmc->iColumn ^ 1, 0));
-
- // Activate Apply button
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }
- }
- break;
-
- case WM_DESTROY:
- HIMAGELIST hIml = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0);
- ImageList_Destroy(hIml);
- g_plugin.releaseIcon(IDI_LIST_FL);
- g_plugin.releaseIcon(IDI_LIST_AL);
- g_plugin.releaseIcon(IDI_LIST_BL);
- g_plugin.releaseIcon(IDI_LIST_RL);
- break;
- }
-
- return FALSE;
-}
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp
deleted file mode 100644
index c9c9f1d6d4..0000000000
--- a/protocols/MSN/src/msn_mail.cpp
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2007-2012 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-static const char oimRecvUrl[] = "https://rsi.hotmail.com/rsi/rsi.asmx";
-static const char mailReqHdr[] =
- "SOAPAction: \"http://www.hotmail.msn.com/ws/2004/09/oim/rsi/%s\"\r\n";
-
-ezxml_t CMsnProto::oimRecvHdr(const char* service, ezxml_t& tbdy, char*& httphdr)
-{
- ezxml_t xmlp = ezxml_new("soap:Envelope");
- ezxml_set_attr(xmlp, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
- ezxml_set_attr(xmlp, "xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
- ezxml_set_attr(xmlp, "xmlns:soap", "http://schemas.xmlsoap.org/soap/envelope/");
-
- ezxml_t hdr = ezxml_add_child(xmlp, "soap:Header", 0);
- ezxml_t cook = ezxml_add_child(hdr, "PassportCookie", 0);
- ezxml_set_attr(cook, "xmlns", "http://www.hotmail.msn.com/ws/2004/09/oim/rsi");
- ezxml_t tcook = ezxml_add_child(cook, "t", 0);
- ezxml_set_txt(tcook, tAuthToken ? tAuthToken : "");
- ezxml_t pcook = ezxml_add_child(cook, "p", 0);
- ezxml_set_txt(pcook, pAuthToken ? pAuthToken : "");
-
- ezxml_t bdy = ezxml_add_child(xmlp, "soap:Body", 0);
-
- tbdy = ezxml_add_child(bdy, service, 0);
- ezxml_set_attr(tbdy, "xmlns", "http://www.hotmail.msn.com/ws/2004/09/oim/rsi");
-
- size_t hdrsz = mir_strlen(service) + sizeof(mailReqHdr) + 20;
- httphdr = (char*)mir_alloc(hdrsz);
-
- mir_snprintf(httphdr, hdrsz, mailReqHdr, service);
-
- return xmlp;
-}
-
-
-void CMsnProto::getOIMs(ezxml_t xmli)
-{
- ezxml_t toki = ezxml_child(xmli, "M");
- if (toki == nullptr) return;
-
- char* getReqHdr;
- ezxml_t reqmsg;
- ezxml_t xmlreq = oimRecvHdr("GetMessage", reqmsg, getReqHdr);
-
- ezxml_t reqmid = ezxml_add_child(reqmsg, "messageId", 0);
- ezxml_t reqmrk = ezxml_add_child(reqmsg, "alsoMarkAsRead", 0);
- ezxml_set_txt(reqmrk, "false");
-
- char* delReqHdr;
- ezxml_t delmsg;
- ezxml_t xmldel = oimRecvHdr("DeleteMessages", delmsg, delReqHdr);
- ezxml_t delmids = ezxml_add_child(delmsg, "messageIds", 0);
-
- while (toki != nullptr) {
- const char* szId = ezxml_txt(ezxml_child(toki, "I"));
- const char* szEmail = ezxml_txt(ezxml_child(toki, "E"));
-
- ezxml_set_txt(reqmid, szId);
- char* szData = ezxml_toxml(xmlreq, true);
-
- unsigned status;
- char* url = (char*)mir_strdup(oimRecvUrl);
-
- char* tResult = getSslResult(&url, szData, getReqHdr, status);
-
- free(szData);
- mir_free(url);
-
- if (tResult != nullptr && status == 200) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- ezxml_t body = getSoapResponse(xmlm, "GetMessage");
-
- MimeHeaders mailInfo;
- const char* mailbody = mailInfo.readFromBuffer((char*)ezxml_txt(body));
-
- time_t evtm = time(0);
- const char* arrTime = mailInfo["X-OriginalArrivalTime"];
- if (arrTime != nullptr) {
- char szTime[32], *p;
- txtParseParam(arrTime, "FILETIME", "[", "]", szTime, sizeof(szTime));
-
- unsigned filetimeLo = strtoul(szTime, &p, 16);
- if (*p == ':') {
- unsigned __int64 filetime = strtoul(p + 1, &p, 16);
- filetime <<= 32;
- filetime |= filetimeLo;
- filetime /= 10000000;
-#ifndef __GNUC__
- filetime -= 11644473600ui64;
-#else
- filetime -= 11644473600ull;
-#endif
- evtm = (time_t)filetime;
- }
- }
-
- PROTORECVEVENT pre = { 0 };
- pre.szMessage = mailInfo.decodeMailBody((char*)mailbody);
- pre.timestamp = evtm;
- ProtoChainRecvMsg(MSN_HContactFromEmail(szEmail), &pre);
- mir_free(pre.szMessage);
-
- ezxml_t delmid = ezxml_add_child(delmids, "messageId", 0);
- ezxml_set_txt(delmid, szId);
-
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- toki = ezxml_next(toki);
- }
- ezxml_free(xmlreq);
- mir_free(getReqHdr);
-
- if (ezxml_child(delmids, "messageId") != nullptr) {
- char* szData = ezxml_toxml(xmldel, true);
-
- unsigned status;
- char* url = (char*)mir_strdup(oimRecvUrl);
-
- char* tResult = getSslResult(&url, szData, delReqHdr, status);
-
- mir_free(url);
- mir_free(tResult);
- free(szData);
- }
- ezxml_free(xmldel);
- mir_free(delReqHdr);
-}
-
-
-void CMsnProto::getMetaData(void)
-{
- char* getReqHdr;
- ezxml_t reqbdy;
- ezxml_t xmlreq = oimRecvHdr("GetMetadata", reqbdy, getReqHdr);
-
- char* szData = ezxml_toxml(xmlreq, true);
- ezxml_free(xmlreq);
-
- unsigned status;
- char* url = (char*)mir_strdup(oimRecvUrl);
-
- char* tResult = getSslResult(&url, szData, getReqHdr, status);
-
- mir_free(url);
- free(szData);
- mir_free(getReqHdr);
-
- if (tResult != nullptr && status == 200) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- ezxml_t xmli = ezxml_get(xmlm, "s:Body", 0, "GetMetadataResponse", 0, "MD", -1);
- if (!xmli)
- xmli = ezxml_get(xmlm, "soap:Body", 0, "GetMetadataResponse", 0, "MD", -1);
-
- getOIMs(xmli);
- ezxml_free(xmlm);
- }
- mir_free(tResult);
-}
-
-
-void CMsnProto::processMailData(char* mailData)
-{
- if (mir_strcmp(mailData, "too-large") == 0) {
- getMetaData();
- }
- else {
- ezxml_t xmli = ezxml_parse_str(mailData, mir_strlen(mailData));
-
- ezxml_t toke = ezxml_child(xmli, "E");
-
- const char* szIU = ezxml_txt(ezxml_child(toke, "IU"));
- if (*szIU) mUnreadMessages = atol(szIU);
-
- const char* szOU = ezxml_txt(ezxml_child(toke, "OU"));
- if (*szOU) mUnreadJunkEmails = atol(szOU);
-
- getOIMs(xmli);
-
- ezxml_free(xmli);
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Processes e-mail notification
-
-void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial)
-{
- wchar_t tBuffer[512];
- wchar_t tBuffer2[512];
- int UnreadMessages = mUnreadMessages;
- int UnreadJunkEmails = mUnreadJunkEmails;
- bool ShowPopup = isInitial;
-
- MimeHeaders tFileInfo;
- tFileInfo.readFromBuffer(msgBody);
-
- const char* From = tFileInfo["From"];
- const char* Subject = tFileInfo["Subject"];
- const char* Fromaddr = tFileInfo["From-Addr"];
- const char* MsgDelta = tFileInfo["Message-Delta"];
- const char* SrcFolder = tFileInfo["Src-Folder"];
- const char* DestFolder = tFileInfo["Dest-Folder"];
- const char* InboxUnread = tFileInfo["Inbox-Unread"];
- const char* FoldersUnread = tFileInfo["Folders-Unread"];
-
- if (InboxUnread != nullptr)
- mUnreadMessages = atol(InboxUnread);
- if (FoldersUnread != nullptr)
- mUnreadJunkEmails = atol(FoldersUnread);
-
- if (MsgDelta != nullptr) {
- int iDelta = atol(MsgDelta);
- if (SrcFolder && mir_strcmp(SrcFolder, "ACTIVE") == 0)
- mUnreadMessages -= iDelta;
- else if (DestFolder && mir_strcmp(DestFolder, "ACTIVE") == 0)
- mUnreadMessages += iDelta;
- if (SrcFolder && mir_strcmp(SrcFolder, "HM_BuLkMail_") == 0)
- mUnreadJunkEmails -= iDelta;
- else if (DestFolder && mir_strcmp(DestFolder, "HM_BuLkMail_") == 0)
- mUnreadJunkEmails += iDelta;
-
- if (mUnreadJunkEmails < 0) mUnreadJunkEmails = 0;
- if (mUnreadMessages < 0) mUnreadMessages = 0;
- }
-
- if (From != nullptr && Subject != nullptr && Fromaddr != nullptr) {
- if (DestFolder != nullptr && SrcFolder == nullptr) {
- mUnreadMessages += mir_strcmp(DestFolder, "ACTIVE") == 0;
- mUnreadJunkEmails += mir_strcmp(DestFolder, "HM_BuLkMail_") == 0;
- }
-
- wchar_t* mimeFromW = tFileInfo.decode(From);
- wchar_t* mimeSubjectW = tFileInfo.decode(Subject);
-
-
- mir_snwprintf(tBuffer2, TranslateT("Subject: %s"), mimeSubjectW);
-
-
-
- wchar_t* msgtxt = _stricmp(From, Fromaddr) ?
- TranslateT("Hotmail from %s (%S)") : TranslateT("Hotmail from %s");
-
- mir_snwprintf(tBuffer, msgtxt, mimeFromW, Fromaddr);
- mir_free(mimeFromW);
- mir_free(mimeSubjectW);
- ShowPopup = true;
- }
- else {
- const char* MailData = tFileInfo["Mail-Data"];
- if (MailData != nullptr) processMailData((char*)MailData);
-
- mir_snwprintf(tBuffer, m_tszUserName);
- mir_snwprintf(tBuffer2, TranslateT("Unread mail is available: %d in Inbox and %d in other folders."), mUnreadMessages, mUnreadJunkEmails);
- }
-
- if (UnreadMessages == mUnreadMessages && UnreadJunkEmails == mUnreadJunkEmails && !isInitial)
- return;
-
- ShowPopup &= mUnreadMessages != 0 || (mUnreadJunkEmails != 0 && !getByte("DisableHotmailJunk", 0));
-
- MCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail);
- if (hContact) {
- g_clistApi.pfnRemoveEvent(hContact, 1);
- displayEmailCount(hContact);
-
- if (ShowPopup && !getByte("DisableHotmailTray", 1)) {
- char buf[64];
- mir_snprintf(buf, "%s%s", m_szModuleName, MS_GOTO_INBOX);
-
- CLISTEVENT cle = {};
- cle.hContact = hContact;
- cle.hDbEvent = 1;
- cle.flags = CLEF_URGENT | CLEF_UNICODE;
- cle.hIcon = Skin_LoadIcon(SKINICON_OTHER_SENDEMAIL);
- cle.szTooltip.w = tBuffer2;
- cle.pszService = buf;
- g_clistApi.pfnAddEvent(&cle);
- }
- }
-
- ProtoBroadcastAck(NULL, ACKTYPE_EMAIL, ACKRESULT_STATUS, nullptr);
-
- // Disable to notify receiving hotmail
- if (ShowPopup && !getByte("DisableHotmail", 0)) {
- Skin_PlaySound(mailsoundname);
-
- const char *msgurl = tFileInfo["Message-URL"];
- if (msgurl) {
- const char *p = strchr(msgurl, '&'); if (p) *(char*)p = 0;
- p = strstr(msgurl, "getmsg"); if (p) msgurl = p;
- }
- else
- msgurl = "inbox";
-
- char szUrl[256];
- mir_snprintf(szUrl, "http://mail.live.com?rru=%s", msgurl);
-
- MSN_ShowPopup(tBuffer, tBuffer2,
- MSN_ALLOW_ENTER | MSN_ALLOW_MSGBOX | MSN_HOTMAIL_POPUP,
- szUrl);
- }
-
- if (!getByte("RunMailerOnHotmail", 0) || !ShowPopup || isInitial)
- return;
-
- char mailerpath[MAX_PATH];
- if (!db_get_static(NULL, m_szModuleName, "MailerPath", mailerpath, sizeof(mailerpath))) {
- if (mailerpath[0]) {
- char* tParams = nullptr;
- char* tCmd = mailerpath;
-
- if (*tCmd == '\"') {
- ++tCmd;
- char* tEndPtr = strchr(tCmd, '\"');
- if (tEndPtr != nullptr) {
- *tEndPtr = 0;
- tParams = tEndPtr + 1;
- }
- }
-
- if (tParams == nullptr) {
- tParams = strchr(tCmd, ' ');
- tParams = tParams ? tParams + 1 : strchr(tCmd, '\0');
- }
-
- while (*tParams == ' ') ++tParams;
-
- debugLogA("Running mailer \"%s\" with params \"%s\"", tCmd, tParams);
- ShellExecuteA(nullptr, "open", tCmd, tParams, nullptr, TRUE);
- }
- }
-}
-
-static void TruncUtf8(char *str, size_t sz)
-{
- size_t len = mir_strlen(str);
- if (sz > len) sz = len;
-
- size_t cntl = 0, cnt = 0;
- for (;;) {
- unsigned char p = (unsigned char)str[cnt];
-
- if (p >= 0xE0) cnt += 3;
- else if (p >= 0xC0) cnt += 2;
- else if (p != 0) ++cnt;
- else break;
-
- if (cnt <= sz) cntl = cnt;
- else break;
- }
- str[cntl] = 0;
-}
-
-void CMsnProto::displayEmailCount(MCONTACT hContact)
-{
- if (!emailEnabled || getByte("DisableHotmailCL", 0)) return;
-
- wchar_t* name = GetContactNameT(hContact);
- if (name == nullptr) return;
-
- wchar_t* ch = name - 1;
- do {
- ch = wcschr(ch + 1, '[');
- } while (ch && !iswdigit(ch[1]));
- if (ch) *ch = 0;
- rtrimw(name);
-
- wchar_t szNick[128];
- mir_snwprintf(szNick, getByte("DisableHotmailJunk", 0) ? L"%s [%d]" : L"%s [%d][%d]", name, mUnreadMessages, mUnreadJunkEmails);
-
- nickChg = true;
- setWString(hContact, "Nick", szNick);
- nickChg = false;
-}
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
deleted file mode 100644
index 611ed479ab..0000000000
--- a/protocols/MSN/src/msn_menu.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-static HGENMENU hBlockMenuItem, hLiveSpaceMenuItem, hNetmeetingMenuItem, hChatInviteMenuItem, hOpenInboxMenuItem;
-
-// Block command callback function
-INT_PTR CMsnProto::MsnBlockCommand(WPARAM hContact, LPARAM)
-{
- if (msnLoggedIn) {
- char tEmail[MSN_MAX_EMAIL_LEN];
- if (db_get_static(hContact, m_szModuleName, "wlid", tEmail, sizeof(tEmail))
- && db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail)))
- return 0;
-
- if (Lists_IsInList(LIST_BL, tEmail))
- delSetting(hContact, "ApparentMode");
- else
- setWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
- }
- return 0;
-}
-
-// MsnGotoInbox - goes to the Inbox folder at the live.com
-INT_PTR CMsnProto::MsnGotoInbox(WPARAM, LPARAM)
-{
- MCONTACT hContact = MSN_HContactFromEmail(MyOptions.szEmail);
- if (hContact)
- g_clistApi.pfnRemoveEvent(hContact, 1);
-
- MsnInvokeMyURL(true, "http://mail.live.com?rru=inbox");
- return 0;
-}
-
-INT_PTR CMsnProto::MsnSendHotmail(WPARAM hContact, LPARAM)
-{
- char szEmail[MSN_MAX_EMAIL_LEN];
- if (MSN_IsMeByContact(hContact, szEmail))
- MsnGotoInbox(0, 0);
- else if (msnLoggedIn)
- MsnInvokeMyURL(true, CMStringA().Format("http://mail.live.com?rru=compose?to=%s", mir_urlEncode(szEmail).c_str()));
-
- return 0;
-}
-
-// MsnSetupAlerts - goes to the alerts section at the live.com
-INT_PTR CMsnProto::MsnSetupAlerts(WPARAM, LPARAM)
-{
- MsnInvokeMyURL(false, "http://alerts.live.com");
- return 0;
-}
-
-// MsnViewProfile - view a contact's profile
-INT_PTR CMsnProto::MsnViewProfile(WPARAM hContact, LPARAM)
-{
- char buf[64], *cid;
-
- if (hContact == NULL)
- cid = mycid;
- else {
- cid = buf;
- if (db_get_static(hContact, m_szModuleName, "CID", buf, 30))
- return 0;
- }
-
- char tUrl[256];
- mir_snprintf(tUrl, "http://cid-%I64X.profiles.live.com", _atoi64(cid));
- MsnInvokeMyURL(false, tUrl);
- return 0;
-}
-
-// MsnEditProfile - goes to the Profile section at the live.com
-INT_PTR CMsnProto::MsnEditProfile(WPARAM, LPARAM)
-{
- MsnViewProfile(0, 0);
- return 0;
-}
-
-// MsnInviteCommand - invite command callback function
-INT_PTR CMsnProto::MsnInviteCommand(WPARAM, LPARAM)
-{
- DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CHATROOM_INVITE), nullptr, DlgInviteToChat,
- LPARAM(new InviteChatParam(nullptr, NULL, this)));
- return 0;
-}
-
-// MsnRebuildContactMenu - gray or ungray the block menus according to contact's status
-int CMsnProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
-{
- if (!MSN_IsMyContact(hContact))
- return 0;
-
- char szEmail[MSN_MAX_EMAIL_LEN];
- bool isMe = MSN_IsMeByContact(hContact, szEmail);
- if (szEmail[0]) {
- int listId = Lists_GetMask(szEmail);
- bool noChat = !(listId & LIST_FL) || isMe || isChatRoom(hContact);
-
- Menu_ModifyItem(hBlockMenuItem, (listId & LIST_BL) ? LPGENW("&Unblock") : LPGENW("&Block"));
- Menu_ShowItem(hBlockMenuItem, !noChat);
-
- Menu_ModifyItem(hOpenInboxMenuItem, isMe ? LPGENW("Open &Hotmail Inbox") : LPGENW("Send &Hotmail E-mail"));
- Menu_ShowItem(hOpenInboxMenuItem, emailEnabled);
-
- Menu_ShowItem(hChatInviteMenuItem, !noChat);
- }
-
- return 0;
-}
-
-int CMsnProto::OnContactDoubleClicked(WPARAM hContact, LPARAM)
-{
- if (emailEnabled && MSN_IsMeByContact(hContact)) {
- MsnSendHotmail(hContact, 0);
- return 1;
- }
- return 0;
-}
-
-// Menus initialization
-void CMsnProto::OnBuildProtoMenu(void)
-{
- CMenuItem mi(&g_plugin);
- mi.root = Menu_GetProtocolRoot(this);
-
- mi.pszService = MSN_INVITE;
- CreateProtoService(mi.pszService, &CMsnProto::MsnInviteCommand);
- mi.position = 201002;
- mi.hIcolibItem = g_plugin.getIconHandle(IDI_INVITE);
- mi.name.a = LPGEN("Create &Chat");
- menuItemsMain[0] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
-
- mi.pszService = MS_GOTO_INBOX;
- CreateProtoService(mi.pszService, &CMsnProto::MsnGotoInbox);
- mi.position = 201003;
- mi.hIcolibItem = g_plugin.getIconHandle(IDI_INBOX);
- mi.name.a = LPGEN("Display &Hotmail Inbox");
- menuItemsMain[1] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
-
- mi.pszService = MS_EDIT_PROFILE;
- CreateProtoService(mi.pszService, &CMsnProto::MsnEditProfile);
- mi.position = 201004;
- mi.hIcolibItem = g_plugin.getIconHandle(IDI_PROFILE);
- mi.name.a = LPGEN("View &Profile");
- menuItemsMain[2] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
-
- mi.pszService = MS_EDIT_ALERTS;
- CreateProtoService(mi.pszService, &CMsnProto::MsnSetupAlerts);
- mi.position = 201004;
- mi.hIcolibItem = g_plugin.getIconHandle(IDI_PROFILE);
- mi.name.a = LPGEN("Setup Live &Alerts");
- menuItemsMain[3] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
-
- MSN_EnableMenuItems(m_iStatus >= ID_STATUS_ONLINE);
-}
-
-void CMsnProto::MSN_EnableMenuItems(bool bEnable)
-{
- for (auto &it : menuItemsMain)
- Menu_ModifyItem(it, nullptr, INVALID_HANDLE_VALUE, bEnable ? 0 : CMIF_GRAYED);
-
- if (bEnable)
- Menu_ShowItem(menuItemsMain[1], emailEnabled);
-}
-
-//////////////////////////////////////////////////////////////////////////////////////
-
-static INT_PTR MsnMenuBlockCommand(WPARAM hContact, LPARAM lParam)
-{
- CMsnProto* ppro = CMPlugin::getInstance(hContact);
- return (ppro) ? ppro->MsnBlockCommand(hContact, lParam) : 0;
-}
-
-static INT_PTR MsnMenuViewProfile(WPARAM hContact, LPARAM lParam)
-{
- CMsnProto* ppro = CMPlugin::getInstance(hContact);
- return (ppro) ? ppro->MsnViewProfile(hContact, lParam) : 0;
-}
-
-static INT_PTR MsnMenuSendHotmail(WPARAM hContact, LPARAM lParam)
-{
- CMsnProto* ppro = CMPlugin::getInstance(hContact);
- return (ppro) ? ppro->MsnSendHotmail(hContact, lParam) : 0;
-}
-
-static int MSN_OnPrebuildContactMenu(WPARAM hContact, LPARAM lParam)
-{
- CMsnProto* ppro = CMPlugin::getInstance(hContact);
- if (ppro)
- ppro->OnPrebuildContactMenu(hContact, lParam);
- else {
- Menu_ShowItem(hBlockMenuItem, false);
- Menu_ShowItem(hLiveSpaceMenuItem, false);
- Menu_ShowItem(hChatInviteMenuItem, false);
- Menu_ShowItem(hOpenInboxMenuItem, false);
- }
-
- return 0;
-}
-
-void MSN_InitContactMenu(void)
-{
- char servicefunction[100];
- mir_strcpy(servicefunction, "MSN");
- char* tDest = servicefunction + mir_strlen(servicefunction);
-
- CMenuItem mi(&g_plugin);
- mi.pszService = servicefunction;
-
- SET_UID(mi, 0xc6169b8f, 0x53ab, 0x4242, 0xbe, 0x90, 0xe2, 0x4a, 0xa5, 0x73, 0x88, 0x32);
- mir_strcpy(tDest, MSN_BLOCK);
- CreateServiceFunction(servicefunction, MsnMenuBlockCommand);
- mi.position = -500050000;
- mi.hIcolibItem = g_plugin.getIconHandle(IDI_MSNBLOCK);
- mi.name.a = LPGEN("&Block");
- hBlockMenuItem = Menu_AddContactMenuItem(&mi);
-
- SET_UID(mi, 0x7f7e4c24, 0x821c, 0x450f, 0x93, 0x76, 0xbe, 0x65, 0xe9, 0x2f, 0xb6, 0xc2);
- mir_strcpy(tDest, MSN_VIEW_PROFILE);
- CreateServiceFunction(servicefunction, MsnMenuViewProfile);
- mi.position = -500050003;
- mi.hIcolibItem = g_plugin.getIconHandle(IDI_PROFILE);
- mi.name.a = LPGEN("View &Profile");
- hLiveSpaceMenuItem = Menu_AddContactMenuItem(&mi);
-
- SET_UID(mi,0x25a007c0, 0x8dc7, 0x4284, 0x8a, 0x5e, 0x2, 0x83, 0x17, 0x5d, 0x52, 0xea);
- mir_strcpy(tDest, "/SendHotmail");
- CreateServiceFunction(servicefunction, MsnMenuSendHotmail);
- mi.position = -2000010005;
- mi.flags = CMIF_HIDDEN;
- mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_SENDEMAIL);
- mi.name.a = LPGEN("Open &Hotmail Inbox");
- hOpenInboxMenuItem = Menu_AddContactMenuItem(&mi);
-
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU, MSN_OnPrebuildContactMenu);
-}
-
-void MSN_RemoveContactMenus(void)
-{
- Menu_RemoveItem(hBlockMenuItem);
- Menu_RemoveItem(hLiveSpaceMenuItem);
- Menu_RemoveItem(hChatInviteMenuItem);
- Menu_RemoveItem(hOpenInboxMenuItem);
-}
diff --git a/protocols/MSN/src/msn_mime.cpp b/protocols/MSN/src/msn_mime.cpp
deleted file mode 100644
index 76a8e93bb5..0000000000
--- a/protocols/MSN/src/msn_mime.cpp
+++ /dev/null
@@ -1,502 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// constructors and destructor
-
-MimeHeaders::MimeHeaders() :
- mCount(0),
- mAllocCount(0),
- mVals(nullptr)
-{
-}
-
-MimeHeaders::MimeHeaders(unsigned iInitCount) :
- mCount(0)
-{
- mAllocCount = iInitCount;
- mVals = (MimeHeader*)mir_alloc(iInitCount * sizeof(MimeHeader));
-}
-
-MimeHeaders::~MimeHeaders()
-{
- clear();
- mir_free(mVals);
-}
-
-void MimeHeaders::clear(void)
-{
- for (unsigned i = 0; i < mCount; i++) {
- MimeHeader& H = mVals[i];
- if (H.flags & 1) mir_free((void*)H.name);
- if (H.flags & 2) mir_free((void*)H.value);
- }
- mCount = 0;
-}
-
-unsigned MimeHeaders::allocSlot(void)
-{
- if (++mCount >= mAllocCount) {
- mAllocCount += 10;
- mVals = (MimeHeader*)mir_realloc(mVals, sizeof(MimeHeader) * mAllocCount);
- }
- return mCount - 1;
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// add various values
-
-void MimeHeaders::addString(const char* name, const char* szValue, unsigned flags)
-{
- if (szValue == nullptr) return;
-
- MimeHeader& H = mVals[allocSlot()];
- H.name = name;
- H.value = szValue;
- H.flags = flags;
-}
-
-void MimeHeaders::addLong(const char* name, long lValue, unsigned flags)
-{
- MimeHeader& H = mVals[allocSlot()];
- H.name = name;
-
- char szBuffer[20];
- _ltoa(lValue, szBuffer, 10);
- H.value = mir_strdup(szBuffer);
- H.flags = 2 | flags;
-}
-
-void MimeHeaders::addULong(const char* name, unsigned lValue)
-{
- MimeHeader& H = mVals[allocSlot()];
- H.name = name;
-
- char szBuffer[20];
- _ultoa(lValue, szBuffer, 10);
- H.value = mir_strdup(szBuffer);
- H.flags = 2;
-}
-
-void MimeHeaders::addBool(const char* name, bool lValue)
-{
- MimeHeader& H = mVals[allocSlot()];
- H.name = name;
- H.value = lValue ? "true" : "false";
- H.flags = 0;
-}
-
-char* MimeHeaders::flipStr(const char* src, size_t len, char* dest)
-{
- if (len == -1) len = mir_strlen(src);
-
- if (src == dest) {
- const unsigned b = (unsigned)len-- / 2;
- for (unsigned i = 0; i < b; i++) {
- const char c = dest[i];
- dest[i] = dest[len - i];
- dest[len - i] = c;
- }
- ++len;
- }
- else {
- for (unsigned i = 0; i < len; i++)
- dest[i] = src[len - 1 - i];
- dest[len] = 0;
- }
-
- return dest + len;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// write all values to a buffer
-
-size_t MimeHeaders::getLength(void)
-{
- size_t iResult = 0;
- for (unsigned i = 0; i < mCount; i++) {
- MimeHeader& H = mVals[i];
- iResult += mir_strlen(H.name) + mir_strlen(H.value) + 4;
- }
-
- return iResult + (iResult ? 2 : 0);
-}
-
-char* MimeHeaders::writeToBuffer(char* dest)
-{
- for (unsigned i = 0; i < mCount; i++) {
- MimeHeader& H = mVals[i];
- if (H.flags & 4) {
- dest = flipStr(H.name, -1, dest);
-
- *(dest++) = ':';
- *(dest++) = ' ';
-
- dest = flipStr(H.value, -1, dest);
-
- *(dest++) = '\r';
- *(dest++) = '\n';
- *dest = 0;
- }
- else
- dest += sprintf(dest, "%s: %s\r\n", H.name, H.value); //!!!!!!!!!!!!
- }
-
- if (mCount) {
- *(dest++) = '\r';
- *(dest++) = '\n';
- *dest = 0;
- }
-
- return dest;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// read set of values from buffer
-
-char* MimeHeaders::readFromBuffer(char* src)
-{
- clear();
-
- while (*src) {
- char* peol = strchr(src, '\n');
-
- if (peol == nullptr)
- return strchr(src, 0);
- else if (peol == src)
- return src + 1;
- else if (peol == (src + 1) && *src == '\r')
- return src + 2;
-
- *peol = 0;
-
- char* delim = strchr(src, ':');
- if (delim) {
- *delim = 0;
-
- MimeHeader& H = mVals[allocSlot()];
-
- H.name = lrtrimp(src);
- H.value = lrtrimp(delim + 1);
- H.flags = 0;
- }
-
- src = peol + 1;
- }
-
- return src;
-}
-
-const char* MimeHeaders::find(const char* szFieldName)
-{
- size_t i;
- for (i = 0; i < mCount; i++) {
- MimeHeader& MH = mVals[i];
- if (_stricmp(MH.name, szFieldName) == 0)
- return MH.value;
- }
-
- const size_t len = mir_strlen(szFieldName);
- char* szFieldNameR = (char*)alloca(len + 1);
- flipStr(szFieldName, len, szFieldNameR);
-
- for (i = 0; i < mCount; i++) {
- MimeHeader& MH = mVals[i];
- if (_stricmp(MH.name, szFieldNameR) == 0 && (MH.flags & 3) == 0) {
- mir_strcpy((char*)MH.name, szFieldNameR);
- flipStr(MH.value, -1, (char*)MH.value);
- return MH.value;
- }
- }
-
- return nullptr;
-}
-
-static const struct _tag_cpltbl
-{
- unsigned cp;
- const char* mimecp;
-} cptbl[] =
-{
- { 37, "IBM037" }, // IBM EBCDIC US-Canada
- { 437, "IBM437" }, // OEM United States
- { 500, "IBM500" }, // IBM EBCDIC International
- { 708, "ASMO-708" }, // Arabic (ASMO 708)
- { 720, "DOS-720" }, // Arabic (Transparent ASMO); Arabic (DOS)
- { 737, "ibm737" }, // OEM Greek (formerly 437G); Greek (DOS)
- { 775, "ibm775" }, // OEM Baltic; Baltic (DOS)
- { 850, "ibm850" }, // OEM Multilingual Latin 1; Western European (DOS)
- { 852, "ibm852" }, // OEM Latin 2; Central European (DOS)
- { 855, "IBM855" }, // OEM Cyrillic (primarily Russian)
- { 857, "ibm857" }, // OEM Turkish; Turkish (DOS)
- { 858, "IBM00858" }, // OEM Multilingual Latin 1 + Euro symbol
- { 860, "IBM860" }, // OEM Portuguese; Portuguese (DOS)
- { 861, "ibm861" }, // OEM Icelandic; Icelandic (DOS)
- { 862, "DOS-862" }, // OEM Hebrew; Hebrew (DOS)
- { 863, "IBM863" }, // OEM French Canadian; French Canadian (DOS)
- { 864, "IBM864" }, // OEM Arabic; Arabic (864)
- { 865, "IBM865" }, // OEM Nordic; Nordic (DOS)
- { 866, "cp866" }, // OEM Russian; Cyrillic (DOS)
- { 869, "ibm869" }, // OEM Modern Greek; Greek, Modern (DOS)
- { 870, "IBM870" }, // IBM EBCDIC Multilingual/ROECE (Latin 2); IBM EBCDIC Multilingual Latin 2
- { 874, "windows-874" }, // ANSI/OEM Thai (same as 28605, ISO 8859-15); Thai (Windows)
- { 875, "cp875" }, // IBM EBCDIC Greek Modern
- { 932, "shift_jis" }, // ANSI/OEM Japanese; Japanese (Shift-JIS)
- { 936, "gb2312" }, // ANSI/OEM Simplified Chinese (PRC, Singapore); Chinese Simplified (GB2312)
- { 949, "ks_c_5601-1987" }, // ANSI/OEM Korean (Unified Hangul Code)
- { 950, "big5" }, // ANSI/OEM Traditional Chinese (Taiwan; Hong Kong SAR, PRC); Chinese Traditional (Big5)
- { 1026, "IBM1026" }, // IBM EBCDIC Turkish (Latin 5)
- { 1047, "IBM01047" }, // IBM EBCDIC Latin 1/Open System
- { 1140, "IBM01140" }, // IBM EBCDIC US-Canada (037 + Euro symbol); IBM EBCDIC (US-Canada-Euro)
- { 1141, "IBM01141" }, // IBM EBCDIC Germany (20273 + Euro symbol); IBM EBCDIC (Germany-Euro)
- { 1142, "IBM01142" }, // IBM EBCDIC Denmark-Norway (20277 + Euro symbol); IBM EBCDIC (Denmark-Norway-Euro)
- { 1143, "IBM01143" }, // IBM EBCDIC Finland-Sweden (20278 + Euro symbol); IBM EBCDIC (Finland-Sweden-Euro)
- { 1144, "IBM01144" }, // IBM EBCDIC Italy (20280 + Euro symbol); IBM EBCDIC (Italy-Euro)
- { 1145, "IBM01145" }, // IBM EBCDIC Latin America-Spain (20284 + Euro symbol); IBM EBCDIC (Spain-Euro)
- { 1146, "IBM01146" }, // IBM EBCDIC United Kingdom (20285 + Euro symbol); IBM EBCDIC (UK-Euro)
- { 1147, "IBM01147" }, // IBM EBCDIC France (20297 + Euro symbol); IBM EBCDIC (France-Euro)
- { 1148, "IBM01148" }, // IBM EBCDIC International (500 + Euro symbol); IBM EBCDIC (International-Euro)
- { 1149, "IBM01149" }, // IBM EBCDIC Icelandic (20871 + Euro symbol); IBM EBCDIC (Icelandic-Euro)
- { 1250, "windows-1250" }, // ANSI Central European; Central European (Windows)
- { 1251, "windows-1251" }, // ANSI Cyrillic; Cyrillic (Windows)
- { 1252, "windows-1252" }, // ANSI Latin 1; Western European (Windows)
- { 1253, "windows-1253" }, // ANSI Greek; Greek (Windows)
- { 1254, "windows-1254" }, // ANSI Turkish; Turkish (Windows)
- { 1255, "windows-1255" }, // ANSI Hebrew; Hebrew (Windows)
- { 1256, "windows-1256" }, // ANSI Arabic; Arabic (Windows)
- { 1257, "windows-1257" }, // ANSI Baltic; Baltic (Windows)
- { 1258, "windows-1258" }, // ANSI/OEM Vietnamese; Vietnamese (Windows)
- { 20127, "us-ascii" }, // US-ASCII (7-bit)
- { 20273, "IBM273" }, // IBM EBCDIC Germany
- { 20277, "IBM277" }, // IBM EBCDIC Denmark-Norway
- { 20278, "IBM278" }, // IBM EBCDIC Finland-Sweden
- { 20280, "IBM280" }, // IBM EBCDIC Italy
- { 20284, "IBM284" }, // IBM EBCDIC Latin America-Spain
- { 20285, "IBM285" }, // IBM EBCDIC United Kingdom
- { 20290, "IBM290" }, // IBM EBCDIC Japanese Katakana Extended
- { 20297, "IBM297" }, // IBM EBCDIC France
- { 20420, "IBM420" }, // IBM EBCDIC Arabic
- { 20423, "IBM423" }, // IBM EBCDIC Greek
- { 20424, "IBM424" }, // IBM EBCDIC Hebrew
- { 20838, "IBM-Thai" }, // IBM EBCDIC Thai
- { 20866, "koi8-r" }, // Russian (KOI8-R); Cyrillic (KOI8-R)
- { 20871, "IBM871" }, // IBM EBCDIC Icelandic
- { 20880, "IBM880" }, // IBM EBCDIC Cyrillic Russian
- { 20905, "IBM905" }, // IBM EBCDIC Turkish
- { 20924, "IBM00924" }, // IBM EBCDIC Latin 1/Open System (1047 + Euro symbol)
- { 20932, "EUC-JP" }, // Japanese (JIS 0208-1990 and 0121-1990)
- { 21025, "cp1025" }, // IBM EBCDIC Cyrillic Serbian-Bulgarian
- { 21866, "koi8-u" }, // Ukrainian (KOI8-U); Cyrillic (KOI8-U)
- { 28591, "iso-8859-1" }, // ISO 8859-1 Latin 1; Western European (ISO)
- { 28592, "iso-8859-2" }, // ISO 8859-2 Central European; Central European (ISO)
- { 28593, "iso-8859-3" }, // ISO 8859-3 Latin 3
- { 28594, "iso-8859-4" }, // ISO 8859-4 Baltic
- { 28595, "iso-8859-5" }, // ISO 8859-5 Cyrillic
- { 28596, "iso-8859-6" }, // ISO 8859-6 Arabic
- { 28597, "iso-8859-7" }, // ISO 8859-7 Greek
- { 28598, "iso-8859-8" }, // ISO 8859-8 Hebrew; Hebrew (ISO-Visual)
- { 28599, "iso-8859-9" }, // ISO 8859-9 Turkish
- { 28603, "iso-8859-13" }, // ISO 8859-13 Estonian
- { 28605, "iso-8859-15" }, // ISO 8859-15 Latin 9
- { 38598, "iso-8859-8-i" }, // ISO 8859-8 Hebrew; Hebrew (ISO-Logical)
- { 50220, "iso-2022-jp" }, // ISO 2022 Japanese with no halfwidth Katakana; Japanese (JIS)
- { 50221, "csISO2022JP" }, // ISO 2022 Japanese with halfwidth Katakana; Japanese (JIS-Allow 1 byte Kana)
- { 50222, "iso-2022-jp" }, // ISO 2022 Japanese JIS X 0201-1989; Japanese (JIS-Allow 1 byte Kana - SO/SI)
- { 50225, "iso-2022-kr" }, // ISO 2022 Korean
- { 50227, "ISO-2022-CN" }, // ISO 2022 Simplified Chinese; Chinese Simplified (ISO 2022)
- { 50229, "ISO-2022-CN-EXT" }, // ISO 2022 Traditional Chinese
- { 51932, "euc-jp" }, // EUC Japanese
- { 51936, "EUC-CN" }, // EUC Simplified Chinese; Chinese Simplified (EUC)
- { 51949, "euc-kr" }, // EUC Korean
- { 52936, "hz-gb-2312" }, // HZ-GB2312 Simplified Chinese; Chinese Simplified (HZ)
- { 54936, "GB18030" }, // Windows XP and later: GB18030 Simplified Chinese (4 byte); Chinese Simplified (GB18030)
-};
-
-
-static unsigned FindCP(const char* mimecp)
-{
- unsigned cp = CP_ACP;
- for (auto &it : cptbl) {
- if (_stricmp(mimecp, it.mimecp) == 0) {
- cp = it.cp;
- break;
- }
- }
- return cp;
-}
-
-
-static int SingleHexToDecimal(char c)
-{
- if (c >= '0' && c <= '9') return c - '0';
- if (c >= 'a' && c <= 'f') return c - 'a' + 10;
- if (c >= 'A' && c <= 'F') return c - 'A' + 10;
- return -1;
-}
-
-static void PQDecode(char* str)
-{
- char* s = str, *d = str;
-
- while (*s) {
- switch (*s) {
- case '=':
- {
- int digit1 = SingleHexToDecimal(s[1]);
- if (digit1 != -1) {
- int digit2 = SingleHexToDecimal(s[2]);
- if (digit2 != -1) {
- s += 3;
- *d++ = (char)((digit1 << 4) | digit2);
- }
- }
- break;
- }
-
- case '_':
- *d++ = ' '; ++s;
- break;
-
- default:
- *d++ = *s++;
- break;
- }
- }
- *d = 0;
-}
-
-static size_t utf8toutf16(char* str, wchar_t* res)
-{
- wchar_t *dec = mir_utf8decodeW(str);
- if (dec == nullptr) dec = mir_a2u(str);
- mir_wstrcpy(res, dec);
- mir_free(dec);
- return mir_wstrlen(res);
-}
-
-
-wchar_t* MimeHeaders::decode(const char* val)
-{
- size_t ssz = mir_strlen(val) * 2 + 1;
- char* tbuf = (char*)alloca(ssz);
- memcpy(tbuf, val, ssz);
-
- wchar_t* res = (wchar_t*)mir_alloc(ssz * sizeof(wchar_t));
- wchar_t* resp = res;
-
- char *p = tbuf;
- while (*p) {
- char *cp = strstr(p, "=?");
- if (cp == nullptr) break;
- *cp = 0;
-
- size_t sz = utf8toutf16(p, resp);
- ssz -= sz; resp += sz;
- cp += 2;
-
- char *enc = strchr(cp, '?');
- if (enc == nullptr) break;
- *(enc++) = 0;
-
- char *fld = strchr(enc, '?');
- if (fld == nullptr) break;
- *(fld++) = 0;
-
- char *pe = strstr(fld, "?=");
- if (pe == nullptr) break;
- *pe = 0;
-
- switch (*enc) {
- case 'b':
- case 'B':
- mir_strcpy(fld, ptrA((char*)mir_base64_decode(fld, nullptr)));
- break;
-
- case 'q':
- case 'Q':
- PQDecode(fld);
- break;
- }
-
- if (_stricmp(cp, "UTF-8") == 0)
- sz = utf8toutf16(fld, resp);
- else {
- sz = MultiByteToWideChar(FindCP(cp), 0, fld, -1, resp, (int)ssz);
- if (sz == 0)
- sz = MultiByteToWideChar(CP_ACP, 0, fld, -1, resp, (int)ssz);
- sz--;
- }
- ssz -= sz; resp += sz;
- p = pe + 2;
- }
-
- utf8toutf16(p, resp);
- return res;
-}
-
-
-char* MimeHeaders::decodeMailBody(char* msgBody)
-{
- char* res;
- const char *val = find("Content-Transfer-Encoding");
- if (val && _stricmp(val, "base64") == 0) {
- char *src = msgBody, *dst = msgBody;
- while (*src != 0) {
- if (isspace(*src)) ++src;
- else *(dst++) = *(src++);
- }
- *dst = 0;
- res = (char*)mir_base64_decode(msgBody, nullptr);
- }
- else {
- res = mir_strdup(msgBody);
- if (val && _stricmp(val, "quoted-printable") == 0)
- PQDecode(res);
- }
- return res;
-}
-
-
-int sttDivideWords(char* parBuffer, int parMinItems, char** parDest)
-{
- int i;
- for (i = 0; i < parMinItems; i++) {
- parDest[i] = parBuffer;
-
- size_t tWordLen = strcspn(parBuffer, " \t");
- if (tWordLen == 0)
- return i;
-
- parBuffer += tWordLen;
- if (*parBuffer != '\0') {
- size_t tSpaceLen = strspn(parBuffer, " \t");
- memset(parBuffer, 0, tSpaceLen);
- parBuffer += tSpaceLen;
- }
- }
-
- return i;
-}
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
deleted file mode 100644
index e9b8d84948..0000000000
--- a/protocols/MSN/src/msn_misc.cpp
+++ /dev/null
@@ -1,1112 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-#include "version.h"
-
-
-// MirandaStatusToMSN - status helper functions
-const char* CMsnProto::MirandaStatusToMSN(int status)
-{
- switch (status) {
- case ID_STATUS_OFFLINE: return "FLN";
- case ID_STATUS_NA:
- case ID_STATUS_AWAY: return "AWY";
- case ID_STATUS_DND:
- case ID_STATUS_OCCUPIED: return "BSY";
- case ID_STATUS_INVISIBLE: return "HDN";
- case ID_STATUS_IDLE: return "IDL";
- default: return "NLN";
- }
-}
-
-WORD CMsnProto::MSNStatusToMiranda(const char *status)
-{
- switch ((*(PDWORD)status & 0x00FFFFFF) | 0x20000000) {
- case ' LDI': return ID_STATUS_IDLE;
- case ' NLN': return ID_STATUS_ONLINE;
- case ' BRB':
- case ' YWA': return ID_STATUS_AWAY;
- case ' YSB': return ID_STATUS_OCCUPIED;
- case ' NDH': return ID_STATUS_INVISIBLE;
- default: return ID_STATUS_OFFLINE;
- }
-}
-
-char** CMsnProto::GetStatusMsgLoc(int status)
-{
- static const int modes[MSN_NUM_MODES] =
- {
- ID_STATUS_ONLINE,
- ID_STATUS_AWAY,
- ID_STATUS_DND,
- ID_STATUS_NA,
- ID_STATUS_OCCUPIED,
- ID_STATUS_FREECHAT,
- ID_STATUS_INVISIBLE,
- };
-
- for (int i = 0; i < MSN_NUM_MODES; i++)
- if (modes[i] == status) return &msnModeMsgs[i];
-
- return nullptr;
-}
-
-// MSN_AddAuthRequest - adds the authorization event to the database
-void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const char *reason)
-{
- MCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true);
-
- DB_AUTH_BLOB blob(hContact, nick, nullptr, nullptr, email, reason);
-
- PROTORECVEVENT pre = { 0 };
- pre.timestamp = (DWORD)time(0);
- pre.lParam = blob.size();
- pre.szMessage = blob;
- ProtoChainRecv(hContact, PSR_AUTH, 0, (LPARAM)&pre);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-void CMsnProto::InitCustomFolders(void)
-{
- if (InitCstFldRan) return;
-
- wchar_t folder[MAX_PATH];
- mir_snwprintf(folder, L"%%miranda_avatarcache%%\\%S", m_szModuleName);
- hCustomSmileyFolder = FoldersRegisterCustomPathW(LPGEN("Custom Smileys"), m_szModuleName, folder, m_tszUserName);
-
- InitCstFldRan = true;
-}
-
-
-char* MSN_GetAvatarHash(char* szContext, char** pszUrl)
-{
- if (pszUrl)
- *pszUrl = nullptr;
-
- if (szContext == nullptr)
- return nullptr;
-
- char *res = nullptr;
-
- ezxml_t xmli = ezxml_parse_str(NEWSTR_ALLOCA(szContext), mir_strlen(szContext));
- const char *szAvatarHash = ezxml_attr(xmli, "SHA1D");
- if (szAvatarHash != nullptr) {
- size_t hashLen;
- mir_ptr<BYTE> hash((BYTE*)mir_base64_decode(szAvatarHash, &hashLen));
- if (hash)
- res = arrayToHex(hash, hashLen);
-
- if (pszUrl) {
- const char *pszUrlAttr;
- for (int i = 0;; i++) {
- char szSetting[20];
- if (i == 0)
- mir_strcpy(szSetting, "Url");
- else
- mir_snprintf(szSetting, "Url%d", i);
- pszUrlAttr = ezxml_attr(xmli, szSetting);
- if (pszUrlAttr == nullptr)
- break;
-
- if (pszUrlAttr[0] != 0) {
- *pszUrl = mir_strdup(pszUrlAttr);
- break;
- }
- }
- }
- }
- ezxml_free(xmli);
-
- return res;
-}
-
-// MSN_GetAvatarFileName - gets a file name for an contact's avatar
-void CMsnProto::MSN_GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const wchar_t *ext)
-{
- size_t tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%S", VARSW(L"%miranda_avatarcache%").get(), m_szModuleName);
-
- CreateDirectoryTreeW(pszDest);
-
- size_t tPathLen2 = tPathLen;
- if (hContact != NULL) {
- DBVARIANT dbv;
- if (getString(hContact, "PictContext", &dbv) == 0) {
- char* szAvatarHash = MSN_GetAvatarHash(dbv.pszVal);
- if (szAvatarHash != nullptr) {
- wchar_t *sztAvatarHash = mir_a2u(szAvatarHash);
- tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s.", sztAvatarHash);
- mir_free(sztAvatarHash);
- mir_free(szAvatarHash);
- }
- else {
- delSetting(hContact, "PictContext");
- if (cbLen) pszDest[0] = 0;
- }
- db_free(&dbv);
- }
- else if (cbLen)
- pszDest[0] = 0;
- }
- else {
- wchar_t *sztModuleName = mir_a2u(m_szModuleName);
- tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s avatar.", sztModuleName);
- mir_free(sztModuleName);
- }
-
- if (ext == nullptr) {
- mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"*");
-
- bool found = false;
- _wfinddata_t c_file;
- long hFile = _wfindfirst(pszDest, &c_file);
- if (hFile > -1L) {
- do {
- if (wcsrchr(c_file.name, '.')) {
- mir_snwprintf(pszDest + tPathLen2, cbLen - tPathLen2, L"\\%s", c_file.name);
- found = true;
- }
- } while (_wfindnext(hFile, &c_file) == 0);
- _findclose(hFile);
- }
-
- if (!found) pszDest[0] = 0;
- }
- else {
- tPathLen--;
- mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, ext);
- }
-}
-
-int CMsnProto::MSN_SetMyAvatar(const wchar_t* sztFname, void* pData, size_t cbLen)
-{
- mir_sha1_ctx sha1ctx;
- BYTE sha1c[MIR_SHA1_HASH_SIZE], sha1d[MIR_SHA1_HASH_SIZE];
-
- T2Utf szFname(sztFname);
-
- mir_sha1_init(&sha1ctx);
- mir_sha1_append(&sha1ctx, (BYTE*)pData, (int)cbLen);
- mir_sha1_finish(&sha1ctx, sha1d);
-
- ptrA szSha1d(mir_base64_encode(sha1d, sizeof(sha1d)));
-
- mir_sha1_init(&sha1ctx);
- ezxml_t xmlp = ezxml_new("msnobj");
-
- mir_sha1_append(&sha1ctx, (PBYTE)"Creator", 7);
- mir_sha1_append(&sha1ctx, (PBYTE)MyOptions.szEmail, (int)mir_strlen(MyOptions.szEmail));
- ezxml_set_attr(xmlp, "Creator", MyOptions.szEmail);
-
- char szFileSize[20];
- _ultoa((unsigned)cbLen, szFileSize, 10);
- mir_sha1_append(&sha1ctx, (PBYTE)"Size", 4);
- mir_sha1_append(&sha1ctx, (PBYTE)szFileSize, (int)mir_strlen(szFileSize));
- ezxml_set_attr(xmlp, "Size", szFileSize);
-
- mir_sha1_append(&sha1ctx, (PBYTE)"Type", 4);
- mir_sha1_append(&sha1ctx, (PBYTE)"3", 1); // MSN_TYPEID_DISPLAYPICT
- ezxml_set_attr(xmlp, "Type", "3");
-
- mir_sha1_append(&sha1ctx, (PBYTE)"Location", 8);
- mir_sha1_append(&sha1ctx, (PBYTE)szFname, (int)mir_strlen(szFname));
- ezxml_set_attr(xmlp, "Location", szFname);
-
- mir_sha1_append(&sha1ctx, (PBYTE)"Friendly", 8);
- mir_sha1_append(&sha1ctx, (PBYTE)"AAA=", 4);
- ezxml_set_attr(xmlp, "Friendly", "AAA=");
-
- mir_sha1_append(&sha1ctx, (PBYTE)"SHA1D", 5);
- mir_sha1_append(&sha1ctx, (PBYTE)(char*)szSha1d, (int)mir_strlen(szSha1d));
- ezxml_set_attr(xmlp, "SHA1D", szSha1d);
-
- mir_sha1_finish(&sha1ctx, sha1c);
-
- ptrA szSha1c(mir_base64_encode(sha1c, sizeof(sha1c)));
-
- // ezxml_set_attr(xmlp, "SHA1C", szSha1c);
-
- ptrA szBuffer(ezxml_toxml(xmlp, false));
- ezxml_free(xmlp);
-
- const wchar_t *szExt;
- int fmt = ProtoGetBufferFormat(pData, &szExt);
- if (fmt == PA_FORMAT_UNKNOWN)
- return fmt;
-
- wchar_t szFileName[MAX_PATH];
- MSN_GetAvatarFileName(NULL, szFileName, _countof(szFileName), nullptr);
- _wremove(szFileName);
-
- MSN_GetAvatarFileName(NULL, szFileName, _countof(szFileName), szExt);
-
- int fileId = _wopen(szFileName, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
- if (fileId >= 0) {
- _write(fileId, pData, (unsigned)cbLen);
- _close(fileId);
-
- char szAvatarHashdOld[41] = "";
- if (!db_get_static(NULL, m_szModuleName, "AvatarHash", szAvatarHashdOld, sizeof(szAvatarHashdOld))) {
- char *szAvatarHash = arrayToHex(sha1d, sizeof(sha1d));
- if (mir_strcmp(szAvatarHashdOld, szAvatarHash)) {
- setString("PictObject", mir_urlEncode(szBuffer));
- setString("AvatarHash", szAvatarHash);
- }
- mir_free(szAvatarHash);
- }
- }
- else MSN_ShowError("Cannot set avatar. File '%s' could not be created/overwritten", szFileName);
-
- return fmt;
-}
-
-// MSN_GetCustomSmileyFileName - gets a file name for an contact's custom smiley
-void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const char* SmileyName, int type)
-{
- size_t tPathLen;
-
- InitCustomFolders();
-
- wchar_t* path = (wchar_t*)alloca(cbLen * sizeof(wchar_t));
- if (hCustomSmileyFolder == nullptr || FoldersGetCustomPathW(hCustomSmileyFolder, path, (int)cbLen, L"")) {
- wchar_t *tmpPath = Utils_ReplaceVarsW(L"%miranda_userdata%");
- wchar_t *tszModuleName = mir_a2u(m_szModuleName);
- tPathLen = mir_snwprintf(pszDest, cbLen, L"%s\\%s\\CustomSmiley", tmpPath, tszModuleName);
- mir_free(tszModuleName);
- mir_free(tmpPath);
- }
- else {
- mir_wstrcpy(pszDest, path);
- tPathLen = mir_wstrlen(pszDest);
- }
-
- if (hContact != NULL) {
- DBVARIANT dbv = { 0 };
- if (getWString(hContact, "e-mail", &dbv)) {
- dbv.type = DBVT_ASCIIZ;
- dbv.pwszVal = (wchar_t*)mir_alloc(11*sizeof(wchar_t));
- _ui64tow((UINT_PTR)hContact, dbv.pwszVal, 10);
- }
-
- tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", dbv.pwszVal);
- db_free(&dbv);
- }
- else {
- wchar_t *tszModuleName = mir_a2u(m_szModuleName);
- tPathLen += mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s", tszModuleName);
- mir_free(tszModuleName);
- }
-
- bool exist = _waccess(pszDest, 0) == 0;
-
- if (type == 0) {
- if (!exist) pszDest[0] = 0;
- return;
- }
-
- if (!exist)
- CreateDirectoryTreeW(pszDest);
-
- wchar_t *sztSmileyName = mir_a2u(SmileyName);
- mir_snwprintf(pszDest + tPathLen, cbLen - tPathLen, L"\\%s.%s", sztSmileyName,
- type == MSN_APPID_CUSTOMSMILEY ? L"png" : L"gif");
- mir_free(sztSmileyName);
-}
-
-// MSN_GoOffline - performs several actions when a server goes offline
-void CMsnProto::MSN_GoOffline(void)
-{
- if (m_iStatus == ID_STATUS_OFFLINE) return;
-
- msnLoggedIn = false;
-
- if (mStatusMsgTS)
- ForkThread(&CMsnProto::msn_storeProfileThread, nullptr);
-
- mir_free(msnPreviousUUX);
- msnPreviousUUX = nullptr;
- msnSearchId = nullptr;
-
- if (!g_bTerminated)
- MSN_EnableMenuItems(false);
-
- MSN_FreeGroups();
-
- clearCachedMsg();
-
- if (!g_bTerminated) {
- int msnOldStatus = m_iStatus; m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
- ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)msnOldStatus, ID_STATUS_OFFLINE);
- isIdle = false;
- setAllContactStatuses(ID_STATUS_OFFLINE, true);
- }
-}
-
-// MSN_SendMessage - formats and sends a MSG packet through the server
-int ThreadData::sendMessage(int, const char *email, int netId, const char *parMsg, int parFlags)
-{
- CMStringA buf;
-
- if ((parFlags & MSG_DISABLE_HDR) == 0) {
- char tFontName[100], tFontStyle[3], *pszMsgType, *pszContType;
- DWORD tFontColor = 0;
-
- if (parFlags & MSG_CONTACT) {
- pszMsgType = "RichText/Contacts";
- pszContType = "application/user+xml\r\nSkype-Age: 18";
- *tFontName = 0;
- } else if (parFlags & MSG_NUDGE) {
- pszMsgType = "Nudge";
- pszContType = "text/x-msnmsgr-datacast";
- *tFontName = 0;
- } else {
- pszMsgType = "Text";
- pszContType = "Text/plain; charset=UTF-8";
-
- mir_strcpy(tFontName, "Arial");
-
- if (proto->getByte("SendFontInfo", 1)) {
- char* p;
-
- DBVARIANT dbv;
- if (!db_get_s(0, "SRMsg", "Font0", &dbv)) {
- for (p = dbv.pszVal; *p; p++)
- if (BYTE(*p) >= 128 || *p < 32)
- break;
-
- if (*p == 0) {
- strncpy_s(tFontName, sizeof(tFontName), mir_urlEncode(dbv.pszVal), _TRUNCATE);
- db_free(&dbv);
- }
- }
-
- int tStyle = db_get_b(0, "SRMsg", "Font0Sty", 0);
- p = tFontStyle;
- if (tStyle & 1) *p++ = 'B';
- if (tStyle & 2) *p++ = 'I';
- *p = 0;
-
- tFontColor = db_get_dw(0, "SRMsg", "Font0Col", 0);
- }
- else tFontStyle[0] = 0;
- }
-
- char *pszNick=proto->MyOptions.szEmail;
- DBVARIANT dbv;
- time_t cur_time;
-
- /* FIXME: Use a real message ID and save it, not just this random UUID */
- unsigned __int64 msgid;
- time(&cur_time);
- msgid = ((unsigned __int64)cur_time<<32)|GetTickCount();
-
- if (!proto->getString("Nick", &dbv))
- pszNick = dbv.pszVal;
-
- CMStringA msgClean;
-
- for (BYTE *p = (BYTE*)parMsg; *p; p++) if (*p >= 0x20 || (*p>=0x09 && *p<=0x0D)) msgClean.AppendChar(*p);
- buf.AppendFormat(
- "Messaging: 2.0\r\n"
- "Client-Message-ID: %llu\r\n"
- "Message-Type: %s\r\n"
- "IM-Display-Name: %s\r\n"
- "Content-Type: %s\r\n"
- "Content-Length: %d\r\n",
- msgid, pszMsgType, pszNick, pszContType, msgClean.GetLength());
-
- if (*tFontName) buf.AppendFormat("X-MMS-IM-Format: FN=%s; EF=%s; CO=%x; CS=0; PF=31%s\r\n",
- tFontName, tFontStyle, tFontColor, (parFlags & MSG_RTL) ? ";RL=1" : "");
- buf.AppendFormat("\r\n%s", msgClean.c_str());
-
- if (pszNick!=proto->MyOptions.szEmail) db_free(&dbv);
- parMsg = buf;
- }
-
- // TODO: Handle msgType!
-
- int seq = sendPacketPayload("SDG", "MSGR",
- "Routing: 1.0\r\n"
- "To: %d:%s\r\n"
- "From: %d:%s;epid=%s\r\n\r\n"
- "Reliability: 1.0\r\n\r\n%s",
- netId, email,
- NETID_SKYPE, proto->GetMyUsername(NETID_SKYPE), proto->MyOptions.szMachineGuid,
- parMsg);
-
- return seq;
-}
-
-void ThreadData::sendTerminate(void)
-{
- if (!termPending) {
- sendPacket("OUT", "CON 0");
- termPending = true;
- }
-}
-
-// MSN_SendRawPacket - sends a packet accordingly to the MSN protocol
-int ThreadData::sendRawMessage(int msgType, const char* data, int datLen)
-{
- if (data == nullptr)
- data = "";
-
- if (datLen == -1)
- datLen = (int)mir_strlen(data);
-
- char* buf = (char*)alloca(datLen + 100);
-
- int thisTrid = InterlockedIncrement(&mTrid);
- int nBytes = mir_snprintf(buf, 100, "MSG %d %c %d\r\nMIME-Version: 1.0\r\n",
- thisTrid, msgType, datLen + 19);
- memcpy(buf + nBytes, data, datLen);
-
- send(buf, nBytes + datLen);
-
- return thisTrid;
-}
-
-// Typing notifications support
-void CMsnProto::MSN_SendTyping(ThreadData* info, const char* email, int netId, bool bTyping)
-{
- char tCommand[1024];
- mir_snprintf(tCommand,
- "Messaging: 2.0\r\n"
- "Message-Type: %s\r\n"
- "Content-Type: Application/Message\r\n"
- "Content-Length: 0\r\n",
- bTyping?"Control/Typing":"Control/ClearTyping");
-
- info->sendMessage(netId == NETID_MSN ? 'U' : '2', email, netId, tCommand, MSG_DISABLE_HDR);
-}
-
-void CMsnProto::MSN_StartStopTyping(GCThreadData* info, bool start)
-{
- MSN_SendTyping(msnNsThread, info->szEmail, info->netId, start);
-}
-
-// Helper to process texts
-static char * HtmlEncodeUTF8T(const wchar_t *src)
-{
- if (src == nullptr)
- return mir_strdup("");
-
- return HtmlEncode(UTF8(src));
-}
-
-// MSN_SendStatusMessage - notify a server about the status message change
-void CMsnProto::MSN_SendStatusMessage(const char*)
-{
- if (!msnLoggedIn)
- return;
-
- MSN_SetServerStatus(m_iDesiredStatus);
-}
-
-// MSN_SendPacket - sends a packet accordingly to the MSN protocol
-int ThreadData::sendPacket(const char* cmd, const char* fmt, ...)
-{
- if (this == nullptr) return 0;
-
- CMStringA str;
- int thisTrid = 0;
-
- if (fmt == nullptr)
- str = cmd;
- else {
- thisTrid = InterlockedIncrement(&mTrid);
- if (fmt[0] == '\0')
- str.AppendFormat("%s %d", cmd, thisTrid);
- else {
- va_list vararg;
- va_start(vararg, fmt);
- str.AppendFormat("%s %d ", cmd, thisTrid);
- str.AppendFormatV(fmt, vararg);
- va_end(vararg);
- }
- }
-
- if (strchr(str, '\r') == nullptr)
- str += "\r\n";
-
- int result = send(str, str.GetLength());
- return (result > 0) ? thisTrid : -1;
-}
-
-int ThreadData::sendPacketPayload(const char* cmd, const char *param, const char* fmt, ...)
-{
- if (this == nullptr) return 0;
-
- va_list vararg;
- va_start(vararg, fmt);
-
- bool bTopHdr = fmt[0] == '\b';
- int thisTrid = InterlockedIncrement(&mTrid);
-
- CMStringA str, payLoad;
- if (bTopHdr)
- fmt++;
-
- if (proto->msnRegistration)
- payLoad.AppendFormat("Registration: %s\r\n", proto->msnRegistration);
- if (!bTopHdr)
- payLoad.Append("\r\n");
- payLoad.AppendFormatV(fmt, vararg);
- va_end(vararg);
-
- str.AppendFormat("%s %d %s ", cmd, thisTrid, param);
- str.AppendFormat("%d\r\n", payLoad.GetLength());
- str += payLoad;
-
- int result = send(str, str.GetLength());
- return (result > 0) ? thisTrid : -1;
-}
-
-// MSN_SetServerStatus - changes plugins status at the server
-void CMsnProto::MSN_SetServerStatus(int newStatus)
-{
- debugLogA("Setting MSN server status %d, logged in = %d", newStatus, msnLoggedIn);
-
- if (!msnLoggedIn)
- return;
-
- if (isIdle)
- newStatus = ID_STATUS_IDLE;
-
- const char* szStatusName = MirandaStatusToMSN(newStatus);
-
- if (newStatus != ID_STATUS_OFFLINE) {
- DBVARIANT msnObject = { 0 };
- if (ServiceExists(MS_AV_SETMYAVATARW))
- getString("PictObject", &msnObject);
-
- // Capabilties: WLM 2009, Chunking, UUN Bootstrap
- myFlags = 0xA0000000 | cap_SupportsChunking | cap_SupportsP2PBootstrap | cap_SupportsSipInvite;
- if (getByte("MobileEnabled", 0) && getByte("MobileAllowed", 0))
- myFlags |= cap_MobileEnabled;
-
- unsigned myFlagsEx = capex_SupportsPeerToPeerV2 | capex_SupportsOfflineIM;
- unsigned myFlagsExEx = capexex_SupportsMissedConversations | capexex_SupportsShortCircuit;
-
- char szMsg[2048];
-
- char *szPlace;
- DBVARIANT dbv;
- if (!getStringUtf("Place", &dbv))
- szPlace = dbv.pszVal;
- else {
- wchar_t buf[128] = L"Miranda";
- DWORD buflen = _countof(buf);
- GetComputerName(buf, &buflen);
- szPlace = mir_utf8encodeW(buf);
- }
-
- char** msgptr = GetStatusMsgLoc(newStatus);
- int sz = mir_snprintf(szMsg,
- "<user>"
- "<sep n=\"PE\" epid=\"%s\"><VER>%s</VER><TYP>11</TYP><Capabilities>0:0</Capabilities></sep>"
- "<s n=\"IM\"><Status>%s</Status></s>"
- "<sep n=\"IM\" epid=\"%s\"><Capabilities>%u:%u:%u</Capabilities></sep>"
- "<sep n=\"PD\" epid=\"%s\"><EpName>%s</EpName><ClientType>11</ClientType></sep>"
- "<s n=\"SKP\"><Mood>%s</Mood><Skypename>%s</Skypename></s>"
- "<sep n=\"SKP\" epid=\"%s\"><NodeInfo></NodeInfo><Version>24</Version><Seamless>true</Seamless></sep>"
- "</user>",
- MyOptions.szMachineGuid, msnProductVer,
- szStatusName,
- MyOptions.szMachineGuid, myFlags, myFlagsEx, myFlagsExEx,
- MyOptions.szMachineGuid, szPlace,
- msgptr ? ptrA(HtmlEncode(*msgptr)).get() : "", GetMyUsername(NETID_SKYPE),
- MyOptions.szMachineGuid,
- MyOptions.szMachineGuid);
- msnNsThread->sendPacketPayload("PUT", "MSGR\\PRESENCE",
- "Routing: 1.0\r\n"
- "To: %d:%s\r\n"
- "From: %d:%s;epid=%s\r\n\r\n"
- "Reliability: 1.0\r\n\r\n"
- "Publication: 1.0\r\n"
- "Uri: /user\r\n"
- "Content-Type: application/user+xml\r\n"
- "Content-Length: %d\r\n\r\n%s",
- NETID_SKYPE, GetMyUsername(NETID_SKYPE),
- NETID_SKYPE, GetMyUsername(NETID_SKYPE),
- MyOptions.szMachineGuid,
- sz, szMsg);
-
- mir_free(szPlace);
- db_free(&msnObject);
- }
-}
-
-// MSN_FetchRecentMessages - fetches missed offline messages
-void CMsnProto::MSN_FetchRecentMessages(time_t since)
-{
- if (!since) {
- /* Assuming that you want all messages that were sent after the last
- * user conversation according to DB
- */
- MEVENT hDbEvent;
- for (auto &hContact : AccContacts()) {
- if (!(hDbEvent = db_event_last(hContact)))
- continue;
-
- DBEVENTINFO dbei = {};
- db_event_get(hDbEvent, &dbei);
- if (dbei.timestamp>since) since=dbei.timestamp;
- }
- }
-
- msnNsThread->sendPacketPayload("GET", "MSGR\\RECENTCONVERSATIONS",
- "<recentconversations><start>%llu</start><pagesize>100</pagesize></recentconversations>",
- ((unsigned __int64)since)*1000);
-}
-
-static const char postdataM[] = "ct=%u&bver=7&wa=wsignin1.0&ru=%s&pl=MBI";
-static const char postdataS[] = "ct=%u&bver=7&id=73625&ru=%s&js=yes&pl=%%3Fid%%3D73625";
-
-// Display Hotmail Inbox thread
-void CMsnProto::MsnInvokeMyURL(bool ismail, const char* url)
-{
- if (!url)
- url = ismail ? "http://mail.live.com?rru=inbox" : "http://profile.live.com";
-
- const char *postdata = ismail ? postdataM : postdataS;
-
- char passport[256];
- if (db_get_static(NULL, m_szModuleName, "MsnPassportHost", passport, 256))
- mir_strcpy(passport, "https://login.live.com/");
-
- char *p = strchr(passport, '/');
- if (p && p[1] == '/') p = strchr(p + 2, '/');
- if (p)
- *p = 0;
-
- CMStringA post = HotmailLogin(CMStringA().Format(postdata, (unsigned)time(0), mir_urlEncode(url).c_str()));
- if (!post.IsEmpty()) {
- CMStringA hippy(passport);
- hippy.AppendFormat("/ppsecure/sha1auth.srf?lc=%d&token=%s", itoa(langpref, passport, 10), mir_urlEncode(post).c_str());
-
- debugLogA("Starting URL: '%s'", hippy.c_str());
- Utils_OpenUrl(hippy.GetString());
- }
-}
-
-// MSN_ShowError - shows an error
-void CMsnProto::MSN_ShowError(const char* msgtext, ...)
-{
- wchar_t tBuffer[4096];
- va_list tArgs;
-
- wchar_t *buf = Langpack_PcharToTchar(msgtext);
-
- va_start(tArgs, msgtext);
- mir_vsnwprintf(tBuffer, _countof(tBuffer), buf, tArgs);
- va_end(tArgs);
-
- mir_free(buf);
-
- MSN_ShowPopup(m_tszUserName, tBuffer, MSN_ALLOW_MSGBOX | MSN_SHOW_ERROR, nullptr);
-}
-
-void HandlePopupData(PopupData *tData) {
- if (tData != nullptr) {
- if (tData->flags & MSN_HOTMAIL_POPUP) {
- MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, nullptr);
- if (hContact)
- g_clistApi.pfnRemoveEvent(hContact, 1);
- if (tData->flags & MSN_ALLOW_ENTER)
- tData->proto->MsnInvokeMyURL(true, tData->url);
- }
- else if (tData->url != nullptr)
- Utils_OpenUrl(tData->url);
- }
-}
-
-void RemovePopupData(PopupData *tData) {
- if (tData != nullptr && (tData->flags & MSN_HOTMAIL_POPUP)) {
- MCONTACT hContact = tData->proto->MSN_HContactFromEmail(tData->proto->MyOptions.szEmail, nullptr);
- if (hContact)
- g_clistApi.pfnRemoveEvent(hContact, 1);
- }
-}
-
-// Popup plugin window proc
-LRESULT CALLBACK NullWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- PopupData *tData = (PopupData*)PUGetPluginData(hWnd);
-
- switch (msg) {
- case WM_COMMAND:
- HandlePopupData(tData);
- PUDeletePopup(hWnd);
- break;
-
- case WM_CONTEXTMENU:
- RemovePopupData(tData);
- PUDeletePopup(hWnd);
- break;
-
- case UM_FREEPLUGINDATA:
- if (tData != nullptr && tData != (PopupData*)CALLSERVICE_NOTFOUND) {
- mir_free(tData->title);
- mir_free(tData->text);
- mir_free(tData->url);
- mir_free(tData);
- }
- break;
- }
-
- return DefWindowProc(hWnd, msg, wParam, lParam);
-}
-
-// InitPopups - popup plugin support
-void CMsnProto::InitPopups(void)
-{
- wchar_t desc[256];
- char name[256];
-
- POPUPCLASS ppc = { sizeof(ppc) };
- ppc.flags = PCF_UNICODE;
- ppc.PluginWindowProc = NullWindowProc;
- ppc.hIcon = g_plugin.getIcon(IDI_MSN);
- ppc.pszName = name;
- ppc.pszDescription.w = desc;
-
- mir_snprintf(name, "%s_%s", m_szModuleName, "Hotmail");
- mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Hotmail"));
- ppc.colorBack = RGB(173, 206, 247);
- ppc.colorText = GetSysColor(COLOR_WINDOWTEXT);
- ppc.iSeconds = 3;
- hPopupHotmail = Popup_RegisterClass(&ppc);
-
- mir_snprintf(name, "%s_%s", m_szModuleName, "Notify");
- mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Notifications"));
- ppc.colorBack = RGB(173, 206, 247);
- ppc.colorText = GetSysColor(COLOR_WINDOWTEXT);
- ppc.iSeconds = 3;
- hPopupNotify = Popup_RegisterClass(&ppc);
-
- mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
- mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Errors"));
- ppc.hIcon = (HICON)LoadImage(nullptr, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED);
- ppc.colorBack = RGB(191, 0, 0); //Red
- ppc.colorText = RGB(255, 245, 225); //Yellow
- ppc.iSeconds = 60;
- hPopupError = Popup_RegisterClass(&ppc);
-}
-
-// MSN_ShowPopup - popup plugin support
-void CALLBACK sttMainThreadCallback(void *param)
-{
- PopupData* pud = (PopupData*)param;
-
- bool iserr = (pud->flags & MSN_SHOW_ERROR) != 0;
- if ((iserr && !pud->proto->MyOptions.ShowErrorsAsPopups)) {
- if (pud->flags & MSN_ALLOW_MSGBOX) {
- wchar_t szMsg[MAX_SECONDLINE + MAX_CONTACTNAME];
- mir_snwprintf(szMsg, L"%s:\n%s", pud->title, pud->text);
- int ret = MessageBox(nullptr, szMsg, TranslateT("MSN Protocol"),
- MB_YESNO | (iserr ? MB_ICONERROR : MB_ICONINFORMATION));
- if (ret == IDYES)
- HandlePopupData(pud);
- else
- RemovePopupData(pud);
- }
- mir_free(pud->title);
- mir_free(pud->text);
- mir_free(pud->url);
- mir_free(pud);
- return;
- }
-
- char name[256];
-
- POPUPDATACLASS ppd = { sizeof(ppd) };
- ppd.szTitle.w = pud->title;
- ppd.szText.w = pud->text;
- ppd.PluginData = pud;
- ppd.pszClassName = name;
-
- if (pud->flags & MSN_SHOW_ERROR)
- mir_snprintf(name, "%s_%s", pud->proto->m_szModuleName, "Error");
- else if (pud->flags & (MSN_HOTMAIL_POPUP | MSN_ALERT_POPUP))
- mir_snprintf(name, "%s_%s", pud->proto->m_szModuleName, "Hotmail");
- else
- mir_snprintf(name, "%s_%s", pud->proto->m_szModuleName, "Notify");
-
- Popup_AddClass(&ppd);
-}
-
-void CMsnProto::MSN_ShowPopup(const wchar_t* nickname, const wchar_t* msg, int flags, const char* url)
-{
- if (g_bTerminated) return;
-
- PopupData *pud = (PopupData*)mir_calloc(sizeof(PopupData));
- pud->flags = flags;
- pud->url = mir_strdup(url);
- pud->title = mir_wstrdup(nickname);
- pud->text = mir_wstrdup(msg);
- pud->proto = this;
-
- CallFunctionAsync(sttMainThreadCallback, pud);
-}
-
-
-void CMsnProto::MSN_ShowPopup(const MCONTACT hContact, const wchar_t* msg, int flags)
-{
- MSN_ShowPopup(GetContactNameT(hContact), msg, flags, nullptr);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// filetransfer class members
-filetransfer::filetransfer(CMsnProto* prt)
-{
- memset(this, 0, sizeof(filetransfer));
- fileId = -1;
- std.flags = PFTS_UNICODE;
- proto = prt;
-
- hLockHandle = CreateMutex(nullptr, FALSE, nullptr);
- hResumeEvt = CreateEvent(nullptr, FALSE, FALSE, nullptr);
-}
-
-filetransfer::~filetransfer(void)
-{
- WaitForSingleObject(hLockHandle, 2000);
- CloseHandle(hLockHandle);
- CloseHandle(hResumeEvt);
-
- if (fileId != -1)
- _close(fileId);
-
- if (!bCompleted) {
- std.pszFiles.w = nullptr;
- std.totalFiles = 0;
- proto->ProtoBroadcastAck(std.hContact, ACKTYPE_FILE, ACKRESULT_FAILED, this);
- }
-
- mir_free(std.szCurrentFile.w);
- mir_free(std.szWorkingDir.w);
- if (std.pszFiles.w != nullptr) {
- for (int i = 0; std.pszFiles.w[i]; i++)
- mir_free(std.pszFiles.w[i]);
- mir_free(std.pszFiles.w);
- }
-
- mir_free(szInvcookie);
-}
-
-void filetransfer::close(void)
-{
- if (fileId != -1) _close(fileId);
- fileId = -1;
-}
-
-void filetransfer::complete(void)
-{
- close();
-
- bCompleted = true;
- proto->ProtoBroadcastAck(std.hContact, ACKTYPE_FILE, ACKRESULT_SUCCESS, this);
-}
-
-int filetransfer::create(void)
-{
- int flags = _O_BINARY | _O_CREAT | _O_WRONLY | _O_APPEND;
-
- if (std.currentFileProgress == 0) flags |= _O_TRUNC;
- fileId = _wopen(std.szCurrentFile.w, flags, _S_IREAD | _S_IWRITE);
-
- if (fileId == -1)
- proto->MSN_ShowError("Cannot create file '%s' during a file transfer", std.szCurrentFile.w);
- // else if (std.currentFileSize != 0)
- // _chsize(fileId, std.currentFileSize);
-
- return fileId;
-}
-
-int filetransfer::openNext(void)
-{
- if (fileId != -1) {
- close();
- ++std.currentFileNumber;
- ++cf;
- }
-
- while (std.pszFiles.w && std.pszFiles.w[cf]) {
- struct _stati64 statbuf;
- if (_wstat64(std.pszFiles.w[cf], &statbuf) == 0 && (statbuf.st_mode & _S_IFDIR) == 0)
- break;
-
- ++cf;
- }
-
- if (std.pszFiles.w && std.pszFiles.w[cf]) {
- bCompleted = false;
- replaceStrW(std.szCurrentFile.w, std.pszFiles.w[cf]);
- fileId = _wopen(std.szCurrentFile.w, _O_BINARY | _O_RDONLY, _S_IREAD);
- if (fileId != -1) {
- std.currentFileSize = _filelengthi64(fileId);
- std.currentFileProgress = 0;
- tType = SERVER_NOTIFICATION;
- }
- else proto->MSN_ShowError("Unable to open file '%s' for the file transfer, error %d", std.szCurrentFile.w, errno);
- }
-
- return fileId;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// TWinErrorCode class
-
-TWinErrorCode::TWinErrorCode() : mErrorText(nullptr)
-{
- mErrorCode = ::GetLastError();
-}
-
-TWinErrorCode::~TWinErrorCode()
-{
- mir_free(mErrorText);
-}
-
-char* TWinErrorCode::getText()
-{
- if (mErrorText == nullptr)
- return nullptr;
-
- mErrorText = (char*)mir_alloc(256);
-
- int tBytes = FormatMessageA(
- FORMAT_MESSAGE_FROM_SYSTEM, nullptr,
- mErrorCode, LANG_NEUTRAL, mErrorText, 256, nullptr);
-
- if (tBytes == 0)
- tBytes = mir_snprintf(mErrorText, 256, "unknown Windows error code %d", mErrorCode);
-
- *mErrorText = (char)tolower(*mErrorText);
-
- if (mErrorText[tBytes - 1] == '\n')
- mErrorText[--tBytes] = 0;
- if (mErrorText[tBytes - 1] == '\r')
- mErrorText[--tBytes] = 0;
- if (mErrorText[tBytes - 1] == '.')
- mErrorText[tBytes - 1] = 0;
-
- return mErrorText;
-}
-
-bool CMsnProto::MSN_IsMyContact(MCONTACT hContact)
-{
- const char* szProto = Proto_GetBaseAccountName(hContact);
- return szProto != nullptr && mir_strcmp(m_szModuleName, szProto) == 0;
-}
-
-bool CMsnProto::MSN_IsMeByContact(MCONTACT hContact, char* szEmail)
-{
- char tEmail[MSN_MAX_EMAIL_LEN];
- char *emailPtr = szEmail ? szEmail : tEmail;
-
- *emailPtr = 0;
- if (db_get_static(hContact, m_szModuleName, "wlid", emailPtr, sizeof(tEmail)) &&
- db_get_static(hContact, m_szModuleName, "e-mail", emailPtr, sizeof(tEmail)))
- return false;
-
- return _stricmp(emailPtr, MyOptions.szEmail) == 0;
-}
-
-bool MSN_MsgWndExist(MCONTACT hContact)
-{
- MessageWindowData msgWinData;
- bool res = Srmm_GetWindowData(hContact, msgWinData) != 0;
- res = res || msgWinData.hwndWindow;
- if (res) {
- hContact = db_mc_getMeta(hContact);
- if (hContact != 0) {
- res = Srmm_GetWindowData(hContact, msgWinData) != 0;
- res |= (msgWinData.hwndWindow == nullptr);
- }
- }
- return res;
-}
-
-void MSN_MakeDigest(const char* chl, char* dgst)
-{
- //Digest it
- DWORD md5hash[4], md5hashOr[4];
- mir_md5_state_t context;
- mir_md5_init(&context);
- mir_md5_append(&context, (BYTE*)chl, (int)mir_strlen(chl));
- mir_md5_append(&context, (BYTE*)msnProtChallenge, (int)mir_strlen(msnProtChallenge));
- mir_md5_finish(&context, (BYTE*)md5hash);
-
- memcpy(md5hashOr, md5hash, sizeof(md5hash));
-
- size_t i;
- for (i = 0; i < 4; i++)
- md5hash[i] &= 0x7FFFFFFF;
-
- char chlString[128];
- mir_snprintf(chlString, "%s%s00000000", chl, msnProductID);
- chlString[(mir_strlen(chl) + mir_strlen(msnProductID) + 7) & 0xF8] = 0;
-
- LONGLONG high = 0, low = 0;
- int* chlStringArray = (int*)chlString;
- for (i = 0; i < mir_strlen(chlString) / 4; i += 2) {
- LONGLONG temp = chlStringArray[i];
-
- temp = (0x0E79A9C1 * temp) % 0x7FFFFFFF;
- temp += high;
- temp = md5hash[0] * temp + md5hash[1];
- temp = temp % 0x7FFFFFFF;
-
- high = chlStringArray[i + 1];
- high = (high + temp) % 0x7FFFFFFF;
- high = md5hash[2] * high + md5hash[3];
- high = high % 0x7FFFFFFF;
-
- low = low + high + temp;
- }
- high = (high + md5hash[1]) % 0x7FFFFFFF;
- low = (low + md5hash[3]) % 0x7FFFFFFF;
-
- md5hashOr[0] ^= high;
- md5hashOr[1] ^= low;
- md5hashOr[2] ^= high;
- md5hashOr[3] ^= low;
-
- char* str = arrayToHex((PBYTE)md5hashOr, sizeof(md5hashOr));
- mir_strcpy(dgst, str);
- mir_free(str);
-}
-
-char* GetGlobalIp(void)
-{
- NETLIBIPLIST *ihaddr = Netlib_GetMyIp(true);
- for (unsigned i = 0; i < ihaddr->cbNum; ++i)
- if (strchr(ihaddr->szIp[i], ':'))
- return mir_strdup(ihaddr->szIp[i]);
-
- mir_free(ihaddr);
- return nullptr;
-}
diff --git a/protocols/MSN/src/msn_msgsplit.cpp b/protocols/MSN/src/msn_msgsplit.cpp
deleted file mode 100644
index ae1d7a363e..0000000000
--- a/protocols/MSN/src/msn_msgsplit.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2007-2012 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-chunkedmsg::chunkedmsg(const char* tid, const size_t totsz, const bool tbychunk)
- : size(totsz), recvsz(0), bychunk(tbychunk)
-{
- id = mir_strdup(tid);
- msg = tbychunk ? nullptr : (char*)mir_alloc(totsz + 1);
-}
-
-chunkedmsg::~chunkedmsg()
-{
- mir_free(id);
- mir_free(msg);
-}
-
-void chunkedmsg::add(const char* tmsg, size_t offset, size_t portion)
-{
- if (bychunk) {
- size_t oldsz = recvsz;
- recvsz += portion;
- msg = (char*)mir_realloc(msg, recvsz + 1);
- memcpy(msg + oldsz, tmsg, portion);
- --size;
- }
- else {
- size_t newsz = offset + portion;
- if (newsz > size) {
- portion = size - offset;
- newsz = size;
- }
- memcpy(msg + offset, tmsg, portion);
- if (newsz > recvsz) recvsz = newsz;
- }
-}
-
-bool chunkedmsg::get(char*& tmsg, size_t& tsize)
-{
- bool alldata = bychunk ? size == 0 : recvsz == size;
- if (alldata) {
- msg[recvsz] = 0;
- tmsg = msg;
- tsize = recvsz;
- msg = nullptr;
- }
-
- return alldata;
-}
-
-
-int CMsnProto::addCachedMsg(const char* id, const char* msg, const size_t offset,
- const size_t portion, const size_t totsz, const bool bychunk)
-{
- int idx = msgCache.getIndex((chunkedmsg*)&id);
- if (idx == -1) {
- msgCache.insert(new chunkedmsg(id, totsz, bychunk));
- idx = msgCache.getIndex((chunkedmsg*)&id);
- }
-
- msgCache[idx].add(msg, offset, portion);
-
- return idx;
-}
-
-size_t CMsnProto::getCachedMsgSize(const char* id)
-{
- int idx = msgCache.getIndex((chunkedmsg*)&id);
- return idx != -1 ? msgCache[idx].size : 0;
-}
-
-bool CMsnProto::getCachedMsg(int idx, char*& msg, size_t& size)
-{
- bool res = msgCache[idx].get(msg, size);
- if (res)
- msgCache.remove(idx);
-
- return res;
-}
-
-bool CMsnProto::getCachedMsg(const char* id, char*& msg, size_t& size)
-{
- int idx = msgCache.getIndex((chunkedmsg*)&id);
- return idx != -1 && getCachedMsg(idx, msg, size);
-}
-
-
-void CMsnProto::clearCachedMsg(int idx)
-{
- if (idx != -1)
- msgCache.remove(idx);
- else
- msgCache.destroy();
-}
-
-void CMsnProto::CachedMsg_Uninit(void)
-{
- clearCachedMsg();
-}
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp
deleted file mode 100644
index 07770e1d10..0000000000
--- a/protocols/MSN/src/msn_opts.cpp
+++ /dev/null
@@ -1,634 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-#include <commdlg.h>
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Icons init
-
-static IconItem iconList[] =
-{
- { LPGEN("Protocol icon"), "main", IDI_MSN },
- { LPGEN("Hotmail Inbox"), "inbox", IDI_INBOX },
- { LPGEN("Profile"), "profile", IDI_PROFILE },
- { LPGEN("MSN Services"), "services", IDI_SERVICES },
- { LPGEN("Block user"), "block", IDI_MSNBLOCK },
- { LPGEN("Invite to chat"), "invite", IDI_INVITE },
- { LPGEN("Start Netmeeting"), "netmeeting", IDI_NETMEETING },
- { LPGEN("Contact list"), "list_fl", IDI_LIST_FL },
- { LPGEN("Allowed list"), "list_al", IDI_LIST_AL },
- { LPGEN("Blocked list"), "list_bl", IDI_LIST_BL },
- { LPGEN("Relative list"), "list_rl", IDI_LIST_RL },
- { LPGEN("Local list"), "list_lc", IDI_LIST_LC },
-};
-
-void MsnInitIcons(void)
-{
- g_plugin.registerIcon("Protocols/MSN", iconList, "MSN");
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN Options dialog procedure
-
-static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- {
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- CMsnProto* proto = (CMsnProto*)lParam;
-
- SetDlgItemTextA(hwndDlg, IDC_HANDLE, proto->MyOptions.szEmail);
-
- char szPassword[100];
- if (!db_get_static(NULL, proto->m_szModuleName, "Password", szPassword, sizeof(szPassword))) {
- szPassword[99] = 0;
- SetDlgItemTextA(hwndDlg, IDC_PASSWORD, szPassword);
- }
- SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_SETLIMITTEXT, 99, 0);
-
- HWND wnd = GetDlgItem(hwndDlg, IDC_HANDLE2);
- DBVARIANT dbv;
- if (!proto->getWString("Nick", &dbv)) {
- SetWindowText(wnd, dbv.pwszVal);
- db_free(&dbv);
- }
- EnableWindow(wnd, proto->msnLoggedIn);
- EnableWindow(GetDlgItem(hwndDlg, IDC_MOBILESEND), proto->msnLoggedIn &&
- proto->getByte("MobileEnabled", 0) && proto->getByte("MobileAllowed", 0));
-
- CheckDlgButton(hwndDlg, IDC_MOBILESEND, proto->getByte("MobileAllowed", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SENDFONTINFO, proto->getByte("SendFontInfo", 1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MANAGEGROUPS, proto->getByte("ManageServer", 1) ? BST_CHECKED : BST_UNCHECKED);
-
- int tValue = proto->getByte("RunMailerOnHotmail", 0);
- CheckDlgButton(hwndDlg, IDC_RUN_APP_ON_HOTMAIL, tValue ? BST_CHECKED : BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_MAILER_APP), tValue);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ENTER_MAILER_APP), tValue);
-
- char tBuffer[MAX_PATH];
- if (!db_get_static(NULL, proto->m_szModuleName, "MailerPath", tBuffer, sizeof(tBuffer)))
- SetDlgItemTextA(hwndDlg, IDC_MAILER_APP, tBuffer);
-
- if (!proto->msnLoggedIn) {
- EnableWindow(GetDlgItem(hwndDlg, IDC_MANAGEGROUPS), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_DISABLE_ANOTHER_CONTACTS), FALSE);
- }
- else CheckDlgButton(hwndDlg, IDC_DISABLE_ANOTHER_CONTACTS, proto->msnOtherContactsBlocked ? BST_CHECKED : BST_UNCHECKED);
- }
- return TRUE;
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK) {
- Utils_OpenUrl("https://signup.live.com");
- return TRUE;
- }
-
- if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus()) {
- switch (LOWORD(wParam)) {
- case IDC_HANDLE: case IDC_PASSWORD: case IDC_HANDLE2:
- case IDC_GATEWAYSERVER: case IDC_YOURHOST: case IDC_DIRECTSERVER:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
-
- if (HIWORD(wParam) == BN_CLICKED) {
- switch (LOWORD(wParam)) {
- case IDC_SENDFONTINFO:
- case IDC_DISABLE_ANOTHER_CONTACTS:
- case IDC_MOBILESEND:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
- case IDC_MANAGEGROUPS:
- if (IsDlgButtonChecked(hwndDlg, IDC_MANAGEGROUPS)) {
- if (IDYES == MessageBox(hwndDlg,
- TranslateT("Server groups import may change your contact list layout after next login. Do you want to upload your groups to the server?"),
- TranslateT("MSN Protocol"), MB_YESNOCANCEL)) {
- CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- proto->MSN_UploadServerGroups(nullptr);
- }
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
- case IDC_RUN_APP_ON_HOTMAIL:
- {
- BOOL tIsChosen = IsDlgButtonChecked(hwndDlg, IDC_RUN_APP_ON_HOTMAIL);
- EnableWindow(GetDlgItem(hwndDlg, IDC_MAILER_APP), tIsChosen);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ENTER_MAILER_APP), tIsChosen);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- break;
-
- case IDC_ENTER_MAILER_APP:
- char szFile[MAX_PATH + 2];
- {
- HWND tEditField = GetDlgItem(hwndDlg, IDC_MAILER_APP);
-
- GetWindowTextA(tEditField, szFile, _countof(szFile));
-
- size_t tSelectLen = 0;
-
- if (szFile[0] == '\"') {
- char* p = strchr(szFile + 1, '\"');
- if (p != nullptr) {
- *p = '\0';
- memmove(szFile, szFile + 1, mir_strlen(szFile));
- tSelectLen += 2;
- goto LBL_Continue;
- }
- }
-
- char* p = strchr(szFile, ' ');
- if (p != nullptr) *p = '\0';
-LBL_Continue:
- tSelectLen += mir_strlen(szFile);
-
- OPENFILENAMEA ofn = { 0 };
- ofn.lStructSize = sizeof(ofn);
- ofn.hwndOwner = hwndDlg;
- ofn.nMaxFile = _countof(szFile);
- ofn.lpstrFile = szFile;
- ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
- if (GetOpenFileNameA(&ofn) != TRUE)
- break;
-
- if (strchr(szFile, ' ') != nullptr) {
- char tmpBuf[MAX_PATH + 2];
- mir_snprintf(tmpBuf, "\"%s\"", szFile);
- mir_strcpy(szFile, tmpBuf);
- }
-
- SendMessage(tEditField, EM_SETSEL, 0, tSelectLen);
- SendMessageA(tEditField, EM_REPLACESEL, TRUE, LPARAM(szFile));
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- }
- break;
-
- case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) {
- bool reconnectRequired = false;
- wchar_t screenStr[MAX_PATH];
- char password[100], szEmail[MSN_MAX_EMAIL_LEN];
- DBVARIANT dbv;
-
- CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- GetDlgItemTextA(hwndDlg, IDC_HANDLE, szEmail, _countof(szEmail));
- if (mir_strcmp(_strlwr(szEmail), proto->MyOptions.szEmail)) {
- reconnectRequired = true;
- mir_strcpy(proto->MyOptions.szEmail, szEmail);
- proto->setString("e-mail", szEmail);
- proto->setString("wlid", szEmail);
- proto->setDword("netId", (proto->MyOptions.netId = proto->GetMyNetID()));
- }
-
- GetDlgItemTextA(hwndDlg, IDC_PASSWORD, password, _countof(password));
- if (!proto->getString("Password", &dbv)) {
- if (mir_strcmp(password, dbv.pszVal)) {
- reconnectRequired = true;
- proto->setString("Password", password);
- }
- db_free(&dbv);
- }
- else {
- reconnectRequired = true;
- proto->setString("Password", password);
- }
-
- proto->setByte("SendFontInfo", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SENDFONTINFO));
- proto->setByte("RunMailerOnHotmail", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_RUN_APP_ON_HOTMAIL));
- proto->setByte("ManageServer", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MANAGEGROUPS));
-
- GetDlgItemText(hwndDlg, IDC_MAILER_APP, screenStr, _countof(screenStr));
- proto->setWString("MailerPath", screenStr);
-
- if (reconnectRequired && proto->msnLoggedIn)
- MessageBox(hwndDlg,
- TranslateT("These changes will take effect the next time you connect to the MSN Messenger network."),
- TranslateT("MSN options"), MB_OK);
-
- proto->LoadOptions();
- return TRUE;
- }
- break;
- }
-
- return FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN Connection Options dialog procedure
-
-static INT_PTR CALLBACK DlgProcMsnConnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- DBVARIANT dbv;
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- {
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- CMsnProto* proto = (CMsnProto*)lParam;
-
- if (!proto->getString("DirectServer", &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, dbv.pszVal);
- db_free(&dbv);
- }
- else SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, MSN_DEFAULT_LOGIN_SERVER);
-
- if (!proto->getString("GatewayServer", &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, dbv.pszVal);
- db_free(&dbv);
- }
- else SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, MSN_DEFAULT_GATEWAY);
-
- CheckDlgButton(hwndDlg, IDC_SLOWSEND, proto->getByte("SlowSend", 0) ? BST_CHECKED : BST_UNCHECKED);
-
- SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Automatically obtain host/port"));
- SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Manually specify host/port"));
- SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_ADDSTRING, 0, (LPARAM)TranslateT("Disable"));
-
- unsigned gethst = proto->getByte("AutoGetHost", 1);
- if (gethst < 2) gethst = !gethst;
-
- char ipaddr[256] = "";
- if (gethst == 1)
- if (db_get_static(NULL, proto->m_szModuleName, "YourHost", ipaddr, sizeof(ipaddr)))
- gethst = 0;
-
- if (gethst == 0)
- strncpy_s(ipaddr, (proto->msnLoggedIn ? proto->MyConnection.GetMyExtIPStr() : ""), _TRUNCATE);
-
- SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_SETCURSEL, gethst, 0);
- if (ipaddr[0])
- SetDlgItemTextA(hwndDlg, IDC_YOURHOST, ipaddr);
- else
- SetDlgItemText(hwndDlg, IDC_YOURHOST, TranslateT("IP info available only after login"));
- EnableWindow(GetDlgItem(hwndDlg, IDC_YOURHOST), gethst == 1);
- }
- return TRUE;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_RESETSERVER:
- SetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, MSN_DEFAULT_LOGIN_SERVER);
- SetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, MSN_DEFAULT_GATEWAY);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }
-
- if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus())
- switch (LOWORD(wParam)) {
- case IDC_DIRECTSERVER:
- case IDC_GATEWAYSERVER:
- case IDC_YOURHOST:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
-
- if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_HOSTOPT) {
- unsigned gethst = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0);
- EnableWindow(GetDlgItem(hwndDlg, IDC_YOURHOST), gethst == 1);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
-
- if (HIWORD(wParam) == BN_CLICKED) {
- switch (LOWORD(wParam)) {
- case IDC_SLOWSEND:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }
- }
- break;
-
- case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) {
- char str[MAX_PATH];
-
- CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- GetDlgItemTextA(hwndDlg, IDC_DIRECTSERVER, str, _countof(str));
- if (mir_strcmp(str, MSN_DEFAULT_LOGIN_SERVER))
- proto->setString("DirectServer", str);
- else
- proto->delSetting("DirectServer");
-
- GetDlgItemTextA(hwndDlg, IDC_GATEWAYSERVER, str, _countof(str));
- if (mir_strcmp(str, MSN_DEFAULT_GATEWAY))
- proto->setString("GatewayServer", str);
- else
- proto->delSetting("GatewayServer");
-
- proto->setByte("SlowSend", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SLOWSEND));
- if (proto->getByte("SlowSend", FALSE)) {
- if (db_get_dw(0, "SRMsg", "MessageTimeout", 60000) < 60000 ||
- db_get_dw(0, "SRMM", "MessageTimeout", 60000) < 60000) {
- MessageBox(nullptr, TranslateT("MSN Protocol requires message timeout to be not less then 60 sec. Correct the timeout value."),
- TranslateT("MSN Protocol"), MB_OK | MB_ICONINFORMATION);
- }
- }
-
- unsigned gethst = SendDlgItemMessage(hwndDlg, IDC_HOSTOPT, CB_GETCURSEL, 0, 0);
- if (gethst < 2) gethst = !gethst;
- proto->setByte("AutoGetHost", (BYTE)gethst);
-
- if (gethst == 0) {
- GetDlgItemTextA(hwndDlg, IDC_YOURHOST, str, _countof(str));
- proto->setString("YourHost", str);
- }
- else proto->delSetting("YourHost");
-
- proto->LoadOptions();
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Popup Options Dialog: style, position, color, font...
-
-static INT_PTR CALLBACK DlgProcHotmailPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- static bool bEnabled;
- CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- bEnabled = false;
-
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- proto = (CMsnProto*)lParam;
- CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILPOPUP, proto->getByte("DisableHotmail", 0) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILTRAY, proto->getByte("DisableHotmailTray", 1) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEHOTMAILCL, proto->getByte("DisableHotmailCL", 0) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEHOTJUNK, proto->getByte("DisableHotmailJunk", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_ENDSESSION, proto->getByte("EnableSessionPopup", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_NOTIFY_FIRSTMSG, proto->getByte("EnableDeliveryPopup", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ERRORS_USING_POPUPS, proto->getByte("ShowErrorsAsPopups", 0) ? BST_CHECKED : BST_UNCHECKED);
-
- bEnabled = true;
- return TRUE;
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_DISABLEHOTMAILPOPUP:
- case IDC_DISABLEHOTMAILTRAY:
- case IDC_DISABLEHOTMAILCL:
- case IDC_DISABLEHOTJUNK:
- case IDC_NOTIFY_ENDSESSION:
- case IDC_NOTIFY_FIRSTMSG:
- case IDC_ERRORS_USING_POPUPS:
- if (bEnabled)
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }
- break;
-
- case WM_NOTIFY: //Here we have pressed either the OK or the APPLY button.
- switch (((LPNMHDR)lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR)lParam)->code) {
- case PSN_RESET:
- proto->LoadOptions();
- return TRUE;
-
- case PSN_APPLY:
- proto->MyOptions.ShowErrorsAsPopups = IsDlgButtonChecked(hwndDlg, IDC_ERRORS_USING_POPUPS) != 0;
- proto->setByte("ShowErrorsAsPopups", proto->MyOptions.ShowErrorsAsPopups);
-
- proto->setByte("DisableHotmail", IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILPOPUP) ? FALSE : TRUE);
- proto->setByte("DisableHotmailCL", IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILCL) ? FALSE : TRUE);
- proto->setByte("DisableHotmailTray", IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTMAILTRAY) ? FALSE : TRUE);
- proto->setByte("DisableHotmailJunk", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_DISABLEHOTJUNK));
- proto->setByte("EnableDeliveryPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_FIRSTMSG));
- proto->setByte("EnableSessionPopup", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_NOTIFY_ENDSESSION));
-
- MCONTACT hContact = proto->MSN_HContactFromEmail(proto->MyOptions.szEmail);
- if (hContact)
- proto->displayEmailCount(hContact);
- return TRUE;
- }
- break;
- }
- break;
- }
-
- return FALSE;
-}
-
-static INT_PTR CALLBACK DlgProcAccMgrUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- {
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
-
- CMsnProto* proto = (CMsnProto*)lParam;
- SetDlgItemTextA(hwndDlg, IDC_HANDLE, proto->MyOptions.szEmail);
-
- char szPassword[100];
- if (!db_get_static(NULL, proto->m_szModuleName, "Password", szPassword, sizeof(szPassword))) {
- szPassword[99] = 0;
- SetDlgItemTextA(hwndDlg, IDC_PASSWORD, szPassword);
- }
- SendDlgItemMessage(hwndDlg, IDC_PASSWORD, EM_SETLIMITTEXT, 99, 0);
-
- DBVARIANT dbv;
- if (!proto->getWString("Place", &dbv)) {
- SetDlgItemText(hwndDlg, IDC_PLACE, dbv.pwszVal);
- db_free(&dbv);
- }
- }
- return TRUE;
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_NEWMSNACCOUNTLINK) {
- Utils_OpenUrl("https://signup.live.com");
- return TRUE;
- }
-
- if (HIWORD(wParam) == EN_CHANGE && (HWND)lParam == GetFocus()) {
- switch (LOWORD(wParam)) {
- case IDC_HANDLE:
- case IDC_PASSWORD:
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- break;
-
- case WM_NOTIFY:
- if (((LPNMHDR)lParam)->code == (UINT)PSN_APPLY) {
- char password[100], szEmail[MSN_MAX_EMAIL_LEN];
- DBVARIANT dbv;
-
- CMsnProto* proto = (CMsnProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- GetDlgItemTextA(hwndDlg, IDC_HANDLE, szEmail, _countof(szEmail));
- if (mir_strcmp(szEmail, proto->MyOptions.szEmail)) {
- mir_strcpy(proto->MyOptions.szEmail, szEmail);
- proto->setString("e-mail", szEmail);
- proto->setString("wlid", szEmail);
- proto->setDword("netId", (proto->MyOptions.netId = proto->GetMyNetID()));
- }
-
- GetDlgItemTextA(hwndDlg, IDC_PASSWORD, password, _countof(password));
- if (!proto->getString("Password", &dbv)) {
- if (mir_strcmp(password, dbv.pszVal))
- proto->setString("Password", password);
- db_free(&dbv);
- }
- else proto->setString("Password", password);
-
- wchar_t szPlace[64];
- GetDlgItemText(hwndDlg, IDC_PLACE, szPlace, _countof(szPlace));
- if (szPlace[0])
- proto->setWString("Place", szPlace);
- else
- proto->delSetting("Place");
-
- return TRUE;
- }
- break;
- }
-
- return FALSE;
-}
-
-INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- return TRUE;
-
- case WM_CLOSE:
- EndDialog(hwndDlg, 0);
- break;
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDOK) {
- int isBlock = IsDlgButtonChecked(hwndDlg, IDC_REMOVEBLOCK);
- int isHot = IsDlgButtonChecked(hwndDlg, IDC_REMOVEHOT);
-
- DeleteParam *param = (DeleteParam*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
-
- char szEmail[MSN_MAX_EMAIL_LEN];
- if (!db_get_static(param->hContact, param->proto->m_szModuleName, "wlid", szEmail, sizeof(szEmail)) ||
- !db_get_static(param->hContact, param->proto->m_szModuleName, "e-mail", szEmail, sizeof(szEmail))) {
- param->proto->MSN_AddUser(param->hContact, szEmail, 0, LIST_FL | (isHot ? LIST_REMOVE : LIST_REMOVENH));
- if (isBlock) {
- param->proto->MSN_AddUser(param->hContact, szEmail, 0, LIST_AL | LIST_REMOVE);
- param->proto->MSN_AddUser(param->hContact, szEmail, 0, LIST_BL);
- }
- }
- EndDialog(hwndDlg, 1);
- }
- break;
- }
-
- return FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Initialize options pages
-
-INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
-int CMsnProto::OnOptionsInit(WPARAM wParam, LPARAM)
-{
- OPTIONSDIALOGPAGE odp = {};
- odp.position = -790000000;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSN);
- odp.szTitle.w = m_tszUserName;
- odp.szGroup.w = LPGENW("Network");
- odp.szTab.w = LPGENW("Account");
- odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE;
- odp.pfnDlgProc = DlgProcMsnOpts;
- odp.dwInitParam = (LPARAM)this;
- g_plugin.addOptions(wParam, &odp);
-
- odp.szTab.w = LPGENW("Connection");
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSN_CONN);
- odp.pfnDlgProc = DlgProcMsnConnOpts;
- g_plugin.addOptions(wParam, &odp);
-
- odp.szTab.w = LPGENW("Server list");
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_LISTSMGR);
- odp.pfnDlgProc = DlgProcMsnServLists;
- g_plugin.addOptions(wParam, &odp);
-
- odp.szTab.w = LPGENW("Notifications");
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOTIFY);
- odp.pfnDlgProc = DlgProcHotmailPopupOpts;
- g_plugin.addOptions(wParam, &odp);
-
- return 0;
-}
-
-INT_PTR CMsnProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
-{
- return (INT_PTR)CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_ACCMGRUI),
- (HWND)lParam, DlgProcAccMgrUI, (LPARAM)this);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Load resident option values into memory
-
-void CMsnProto::LoadOptions(void)
-{
- memset(&MyOptions, 0, sizeof(MyOptions));
-
- //Popup Options
- MyOptions.ManageServer = getByte("ManageServer", TRUE) != 0;
- MyOptions.ShowErrorsAsPopups = getByte("ShowErrorsAsPopups", TRUE) != 0;
- MyOptions.SlowSend = getByte("SlowSend", FALSE) != 0;
- if (db_get_static(NULL, m_szModuleName, "wlid", MyOptions.szEmail, sizeof(MyOptions.szEmail)))
- {
- if (db_get_static(NULL, m_szModuleName, "e-mail", MyOptions.szEmail, sizeof(MyOptions.szEmail)))
- MyOptions.szEmail[0] = 0;
- else setString("wlid", MyOptions.szEmail);
- }
- _strlwr(MyOptions.szEmail);
- MyOptions.netId = getDword("netId", GetMyNetID());
-
- if (db_get_static(NULL, m_szModuleName, "MachineGuid", MyOptions.szMachineGuid, sizeof(MyOptions.szMachineGuid))) {
- char* uuid = getNewUuid();
- mir_strcpy(MyOptions.szMachineGuid, uuid);
- setString("MachineGuid", MyOptions.szMachineGuid);
- mir_free(uuid);
- }
- mir_strcpy(MyOptions.szMachineGuidP2P, MyOptions.szMachineGuid);
- _strlwr(MyOptions.szMachineGuidP2P);
-}
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
deleted file mode 100644
index a6a9e80d24..0000000000
--- a/protocols/MSN/src/msn_proto.cpp
+++ /dev/null
@@ -1,919 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2008-2012 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-static int CompareLists(const MsnContact *p1, const MsnContact *p2)
-{
- return _stricmp(p1->email, p2->email);
-}
-
-CMsnProto::CMsnProto(const char* aProtoName, const wchar_t* aUserName) :
- PROTO<CMsnProto>(aProtoName, aUserName),
- m_arContacts(10, CompareLists),
- m_arGroups(10, CompareId),
- m_arThreads(10, PtrKeySortT),
- m_arGCThreads(10, PtrKeySortT),
- lsMessageQueue(1),
- lsAvatarQueue(1),
- msgCache(5, CompareId),
- authContactToken("authContact", "service::contacts.msn.com::MBI_SSL"),
- authStorageToken("authStorage", "service::storage.msn.com::MBI_SSL"),
- authSSLToken("authSSL", "service::ssl.live.com::MBI_SSL"),
- authSkypeComToken("authSkypeCom", "service::skype.com::MBI_SSL"),
- authStrToken("authStr", "service::chatservice.live.com::MBI_SSL", true),
- authSkypeToken("authSkype")
-{
- db_set_resident(m_szModuleName, "IdleTS");
- db_set_resident(m_szModuleName, "p2pMsgId");
- db_set_resident(m_szModuleName, "MobileEnabled");
- db_set_resident(m_szModuleName, "MobileAllowed");
-
- // Initialize tokens
- authContactToken.Init(this);
- authStorageToken.Init(this);
- authSSLToken.Init(this);
- authSkypeComToken.Init(this);
- authStrToken.Init(this);
- authSkypeToken.Init(this);
- LoadAuthTokensDB();
-
- // Protocol services and events...
-
- CreateProtoService(PS_CREATEACCMGRUI, &CMsnProto::SvcCreateAccMgrUI);
-
- CreateProtoService(PS_GETAVATARINFO, &CMsnProto::GetAvatarInfo);
- CreateProtoService(PS_GETMYAWAYMSG, &CMsnProto::GetMyAwayMsg);
-
- CreateProtoService(PS_LEAVECHAT, &CMsnProto::OnLeaveChat);
-
- CreateProtoService(PS_GETMYAVATAR, &CMsnProto::GetAvatar);
- CreateProtoService(PS_SETMYAVATAR, &CMsnProto::SetAvatar);
- CreateProtoService(PS_GETAVATARCAPS, &CMsnProto::GetAvatarCaps);
-
- CreateProtoService(PS_SETMYNICKNAME, &CMsnProto::SetNickName);
-
- hMSNNudge = CreateProtoEvent(PE_NUDGE);
- CreateProtoService(PS_SEND_NUDGE, &CMsnProto::SendNudge);
-
- CreateProtoService(PS_GETUNREADEMAILCOUNT, &CMsnProto::GetUnreadEmailCount);
-
- // event hooks
- HookProtoEvent(ME_MSG_WINDOWPOPUP, &CMsnProto::OnWindowPopup);
- HookProtoEvent(ME_CLIST_GROUPCHANGE, &CMsnProto::OnGroupChange);
- HookProtoEvent(ME_OPT_INITIALISE, &CMsnProto::OnOptionsInit);
- HookProtoEvent(ME_CLIST_DOUBLECLICKED, &CMsnProto::OnContactDoubleClicked);
- HookProtoEvent(ME_DB_CONTACT_SETTINGCHANGED, &CMsnProto::OnDbSettingChanged);
-
- LoadOptions();
-
- for (auto &hContact : AccContacts()) {
- delSetting(hContact, "Status");
- delSetting(hContact, "IdleTS");
- delSetting(hContact, "p2pMsgId");
- delSetting(hContact, "AccList");
- }
- delSetting("MobileEnabled");
- delSetting("MobileAllowed");
-
- char path[MAX_PATH];
- if (db_get_static(NULL, m_szModuleName, "LoginServer", path, sizeof(path)) == 0 &&
- (mir_strcmp(path, MSN_DEFAULT_LOGIN_SERVER) == 0 ||
- mir_strcmp(path, MSN_DEFAULT_GATEWAY) == 0))
- delSetting("LoginServer");
-
- if (MyOptions.SlowSend) {
- if (db_get_dw(0, "SRMsg", "MessageTimeout", 10000) < 60000)
- db_set_dw(0, "SRMsg", "MessageTimeout", 60000);
- if (db_get_dw(0, "SRMM", "MessageTimeout", 10000) < 60000)
- db_set_dw(0, "SRMM", "MessageTimeout", 60000);
- }
-
- mailsoundname = (char*)mir_alloc(64);
- mir_snprintf(mailsoundname, 64, "%s:Hotmail", m_szModuleName);
- g_plugin.addSound(mailsoundname, m_tszUserName, LPGENW("Live Mail"));
-
- alertsoundname = (char*)mir_alloc(64);
- mir_snprintf(alertsoundname, 64, "%s:Alerts", m_szModuleName);
- g_plugin.addSound(alertsoundname, m_tszUserName, LPGENW("Live Alert"));
-
- AvatarQueue_Init();
- InitCustomFolders();
-
- wchar_t szBuffer[MAX_PATH];
- mir_snwprintf(szBuffer, TranslateT("%s plugin connections"), m_tszUserName);
-
- NETLIBUSER nlu = {};
- nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
- nlu.szSettingsModule = m_szModuleName;
- nlu.szDescriptiveName.w = szBuffer;
- m_hNetlibUser = Netlib_RegisterUser(&nlu);
-
- m_DisplayNameCache = nullptr;
-}
-
-CMsnProto::~CMsnProto()
-{
- MSN_FreeGroups();
- Threads_Uninit();
- AvatarQueue_Uninit();
- Lists_Uninit();
- CachedMsg_Uninit();
-
- mir_free(mailsoundname);
- mir_free(alertsoundname);
-
- for (int i = 0; i < MSN_NUM_MODES; i++)
- mir_free(msnModeMsgs[i]);
-
- mir_free(msnLastStatusMsg);
- mir_free(msnPreviousUUX);
- mir_free(msnExternalIP);
- mir_free(msnRegistration);
-
- mir_free(abCacheKey);
- mir_free(sharingCacheKey);
- mir_free(storageCacheKey);
- mir_free(m_DisplayNameCache);
-
- FreeAuthTokens();
-}
-
-void CMsnProto::OnModulesLoaded()
-{
- GCREGISTER gcr = {};
- gcr.dwFlags = GC_TYPNOTIF | GC_CHANMGR;
- gcr.iMaxText = 0;
- gcr.ptszDispName = m_tszUserName;
- gcr.pszModule = m_szModuleName;
- Chat_Register(&gcr);
-
- HookProtoEvent(ME_GC_EVENT, &CMsnProto::MSN_GCEventHook);
- HookProtoEvent(ME_GC_BUILDMENU, &CMsnProto::MSN_GCMenuHook);
-
- HookProtoEvent(ME_IDLE_CHANGED, &CMsnProto::OnIdleChanged);
- InitPopups();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// OnPreShutdown - prepare a global Miranda shutdown
-
-void CMsnProto::OnShutdown()
-{
- g_bTerminated = true;
- ReleaseSemaphore(hevAvatarQueue, 1, nullptr);
-
- Popup_UnregisterClass(hPopupError);
- Popup_UnregisterClass(hPopupHotmail);
- Popup_UnregisterClass(hPopupNotify);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnAddToList - adds contact to the server list
-
-MCONTACT CMsnProto::AddToListByEmail(const char *email, const char *nick, DWORD flags)
-{
- MCONTACT hContact = MSN_HContactFromEmail(email, nick, true, flags & PALF_TEMPORARY);
-
- if (flags & PALF_TEMPORARY) {
- if (!Contact_OnList(hContact))
- Contact_Hide(hContact);
- }
- else {
- Contact_Hide(hContact, false);
- if (msnLoggedIn) {
- int netId = strncmp(email, "tel:", 4) ? NETID_MSN : NETID_MOB;
- if (MSN_AddUser(hContact, email, netId, LIST_FL)) {
- MSN_AddUser(hContact, email, netId, LIST_PL + LIST_REMOVE);
- MSN_AddUser(hContact, email, netId, LIST_BL + LIST_REMOVE);
- MSN_AddUser(hContact, email, netId, LIST_AL);
- Contact_Hide(hContact, false);
- }
- MSN_SetContactDb(hContact, email);
-
- if (MSN_IsMeByContact(hContact)) displayEmailCount(hContact);
- }
- else hContact = NULL;
- }
- return hContact;
-}
-
-MCONTACT CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr)
-{
- wchar_t *id = psr->id.w ? psr->id.w : psr->email.w;
- return AddToListByEmail(
- psr->flags & PSR_UNICODE ? UTF8((wchar_t*)id) : UTF8((char*)id),
- psr->flags & PSR_UNICODE ? UTF8((wchar_t*)psr->nick.w) : UTF8((char*)psr->nick.w),
- flags);
-}
-
-MCONTACT CMsnProto::AddToListByEvent(int flags, int, MEVENT hDbEvent)
-{
- DBEVENTINFO dbei = {};
- if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
- return NULL;
-
- dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
- if (db_event_get(hDbEvent, &dbei)) return NULL;
- if (mir_strcmp(dbei.szModule, m_szModuleName)) return NULL;
- if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return NULL;
-
- DB_AUTH_BLOB blob(dbei.pBlob);
- return AddToListByEmail(blob.get_email(), blob.get_nick(), flags);
-}
-
-int CMsnProto::AuthRecv(MCONTACT, PROTORECVEVENT* pre)
-{
- return Proto_AuthRecv(m_szModuleName, pre);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// PSS_AUTHREQUEST
-
-int CMsnProto::AuthRequest(MCONTACT hContact, const wchar_t* szMessage)
-{
- if (msnLoggedIn) {
- char email[MSN_MAX_EMAIL_LEN];
- if (db_get_static(hContact, m_szModuleName, "wlid", email, sizeof(email)) &&
- db_get_static(hContact, m_szModuleName, "e-mail", email, sizeof(email)))
- return 1;
-
- int netId = strncmp(email, "tel:", 4) == 0 ? NETID_MOB : (strncmp(email, "live:", 5) == 0 ? NETID_SKYPE : NETID_MSN);
- if (MSN_AddUser(hContact, email, netId, LIST_FL, T2Utf(szMessage))) {
- MSN_AddUser(hContact, email, netId, LIST_PL + LIST_REMOVE);
- MSN_AddUser(hContact, email, netId, LIST_BL + LIST_REMOVE);
- MSN_AddUser(hContact, email, netId, LIST_AL);
- }
- MSN_SetContactDb(hContact, email);
-
- if (MSN_IsMeByContact(hContact)) displayEmailCount(hContact);
- return 0;
- }
- return 1;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnAuthAllow - called after successful authorization
-
-int CMsnProto::Authorize(MEVENT hDbEvent)
-{
- if (!msnLoggedIn)
- return 1;
-
- DBEVENTINFO dbei = {};
- if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
- return 1;
-
- dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
- if (db_event_get(hDbEvent, &dbei))
- return 1;
-
- if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
- return 1;
-
- if (mir_strcmp(dbei.szModule, m_szModuleName))
- return 1;
-
- DB_AUTH_BLOB blob(dbei.pBlob);
-
- MCONTACT hContact = MSN_HContactFromEmail(blob.get_email(), blob.get_nick(), true, 0);
- int netId = Lists_GetNetId(blob.get_email());
-
- MSN_AddUser(hContact, blob.get_email(), netId, LIST_AL);
- MSN_AddUser(hContact, blob.get_email(), netId, LIST_BL + LIST_REMOVE);
- MSN_AddUser(hContact, blob.get_email(), netId, LIST_PL + LIST_REMOVE);
-
- MSN_SetContactDb(hContact, blob.get_email());
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnAuthDeny - called after unsuccessful authorization
-
-int CMsnProto::AuthDeny(MEVENT hDbEvent, const wchar_t*)
-{
- if (!msnLoggedIn)
- return 1;
-
- DBEVENTINFO dbei = {};
- if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
- return 1;
-
- dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
- if (db_event_get(hDbEvent, &dbei))
- return 1;
-
- if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
- return 1;
-
- if (mir_strcmp(dbei.szModule, m_szModuleName))
- return 1;
-
- DB_AUTH_BLOB blob(dbei.pBlob);
-
- MsnContact* msc = Lists_Get(blob.get_email());
- if (msc == nullptr)
- return 0;
-
- MSN_AddUser(NULL, blob.get_email(), msc->netId, LIST_PL + LIST_REMOVE);
- MSN_AddUser(NULL, blob.get_email(), msc->netId, LIST_BL);
- MSN_AddUser(NULL, blob.get_email(), msc->netId, LIST_RL);
-
- if (!(msc->list & (LIST_FL | LIST_LL))) {
- if (msc->hContact) db_delete_contact(msc->hContact);
- msc->hContact = NULL;
- MCONTACT hContact = MSN_HContactFromEmail(blob.get_email());
- if (hContact) db_delete_contact(hContact);
- }
-
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnBasicSearch - search contacts by e-mail
-
-void __cdecl CMsnProto::MsnSearchAckThread(void* arg)
-{
- const wchar_t* emailT = (wchar_t*)arg;
- T2Utf email(emailT);
-
- if (Lists_IsInList(LIST_FL, email)) {
- MSN_ShowPopup(emailT, TranslateT("Contact already in your contact list"), MSN_ALLOW_MSGBOX, nullptr);
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg);
- mir_free(arg);
- return;
- }
-
- if (MyOptions.netId == NETID_SKYPE) MSN_SKYABSearch(email, arg);
- else {
- unsigned res = MSN_ABContactAdd(email, nullptr, NETID_MSN, nullptr, 1, true);
- switch (res) {
- case 0:
- case 2:
- case 3:
- {
- PROTOSEARCHRESULT psr = {};
- psr.cbSize = sizeof(psr);
- psr.flags = PSR_UNICODE;
- psr.id.w = (wchar_t*)emailT;
- psr.nick.w = (wchar_t*)emailT;
- psr.email.w = (wchar_t*)emailT;
-
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, arg, (LPARAM)&psr);
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg);
- }
- break;
-
- case 1:
- if (strstr(email, "@yahoo.com") == nullptr)
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg);
- break;
-
- default:
- ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, arg);
- break;
- }
- }
- mir_free(arg);
-}
-
-HANDLE CMsnProto::SearchBasic(const wchar_t* id)
-{
- if (!msnLoggedIn) return nullptr;
-
- wchar_t* email = mir_wstrdup(id);
- ForkThread(&CMsnProto::MsnSearchAckThread, email);
-
- return email;
-}
-
-HANDLE CMsnProto::SearchByEmail(const wchar_t* email)
-{
- return SearchBasic(email);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// stolen from netlibhttp.cpp
-
-static void MyNetlibConnFromUrl(const char* szUrl, NETLIBOPENCONNECTION &nloc)
-{
- bool secur = _strnicmp(szUrl, "https", 5) == 0;
- const char* phost = strstr(szUrl, "://");
-
- char* szHost = mir_strdup(phost ? phost + 3 : szUrl);
-
- char* ppath = strchr(szHost, '/');
- if (ppath) *ppath = '\0';
-
- memset(&nloc, 0, sizeof(nloc));
- nloc.szHost = szHost;
-
- char* pcolon = strrchr(szHost, ':');
- if (pcolon) {
- *pcolon = '\0';
- nloc.wPort = (WORD)strtol(pcolon + 1, nullptr, 10);
- }
- else nloc.wPort = secur ? 443 : 80;
- nloc.flags = (secur ? NLOCF_SSL : 0);
-}
-
-
-void __cdecl CMsnProto::MsnFileAckThread(void* arg)
-{
- filetransfer* ft = (filetransfer*)arg;
-
- wchar_t filefull[MAX_PATH];
- mir_snwprintf(filefull, L"%s\\%s", ft->std.szWorkingDir.w, ft->std.szCurrentFile.w);
- replaceStrW(ft->std.szCurrentFile.w, filefull);
-
- ResetEvent(ft->hResumeEvt);
- if (ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, ft, (LPARAM)&ft->std))
- WaitForSingleObject(ft->hResumeEvt, INFINITE);
-
- ft->create();
-
- ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_INITIALISING, ft);
-
- if (ft->tType == SERVER_HTTP) {
- const char *pszSkypeToken;
-
- if (ft->fileId != -1 && (pszSkypeToken = authSkypeToken.Token())) {
- NETLIBHTTPHEADER nlbhHeaders[3] = {};
- NETLIBHTTPREQUEST nlhr = { 0 }, *nlhrReply;
- char szRange[32];
-
- nlbhHeaders[0].szName = "User-Agent"; nlbhHeaders[0].szValue = (LPSTR)MSN_USER_AGENT;
- nlbhHeaders[1].szName = "Authorization"; nlbhHeaders[1].szValue = (char*)pszSkypeToken;
- nlhr.headersCount = 2;
- if (ft->std.currentFileProgress) {
- mir_snprintf(szRange, sizeof(szRange), "bytes=%I64d-", ft->std.currentFileProgress);
- nlbhHeaders[2].szName = "Range";
- nlbhHeaders[2].szValue = szRange;
- nlhr.headersCount++;
- }
-
- nlhr.cbSize = sizeof(nlhr);
- nlhr.requestType = REQUEST_GET;
- nlhr.flags = NLHRF_HTTP11;
- nlhr.szUrl = ft->szInvcookie;
- nlhr.headers = (NETLIBHTTPHEADER*)&nlbhHeaders;
-
- NETLIBOPENCONNECTION nloc = {};
- MyNetlibConnFromUrl(nlhr.szUrl, nloc);
- nloc.flags |= NLOCF_HTTP;
- if (nloc.flags & NLOCF_SSL)
- nlhr.flags |= NLHRF_SSL;
-
- HNETLIBCONN nlc = Netlib_OpenConnection(m_hNetlibUser, &nloc);
- if (nlc && Netlib_SendHttpRequest(nlc, &nlhr) != SOCKET_ERROR && (nlhrReply = Netlib_RecvHttpHeaders(nlc))) {
- if (nlhrReply->resultCode == 200 || nlhrReply->resultCode == 206) {
- ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_CONNECTED, ft);
-
- INT_PTR dw;
- char buf[1024];
- while (!ft->bCanceled && ft->std.currentFileProgress < ft->std.currentFileSize &&
- (dw = Netlib_Recv(nlc, buf, sizeof(buf), MSG_NODUMP)) > 0 && dw != SOCKET_ERROR)
- {
- _write(ft->fileId, buf, dw);
- ft->std.totalProgress += dw;
- ft->std.currentFileProgress += dw;
- ProtoBroadcastAck(ft->std.hContact, ACKTYPE_FILE, ACKRESULT_DATA, ft, (LPARAM)&ft->std);
- }
-
- if (ft->std.currentFileProgress == ft->std.currentFileSize)
- ft->std.currentFileNumber++;
- }
- Netlib_FreeHttpRequest(nlhrReply);
- }
- Netlib_CloseHandle(nlc);
- mir_free((char*)nloc.szHost);
- if (ft->std.currentFileNumber >= ft->std.totalFiles)
- ft->complete();
- }
- delete ft;
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnFileAllow - starts the file transfer
-
-HANDLE CMsnProto::FileAllow(MCONTACT, HANDLE hTransfer, const wchar_t* szPath)
-{
- filetransfer* ft = (filetransfer*)hTransfer;
-
- if ((ft->std.szWorkingDir.w = mir_wstrdup(szPath)) == nullptr) {
- wchar_t szCurrDir[MAX_PATH];
- GetCurrentDirectory(_countof(szCurrDir), szCurrDir);
- ft->std.szWorkingDir.w = mir_wstrdup(szCurrDir);
- }
- else {
- size_t len = mir_wstrlen(ft->std.szWorkingDir.w) - 1;
- if (ft->std.szWorkingDir.w[len] == '\\')
- ft->std.szWorkingDir.w[len] = 0;
- }
-
- ForkThread(&CMsnProto::MsnFileAckThread, ft);
-
- return ft;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnFileCancel - cancels the active file transfer
-
-int CMsnProto::FileCancel(MCONTACT, HANDLE hTransfer)
-{
- filetransfer* ft = (filetransfer*)hTransfer;
- if (ft->tType == SERVER_HTTP)
- ft->bCanceled = true;
-
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnFileDeny - rejects the file transfer request
-
-int CMsnProto::FileDeny(MCONTACT, HANDLE hTransfer, const wchar_t* /*szReason*/)
-{
- filetransfer* ft = (filetransfer*)hTransfer;
- if (ft->tType == SERVER_HTTP)
- delete ft;
-
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnFileResume - renames a file
-
-int CMsnProto::FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename)
-{
- filetransfer* ft = (filetransfer*)hTransfer;
-
- if (ft->tType == SERVER_HTTP) {
- switch (*action) {
- case FILERESUME_SKIP:
- ft->close();
- ft->bCanceled = true;
- break;
- case FILERESUME_RENAME:
- replaceStrW(ft->std.szCurrentFile.w, *szFilename);
- break;
- case FILERESUME_OVERWRITE:
- ft->std.currentFileProgress = 0;
- break;
- case FILERESUME_RESUME:
- struct _stati64 statbuf;
- _wstat64(ft->std.szCurrentFile.w, &statbuf);
- ft->std.currentFileProgress = statbuf.st_size;
- break;
- }
- SetEvent(ft->hResumeEvt);
- }
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnGetAwayMsg - reads the current status message for a user
-
-struct AwayMsgInfo
-{
- INT_PTR id;
- MCONTACT hContact;
-};
-
-void __cdecl CMsnProto::MsnGetAwayMsgThread(void* arg)
-{
- Sleep(150);
-
- AwayMsgInfo *inf = (AwayMsgInfo*)arg;
-
- ptrW wszStatus(db_get_wsa(inf->hContact, "CList", "StatusMsg"));
- ProtoBroadcastAck(inf->hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)inf->id, wszStatus);
-
- mir_free(inf);
-}
-
-HANDLE CMsnProto::GetAwayMsg(MCONTACT hContact)
-{
- AwayMsgInfo *inf = (AwayMsgInfo*)mir_alloc(sizeof(AwayMsgInfo));
- inf->hContact = hContact;
- inf->id = MSN_GenRandom();
-
- ForkThread(&CMsnProto::MsnGetAwayMsgThread, inf);
- return (HANDLE)inf->id;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnGetCaps - obtain the protocol capabilities
-
-INT_PTR CMsnProto::GetCaps(int type, MCONTACT)
-{
- switch (type) {
- case PFLAGNUM_1:
- return PF1_IM | PF1_SERVERCLIST | PF1_AUTHREQ | PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_CHAT | PF1_CONTACT |
- PF1_FILERECV | PF1_VISLIST | PF1_MODEMSG;
-
- case PFLAGNUM_2:
- return PF2_ONLINE | PF2_SHORTAWAY | PF2_LIGHTDND | PF2_INVISIBLE | PF2_IDLE;
-
- case PFLAGNUM_3:
- return PF2_ONLINE | PF2_SHORTAWAY | PF2_LIGHTDND;
-
- case PFLAGNUM_4:
- return PF4_FORCEAUTH | PF4_SUPPORTTYPING | PF4_AVATARS | PF4_SUPPORTIDLE | PF4_IMSENDOFFLINE | PF4_NOAUTHDENYREASON;
-
- case PFLAG_UNIQUEIDTEXT:
- return (INT_PTR)Translate("Live ID");
-
- case PFLAG_MAXLENOFMESSAGE:
- return 1202;
-
- case PFLAG_MAXCONTACTSPERPACKET:
- return 1024; // Only an assumption...
- }
-
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnRecvMessage - creates a database event from the message been received
-
-MEVENT CMsnProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre)
-{
- char tEmail[MSN_MAX_EMAIL_LEN];
- if (!db_get_static(hContact, m_szModuleName, "wlid", tEmail, sizeof(tEmail)) || !db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail)))
- if (Lists_IsInList(LIST_FL, tEmail) && db_get_b(hContact, "MetaContacts", "IsSubcontact", 0) == 0)
- Contact_Hide(hContact, false);
-
- return CSuper::RecvMsg(hContact, pre);
-}
-
-int CMsnProto::GetInfo(MCONTACT hContact, int)
-{
- if (MyOptions.netId == NETID_SKYPE) {
- char tEmail[MSN_MAX_EMAIL_LEN];
- if (db_get_static(hContact, m_szModuleName, "wlid", tEmail, sizeof(tEmail)) && db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail)))
- return 0;
-
- MSN_SKYABGetProfile(tEmail);
- return 1;
- }
- return 0;
-}
-
-// MsnRecvContacts - creates a database event from the contacts received
-int CMsnProto::RecvContacts(MCONTACT hContact, PROTORECVEVENT* pre)
-{
- PROTOSEARCHRESULT **isrList = (PROTOSEARCHRESULT**)pre->szMessage;
- DBEVENTINFO dbei = {};
- BYTE *pCurBlob;
- int i;
-
- for (i = 0; i < pre->lParam; i++)
- dbei.cbBlob += int(mir_wstrlen(isrList[i]->nick.w) + 2 + mir_wstrlen(isrList[i]->id.w));
- dbei.pBlob = (PBYTE)_alloca(dbei.cbBlob);
- for (i = 0, pCurBlob = dbei.pBlob; i < pre->lParam; i++) {
- mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->nick.w));
- pCurBlob += mir_strlen((char*)pCurBlob) + 1;
- mir_strcpy((char*)pCurBlob, _T2A(isrList[i]->id.w));
- pCurBlob += mir_strlen((char*)pCurBlob) + 1;
- }
-
- dbei.szModule = m_szModuleName;
- dbei.timestamp = pre->timestamp;
- dbei.flags = (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
- dbei.eventType = EVENTTYPE_CONTACTS;
- db_event_add(hContact, &dbei);
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnSendMessage - sends the message to a server
-
-int CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc)
-{
- if (!msnLoggedIn) {
- ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)999999, (LPARAM)Translate("Protocol is offline"));
- return 999999;
- }
-
- char tEmail[MSN_MAX_EMAIL_LEN];
- if (MSN_IsMeByContact(hContact, tEmail)) {
- ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)999999, (LPARAM)Translate("You cannot send message to yourself"));
- return 999999;
- }
-
- char *msg = (char*)pszSrc;
- if (msg == nullptr)
- return 0;
-
- int rtlFlag = (flags & PREF_RTL) ? MSG_RTL : 0;
-
- int seq = 0;
- int netId = Lists_GetNetId(tEmail);
-
- switch (netId) {
- case NETID_MOB:
- if (mir_strlen(msg) > 133) {
- seq = 999997;
- ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)seq, (LPARAM)Translate("Message is too long: SMS page limited to 133 UTF-8 chars"));
- }
- else {
- seq = msnNsThread->sendMessage('1', tEmail, netId, msg, rtlFlag);
- ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)seq);
- }
- break;
-
- case NETID_YAHOO:
- if (mir_strlen(msg) > 1202) {
- seq = 999996;
- ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)seq, (LPARAM)Translate("Message is too long: MSN messages are limited by 1202 UTF-8 chars"));
- }
- else {
- seq = msnNsThread->sendMessage('1', tEmail, netId, msg, rtlFlag);
- ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)seq);
- }
- break;
-
- default:
- if (mir_strlen(msg) > 1202) {
- seq = 999996;
- ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)seq, (LPARAM)Translate("Message is too long: MSN messages are limited by 1202 UTF-8 chars"));
- }
- else {
- if (netId != NETID_LCS) {
- seq = msnNsThread->sendMessage('1', tEmail, netId, msg, rtlFlag | MSG_OFFLINE);
- ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)seq);
- }
- else {
- seq = 999993;
- ProtoBroadcastAsync(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE)seq, (LPARAM)Translate("Offline messaging is not allowed for LCS contacts"));
- }
- }
- break;
- }
-
- return seq;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnSendContacts - sends contacts to a certain user
-
-int CMsnProto::SendContacts(MCONTACT hContact, int, int nContacts, MCONTACT *hContactsList)
-{
- if (!msnLoggedIn)
- return 0;
-
- char tEmail[MSN_MAX_EMAIL_LEN];
- if (MSN_IsMeByContact(hContact, tEmail)) return 0;
-
- int seq = 0;
- int netId = Lists_GetNetId(tEmail);
- CMStringA msg;
-
- msg.Append("<contacts alt=\"[Contacts enclosed. Please upgrade to latest Skype version to receive contacts.]\">");
- for (int i = 0; i < nContacts; i++) {
- ptrA wlid(getStringA(hContactsList[i], "wlid"));
- if (wlid != NULL)
- msg.AppendFormat("<c t=\"s\" s=\"%s\"/>", wlid.get());
- }
- msg.Append("</contacts>");
- seq = msnNsThread->sendMessage('1', tEmail, netId, msg, MSG_CONTACT);
- ProtoBroadcastAsync(hContact, ACKTYPE_CONTACTS, ACKRESULT_SUCCESS, (HANDLE)seq);
- return seq;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnSetAwayMsg - sets the current status message for a user
-
-int CMsnProto::SetAwayMsg(int status, const wchar_t* msg)
-{
- char** msgptr = GetStatusMsgLoc(status);
-
- if (msgptr == nullptr)
- return 1;
-
- mir_free(*msgptr);
- char* buf = *msgptr = mir_utf8encodeW(msg);
- if (buf && mir_strlen(buf) > 1859) {
- buf[1859] = 0;
- const int i = 1858;
- if (buf[i] & 128) {
- if (buf[i] & 64)
- buf[i] = '\0';
- else if ((buf[i - 1] & 224) == 224)
- buf[i - 1] = '\0';
- else if ((buf[i - 2] & 240) == 240)
- buf[i - 2] = '\0';
- }
- }
-
- if (status == m_iDesiredStatus)
- MSN_SendStatusMessage(*msgptr);
-
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnSetStatus - set the plugin's connection status
-
-int CMsnProto::SetStatus(int iNewStatus)
-{
- if (m_iDesiredStatus == iNewStatus) return 0;
-
- m_iDesiredStatus = iNewStatus;
- debugLogA("PS_SETSTATUS(%d,0)", iNewStatus);
-
- if (m_iDesiredStatus == ID_STATUS_OFFLINE) {
- if (msnNsThread)
- msnNsThread->sendTerminate();
- }
- else if (!msnLoggedIn && m_iStatus == ID_STATUS_OFFLINE) {
- char szPassword[100];
- int ps = db_get_static(NULL, m_szModuleName, "Password", szPassword, sizeof(szPassword));
- if (ps != 0 || *szPassword == 0) {
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_WRONGPASSWORD);
- m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
- return 0;
- }
-
- if (*MyOptions.szEmail == 0) {
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_BADUSERID);
- m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
- return 0;
- }
-
- int oldMode = m_iStatus;
- m_iStatus = ID_STATUS_CONNECTING;
- ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldMode, m_iStatus);
-
- ThreadData* newThread = new ThreadData;
-
- newThread->mType = SERVER_NOTIFICATION;
- newThread->mIsMainThread = true;
-
- newThread->startThread(&CMsnProto::MSNServerThread, this);
- }
- else
- if (m_iStatus > ID_STATUS_OFFLINE) MSN_SetServerStatus(m_iDesiredStatus);
-
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnUserIsTyping - notify another contact that we're typing a message
-
-int CMsnProto::UserIsTyping(MCONTACT hContact, int type)
-{
- if (!msnLoggedIn) return 0;
-
- char tEmail[MSN_MAX_EMAIL_LEN];
- if (MSN_IsMeByContact(hContact, tEmail)) return 0;
-
- bool typing = type == PROTOTYPE_SELFTYPING_ON;
- int netId = Lists_GetNetId(tEmail);
-
- if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
- MSN_SendTyping(msnNsThread, tEmail, netId, typing);
-
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnSetApparentMode - controls contact visibility
-
-int CMsnProto::SetApparentMode(MCONTACT hContact, int mode)
-{
- if (mode && mode != ID_STATUS_OFFLINE)
- return 1;
-
- WORD oldMode = getWord(hContact, "ApparentMode", 0);
- if (mode != oldMode)
- setWord(hContact, "ApparentMode", (WORD)mode);
-
- return 1;
-}
-
-void CMsnProto::OnErase()
-{
- char szDbsettings[64];
- mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
- db_delete_module(0, szDbsettings);
-}
diff --git a/protocols/MSN/src/msn_proto.h b/protocols/MSN/src/msn_proto.h
deleted file mode 100644
index 0d0fa760a1..0000000000
--- a/protocols/MSN/src/msn_proto.h
+++ /dev/null
@@ -1,474 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2009-2012 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _MSN_PROTO_H_
-#define _MSN_PROTO_H_
-
-#include <m_protoint.h>
-
-struct CMsnProto : public PROTO<CMsnProto>
-{
- CMsnProto(const char*, const wchar_t*);
- ~CMsnProto();
-
- //====================================================================================
- // PROTO_INTERFACE
- //====================================================================================
-
- MCONTACT AddToList(int flags, PROTOSEARCHRESULT* psr) override;
- MCONTACT AddToListByEvent(int flags, int iContact, MEVENT hDbEvent) override;
-
- int Authorize(MEVENT hDbEvent) override;
- int AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) override;
- int AuthRecv(MCONTACT hContact, PROTORECVEVENT*) override;
- int AuthRequest(MCONTACT hContact, const wchar_t* szMessage) override;
-
- HANDLE FileAllow(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szPath) override;
- int FileCancel(MCONTACT hContact, HANDLE hTransfer) override;
- int FileDeny(MCONTACT hContact, HANDLE hTransfer, const wchar_t* szReason) override;
- int FileResume(HANDLE hTransfer, int* action, const wchar_t** szFilename) override;
-
- INT_PTR GetCaps(int type, MCONTACT hContact = NULL) override;
- int GetInfo(MCONTACT hContact, int infoType) override;
-
- HANDLE SearchBasic(const wchar_t* id) override;
- HANDLE SearchByEmail(const wchar_t* email) override;
-
- MEVENT RecvMsg(MCONTACT hContact, PROTORECVEVENT*) override;
- int RecvContacts(MCONTACT hContact, PROTORECVEVENT*) override;
-
- int SendMsg(MCONTACT hContact, int flags, const char* msg) override;
- int SendContacts(MCONTACT hContact, int flags, int nContacts, MCONTACT *hContactsList) override;
-
- int SetApparentMode(MCONTACT hContact, int mode) override;
- int SetStatus(int iNewStatus) override;
-
- HANDLE GetAwayMsg(MCONTACT hContact) override;
- int SetAwayMsg(int m_iStatus, const wchar_t* msg) override;
-
- int UserIsTyping(MCONTACT hContact, int type) override;
-
- void OnBuildProtoMenu(void) override;
- void OnContactDeleted(MCONTACT) override;
- void OnErase() override;
- void OnModulesLoaded() override;
- void OnShutdown() override;
-
- //====| Services |====================================================================
-
- INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM wParam, LPARAM lParam);
-
- INT_PTR __cdecl GetAvatarInfo(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl GetMyAwayMsg(WPARAM wParam, LPARAM lParam);
-
- INT_PTR __cdecl GetAvatar(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl SetAvatar(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl GetAvatarCaps(WPARAM wParam, LPARAM lParam);
-
- INT_PTR __cdecl SetNickName(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl SendNudge(WPARAM wParam, LPARAM lParam);
-
- INT_PTR __cdecl GetUnreadEmailCount(WPARAM wParam, LPARAM lParam);
-
- INT_PTR __cdecl OnLeaveChat(WPARAM wParam, LPARAM lParam);
-
- //====| Events |======================================================================
-
- int __cdecl OnIdleChanged(WPARAM wParam, LPARAM lParam);
- int __cdecl OnGroupChange(WPARAM wParam, LPARAM lParam);
- int __cdecl OnOptionsInit(WPARAM wParam, LPARAM lParam);
- int __cdecl OnPrebuildContactMenu(WPARAM wParam, LPARAM lParam);
- int __cdecl OnContactDoubleClicked(WPARAM wParam, LPARAM lParam);
- int __cdecl OnDbSettingChanged(WPARAM wParam, LPARAM lParam);
- int __cdecl OnWindowPopup(WPARAM wParam, LPARAM lParam);
-
- //====| Data |========================================================================
-
- // Security Tokens
- char *pAuthToken, *tAuthToken;
- char *oimSendToken;
- char *authSecretToken;
- OAuthToken authStrToken, authContactToken, authStorageToken, authSSLToken, authSkypeComToken;
- SkypeToken authSkypeToken;
- char *hotSecretToken, *hotAuthToken;
- char *authUser, *authUIC, *authCookies, *authRefreshToken;
- bool bAskingForAuth, bPassportAuth;
- int authMethod;
- bool bSentBND, bIgnoreATH;
-
- char *abCacheKey, *sharingCacheKey, *storageCacheKey;
-
- mir_cs m_csLists;
- OBJLIST<MsnContact> m_arContacts;
-
- LIST<ServerGroupItem> m_arGroups;
-
- mir_cs m_csThreads;
- OBJLIST<ThreadData> m_arThreads;
- LIST<GCThreadData> m_arGCThreads;
-
- mir_cs m_csSessions;
-
- mir_cs csMsgQueue;
- int msgQueueSeq;
- OBJLIST<MsgQueueEntry> lsMessageQueue;
-
- mir_cs csAvatarQueue;
- LIST<AvatarQueueEntry> lsAvatarQueue;
- HANDLE hevAvatarQueue;
-
- LONG m_chatID;
-
- int msnPingTimeout;
- unsigned __int64 lastMsgId;
- HANDLE hKeepAliveThreadEvt;
-
- char* msnModeMsgs[MSN_NUM_MODES];
-
- LISTENINGTOINFO msnCurrentMedia;
- MYOPTIONS MyOptions;
- MyConnectionType MyConnection;
-
- ThreadData* msnNsThread;
- bool msnLoggedIn;
-
- char* msnExternalIP;
- char* msnRegistration;
- char* msnPreviousUUX;
- char* msnLastStatusMsg;
-
- char* mailsoundname;
- char* alertsoundname;
-
- unsigned langpref;
- bool emailEnabled;
- unsigned abchMigrated;
- unsigned myFlags;
-
- unsigned msnOtherContactsBlocked;
- int mUnreadMessages;
- int mUnreadJunkEmails;
- clock_t mHttpsTS;
- clock_t mStatusMsgTS;
-
- HANDLE msnSearchId;
- HNETLIBCONN hHttpsConnection;
- HANDLE hMSNNudge;
- HANDLE hPopupError, hPopupHotmail, hPopupNotify;
-
- HANDLE hCustomSmileyFolder;
- bool InitCstFldRan;
- bool isConnectSuccess;
- bool isIdle;
-
- void InitCustomFolders(void);
-
- char* getSslResult(char** parUrl, const char* parAuthInfo, const char* hdrs, unsigned& status);
- bool getMyAvatarFile(char *url, wchar_t *fname);
-
- void MSN_GoOffline(void);
- void MSN_GetCustomSmileyFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const char* SmileyName, int Type);
-
- const char* MirandaStatusToMSN(int status);
- WORD MSNStatusToMiranda(const char *status);
- char** GetStatusMsgLoc(int status);
-
- void MSN_SendStatusMessage(const char* msg);
- void MSN_SetServerStatus(int newStatus);
- void MSN_FetchRecentMessages(time_t since = 0);
- void MSN_StartStopTyping(GCThreadData* info, bool start);
- void MSN_SendTyping(ThreadData* info, const char* email, int netId, bool bTyping);
-
- void MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* params);
- int MSN_HandleCommands(ThreadData* info, char* cmdString);
- int MSN_HandleErrors(ThreadData* info, char* cmdString);
- void MSN_ProcessNotificationMessage(char* buf, size_t bufLen);
- void MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid);
- void MSN_ProcessNLN(const char *userStatus, const char *wlid, char *userNick, const char *objid, char *cmdstring);
- void MSN_ProcessYFind(char* buf, size_t len);
- void MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli);
- void MSN_SetMirVer(MCONTACT hContact, MsnPlace *place);
-
- void LoadOptions(void);
-
- void InitPopups(void);
- void MSN_ShowPopup(const wchar_t* nickname, const wchar_t* msg, int flags, const char* url);
- void MSN_ShowPopup(const MCONTACT hContact, const wchar_t* msg, int flags);
- void MSN_ShowError(const char* msgtext, ...);
- void MSN_SendNicknameUtf(const char* nickname);
-
- typedef struct { wchar_t *szName; const char *szMimeType; unsigned char *data; size_t dataSize; } StoreAvatarData;
- void __cdecl msn_storeAvatarThread(void* arg);
-
- void __cdecl msn_storeProfileThread(void*);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN menus
-
- HGENMENU menuItemsMain[4];
-
- void MSN_EnableMenuItems(bool parEnable);
- void MsnInvokeMyURL(bool ismail, const char* url);
-
- INT_PTR __cdecl MsnBlockCommand(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl MsnGotoInbox(WPARAM, LPARAM);
- INT_PTR __cdecl MsnSendHotmail(WPARAM wParam, LPARAM);
- INT_PTR __cdecl MsnEditProfile(WPARAM, LPARAM);
- INT_PTR __cdecl MsnInviteCommand(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl MsnViewProfile(WPARAM wParam, LPARAM lParam);
- INT_PTR __cdecl MsnSetupAlerts(WPARAM wParam, LPARAM lParam);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN thread functions
-
- void __cdecl msn_keepAliveThread(void* arg);
- void __cdecl msn_loginThread(void* arg);
- void __cdecl msn_IEAuthThread(void* arg);
- void __cdecl msn_refreshOAuthThread(void*);
- void __cdecl MSNServerThread(void* arg);
-
- void __cdecl MsnFileAckThread(void* arg);
- void __cdecl MsnSearchAckThread(void* arg);
-
- void __cdecl MsnGetAwayMsgThread(void* arg);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN thread support
-
- void Threads_Uninit(void);
- void MSN_CloseConnections(void);
- ThreadData* MSN_GetThreadByConnection(HANDLE hConn);
- GCThreadData* MSN_GetThreadByChatId(const wchar_t* chatId);
-
- void __cdecl ThreadStub(void* arg);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN message reassembly support
-
- OBJLIST<chunkedmsg> msgCache;
-
- int addCachedMsg(const char* id, const char* msg, const size_t offset, const size_t portion, const size_t totsz, const bool bychunk);
- size_t getCachedMsgSize(const char* id);
- bool getCachedMsg(const int idx, char*& msg, size_t& size);
- bool getCachedMsg(const char* id, char*& msg, size_t& size);
- void clearCachedMsg(int idx = -1);
- void CachedMsg_Uninit(void);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN Chat support
-
- int MSN_ChatInit(GCThreadData *info, const char *pszID, const char *pszTopic);
- void MSN_ChatStart(ezxml_t xmli);
- void MSN_KillChatSession(const wchar_t* id);
- void MSN_Kickuser(GCHOOK *gch);
- void MSN_Promoteuser(GCHOOK *gch, const char *pszRole);
- const wchar_t* MSN_GCGetRole(GCThreadData* thread, const char *pszWLID);
- void MSN_GCProcessThreadActivity(ezxml_t xmli, const wchar_t *mChatID);
- void MSN_GCAddMessage(wchar_t *mChatID, MCONTACT hContact, char *email, time_t ts, bool sentMsg, char *msgBody);
- void MSN_GCRefreshThreadsInfo(void);
-
- MCONTACT MSN_GetChatInernalHandle(MCONTACT hContact);
-
- int __cdecl MSN_GCEventHook(WPARAM wParam, LPARAM lParam);
- int __cdecl MSN_GCMenuHook(WPARAM wParam, LPARAM lParam);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN contact list
-
- int Lists_Add(int list, int netId, const char* email, MCONTACT hContact = NULL, const char* nick = nullptr, const char* invite = nullptr);
- bool Lists_IsInList(int list, const char* email);
- int Lists_GetMask(const char* email);
- int Lists_GetNetId(const char* email);
- void Lists_Remove(int list, const char* email);
- void Lists_Populate(void);
- void Lists_Wipe(void);
-
- MsnContact* Lists_Get(const char* email);
- MsnContact* Lists_Get(MCONTACT hContact);
- MsnContact* Lists_GetNext(int& i);
-
- MsnPlace* Lists_GetPlace(const char* wlid);
- MsnPlace* Lists_GetPlace(const char* szEmail, const char *szInst);
- MsnPlace* Lists_AddPlace(const char* email, const char* id, unsigned cap1, unsigned cap2);
-
- void Lists_Uninit(void);
-
- void AddDelUserContList(const char* email, const int list, const int netId, const bool del);
-
- void MSN_CreateContList(void);
- void MSN_CleanupLists(void);
- bool MSN_RefreshContactList(void);
-
- bool MSN_IsMyContact(MCONTACT hContact);
- bool MSN_IsMeByContact(MCONTACT hContact, char* szEmail = nullptr);
- bool MSN_AddUser(MCONTACT hContact, const char* email, int netId, int flags, const char *msg = nullptr);
- void MSN_AddAuthRequest(const char *email, const char *nick, const char *reason);
- void MSN_SetContactDb(MCONTACT hContact, const char *szEmail);
- MCONTACT MSN_HContactFromEmail(const char* msnEmail, const char* msnNick = nullptr, bool addIfNeeded = false, bool temporary = false);
- MCONTACT MSN_HContactFromChatID(const char* wlid);
- MCONTACT AddToListByEmail(const char *email, const char *nick, DWORD flags);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN server groups
-
- void MSN_AddGroup(const char* pName, const char* pId, bool init);
- void MSN_DeleteGroup(const char* pId);
- void MSN_FreeGroups(void);
- LPCSTR MSN_GetGroupById(const char* pId);
- LPCSTR MSN_GetGroupByName(const char* pName);
- void MSN_SetGroupName(const char* pId, const char* pName);
-
- void MSN_MoveContactToGroup(MCONTACT hContact, const char* grpName);
- void MSN_RenameServerGroup(LPCSTR szId, const char* newName);
- void MSN_DeleteServerGroup(LPCSTR szId);
- void MSN_RemoveEmptyGroups(void);
- void MSN_SyncContactToServerGroup(MCONTACT hContact, const char* szContId, ezxml_t cgrp);
- void MSN_UploadServerGroups(char* group);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN Authentication
-
- int MSN_GetPassportAuth(void);
- int MSN_SkypeAuth(const char *pszNonce, char *pszUIC);
- void LoadAuthTokensDB(void);
- void SaveAuthTokensDB(void);
- bool parseLoginPage(char *pszHTML, NETLIBHTTPREQUEST *nlhr, CMStringA *post);
- int LoginSkypeOAuth(const char *pRefreshToken);
- bool RefreshOAuth(const char *pszRefreshToken, const char *pszService, CMStringA *pszAccessToken, CMStringA *pszOutRefreshToken, time_t *ptExpires);
- int MSN_AuthOAuth(void);
- int MSN_RefreshOAuthTokens(bool bJustCheck);
- void MSN_SendATH(ThreadData *info);
- CMStringA HotmailLogin(const char *url);
- void FreeAuthTokens(void);
- int GetMyNetID(void);
- LPCSTR GetMyUsername(int netId);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN avatars support
-
- void AvatarQueue_Init(void);
- void AvatarQueue_Uninit(void);
-
- void MSN_GetAvatarFileName(MCONTACT hContact, wchar_t* pszDest, size_t cbLen, const wchar_t *ext);
- int MSN_SetMyAvatar(const wchar_t* szFname, void* pData, size_t cbLen);
-
- void __cdecl MSN_AvatarsThread(void*);
-
- void pushAvatarRequest(MCONTACT hContact, LPCSTR pszUrl);
- bool loadHttpAvatar(AvatarQueueEntry *p);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN Mail & Offline messaging support
-
- bool nickChg;
-
- void getMetaData(void);
- void getOIMs(ezxml_t xmli);
- ezxml_t oimRecvHdr(const char* service, ezxml_t& tbdy, char*& httphdr);
-
- void processMailData(char* mailData);
- void sttNotificationMessage(char* msgBody, bool isInitial);
- void displayEmailCount(MCONTACT hContact);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // SKYPE JSON Address Book
- bool MSN_SKYABRefreshClist(void);
- bool MSN_SKYABBlockContact(const char *wlid, const char *pszAction);
- bool MSN_SKYABAuthRq(const char *wlid, const char *pszGreeting);
- bool MSN_SKYABAuthRsp(const char *wlid, const char *pszAction);
- bool MSN_SKYABDeleteContact(const char *wlid);
- bool MSN_SKYABSearch(const char *keyWord, HANDLE hSearch);
- bool MSN_SKYABGetProfiles(const char *pszPOST);
- bool MSN_SKYABGetProfile(const char *wlid);
-
- bool APISkypeComRequest(NETLIBHTTPREQUEST *nlhr, NETLIBHTTPHEADER *headers);
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN SOAP Address Book
-
- bool MSN_SharingFindMembership(bool deltas = false, bool allowRecurse = true);
- bool MSN_SharingAddDelMember(const char* szEmail, const int listId, const int netId, const char* szMethod, bool allowRecurse = true);
- bool MSN_SharingMyProfile(bool allowRecurse = true);
- bool MSN_ABAdd(bool allowRecurse = true);
- bool MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas = false, bool allowRecurse = true);
- bool MSN_ABAddDelContactGroup(const char* szCntId, const char* szGrpId, const char* szMethod, bool allowRecurse = true);
- void MSN_ABAddGroup(const char* szGrpName, bool allowRecurse = true);
- void MSN_ABRenameGroup(const char* szGrpName, const char* szGrpId, bool allowRecurse = true);
- void MSN_ABUpdateNick(const char* szNick, const char* szCntId);
- void MSN_ABUpdateAttr(const char* szCntId, const char* szAttr, const char* szValue, bool allowRecurse = true);
- bool MSN_ABUpdateProperty(const char* szCntId, const char* propName, const char* propValue, bool allowRecurse = true);
- bool MSN_ABAddRemoveContact(const char* szCntId, int netId, bool add, bool allowRecurse = true);
- unsigned MSN_ABContactAdd(const char* szEmail, const char* szNick, int netId, const char* szInvite, bool search, bool retry = false, bool allowRecurse = true);
- void MSN_ABUpdateDynamicItem(bool allowRecurse = true);
- bool MSN_ABRefreshClist(unsigned int nTry = 0);
-
- ezxml_t abSoapHdr(const char* service, const char* scenario, ezxml_t& tbdy, char*& httphdr);
- char* GetABHost(const char* service, bool isSharing);
- void SetAbParam(MCONTACT hContact, const char *name, const char *par);
- void UpdateABHost(const char* service, const char* url);
- void UpdateABCacheKey(ezxml_t bdy, bool isSharing);
-
- ezxml_t getSoapResponse(ezxml_t bdy, const char* service);
- ezxml_t getSoapFault(ezxml_t bdy, bool err);
-
- char mycid[32];
- char mypuid[32];
-
- /////////////////////////////////////////////////////////////////////////////////////////
- // MSN SOAP Roaming Storage
-
- bool MSN_StoreGetProfile(bool allowRecurse = true);
- bool MSN_StoreUpdateProfile(const char* szNick, const char* szStatus, bool lock, bool allowRecurse = true);
- bool MSN_StoreCreateProfile(bool allowRecurse = true);
- bool MSN_StoreShareItem(const char* id, bool allowRecurse = true);
- bool MSN_StoreCreateRelationships(bool allowRecurse = true);
- bool MSN_StoreDeleteRelationships(bool tile, bool allowRecurse = true);
- bool MSN_StoreCreateDocument(const wchar_t *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse = true);
- bool MSN_StoreUpdateDocument(const wchar_t *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse = true);
- bool MSN_StoreFindDocuments(bool allowRecurse = true);
-
- ezxml_t storeSoapHdr(const char* service, const char* scenario, ezxml_t& tbdy, char*& httphdr);
- char* GetStoreHost(const char* service);
- void UpdateStoreHost(const char* service, const char* url);
- void UpdateStoreCacheKey(ezxml_t bdy);
-
- char proresid[64];
- char expresid[64];
- char photoid[64];
-
- //////////////////////////////////////////////////////////////////////////////////////
-
- wchar_t *m_DisplayNameCache;
- wchar_t* GetContactNameT(MCONTACT hContact);
-
- int getStringUtf(MCONTACT hContact, const char* name, DBVARIANT* result);
- int getStringUtf(const char* name, DBVARIANT* result);
- void setStringUtf(MCONTACT hContact, const char* name, const char* value);
-};
-
-struct CMPlugin : public ACCPROTOPLUGIN<CMsnProto>
-{
- CMPlugin();
-
- int Load() override;
- int Unload() override;
-};
-
-#endif
diff --git a/protocols/MSN/src/msn_skypeab.cpp b/protocols/MSN/src/msn_skypeab.cpp
deleted file mode 100644
index a890202336..0000000000
--- a/protocols/MSN/src/msn_skypeab.cpp
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2007-2012 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-bool CMsnProto::APISkypeComRequest(NETLIBHTTPREQUEST *nlhr, NETLIBHTTPHEADER *headers)
-{
- const char *pszSkypeToken = authSkypeToken.XSkypetoken();
-
- if (!pszSkypeToken) return false;
- nlhr->cbSize = sizeof(NETLIBHTTPREQUEST);
- nlhr->flags = NLHRF_HTTP11 | NLHRF_DUMPASTEXT | NLHRF_PERSISTENT | NLHRF_REDIRECT;
- nlhr->nlc = hHttpsConnection;
- nlhr->headersCount = 3;
- nlhr->headers = headers;
- nlhr->headers[0].szName = "User-Agent";
- nlhr->headers[0].szValue = (char*)MSN_USER_AGENT;
- nlhr->headers[1].szName = "Accept";
- nlhr->headers[1].szValue = "application/json";
- nlhr->headers[2].szName = "X-Skypetoken";
- nlhr->headers[2].szValue = (char*)pszSkypeToken;
- return true;
-}
-
-static wchar_t* get_json_str(JSONNode *item, const char *pszValue)
-{
- if (JSONNode *node = json_get(item, pszValue)) {
- wchar_t *ret = json_as_string(node);
- if (!mir_wstrcmp(ret, L"null")) {
- mir_free(ret);
- return nullptr;
- }
- return ret;
- }
- return nullptr;
-}
-
-bool CMsnProto::MSN_SKYABRefreshClist(void)
-{
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[3];
- CMStringA post;
- bool bRet = false;
-
- // initialize the netlib request
- if (!APISkypeComRequest(&nlhr, headers)) return false;
- nlhr.requestType = REQUEST_GET;
- nlhr.szUrl = "https://contacts.skype.com/contacts/v1/users/SELF/contacts";
-
-
- // Query addressbook
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
- if (nlhrReply->resultCode == 200 && nlhrReply->pData) {
- JSONROOT root(nlhrReply->pData);
- if (root == nullptr)
- return false;
-
- JSONNode *items = json_get(root, "contacts"), *item, *node;
- for (size_t i = 0; i < json_size(items); i++) {
- int lstId = LIST_FL, type = NETID_SKYPE;
- item = json_at(items, i);
- if (item == nullptr)
- break;
-
- ptrW value;
- ptrA skypename(mir_u2a(ptrW(json_as_string(json_get(item, "id")))));
- ptrA wlid(mir_u2a(ptrW(json_as_string(json_get(item, "person_id")))));
- MCONTACT hContact = MSN_HContactFromEmail(wlid, skypename, false, false);
-
- if (hContact) {
- if (!json_as_bool(json_get(item, "authorized"))) lstId = LIST_PL;
- if (!json_as_bool(json_get(item, "blocked"))) lstId = LIST_BL;
- if ((node = json_get(item, "name")) && !node->empty()) {
- if (value = get_json_str(node, "first")) setWString(hContact, "FirstName", value);
- }
- //if (value = get_json_str(item, "lastname")) setWString(hContact, "LastName", value);
- if ((node = json_get(item, "locations")) && !node->empty()) {
- if (value = get_json_str(node, "country")) setString(hContact, "Country", (char*)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, (WPARAM)(char*)_T2A(value), 0));
- if (value = get_json_str(node, "city")) setWString(hContact, "City", value);
- }
- if (value = get_json_str(item, "mood")) db_set_ws(hContact, "CList", "StatusMsg", value);
- if ((value = get_json_str(item, "type")) && mir_wstrcmp(value, L"skype")) type = NETID_MSN;
- if (value = get_json_str(item, "display_name")) setWString(hContact, "Nick", value);
- Lists_Add(lstId, type, skypename, NULL, value?ptrA(mir_u2a(value)):skypename, NULL);
- }
- }
- bRet = true;
- }
- }
- else hHttpsConnection = nullptr;
- return bRet;
-}
-
-// pszPOST = contacts[]={skypename1}&contacts[]={skypename2}&...
-bool CMsnProto::MSN_SKYABGetProfiles(const char *pszPOST)
-{
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[4];
- bool bRet = false;
-
- // initialize the netlib request
- if (!APISkypeComRequest(&nlhr, headers)) return false;
- nlhr.requestType = REQUEST_POST;
- nlhr.szUrl = "https://api.skype.com/users/self/contacts/profiles";
- nlhr.dataLength = (int)mir_strlen(pszPOST);
- nlhr.pData = (char*)pszPOST;
-
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
- if (nlhrReply->resultCode == 200 && nlhrReply->pData) {
- JSONROOT root(nlhrReply->pData);
- if (root == nullptr) return false;
-
- JSONNode *items = json_as_array(root), *item, *node;
- for (size_t i = 0; i < json_size(items); i++) {
- item = json_at(items, i);
- if (item == nullptr)
- break;
-
- node = json_get(item, "username");
- ptrA skypename(mir_u2a(ptrW(json_as_string(node))));
- ptrW value;
- char szWLId[128];
- mir_snprintf(szWLId, sizeof(szWLId), "%d:%s", NETID_SKYPE, skypename.get());
- MCONTACT hContact = MSN_HContactFromEmail(szWLId, skypename, false, false);
-
- if (hContact) {
- if (value = get_json_str(item, "firstname")) setWString(hContact, "FirstName", value);
- if (value = get_json_str(item, "lastname")) setWString(hContact, "LastName", value);
- if (value = get_json_str(item, "displayname")) setWString(hContact, "Nick", value);
- if (value = get_json_str(item, "country")) setString(hContact, "Country", (char*)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, (WPARAM)(char*)_T2A(value), 0));
- if (value = get_json_str(item, "city")) setWString(hContact, "City", value);
- if (value = get_json_str(item, "mood")) db_set_ws(hContact, "CList", "StatusMsg", value);
- }
- }
- json_delete(items);
- bRet = true;
- }
- }
- else hHttpsConnection = nullptr;
- return bRet;
-}
-
-bool CMsnProto::MSN_SKYABGetProfile(const char *wlid)
-{
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[4];
- bool bRet = false;
- char szURL[256];
-
- // initialize the netlib request
- if (!APISkypeComRequest(&nlhr, headers)) return false;
- nlhr.requestType = REQUEST_GET;
- mir_snprintf(szURL, sizeof(szURL), "https://api.skype.com/users/%s/profile", wlid);
- nlhr.szUrl = szURL;
-
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
- if (nlhrReply->resultCode == 200 && nlhrReply->pData) {
- JSONROOT item(nlhrReply->pData);
- if (item == nullptr)
- return false;
-
- ptrA skypename(mir_u2a(ptrW(json_as_string(json_get(item, "username")))));
- ptrW value;
- char szWLId[128];
- mir_snprintf(szWLId, sizeof(szWLId), "%d:%s", NETID_SKYPE, skypename.get());
- MCONTACT hContact = MSN_HContactFromEmail(szWLId, skypename, false, false);
-
- if (hContact) {
- if (value = get_json_str(item, "firstname")) setWString(hContact, "FirstName", value);
- if (value = get_json_str(item, "lastname")) setWString(hContact, "LastName", value);
- if (value = get_json_str(item, "displayname")) setWString(hContact, "Nick", value);
- if (value = get_json_str(item, "gender")) setByte(hContact, "Gender", (BYTE)(_wtoi(value) == 1 ? 'M' : 'F'));
- if (value = get_json_str(item, "birthday")) {
- int d, m, y;
- if (swscanf(value, L"%d-%d-%d", &y, &m, &d) == 3) {
- setWord(hContact, "BirthYear", y);
- setByte(hContact, "BirthDay", d);
- setByte(hContact, "BirthMonth", m);
- }
- }
- if (value = get_json_str(item, "country")) setString(hContact, "Country", (char*)CallService(MS_UTILS_GETCOUNTRYBYISOCODE, _T2A(value), 0));
- if (value = get_json_str(item, "province")) setWString(hContact, "State", value);
- if (value = get_json_str(item, "city")) setWString(hContact, "City", value);
- if (value = get_json_str(item, "homepage")) setWString(hContact, "Homepage", value);
- if (value = get_json_str(item, "about")) setWString(hContact, "About", value);
-
- JSONNode *node = json_get(item, "emails");
- if (node && !node->empty()) {
- int num = 0;
- for (auto it = node->begin(); it != node->end(); ++it, ++num) {
- if (num == 3)
- break;
-
- char szName[16];
- sprintf(szName, "e-mail%d", num);
- setStringUtf(hContact, szName, (*it).as_string().c_str());
- }
- }
- if (value = get_json_str(item, "phoneMobile")) setWString(hContact, "Cellular", value);
- if (value = get_json_str(item, "phone")) setWString(hContact, "Phone", value);
- if (value = get_json_str(item, "phoneOffice")) setWString(hContact, "CompanyPhone", value);
- if (value = get_json_str(item, "mood")) db_set_ws(hContact, "CList", "StatusMsg", value);
- }
- bRet = true;
- }
- }
- else hHttpsConnection = nullptr;
- return bRet;
-}
-
-// pszAction: "block" or "unblock"
-bool CMsnProto::MSN_SKYABBlockContact(const char *wlid, const char *pszAction)
-{
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[4];
- // initialize the netlib request
- if (!APISkypeComRequest(&nlhr, headers))
- return false;
-
- char szURL[256], szPOST[128];
- mir_snprintf(szURL, sizeof(szURL), "https://api.skype.com/users/self/contacts/%s/%s", wlid, pszAction);
-
- nlhr.requestType = REQUEST_PUT;
- nlhr.szUrl = szURL;
- nlhr.headers[3].szName = "Content-type";
- nlhr.headers[3].szValue = "application/x-www-form-urlencoded";
- nlhr.headersCount++;
- nlhr.dataLength = mir_snprintf(szPOST, sizeof(szPOST), "reporterIp=123.123.123.123&uiVersion=%s", msnProductVer);
- nlhr.pData = szPOST;
-
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (!nlhrReply) {
- hHttpsConnection = nullptr;
- return false;
- }
-
- hHttpsConnection = nlhrReply->nlc;
- return true;
-}
-
-bool CMsnProto::MSN_SKYABDeleteContact(const char *wlid)
-{
- // initialize the netlib request
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[4];
- if (!APISkypeComRequest(&nlhr, headers))
- return false;
-
- char szURL[256];
- mir_snprintf(szURL, sizeof(szURL), "https://contacts.skype.com/contacts/v2/users/SELF/contacts/%s", wlid);
- nlhr.requestType = REQUEST_DELETE;
- nlhr.szUrl = szURL;
- nlhr.headers[3].szName = "Content-type";
- nlhr.headers[3].szValue = "application/x-www-form-urlencoded";
- nlhr.headersCount++;
-
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (!nlhrReply) {
- hHttpsConnection = nullptr;
- return false;
- }
-
- hHttpsConnection = nlhrReply->nlc;
- return true;
-}
-
-// pszAction: "accept" or "decline"
-bool CMsnProto::MSN_SKYABAuthRsp(const char *wlid, const char *pszAction)
-{
- // initialize the netlib request
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[3];
- if (!APISkypeComRequest(&nlhr, headers))
- return false;
-
- char szURL[256];
- mir_snprintf(szURL, sizeof(szURL), "https://contacts.skype.com/contacts/v2/users/SELF/invites/%s/%s", wlid, pszAction);
- nlhr.requestType = REQUEST_PUT;
- nlhr.szUrl = szURL;
-
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (!nlhrReply) {
- hHttpsConnection = nullptr;
- return false;
- }
- hHttpsConnection = nlhrReply->nlc;
- return true;
-}
-
-bool CMsnProto::MSN_SKYABAuthRq(const char *wlid, const char *pszGreeting)
-{
- // initialize the netlib request
- NETLIBHTTPHEADER headers[4];
- NETLIBHTTPREQUEST nlhr = { 0 };
- if (!APISkypeComRequest(&nlhr, headers))
- return false;
-
- nlhr.requestType = REQUEST_PUT;
- nlhr.szUrl = "https://contacts.skype.com/contacts/v2/users/SELF/contacts";
- nlhr.headers[3].szName = "Content-type";
- nlhr.headers[3].szValue = "application/x-www-form-urlencoded";
- nlhr.headersCount++;
- JSONNode node;
- node
- << JSONNode("mri", wlid)
- << JSONNode("greeting", pszGreeting);
-
- CMStringA post = node.write().c_str();
- nlhr.dataLength = post.GetLength();
- nlhr.pData = (char*)(const char*)post;
-
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
- return true;
- }
-
- hHttpsConnection = nullptr;
- return false;
-}
-
-bool CMsnProto::MSN_SKYABSearch(const char *keyWord, HANDLE hSearch)
-{
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[4];
- bool bRet = false;
-
- // initialize the netlib request
- if (!APISkypeComRequest(&nlhr, headers)) {
- ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, hSearch);
- return false;
- }
-
- char szURL[256];
- mir_snprintf(szURL, sizeof(szURL), "https://api.skype.com/search/users/any?keyWord=%s&contactTypes[]=skype", keyWord);
-
- nlhr.requestType = REQUEST_GET;
- nlhr.szUrl = szURL;
- nlhr.headers[3].szName = "Connection";
- nlhr.headers[3].szValue = "keep-alive";
- nlhr.headersCount++;
-
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
- if (nlhrReply->resultCode == 200 && nlhrReply->pData) {
- JSONROOT root(nlhrReply->pData);
- if (root == nullptr) {
- ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, hSearch);
- return false;
- }
-
- JSONNode *items = json_as_array(root);
- for (size_t i = 0; i < json_size(items); i++) {
- JSONNode *item = json_at(items, i);
- JSONNode *ContactCards = json_get(item, "ContactCards");
- JSONNode *Skype = json_get(ContactCards, "Skype");
-
- wchar_t *sDisplayName = json_as_string(json_get(Skype, "DisplayName"));
- wchar_t *sSkypeName = json_as_string(json_get(Skype, "SkypeName"));
-
- PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.flags = PSR_UNICODE;
- psr.id.w = sSkypeName;
- psr.nick.w = sDisplayName;
- ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_DATA, hSearch, (LPARAM)&psr);
- }
- json_free(items);
- ProtoBroadcastAck(0, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, hSearch);
- bRet = true;
- }
- }
- else hHttpsConnection = nullptr;
- return bRet;
-}
diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp
deleted file mode 100644
index 1ec6958862..0000000000
--- a/protocols/MSN/src/msn_soapab.cpp
+++ /dev/null
@@ -1,1608 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2007-2012 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-static const char abReqHdr[] = "SOAPAction: http://www.msn.com/webservices/AddressBook/%s\r\n";
-
-ezxml_t CMsnProto::abSoapHdr(const char* service, const char* scenario, ezxml_t& tbdy, char*& httphdr)
-{
- ezxml_t xmlp = ezxml_new("soap:Envelope");
- ezxml_set_attr(xmlp, "xmlns:soap", "http://schemas.xmlsoap.org/soap/envelope/");
- ezxml_set_attr(xmlp, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
- ezxml_set_attr(xmlp, "xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
- ezxml_set_attr(xmlp, "xmlns:soapenc", "http://schemas.xmlsoap.org/soap/encoding/");
-
- ezxml_t hdr = ezxml_add_child(xmlp, "soap:Header", 0);
- ezxml_t apphdr = ezxml_add_child(hdr, "ABApplicationHeader", 0);
- ezxml_set_attr(apphdr, "xmlns", "http://www.msn.com/webservices/AddressBook");
- ezxml_t node = ezxml_add_child(apphdr, "ApplicationId", 0);
- ezxml_set_txt(node, msnAppID);
- node = ezxml_add_child(apphdr, "IsMigration", 0);
- ezxml_set_txt(node, "false"); // abchMigrated ? "false" : "true");
- node = ezxml_add_child(apphdr, "PartnerScenario", 0);
- ezxml_set_txt(node, scenario);
-
- char *cacheKey = strstr(service, "Member") ? sharingCacheKey : abCacheKey;
- if (cacheKey) {
- node = ezxml_add_child(apphdr, "CacheKey", 0);
- ezxml_set_txt(node, cacheKey);
- }
-
- ezxml_t authhdr = ezxml_add_child(hdr, "ABAuthHeader", 0);
- ezxml_set_attr(authhdr, "xmlns", "http://www.msn.com/webservices/AddressBook");
- node = ezxml_add_child(authhdr, "ManagedGroupRequest", 0);
- ezxml_set_txt(node, "false");
- node = ezxml_add_child(authhdr, "TicketToken", 0);
- if (authContactToken) ezxml_set_txt(node, authContactToken);
-
- ezxml_t bdy = ezxml_add_child(xmlp, "soap:Body", 0);
-
- tbdy = ezxml_add_child(bdy, service, 0);
- ezxml_set_attr(tbdy, "xmlns", "http://www.msn.com/webservices/AddressBook");
-
- if (!strstr(service, "Member") && mir_strcmp(service, "ABAdd") && mir_strcmp(service, "ABFindContactsPaged"))
- ezxml_set_txt(ezxml_add_child(tbdy, "abId", 0), "00000000-0000-0000-0000-000000000000");
-
- size_t hdrsz = mir_strlen(service) + sizeof(abReqHdr) + 20;
- httphdr = (char*)mir_alloc(hdrsz);
-
- mir_snprintf(httphdr, hdrsz, abReqHdr, service);
-
- return xmlp;
-}
-
-
-ezxml_t CMsnProto::getSoapResponse(ezxml_t bdy, const char* service)
-{
- char resp1[40], resp2[40];
- mir_snprintf(resp1, "%sResponse", service);
- mir_snprintf(resp2, "%sResult", service);
-
- ezxml_t res = ezxml_get(bdy, "soap:Body", 0, resp1, 0, resp2, -1);
- if (res == nullptr)
- res = ezxml_get(bdy, "s:Body", 0, resp1, 0, resp2, -1);
-
- return res;
-}
-
-ezxml_t CMsnProto::getSoapFault(ezxml_t bdy, bool err)
-{
- ezxml_t flt = ezxml_get(bdy, "soap:Body", 0, "soap:Fault", -1);
- return err ? ezxml_get(flt, "detail", 0, "errorcode", -1) : flt;
-}
-
-void CMsnProto::UpdateABHost(const char* service, const char* url)
-{
- char hostname[128];
- mir_snprintf(hostname, "ABHost-%s", service);
-
- if (url)
- setString(hostname, url);
- else
- delSetting(hostname);
-}
-
-void CMsnProto::UpdateABCacheKey(ezxml_t bdy, bool isSharing)
-{
- ezxml_t hdr = ezxml_get(bdy, "soap:Header", 0, "ServiceHeader", -1);
- bool changed = mir_strcmp(ezxml_txt(ezxml_child(hdr, "CacheKeyChanged")), "true") == 0;
- if (changed)
- replaceStr(isSharing ? sharingCacheKey : abCacheKey, ezxml_txt(ezxml_child(hdr, "CacheKey")));
-}
-
-char* CMsnProto::GetABHost(const char* service, bool isSharing)
-{
- char hostname[128];
- mir_snprintf(hostname, "ABHost-%s", service);
-
- char* host = (char*)mir_alloc(256);
- if (db_get_static(NULL, m_szModuleName, hostname, host, 256)) {
- mir_snprintf(host, 256, "https://byrdr.omega.contacts.msn.com/abservice/%s.asmx",
- isSharing ? "SharingService" : "abservice");
- }
-
- return host;
-}
-
-bool CMsnProto::MSN_ABAdd(bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy, node;
- ezxml_t xmlp = abSoapHdr("ABAdd", "Timer", tbdy, reqHdr);
-
- ezxml_t abinf = ezxml_add_child(tbdy, "abInfo", 0);
- ezxml_add_child(abinf, "name", 0);
- node = ezxml_add_child(abinf, "ownerPuid", 0);
- ezxml_set_txt(node, "0");
- node = ezxml_add_child(abinf, "ownerEmail", 0);
- ezxml_set_txt(node, MyOptions.szEmail);
- node = ezxml_add_child(abinf, "fDefault", 0);
- ezxml_set_txt(node, "true");
-
- char* szData = ezxml_toxml(xmlp, true);
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost("ABAdd", false);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult)
- break;
- UpdateABHost("ABAdd", nullptr);
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateABHost("ABAdd", abUrl);
-
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_ABAdd(false) ? 200 : 500;
- }
- }
- ezxml_free(xmlm);
- }
-
- mir_free(tResult);
- mir_free(abUrl);
-
- return status == 200;
-}
-
-
-bool CMsnProto::MSN_SharingFindMembership(bool deltas, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = abSoapHdr("FindMembership", "Initial", tbdy, reqHdr);
-
- ezxml_t svcflt = ezxml_add_child(tbdy, "serviceFilter", 0);
- ezxml_t tps = ezxml_add_child(svcflt, "Types", 0);
- ezxml_t node = ezxml_add_child(tps, "ServiceType", 0);
- ezxml_set_txt(node, "Messenger");
-
- ptrA szLastChange;
- if (deltas) {
- szLastChange = getStringA("SharingLastChange");
- deltas &= (szLastChange != NULL);
- }
-
- node = ezxml_add_child(tbdy, "View", 0);
- ezxml_set_txt(node, "Full");
- node = ezxml_add_child(tbdy, "deltasOnly", 0);
- ezxml_set_txt(node, deltas ? "true" : "false");
- node = ezxml_add_child(tbdy, "lastChange", 0);
- ezxml_set_txt(node, deltas ? szLastChange : "0001-01-01T00:00:00.0000000-08:00");
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost("FindMembership", true);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost("FindMembership", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- if (status == 200) {
- UpdateABCacheKey(xmlm, true);
- ezxml_t body = getSoapResponse(xmlm, "FindMembership");
- ezxml_t svcs = ezxml_get(body, "Services", 0, "Service", -1);
-
- UpdateABHost("FindMembership", body ? abUrl : nullptr);
-
- while (svcs != nullptr) {
- const char* szType = ezxml_txt(ezxml_get(svcs, "Info", 0, "Handle", 0, "Type", -1));
- if (_stricmp(szType, "Messenger") == 0) break;
- svcs = ezxml_next(svcs);
- }
-
- const char* pszLastChange = ezxml_txt(ezxml_child(svcs, "LastChange"));
- if (pszLastChange[0])
- setString("SharingLastChange", pszLastChange);
-
- for (ezxml_t mems = ezxml_get(svcs, "Memberships", 0, "Membership", -1); mems != nullptr; mems = ezxml_next(mems)) {
- const char* szRole = ezxml_txt(ezxml_child(mems, "MemberRole"));
-
- int lstId = ((mir_strcmp(szRole, "Allow") == 0) ? LIST_AL : ((mir_strcmp(szRole, "Block") == 0) ? LIST_BL :
- ((mir_strcmp(szRole, "Reverse") == 0) ? LIST_RL : ((mir_strcmp(szRole, "Pending") == 0) ? LIST_PL : 0))));
-
- for (ezxml_t memb = ezxml_get(mems, "Members", 0, "Member", -1); memb != nullptr; memb = ezxml_next(memb)) {
- bool deleted = mir_strcmp(ezxml_txt(ezxml_child(memb, "Deleted")), "true") == 0;
- const char *szType = ezxml_txt(ezxml_child(memb, "Type"));
- const char *szInvite = nullptr, *szEmail = nullptr, *szNick = nullptr;
- char email[128];
- int netId;
-
- if (mir_strcmp(szType, "Passport") == 0) {
- netId = NETID_MSN;
- szEmail = ezxml_txt(ezxml_child(memb, "PassportName"));
- szNick = ezxml_txt(ezxml_child(memb, "DisplayName")); if (!szNick[0]) szNick = nullptr;
- ezxml_t anot = ezxml_get(memb, "Annotations", 0, "Annotation", -1);
- while (anot != nullptr) {
- if (mir_strcmp(ezxml_txt(ezxml_child(anot, "Name")), "MSN.IM.InviteMessage") == 0)
- szInvite = ezxml_txt(ezxml_child(anot, "Value"));
-
- anot = ezxml_next(anot);
- }
- }
- else if (mir_strcmp(szType, "Phone") == 0) {
- netId = NETID_MOB;
- mir_snprintf(email, "tel:%s", ezxml_txt(ezxml_child(memb, "PhoneNumber")));
- szEmail = email;
- }
- else if (mir_strcmp(szType, "Email") == 0) {
- szEmail = ezxml_txt(ezxml_child(memb, "Email"));
- szNick = ezxml_txt(ezxml_child(memb, "DisplayName")); if (!szNick[0]) szNick = nullptr;
- netId = strstr(szEmail, "@yahoo.com") ? NETID_YAHOO : NETID_LCS;
- ezxml_t anot = ezxml_get(memb, "Annotations", 0, "Annotation", -1);
- while (anot != nullptr) {
- if (mir_strcmp(ezxml_txt(ezxml_child(anot, "Name")), "MSN.IM.BuddyType") == 0)
- netId = atol(ezxml_txt(ezxml_child(anot, "Value")));
- else if (mir_strcmp(ezxml_txt(ezxml_child(anot, "Name")), "MSN.IM.InviteMessage") == 0)
- szInvite = ezxml_txt(ezxml_child(anot, "Value"));
-
- anot = ezxml_next(anot);
- }
- }
- else continue;
-
- if (!deleted)
- Lists_Add(lstId, netId, szEmail, NULL, szNick, szInvite);
- else
- Lists_Remove(lstId, szEmail);
- }
- }
- }
- else if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "ABDoesNotExist") == 0) {
- MSN_ABAdd();
- status = 200;
- }
- else if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_SharingFindMembership(deltas, false) ? 200 : 500;
- }
- }
- else UpdateABHost("FindMembership", nullptr);
-
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- mir_free(abUrl);
-
- return status == 200;
-}
-
-// AddMember, DeleteMember
-bool CMsnProto::MSN_SharingAddDelMember(const char* szEmail, const int listId, const int netId, const char* szMethod, bool allowRecurse)
-{
- const char* szRole;
- if (listId & LIST_AL) szRole = "Allow";
- else if (listId & LIST_BL) szRole = "Block";
- else if (listId & LIST_PL) szRole = "Pending";
- else if (listId & LIST_RL) szRole = "Reverse";
- else return false;
-
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = abSoapHdr(szMethod, "BlockUnblock", tbdy, reqHdr);
-
- ezxml_t svchnd = ezxml_add_child(tbdy, "serviceHandle", 0);
- ezxml_t node = ezxml_add_child(svchnd, "Id", 0);
- ezxml_set_txt(node, "0");
- node = ezxml_add_child(svchnd, "Type", 0);
- ezxml_set_txt(node, "Messenger");
- node = ezxml_add_child(svchnd, "ForeignId", 0);
-
- const char* szMemberName = "";
- const char* szTypeName = "";
- const char* szAccIdName = "";
-
- switch (netId) {
- case 1:
- szMemberName = "PassportMember";
- szTypeName = "Passport";
- szAccIdName = "PassportName";
- break;
-
- case 4:
- szMemberName = "PhoneMember";
- szTypeName = "Phone";
- szAccIdName = "PhoneNumber";
- szEmail = strchr(szEmail, ':') + 1;
- break;
-
- case 2:
- case 32:
- szMemberName = "EmailMember";
- szTypeName = "Email";
- szAccIdName = "Email";
- break;
- }
-
- ezxml_t memb = ezxml_add_child(tbdy, "memberships", 0);
- memb = ezxml_add_child(memb, "Membership", 0);
- node = ezxml_add_child(memb, "MemberRole", 0);
- ezxml_set_txt(node, szRole);
- memb = ezxml_add_child(memb, "Members", 0);
- memb = ezxml_add_child(memb, "Member", 0);
- ezxml_set_attr(memb, "xsi:type", szMemberName);
- ezxml_set_attr(memb, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
- node = ezxml_add_child(memb, "Type", 0);
- ezxml_set_txt(node, szTypeName);
- node = ezxml_add_child(memb, "State", 0);
- ezxml_set_txt(node, "Accepted");
- node = ezxml_add_child(memb, szAccIdName, 0);
- ezxml_set_txt(node, szEmail);
-
- char buf[64];
- if ((netId == NETID_LCS || netId == NETID_YAHOO) && mir_strcmp(szMethod, "DeleteMember") != 0) {
- node = ezxml_add_child(memb, "Annotations", 0);
- ezxml_t anot = ezxml_add_child(node, "Annotation", 0);
- node = ezxml_add_child(anot, "Name", 0);
- ezxml_set_txt(node, "MSN.IM.BuddyType");
- node = ezxml_add_child(anot, "Value", 0);
-
- mir_snprintf(buf, "%02d:", netId);
- ezxml_set_txt(node, buf);
- }
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost(szMethod, true);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost(szMethod, nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateABHost(szMethod, abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateABCacheKey(xmlm, true);
- if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_SharingAddDelMember(szEmail, listId, netId, szMethod, false) ? 200 : 500;
- }
- }
- ezxml_free(xmlm);
- }
-
- mir_free(tResult);
- mir_free(abUrl);
-
- return status == 200;
-}
-
-bool CMsnProto::MSN_SharingMyProfile(bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = abSoapHdr("AddMember", "RoamingSeed", tbdy, reqHdr);
-
- ezxml_t svchnd = ezxml_add_child(tbdy, "serviceHandle", 0);
- ezxml_t node = ezxml_add_child(svchnd, "Id", 0);
- ezxml_set_txt(node, "0");
- node = ezxml_add_child(svchnd, "Type", 0);
- ezxml_set_txt(node, "Profile");
- node = ezxml_add_child(svchnd, "ForeignId", 0);
- ezxml_set_txt(node, "MyProfile");
-
- ezxml_t memb = ezxml_add_child(tbdy, "memberships", 0);
- memb = ezxml_add_child(memb, "Membership", 0);
- node = ezxml_add_child(memb, "MemberRole", 0);
- ezxml_set_txt(node, "ProfileExpression");
- memb = ezxml_add_child(memb, "Members", 0);
- memb = ezxml_add_child(memb, "Member", 0);
- ezxml_set_attr(memb, "xsi:type", "RoleMember");
- ezxml_set_attr(memb, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
- node = ezxml_add_child(memb, "Type", 0);
- ezxml_set_txt(node, "Role");
- node = ezxml_add_child(memb, "State", 0);
- ezxml_set_txt(node, "Accepted");
- node = ezxml_add_child(memb, "Id", 0);
- ezxml_set_txt(node, "Allow");
-
- ezxml_t svcdef = ezxml_add_child(memb, "DefiningService", 0);
- node = ezxml_add_child(svcdef, "Id", 0);
- ezxml_set_txt(node, "0");
- node = ezxml_add_child(svcdef, "Type", 0);
- ezxml_set_txt(node, "Messenger");
- node = ezxml_add_child(svcdef, "ForeignId", 0);
-
- node = ezxml_add_child(memb, "MaxRoleRecursionDepth", 0);
- ezxml_set_txt(node, "0");
-
- node = ezxml_add_child(memb, "MaxDegreesSeparationDepth", 0);
- ezxml_set_txt(node, "0");
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost("AddMember", true);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost("AddMember", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- MSN_SharingMyProfile(false);
- }
- }
- ezxml_free(xmlm);
-
- mir_free(tResult);
- mir_free(abUrl);
-
- return status == 200;
-}
-
-
-void CMsnProto::SetAbParam(MCONTACT hContact, const char *name, const char *par)
-{
- if (*par) setStringUtf(hContact, name, (char*)par);
- // else delSetting(hContact, "FirstName");
-}
-
-// "ABFindAll", "ABFindByContacts", "ABFindContactsPaged"
-bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = abSoapHdr(szMethod, "Initial", tbdy, reqHdr);
-
- ptrA szLastChange, szDynLastChange;
- if (deltas) {
- szLastChange = getStringA("ABFullLastChange");
- deltas &= (szLastChange != NULL);
-
- szDynLastChange = getStringA("ABFullDynLastChange");
- deltas &= (szDynLastChange != NULL);
- }
-
- const char *szGroups, *szContacts, *szLastChangeStr;
- if (mir_strcmp(szMethod, "ABFindContactsPaged")) {
- ezxml_t node = ezxml_add_child(tbdy, "abView", 0);
- ezxml_set_txt(node, "Full");
- node = ezxml_add_child(tbdy, "deltasOnly", 0);
- ezxml_set_txt(node, deltas ? "true" : "false");
- node = ezxml_add_child(tbdy, "dynamicItemView", 0);
- ezxml_set_txt(node, "Gleam");
- if (deltas) {
- node = ezxml_add_child(tbdy, "lastChange", 0);
- ezxml_set_txt(node, szLastChange);
- node = ezxml_add_child(tbdy, "dynamicItemLastChange", 0);
- ezxml_set_txt(node, szDynLastChange);
- }
-
- if (szGuid) {
- node = ezxml_add_child(tbdy, "contactIds", 0);
- node = ezxml_add_child(node, "guid", 0);
- ezxml_set_txt(node, szGuid);
- }
- szGroups = "groups";
- szContacts = "contacts";
- szLastChangeStr = "LastChange";
- }
- else {
- ezxml_t node = ezxml_add_child(tbdy, "abView", 0);
- ezxml_set_txt(node, "MessengerClient8");
- node = ezxml_add_child(tbdy, "extendedContent", 0);
- ezxml_set_txt(node, "AB AllGroups CircleResult");
- ezxml_t filt = ezxml_add_child(tbdy, "filterOptions", 0);
-
- node = ezxml_add_child(filt, "DeltasOnly", 0);
- ezxml_set_txt(node, deltas ? "true" : "false");
- if (deltas) {
- node = ezxml_add_child(filt, "LastChanged", 0);
- ezxml_set_txt(node, szLastChange);
- }
- node = ezxml_add_child(filt, "ContactFilter", 0);
- node = ezxml_add_child(node, "IncludeHiddenContacts", 0);
- ezxml_set_txt(node, "true");
-
- szGroups = "Groups";
- szContacts = "Contacts";
- szLastChangeStr = "lastChange";
- }
-
- char *szData = ezxml_toxml(xmlp, true);
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost(szMethod, false);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost(szMethod, nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateABCacheKey(xmlm, false);
-
- if (status == 200) {
- ezxml_t body = getSoapResponse(xmlm, szMethod);
- UpdateABHost(szMethod, body ? abUrl : nullptr);
-
- ezxml_t ab = ezxml_child(body, "Ab");
- if (mir_strcmp(szMethod, "ABFindByContacts")) {
- const char *pszLastChange = ezxml_txt(ezxml_child(ab, szLastChangeStr));
- if (pszLastChange[0])
- setString("ABFullLastChange", pszLastChange);
- pszLastChange = ezxml_txt(ezxml_child(ab, "DynamicItemLastChanged"));
- if (pszLastChange[0])
- setString("ABFullDynLastChange", pszLastChange);
- }
-
- ezxml_t abinf = ezxml_child(ab, "abInfo");
- strncpy_s(mycid, ezxml_txt(ezxml_child(abinf, "OwnerCID")), _TRUNCATE);
- strncpy_s(mypuid, ezxml_txt(ezxml_child(abinf, "ownerPuid")), _TRUNCATE);
-
- if (MyOptions.ManageServer) {
- ezxml_t grp = ezxml_get(body, szGroups, 0, "Group", -1);
- while (grp != nullptr) {
- const char* szGrpId = ezxml_txt(ezxml_child(grp, "groupId"));
- const char* szGrpName = ezxml_txt(ezxml_get(grp, "groupInfo", 0, "name", -1));
- MSN_AddGroup(szGrpName, szGrpId, true);
-
- grp = ezxml_next(grp);
- }
- }
-
- for (ezxml_t cont = ezxml_get(body, szContacts, 0, "Contact", -1); cont != nullptr; cont = ezxml_next(cont)) {
- const char* szContId = ezxml_txt(ezxml_child(cont, "contactId"));
-
- ezxml_t contInf = ezxml_child(cont, "contactInfo");
- const char* szType = ezxml_txt(ezxml_child(contInf, "contactType"));
-
- if (mir_strcmp(szType, "Me") != 0) {
- char email[128];
-
- const char* szEmail = ezxml_txt(ezxml_child(contInf, "passportName"));
- const char* szMsgUsr = ezxml_txt(ezxml_child(contInf, "isMessengerUser"));
-
- int netId = NETID_UNKNOWN;
- if (mir_strcmp(szMsgUsr, "true") == 0) netId = NETID_MSN;
-
- if (szEmail[0] == '\0') {
- ezxml_t eml = ezxml_get(contInf, "emails", 0, "ContactEmail", -1);
- while (eml != nullptr) {
- szMsgUsr = ezxml_txt(ezxml_child(eml, "isMessengerEnabled"));
- if (mir_strcmp(szMsgUsr, "true") == 0) {
- szEmail = ezxml_txt(ezxml_child(eml, "email"));
- const char* szCntType = ezxml_txt(ezxml_child(eml, "contactEmailType"));
- if (mir_strcmp(szCntType, "Messenger2") == 0)
- netId = NETID_YAHOO;
- else if (mir_strcmp(szCntType, "Messenger3") == 0)
- netId = NETID_LCS;
- break;
- }
- eml = ezxml_next(eml);
- }
-
- if (netId == NETID_UNKNOWN) {
- ezxml_t phn = ezxml_get(contInf, "phones", 0, "ContactPhone", -1);
- while (phn != nullptr) {
- szMsgUsr = ezxml_txt(ezxml_child(phn, "isMessengerEnabled"));
- if (mir_strcmp(szMsgUsr, "true") == 0) {
- szEmail = ezxml_txt(ezxml_child(phn, "number"));
- mir_snprintf(email, "tel:%s", szEmail);
- szEmail = email;
- netId = NETID_MOB;
- break;
- }
- phn = ezxml_next(phn);
- }
- }
- }
-
- if (netId == NETID_UNKNOWN || szEmail[0] == 0)
- continue;
-
- Lists_Add(LIST_FL, netId, szEmail);
-
- MCONTACT hContact = MSN_HContactFromEmail(szEmail, szEmail, true, false);
-
- if (MyOptions.ManageServer) {
- ezxml_t grpid = ezxml_child(contInf, "groupIds");
- if (!deltas || grpid) {
- ezxml_t grps = ezxml_child(grpid, "guid");
- MSN_SyncContactToServerGroup(hContact, szContId, grps);
- }
- }
-
- const char* szNick = nullptr;
- ezxml_t anot = ezxml_get(contInf, "annotations", 0, "Annotation", -1);
- while (anot != nullptr) {
- if (mir_strcmp(ezxml_txt(ezxml_child(anot, "Name")), "AB.NickName") == 0) {
- szNick = ezxml_txt(ezxml_child(anot, "Value"));
- db_set_utf(hContact, m_szModuleName, "Nick", szNick);
- }
- if (mir_strcmp(ezxml_txt(ezxml_child(anot, "Name")), "AB.JobTitle") == 0) {
- const char *szTmp = ezxml_txt(ezxml_child(anot, "Value"));
- SetAbParam(hContact, "CompanyPosition", szTmp);
- }
- anot = ezxml_next(anot);
- }
- if (szNick == nullptr)
- delSetting(hContact,"Nick");
-
- setString(hContact, "ID", szContId);
-
- switch (netId) {
- case NETID_YAHOO:
- setString(hContact, "Transport", "YAHOO");
- break;
-
- case NETID_LCS:
- setString(hContact, "Transport", "LCS");
- break;
-
- default:
- delSetting(hContact, "Transport");
- }
-
- const char *szTmp = ezxml_txt(ezxml_child(contInf, "CID"));
- SetAbParam(hContact, "CID", szTmp);
-
- szTmp = ezxml_txt(ezxml_child(contInf, "IsNotMobileVisible"));
- setByte(hContact, "MobileAllowed", mir_strcmp(szTmp, "true") != 0);
-
- szTmp = ezxml_txt(ezxml_child(contInf, "isMobileIMEnabled"));
- setByte(hContact, "MobileEnabled", mir_strcmp(szTmp, "true") == 0);
-
- szTmp = ezxml_txt(ezxml_child(contInf, "firstName"));
- SetAbParam(hContact, "FirstName", szTmp);
-
- szTmp = ezxml_txt(ezxml_child(contInf, "lastName"));
- SetAbParam(hContact, "LastName", szTmp);
-
- szTmp = ezxml_txt(ezxml_child(contInf, "birthdate"));
- char *szPtr;
- if (strtol(szTmp, &szPtr, 10) > 1) {
- setWord(hContact, "BirthYear", (WORD)strtol(szTmp, &szPtr, 10));
- setByte(hContact, "BirthMonth", (BYTE)strtol(szPtr + 1, &szPtr, 10));
- setByte(hContact, "BirthDay", (BYTE)strtol(szPtr + 1, &szPtr, 10));
- }
-
- szTmp = ezxml_txt(ezxml_child(contInf, "comment"));
- if (*szTmp)
- db_set_s(hContact, "UserInfo", "MyNotes", szTmp);
-
- ezxml_t loc = ezxml_get(contInf, "locations", 0, "ContactLocation", -1);
- while (loc != nullptr) {
- const char* szCntType = ezxml_txt(ezxml_child(loc, "contactLocationType"));
-
- int locid = -1;
- if (mir_strcmp(szCntType, "ContactLocationPersonal") == 0)
- locid = 0;
- else if (mir_strcmp(szCntType, "ContactLocationBusiness") == 0)
- locid = 1;
-
- if (locid >= 0) {
- szTmp = ezxml_txt(ezxml_child(loc, "name"));
- SetAbParam(hContact, "Company", szTmp);
- szTmp = ezxml_txt(ezxml_child(loc, "street"));
- SetAbParam(hContact, locid ? "CompanyStreet" : "Street", szTmp);
- szTmp = ezxml_txt(ezxml_child(loc, "city"));
- SetAbParam(hContact, locid ? "CompanyCity" : "City", szTmp);
- szTmp = ezxml_txt(ezxml_child(loc, "state"));
- SetAbParam(hContact, locid ? "CompanyState" : "State", szTmp);
- szTmp = ezxml_txt(ezxml_child(loc, "country"));
- SetAbParam(hContact, locid ? "CompanyCountry" : "Country", szTmp);
- szTmp = ezxml_txt(ezxml_child(loc, "postalCode"));
- SetAbParam(hContact, locid ? "CompanyZIP" : "ZIP", szTmp);
- }
- loc = ezxml_next(loc);
- }
-
- ezxml_t web = ezxml_get(contInf, "webSites", 0, "ContactWebSite", -1);
- while (web != nullptr) {
- const char* szCntType = ezxml_txt(ezxml_child(web, "contactWebSiteType"));
- if (mir_strcmp(szCntType, "ContactWebSiteBusiness") == 0) {
- szTmp = ezxml_txt(ezxml_child(web, "webURL"));
- SetAbParam(hContact, "CompanyHomepage", szTmp);
- }
- web = ezxml_next(web);
- }
- }
- else {
- const char *szTmp;
-
- szTmp = ezxml_txt(ezxml_child(contInf, "isMobileIMEnabled"));
- setByte("MobileEnabled", mir_strcmp(szTmp, "true") == 0);
-
- szTmp = ezxml_txt(ezxml_child(contInf, "IsNotMobileVisible"));
- setByte("MobileAllowed", mir_strcmp(szTmp, "true") != 0);
-
- szTmp = ezxml_txt(ezxml_child(contInf, "firstName"));
- setStringUtf(NULL, "FirstName", szTmp);
-
- szTmp = ezxml_txt(ezxml_child(contInf, "lastName"));
- setStringUtf(NULL, "LastName", szTmp);
-
- ezxml_t anot = ezxml_get(contInf, "annotations", 0, "Annotation", -1);
- while (anot != nullptr) {
- if (mir_strcmp(ezxml_txt(ezxml_child(anot, "Name")), "MSN.IM.BLP") == 0)
- msnOtherContactsBlocked = !atol(ezxml_txt(ezxml_child(anot, "Value")));
-
- anot = ezxml_next(anot);
- }
-
- ezxml_t nil = ezxml_get(contInf, "NetworkInfoList", 0, "NetworkInfo", -1);
- while (nil != nullptr) {
- if (mir_strcmp(ezxml_txt(ezxml_child(nil, "SourceId")), "SKYPE") == 0) {
- const char *pszPartner = ezxml_txt(ezxml_child(nil, "DomainTag"));
- if (*pszPartner) setString("SkypePartner", pszPartner);
- }
- nil = ezxml_next(nil);
- }
-
- }
- }
- if (!msnLoggedIn && msnNsThread) {
- char *szCircleTicket = ezxml_txt(ezxml_get(body, "CircleResult", 0, "CircleTicket", -1));
- ptrA szCircleTicketEnc(mir_base64_encode(szCircleTicket, mir_strlen(szCircleTicket)));
- if (szCircleTicketEnc)
- msnNsThread->sendPacket("USR", "SHA A %s", szCircleTicketEnc.get());
- }
-
- }
- else if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_ABFind(szMethod, szGuid, deltas, false) ? 200 : 500;
- }
- else if (mir_strcmp(szErr, "FullSyncRequired") == 0 && deltas) {
- status = MSN_ABFind(szMethod, szGuid, false, false) ? 200 : 500;
- }
- }
- else
- UpdateABHost(szMethod, nullptr);
-
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- mir_free(abUrl);
-
- return status == 200;
-}
-
-bool CMsnProto::MSN_ABRefreshClist(unsigned int nTry)
-{
- NETLIBHTTPREQUEST nlhr = { 0 };
- NETLIBHTTPHEADER headers[2];
- bool bRet = false;
-
- if (!authCookies) return false;
-
- // initialize the netlib request
- nlhr.cbSize = sizeof(nlhr);
- nlhr.requestType = REQUEST_GET;
- nlhr.flags = NLHRF_HTTP11 | NLHRF_DUMPASTEXT | NLHRF_PERSISTENT | NLHRF_REDIRECT;
- nlhr.nlc = hHttpsConnection;
- nlhr.headersCount = 2;
- nlhr.headers = headers;
- nlhr.headers[0].szName = "User-Agent";
- nlhr.headers[0].szValue = (char*)MSN_USER_AGENT;
- nlhr.headers[1].szName = "Cookie";
- nlhr.headers[1].szValue = authCookies;
- nlhr.szUrl = "https://people.directory.live.com/people/abcore?SerializeAs=xml&market=en-gb&appid=5c7a1e34-3a23-4a36-b2e6-7aa15be85f07&version=W5.M2";
-
- // Query addressbook
- mHttpsTS = clock();
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- mHttpsTS = clock();
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
- if (nlhrReply->resultCode == 200 && nlhrReply->pData) {
- ezxml_t xmlm = ezxml_parse_str(nlhrReply->pData, mir_strlen(nlhrReply->pData));
-
- if (xmlm) {
- bRet = true;
- ezxml_t abinf = ezxml_child(xmlm, "ab");
-
- for (ezxml_t pers = ezxml_get(abinf, "persons", 0, "Person", -1); pers != nullptr; pers = ezxml_next(pers)) {
- const char *cid = ezxml_txt(ezxml_child(pers, "cid"));
- if (!mir_strcmp(cid, mycid)) continue;
-
- for (ezxml_t cont = ezxml_get(pers, "contacts", 0, "Contact", -1); cont != nullptr; cont = ezxml_next(cont)) {
- int netId;
- const char* szEmail;
-
- const char *src = ezxml_txt(ezxml_child(cont, "sourceId"));
- if (!mir_strcmp(src, "WL")) {
- netId = NETID_MSN;
- szEmail = ezxml_txt(ezxml_child(cont, "domainTag"));
- }
- else if (!mir_strcmp(src, "SKYPE")) {
- netId = NETID_SKYPE;
- szEmail = ezxml_txt(ezxml_child(cont, "objectId"));
- }
- else continue;
- /* Other valid sourceIds:
- * GOOG - Google
- * SCD - Short circuit
- * FB - Facebook */
-
- if (!*szEmail) continue;
-
- ezxml_t xmlnick = ezxml_child(pers, "nickname");
- const char *pszNickname = xmlnick?xmlnick->txt:nullptr;
- int lstId = LIST_FL;
- if (mir_strcmpi(ezxml_txt(ezxml_child(cont, "isBlocked")), "true") == 0) lstId = LIST_BL;
- else if (mir_strcmp(ezxml_txt(ezxml_child(cont, "contactState")), "2") == 0) lstId = LIST_PL;
- else if (mir_strcmp(szEmail, "echo123") == 0) lstId = LIST_LL; /* Seems to be dead */
- Lists_Add(lstId, netId, szEmail, NULL, pszNickname);
- char szWLId[128];
- mir_snprintf(szWLId, sizeof(szWLId), "%d:%s", netId, szEmail);
-
- MCONTACT hContact = MSN_HContactFromEmail(szWLId, pszNickname, true, false);
- if (!hContact) continue;
-
- const char* szNick = ezxml_txt(ezxml_child(pers, "orderedName"));
- if (*szNick)
- db_set_utf(hContact, m_szModuleName, "Nick", szNick);
- else
- delSetting(hContact, "Nick");
- if (mir_strcmpi(ezxml_txt(ezxml_child(pers, "onHideList")), "true") == 0)
- Contact_Hide(hContact);
- setString(hContact, "ID", ezxml_txt(ezxml_child(pers, "id")));
- SetAbParam(hContact, "CID", cid);
-
- const char *szTmp = ezxml_txt(ezxml_child(pers, "firstName"));
- SetAbParam(hContact, "FirstName", szTmp);
-
- szTmp = ezxml_txt(ezxml_child(pers, "lastName"));
- SetAbParam(hContact, "LastName", szTmp);
-
- szTmp = ezxml_txt(ezxml_child(pers, "birthday"));
- char *szPtr;
- if (strtol(szTmp, &szPtr, 10) > 1) {
- setWord(hContact, "BirthYear", (WORD)strtol(szTmp, &szPtr, 10));
- setByte(hContact, "BirthMonth", (BYTE)strtol(szPtr + 1, &szPtr, 10));
- setByte(hContact, "BirthDay", (BYTE)strtol(szPtr + 1, &szPtr, 10));
- }
-
- setByte("MobileEnabled", atoi(ezxml_txt(ezxml_child(cont, "phonesIMEnabled"))));
- }
- }
- ezxml_free(xmlm);
- }
- } else if (nlhrReply->resultCode == 400 && !nTry) {
- // FIXME: No idea how to properly refresh WLSSC cookie required, therefore
- // complete relogin :( For this we nuke auth token so that relogin is encforeced
- // until we have a better solution
- authSkypeComToken.Clear();
- if (MSN_AuthOAuth() > 0) return MSN_ABRefreshClist(1);
- }
- }
- else hHttpsConnection = nullptr;
- return bRet;
-}
-
-/*
-bool MSN_ABSearchSkypeDirectory()
-{
- //authAccessToken
-}
-*/
-
-// "ABGroupContactAdd" : "ABGroupContactDelete", "ABGroupDelete", "ABContactDelete"
-bool CMsnProto::MSN_ABAddDelContactGroup(const char* szCntId, const char* szGrpId, const char* szMethod, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy, node;
- ezxml_t xmlp = abSoapHdr(szMethod, "Timer", tbdy, reqHdr);
-
- if (szGrpId != nullptr) {
- node = ezxml_add_child(tbdy, "groupFilter", 0);
- node = ezxml_add_child(node, "groupIds", 0);
- node = ezxml_add_child(node, "guid", 0);
- ezxml_set_txt(node, szGrpId);
- }
-
- if (szCntId != nullptr) {
- node = ezxml_add_child(tbdy, "contacts", 0);
- node = ezxml_add_child(node, "Contact", 0);
- node = ezxml_add_child(node, "contactId", 0);
- ezxml_set_txt(node, szCntId);
- }
-
- char* szData = ezxml_toxml(xmlp, true);
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost(szMethod, false);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost(szMethod, nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateABHost(szMethod, abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateABCacheKey(xmlm, false);
- if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_ABAddDelContactGroup(szCntId, szGrpId, szMethod, false) ? 200 : 500;
- }
- }
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- mir_free(abUrl);
-
- return status == 200;
-}
-
-void CMsnProto::MSN_ABAddGroup(const char* szGrpName, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = abSoapHdr("ABGroupAdd", "GroupSave", tbdy, reqHdr);
-
- ezxml_t node = ezxml_add_child(tbdy, "groupAddOptions", 0);
- node = ezxml_add_child(node, "fRenameOnMsgrConflict", 0);
- ezxml_set_txt(node, "false");
-
- node = ezxml_add_child(tbdy, "groupInfo", 0);
- ezxml_t grpi = ezxml_add_child(node, "GroupInfo", 0);
- node = ezxml_add_child(grpi, "name", 0);
- ezxml_set_txt(node, szGrpName);
- node = ezxml_add_child(grpi, "groupType", 0);
- ezxml_set_txt(node, "C8529CE2-6EAD-434d-881F-341E17DB3FF8");
- node = ezxml_add_child(grpi, "fMessenger", 0);
- ezxml_set_txt(node, "false");
- node = ezxml_add_child(grpi, "annotations", 0);
- ezxml_t annt = ezxml_add_child(node, "Annotation", 0);
- node = ezxml_add_child(annt, "Name", 0);
- ezxml_set_txt(node, "MSN.IM.Display");
- node = ezxml_add_child(annt, "Value", 0);
- ezxml_set_txt(node, "1");
-
- char* szData = ezxml_toxml(xmlp, true);
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost("ABGroupAdd", false);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost("ABGroupAdd", nullptr);
- else break;
- }
-
- free(szData);
- mir_free(reqHdr);
-
- if (tResult != nullptr) {
- UpdateABHost("ABGroupAdd", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateABCacheKey(xmlm, false);
- if (status == 200) {
- ezxml_t body = getSoapResponse(xmlm, "ABGroupAdd");
- const char* szGrpId = ezxml_txt(ezxml_child(body, "guid"));
- MSN_AddGroup(szGrpName, szGrpId, false);
- }
- else if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- MSN_ABAddGroup(szGrpName, false);
- }
- }
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- mir_free(abUrl);
-}
-
-
-void CMsnProto::MSN_ABRenameGroup(const char* szGrpName, const char* szGrpId, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = abSoapHdr("ABGroupUpdate", "Timer", tbdy, reqHdr);
-
- ezxml_t node = ezxml_add_child(tbdy, "groups", 0);
- ezxml_t grp = ezxml_add_child(node, "Group", 0);
-
- node = ezxml_add_child(grp, "groupId", 0);
- ezxml_set_txt(node, szGrpId);
- ezxml_t grpi = ezxml_add_child(grp, "groupInfo", 0);
- node = ezxml_add_child(grpi, "name", 0);
- ezxml_set_txt(node, szGrpName);
- node = ezxml_add_child(grp, "propertiesChanged", 0);
- ezxml_set_txt(node, "GroupName");
-
- char* szData = ezxml_toxml(xmlp, true);
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost("ABGroupUpdate", false);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost("ABGroupUpdate", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateABHost("ABGroupUpdate", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateABCacheKey(xmlm, false);
- if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- MSN_ABRenameGroup(szGrpName, szGrpId, false);
- }
- }
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- mir_free(abUrl);
-}
-
-
-bool CMsnProto::MSN_ABAddRemoveContact(const char* szCntId, int netId, bool add, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy, contp;
- ezxml_t xmlp = abSoapHdr("ABContactUpdate", "Timer", tbdy, reqHdr);
-
- ezxml_t node = ezxml_add_child(tbdy, "contacts", 0);
- ezxml_t cont = ezxml_add_child(node, "Contact", 0);
- ezxml_set_attr(cont, "xmlns", "http://www.msn.com/webservices/AddressBook");
-
- node = ezxml_add_child(cont, "contactId", 0);
- ezxml_set_txt(node, szCntId);
- ezxml_t conti = ezxml_add_child(cont, "contactInfo", 0);
-
- switch (netId) {
- case NETID_MSN:
- node = ezxml_add_child(conti, "isMessengerUser", 0);
- ezxml_set_txt(node, add ? "true" : "false");
- node = ezxml_add_child(cont, "propertiesChanged", 0);
- ezxml_set_txt(node, "IsMessengerUser");
- break;
-
- case NETID_LCS:
- case NETID_YAHOO:
- contp = ezxml_add_child(conti, "emails", 0);
- contp = ezxml_add_child(contp, "ContactEmail", 0);
- node = ezxml_add_child(contp, "contactEmailType", 0);
- ezxml_set_txt(node, netId == NETID_YAHOO ? "Messenger2" : "Messenger3");
- node = ezxml_add_child(contp, "isMessengerEnabled", 0);
- ezxml_set_txt(node, add ? "true" : "false");
- node = ezxml_add_child(contp, "propertiesChanged", 0);
- ezxml_set_txt(node, "IsMessengerEnabled");
- node = ezxml_add_child(cont, "propertiesChanged", 0);
- ezxml_set_txt(node, "ContactEmail");
- break;
-
- case NETID_MOB:
- contp = ezxml_add_child(conti, "phones", 0);
- contp = ezxml_add_child(contp, "ContactPhone", 0);
- node = ezxml_add_child(contp, "contactPhoneType", 0);
- ezxml_set_txt(node, "ContactPhoneMobile");
- node = ezxml_add_child(contp, "isMessengerEnabled", 0);
- ezxml_set_txt(node, add ? "true" : "false");
- node = ezxml_add_child(contp, "propertiesChanged", 0);
- ezxml_set_txt(node, "IsMessengerEnabled");
- node = ezxml_add_child(cont, "propertiesChanged", 0);
- ezxml_set_txt(node, "ContactPhone");
- break;
- }
-
- char* szData = ezxml_toxml(xmlp, true);
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost("ABContactUpdate", false);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost("ABContactUpdate", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateABHost("ABContactUpdate", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateABCacheKey(xmlm, false);
- if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- if (MSN_ABAddRemoveContact(szCntId, netId, add, false))
- status = 200;
- }
- }
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- mir_free(abUrl);
-
- return status == 200;
-}
-
-
-bool CMsnProto::MSN_ABUpdateProperty(const char* szCntId, const char* propName, const char* propValue, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = abSoapHdr("ABContactUpdate", "Timer", tbdy, reqHdr);
-
- ezxml_t node = ezxml_add_child(tbdy, "contacts", 0);
- ezxml_t cont = ezxml_add_child(node, "Contact", 0);
- ezxml_set_attr(cont, "xmlns", "http://www.msn.com/webservices/AddressBook");
-
- ezxml_t conti = ezxml_add_child(cont, "contactInfo", 0);
- if (szCntId == nullptr) {
- node = ezxml_add_child(conti, "contactType", 0);
- ezxml_set_txt(node, "Me");
- }
- else {
- node = ezxml_add_child(cont, "contactId", 0);
- ezxml_set_txt(node, szCntId);
- }
- node = ezxml_add_child(conti, propName, 0);
- ezxml_set_txt(node, propValue);
-
- node = ezxml_add_child(cont, "propertiesChanged", 0);
- char* szPrpChg = mir_strdup(propName);
- *szPrpChg = _toupper(*szPrpChg);
- ezxml_set_txt(node, szPrpChg);
-
- char* szData = ezxml_toxml(xmlp, true);
- ezxml_free(xmlp);
- mir_free(szPrpChg);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost("ABContactUpdate", false);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost("ABContactUpdate", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateABHost("ABContactUpdate", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateABCacheKey(xmlm, false);
- if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- if (MSN_ABUpdateProperty(szCntId, propName, propValue, false))
- status = 200;
- }
- }
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- mir_free(abUrl);
-
- return status == 200;
-}
-
-void CMsnProto::MSN_ABUpdateAttr(const char* szCntId, const char* szAttr, const char* szValue, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = abSoapHdr("ABContactUpdate", "Timer", tbdy, reqHdr);
-
- ezxml_t node = ezxml_add_child(tbdy, "contacts", 0);
- ezxml_t cont = ezxml_add_child(node, "Contact", 0);
- ezxml_set_attr(cont, "xmlns", "http://www.msn.com/webservices/AddressBook");
- ezxml_t conti = ezxml_add_child(cont, "contactInfo", 0);
- if (szCntId == nullptr) {
- node = ezxml_add_child(conti, "contactType", 0);
- ezxml_set_txt(node, "Me");
- }
- else {
- node = ezxml_add_child(cont, "contactId", 0);
- ezxml_set_txt(node, szCntId);
- }
- node = ezxml_add_child(conti, "annotations", 0);
- ezxml_t anot = ezxml_add_child(node, "Annotation", 0);
- node = ezxml_add_child(anot, "Name", 0);
- ezxml_set_txt(node, szAttr);
- node = ezxml_add_child(anot, "Value", 0);
- if (szValue != nullptr) ezxml_set_txt(node, szValue);
-
- node = ezxml_add_child(cont, "propertiesChanged", 0);
- ezxml_set_txt(node, "Annotation");
-
- char* szData = ezxml_toxml(xmlp, true);
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost("ABContactUpdate", false);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost("ABContactUpdate", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateABHost("ABContactUpdate", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateABCacheKey(xmlm, false);
- if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- MSN_ABUpdateAttr(szCntId, szAttr, szValue, false);
- }
- }
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- mir_free(abUrl);
-}
-
-
-void CMsnProto::MSN_ABUpdateNick(const char* szNick, const char* szCntId)
-{
- if (szCntId != nullptr)
- MSN_ABUpdateAttr(szCntId, "AB.NickName", szNick);
- else
- MSN_ABUpdateProperty(szCntId, "displayName", szNick);
-}
-
-
-unsigned CMsnProto::MSN_ABContactAdd(const char* szEmail, const char* szNick, int netId, const char* szInvite, bool search, bool retry, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = abSoapHdr("ABContactAdd", "ContactSave", tbdy, reqHdr);
-
- ezxml_t conts = ezxml_add_child(tbdy, "contacts", 0);
- ezxml_t node = ezxml_add_child(conts, "Contact", 0);
- ezxml_set_attr(node, "xmlns", "http://www.msn.com/webservices/AddressBook");
- ezxml_t conti = ezxml_add_child(node, "contactInfo", 0);
- ezxml_t contp;
-
- const char* szEmailNP = strchr(szEmail, ':');
- if (szEmailNP != nullptr) netId = NETID_MOB;
-
- switch (netId) {
- case NETID_MSN:
- node = ezxml_add_child(conti, "contactType", 0);
- ezxml_set_txt(node, "LivePending");
- node = ezxml_add_child(conti, "passportName", 0);
- ezxml_set_txt(node, szEmail);
- node = ezxml_add_child(conti, "isMessengerUser", 0);
- ezxml_set_txt(node, "true");
-
- if (szInvite) {
- node = ezxml_add_child(conti, "MessengerMemberInfo", 0);
- node = ezxml_add_child(node, "PendingAnnotations", 0);
- ezxml_t anot = ezxml_add_child(node, "Annotation", 0);
- node = ezxml_add_child(anot, "Name", 0);
- ezxml_set_txt(node, "MSN.IM.InviteMessage");
- node = ezxml_add_child(anot, "Value", 0);
- ezxml_set_txt(node, szInvite);
- }
- break;
-
- case NETID_MOB:
- ++szEmailNP;
- if (szNick == nullptr) szNick = szEmailNP;
- node = ezxml_add_child(conti, "phones", 0);
- contp = ezxml_add_child(node, "ContactPhone", 0);
- node = ezxml_add_child(contp, "contactPhoneType", 0);
- ezxml_set_txt(node, "ContactPhoneMobile");
- node = ezxml_add_child(contp, "number", 0);
- ezxml_set_txt(node, szEmailNP);
- node = ezxml_add_child(contp, "isMessengerEnabled", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(contp, "propertiesChanged", 0);
- ezxml_set_txt(node, "Number IsMessengerEnabled");
- break;
-
- case NETID_LCS:
- case NETID_YAHOO:
- node = ezxml_add_child(conti, "emails", 0);
- contp = ezxml_add_child(node, "ContactEmail", 0);
- node = ezxml_add_child(contp, "contactEmailType", 0);
- ezxml_set_txt(node, netId == NETID_YAHOO ? "Messenger2" : "Messenger3");
- node = ezxml_add_child(contp, "email", 0);
- ezxml_set_txt(node, szEmail);
- node = ezxml_add_child(contp, "isMessengerEnabled", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(contp, "Capability", 0);
- ezxml_set_txt(node, netId == NETID_YAHOO ? "32" : "2");
- node = ezxml_add_child(contp, "propertiesChanged", 0);
- ezxml_set_txt(node, "Email IsMessengerEnabled Capability");
- break;
- }
-
- if (szNick != nullptr) {
- node = ezxml_add_child(conti, "annotations", 0);
- ezxml_t annt = ezxml_add_child(node, "Annotation", 0);
- node = ezxml_add_child(annt, "Name", 0);
- ezxml_set_txt(node, "MSN.IM.Display");
- node = ezxml_add_child(annt, "Value", 0);
- ezxml_set_txt(node, szNick);
- }
-
- node = ezxml_add_child(conts, "options", 0);
- node = ezxml_add_child(node, "EnableAllowListManagement", 0);
- ezxml_set_txt(node, "true");
-
- char* szData = ezxml_toxml(xmlp, true);
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost("ABContactAdd", false);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost("ABContactAdd", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateABCacheKey(xmlm, false);
- if (status == 200) {
- ezxml_t body = getSoapResponse(xmlm, "ABContactAdd");
-
- const char *szContId = ezxml_txt(ezxml_child(body, "guid"));
-
- if (search)
- MSN_ABAddDelContactGroup(szContId, nullptr, "ABContactDelete");
- else {
- MSN_ABAddRemoveContact(szContId, NETID_MSN, true);
- MCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false);
- setString(hContact, "ID", szContId);
- }
- status = 0;
- }
- else if (status == 500) {
- const char *szErr = ezxml_txt(getSoapFault(xmlm, true));
-
- if (mir_strcmp(szErr, "InvalidPassportUser") == 0)
- status = 1;
- else if (mir_strcmp(szErr, "FederatedQueryFailure") == 0)
- status = 4;
- else if (mir_strcmp(szErr, "EmailDomainIsFederated") == 0)
- status = 2;
- else if (mir_strcmp(szErr, "BadEmailArgument") == 0)
- status = 4;
- else if (mir_strcmp(szErr, "ContactAlreadyExists") == 0) {
- status = 3;
-
- const char *szContId = ezxml_txt(ezxml_get(getSoapFault(xmlm, false), "detail", 0, "additionalDetails", 0, "conflictObjectId", -1));
- if (search) {
- if (retry) {
- MSN_ABAddDelContactGroup(szContId, nullptr, "ABContactDelete");
- status = 0;
- }
- }
- else {
- MCONTACT hContact = MSN_HContactFromEmail(szEmail, szNick ? szNick : szEmail, true, false);
- setString(hContact, "ID", szContId);
- }
- }
- else if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_ABContactAdd(szEmail, szNick, netId, nullptr, search, retry, false);
- }
- else status = MSN_ABContactAdd(szEmail, szNick, netId, nullptr, search, false);
- }
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- mir_free(abUrl);
-
- return status;
-}
-
-void CMsnProto::MSN_ABUpdateDynamicItem(bool allowRecurse)
-{
- char *reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = abSoapHdr("UpdateDynamicItem", "RoamingIdentityChanged", tbdy, reqHdr);
-
- ezxml_t dynitms = ezxml_add_child(tbdy, "dynamicItems", 0);
- ezxml_t dynitm = ezxml_add_child(dynitms, "DynamicItem", 0);
-
- ezxml_set_attr(dynitm, "xsi:type", "PassportDynamicItem");
- ezxml_t node = ezxml_add_child(dynitm, "Type", 0);
- ezxml_set_txt(node, "Passport");
- node = ezxml_add_child(dynitm, "PassportName", 0);
- ezxml_set_txt(node, MyOptions.szEmail);
-
- ezxml_t nots = ezxml_add_child(dynitm, "Notifications", 0);
- ezxml_t notd = ezxml_add_child(nots, "NotificationData", 0);
- ezxml_t strsvc = ezxml_add_child(notd, "StoreService", 0);
- ezxml_t info = ezxml_add_child(strsvc, "Info", 0);
-
- ezxml_t hnd = ezxml_add_child(info, "Handle", 0);
- node = ezxml_add_child(hnd, "Id", 0);
- ezxml_set_txt(node, "0");
- node = ezxml_add_child(hnd, "Type", 0);
- ezxml_set_txt(node, "Profile");
- node = ezxml_add_child(hnd, "ForeignId", 0);
- ezxml_set_txt(node, "MyProfile");
-
- node = ezxml_add_child(info, "InverseRequired", 0);
- ezxml_set_txt(node, "false");
- node = ezxml_add_child(info, "IsBot", 0);
- ezxml_set_txt(node, "false");
-
- node = ezxml_add_child(strsvc, "Changes", 0);
- node = ezxml_add_child(strsvc, "LastChange", 0);
- ezxml_set_txt(node, "0001-01-01T00:00:00");
- node = ezxml_add_child(strsvc, "Deleted", 0);
- ezxml_set_txt(node, "false");
-
- node = ezxml_add_child(notd, "Status", 0);
- ezxml_set_txt(node, "Exist Access");
- node = ezxml_add_child(notd, "LastChanged", 0);
-
- time_t timer;
- time(&timer);
- tm *tmst = gmtime(&timer);
-
- char tmstr[64];
- mir_snprintf(tmstr, "%04u-%02u-%02uT%02u:%02u:%02uZ",
- tmst->tm_year + 1900, tmst->tm_mon + 1, tmst->tm_mday,
- tmst->tm_hour, tmst->tm_min, tmst->tm_sec);
-
- ezxml_set_txt(node, tmstr);
- node = ezxml_add_child(notd, "Gleam", 0);
- ezxml_set_txt(node, "false");
- node = ezxml_add_child(notd, "InstanceId", 0);
- ezxml_set_txt(node, "0");
-
- node = ezxml_add_child(dynitm, "Changes", 0);
- ezxml_set_txt(node, "Notifications");
-
- char* szData = ezxml_toxml(xmlp, true);
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *abUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(abUrl);
- abUrl = GetABHost("UpdateDynamicItem", false);
- tResult = getSslResult(&abUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateABHost("UpdateDynamicItem", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateABHost("UpdateDynamicItem", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateABCacheKey(xmlm, false);
- if (status == 500) {
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- MSN_ABUpdateDynamicItem(false);
- }
- }
- ezxml_free(xmlm);
- }
- mir_free(tResult);
- mir_free(abUrl);
-}
diff --git a/protocols/MSN/src/msn_soapstore.cpp b/protocols/MSN/src/msn_soapstore.cpp
deleted file mode 100644
index f598bdece6..0000000000
--- a/protocols/MSN/src/msn_soapstore.cpp
+++ /dev/null
@@ -1,731 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2007-2012 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-static const char storeReqHdr[] =
- "SOAPAction: http://www.msn.com/webservices/storage/2008/%s\r\n";
-
-ezxml_t CMsnProto::storeSoapHdr(const char* service, const char* scenario, ezxml_t& tbdy, char*& httphdr)
-{
- ezxml_t xmlp = ezxml_new("soap:Envelope");
- ezxml_set_attr(xmlp, "xmlns:soap", "http://schemas.xmlsoap.org/soap/envelope/");
- ezxml_set_attr(xmlp, "xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
- ezxml_set_attr(xmlp, "xmlns:xsd", "http://www.w3.org/2001/XMLSchema");
- ezxml_set_attr(xmlp, "xmlns:soapenc", "http://schemas.xmlsoap.org/soap/encoding/");
-
- ezxml_t hdr = ezxml_add_child(xmlp, "soap:Header", 0);
-
- if (storageCacheKey) {
- ezxml_t cachehdr = ezxml_add_child(hdr, "AffinityCacheHeader", 0);
- ezxml_set_attr(cachehdr, "xmlns", "http://www.msn.com/webservices/storage/2008");
- ezxml_t node = ezxml_add_child(cachehdr, "CacheKey", 0);
- ezxml_set_txt(node, storageCacheKey);
- }
-
- ezxml_t apphdr = ezxml_add_child(hdr, "StorageApplicationHeader", 0);
- ezxml_set_attr(apphdr, "xmlns", "http://www.msn.com/webservices/storage/2008");
- ezxml_t node = ezxml_add_child(apphdr, "ApplicationID", 0);
- ezxml_set_txt(node, "Messenger Client 9.0");
- node = ezxml_add_child(apphdr, "Scenario", 0);
- ezxml_set_txt(node, scenario);
-
- ezxml_t authhdr = ezxml_add_child(hdr, "StorageUserHeader", 0);
- ezxml_set_attr(authhdr, "xmlns", "http://www.msn.com/webservices/storage/2008");
- node = ezxml_add_child(authhdr, "Puid", 0);
- ezxml_set_txt(node, mypuid);
- node = ezxml_add_child(authhdr, "TicketToken", 0);
- if (authStorageToken) ezxml_set_txt(node, authStorageToken);
-
- ezxml_t bdy = ezxml_add_child(xmlp, "soap:Body", 0);
-
- tbdy = ezxml_add_child(bdy, service, 0);
- ezxml_set_attr(tbdy, "xmlns", "http://www.msn.com/webservices/storage/2008");
-
- size_t hdrsz = mir_strlen(service) + sizeof(storeReqHdr) + 20;
- httphdr = (char*)mir_alloc(hdrsz);
-
- mir_snprintf(httphdr, hdrsz, storeReqHdr, service);
-
- return xmlp;
-}
-
-char* CMsnProto::GetStoreHost(const char* service)
-{
- char hostname[128];
- mir_snprintf(hostname, "StoreHost-%s", service);
-
- char* host = (char*)mir_alloc(256);
- if (db_get_static(NULL, m_szModuleName, hostname, host, 256) || !*host)
- mir_strcpy(host, "https://tkrdr.storage.msn.com/storageservice/SchematizedStore.asmx");
-
- return host;
-}
-
-void CMsnProto::UpdateStoreHost(const char* service, const char* url)
-{
- char hostname[128];
- mir_snprintf(hostname, "StoreHost-%s", service);
-
- setString(hostname, url);
-}
-
-void CMsnProto::UpdateStoreCacheKey(ezxml_t bdy)
-{
- ezxml_t key = ezxml_get(bdy, "soap:Header", 0, "AffinityCacheHeader", 0, "CacheKey", -1);
- if (key) replaceStr(storageCacheKey, ezxml_txt(key));
-}
-
-bool CMsnProto::MSN_StoreCreateProfile(bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = storeSoapHdr("CreateProfile", "RoamingSeed", tbdy, reqHdr);
-
- ezxml_t pro = ezxml_add_child(tbdy, "profile", 0);
- ezxml_t node;
-
- pro = ezxml_add_child(pro, "ExpressionProfile", 0);
- ezxml_add_child(pro, "PersonalStatus", 0);
- node = ezxml_add_child(pro, "RoleDefinitionName", 0);
- ezxml_set_txt(node, "ExpressionProfileDefault");
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *storeUrl, *tResult = nullptr;
-
- storeUrl = mir_strdup("https://storage.msn.com/storageservice/SchematizedStore.asmx");
- tResult = getSslResult(&storeUrl, szData, reqHdr, status);
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- if (status == 200) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- UpdateStoreCacheKey(xmlm);
- ezxml_t body = getSoapResponse(xmlm, "CreateProfile");
-
- MSN_StoreShareItem(ezxml_txt(body));
- MSN_SharingMyProfile();
-
- ezxml_free(xmlm);
- }
- else if (status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_StoreCreateProfile(false) ? 200 : 500;
- }
- ezxml_free(xmlm);
- }
- }
-
- mir_free(tResult);
- mir_free(storeUrl);
-
- return status == 200;
-}
-
-bool CMsnProto::MSN_StoreShareItem(const char* id, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = storeSoapHdr("ShareItem", "RoamingSeed", tbdy, reqHdr);
-
- ezxml_t node = ezxml_add_child(tbdy, "resourceID", 0);
- ezxml_set_txt(node, id);
- node = ezxml_add_child(tbdy, "displayName", 0);
- ezxml_set_txt(node, "Messenger Roaming Identity");
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
-
- char *storeUrl = mir_strdup("https://storage.msn.com/storageservice/SchematizedStore.asmx");
- char *tResult = getSslResult(&storeUrl, szData, reqHdr, status);
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr && status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_StoreCreateProfile(false) ? 200 : 500;
- }
- ezxml_free(xmlm);
- }
-
- mir_free(tResult);
- mir_free(storeUrl);
-
- return status == 200;
-}
-
-bool CMsnProto::MSN_StoreGetProfile(bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = storeSoapHdr("GetProfile", "Initial", tbdy, reqHdr);
-
- ezxml_t prohndl = ezxml_add_child(tbdy, "profileHandle", 0);
-
- ezxml_t alias = ezxml_add_child(prohndl, "Alias", 0);
- ezxml_t node = ezxml_add_child(alias, "Name", 0);
- ezxml_set_txt(node, mycid);
- node = ezxml_add_child(alias, "NameSpace", 0);
- ezxml_set_txt(node, "MyCidStuff");
-
- node = ezxml_add_child(prohndl, "RelationshipName", 0);
- ezxml_set_txt(node, "MyProfile");
-
- ezxml_t proattr = ezxml_add_child(tbdy, "profileAttributes", 0);
- node = ezxml_add_child(proattr, "ResourceID", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(proattr, "DateModified", 0);
- ezxml_set_txt(node, "true");
-
- ezxml_t exproattr = ezxml_add_child(proattr, "ExpressionProfileAttributes", 0);
- node = ezxml_add_child(exproattr, "ResourceID", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(exproattr, "DateModified", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(exproattr, "DisplayName", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(exproattr, "DisplayNameLastModified", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(exproattr, "PersonalStatus", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(exproattr, "PersonalStatusLastModified", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(exproattr, "StaticUserTilePublicURL", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(exproattr, "Photo", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(exproattr, "Flags", 0);
- ezxml_set_txt(node, "true");
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *storeUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(storeUrl);
- storeUrl = GetStoreHost("GetProfile");
- tResult = getSslResult(&storeUrl, szData, reqHdr, status);
- if (tResult == nullptr)
- UpdateStoreHost("GetProfile", nullptr);
- else
- break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- if (status == 200) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- ezxml_t body = getSoapResponse(xmlm, "GetProfile");
-
- UpdateStoreHost("GetProfile", body ? storeUrl : nullptr);
-
- strncpy_s(proresid, ezxml_txt(ezxml_child(body, "ResourceID")), _TRUNCATE);
-
- ezxml_t expr = ezxml_child(body, "ExpressionProfile");
- if (expr == nullptr) {
- MSN_StoreShareItem(proresid);
- MSN_SharingMyProfile();
- if (allowRecurse) MSN_StoreGetProfile(false);
- }
- else {
- const char* szNick = ezxml_txt(ezxml_child(expr, "DisplayName"));
- setStringUtf(NULL, "Nick", (char*)szNick);
-
- const char* szStatus = ezxml_txt(ezxml_child(expr, "PersonalStatus"));
- replaceStr(msnLastStatusMsg, szStatus);
-
- strncpy_s(expresid, ezxml_txt(ezxml_child(expr, "ResourceID")), _TRUNCATE);
-
- ezxml_t photo = ezxml_child(expr, "Photo");
- strncpy_s(photoid, ezxml_txt(ezxml_child(photo, "ResourceID")), _TRUNCATE);
-
- ezxml_t docstr = ezxml_get(photo, "DocumentStreams", 0, "DocumentStream", -1);
- while (docstr) {
- const char *docname = ezxml_txt(ezxml_child(docstr, "DocumentStreamName"));
- if (!mir_strcmp(docname, "UserTileStatic")) {
- getMyAvatarFile(ezxml_txt(ezxml_child(docstr, "PreAuthURL")), L"miranda_avatar.tmp");
- break;
- }
- docstr = ezxml_next(docstr);
- }
- }
- ezxml_free(xmlm);
- }
- else if (status == 500 && allowRecurse) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0) {
- MSN_GetPassportAuth();
- MSN_StoreGetProfile(false);
- }
- else {
- MSN_StoreCreateProfile();
- if (MSN_StoreGetProfile(false)) status = 200;
- }
- ezxml_free(xmlm);
- }
- else
- UpdateStoreHost("GetProfile", nullptr);
-
- }
- mir_free(tResult);
- mir_free(storeUrl);
-
- return status == 200;
-}
-
-bool CMsnProto::MSN_StoreUpdateProfile(const char* szNick, const char* szStatus, bool lock, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = storeSoapHdr("UpdateProfile", "RoamingIdentityChanged", tbdy, reqHdr);
-
- ezxml_t pro = ezxml_add_child(tbdy, "profile", 0);
- ezxml_t node = ezxml_add_child(pro, "ResourceID", 0);
- ezxml_set_txt(node, proresid);
-
- ezxml_t expro = ezxml_add_child(pro, "ExpressionProfile", 0);
- node = ezxml_add_child(expro, "FreeText", 0);
- ezxml_set_txt(node, "Update");
- if (szNick) {
- node = ezxml_add_child(expro, "DisplayName", 0);
- ezxml_set_txt(node, szNick);
- }
- if (szStatus) {
- node = ezxml_add_child(expro, "PersonalStatus", 0);
- ezxml_set_txt(node, szStatus);
- }
- node = ezxml_add_child(expro, "Flags", 0);
- ezxml_set_txt(node, lock ? "1" : "0");
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *storeUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(storeUrl);
- storeUrl = GetStoreHost("UpdateProfile");
- tResult = getSslResult(&storeUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateStoreHost("UpdateProfile", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateStoreHost("UpdateProfile", storeUrl);
- if (status == 200) {
- replaceStr(msnLastStatusMsg, szStatus);
- MSN_ABUpdateDynamicItem();
- }
- else if (status == 500 && allowRecurse) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0) {
- MSN_GetPassportAuth();
- status = MSN_StoreUpdateProfile(szNick, szStatus, lock, false) ? 200 : 500;
- }
- ezxml_free(xmlm);
- }
- }
-
- mir_free(tResult);
- mir_free(storeUrl);
-
- return status == 200;
-}
-
-
-bool CMsnProto::MSN_StoreCreateRelationships(bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = storeSoapHdr("CreateRelationships", "RoamingIdentityChanged", tbdy, reqHdr);
-
- ezxml_t rels = ezxml_add_child(tbdy, "relationships", 0);
- ezxml_t rel = ezxml_add_child(rels, "Relationship", 0);
- ezxml_t node = ezxml_add_child(rel, "SourceID", 0);
- ezxml_set_txt(node, expresid);
- node = ezxml_add_child(rel, "SourceType", 0);
- ezxml_set_txt(node, "SubProfile");
- node = ezxml_add_child(rel, "TargetID", 0);
- ezxml_set_txt(node, photoid);
- node = ezxml_add_child(rel, "TargetType", 0);
- ezxml_set_txt(node, "Photo");
- node = ezxml_add_child(rel, "RelationshipName", 0);
- ezxml_set_txt(node, "ProfilePhoto");
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *storeUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(storeUrl);
- storeUrl = GetStoreHost("CreateRelationships");
- tResult = getSslResult(&storeUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateStoreHost("CreateRelationships", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateStoreHost("CreateRelationships", storeUrl);
-
- if (status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_StoreCreateRelationships(false) ? 200 : 500;
- }
- ezxml_free(xmlm);
- }
- }
-
- mir_free(tResult);
- mir_free(storeUrl);
-
- return status == 200;
-}
-
-
-bool CMsnProto::MSN_StoreDeleteRelationships(bool tile, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = storeSoapHdr("DeleteRelationships", "RoamingIdentityChanged", tbdy, reqHdr);
-
- ezxml_t srch = ezxml_add_child(tbdy, "sourceHandle", 0);
-
- ezxml_t node;
- if (tile) {
- node = ezxml_add_child(srch, "RelationshipName", 0);
- ezxml_set_txt(node, "/UserTiles");
-
- ezxml_t alias = ezxml_add_child(srch, "Alias", 0);
- node = ezxml_add_child(alias, "Name", 0);
- ezxml_set_txt(node, mycid);
- node = ezxml_add_child(alias, "NameSpace", 0);
- ezxml_set_txt(node, "MyCidStuff");
- }
- else {
- node = ezxml_add_child(srch, "ResourceID", 0);
- ezxml_set_txt(node, expresid);
- }
-
- node = ezxml_add_child(tbdy, "targetHandles", 0);
- node = ezxml_add_child(node, "ObjectHandle", 0);
- node = ezxml_add_child(node, "ResourceID", 0);
- ezxml_set_txt(node, photoid);
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *storeUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(storeUrl);
- storeUrl = GetStoreHost("DeleteRelationships");
- tResult = getSslResult(&storeUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateStoreHost("DeleteRelationships", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateStoreHost("DeleteRelationships", storeUrl);
- if (status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_StoreDeleteRelationships(tile, false) ? 200 : 500;
- }
- ezxml_free(xmlm);
- }
- }
-
- mir_free(tResult);
- mir_free(storeUrl);
-
- return status == 200;
-}
-
-
-bool CMsnProto::MSN_StoreCreateDocument(const wchar_t *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- T2Utf szName(sztName);
- ezxml_t xmlp = storeSoapHdr("CreateDocument", "RoamingIdentityChanged", tbdy, reqHdr);
-
- ezxml_t hndl = ezxml_add_child(tbdy, "parentHandle", 0);
- ezxml_t node = ezxml_add_child(hndl, "RelationshipName", 0);
- ezxml_set_txt(node, "/UserTiles");
-
- ezxml_t alias = ezxml_add_child(hndl, "Alias", 0);
- node = ezxml_add_child(alias, "Name", 0);
- ezxml_set_txt(node, mycid);
- node = ezxml_add_child(alias, "NameSpace", 0);
- ezxml_set_txt(node, "MyCidStuff");
-
- ezxml_t doc = ezxml_add_child(tbdy, "document", 0);
- ezxml_set_attr(doc, "xsi:type", "Photo");
- node = ezxml_add_child(doc, "Name", 0);
- ezxml_set_txt(node, szName);
-
- doc = ezxml_add_child(doc, "DocumentStreams", 0);
- doc = ezxml_add_child(doc, "DocumentStream", 0);
- ezxml_set_attr(doc, "xsi:type", "PhotoStream");
- node = ezxml_add_child(doc, "DocumentStreamType", 0);
-
- ezxml_set_txt(node, "UserTileStatic");
- node = ezxml_add_child(doc, "MimeType", 0);
- ezxml_set_txt(node, szMimeType);
- node = ezxml_add_child(doc, "Data", 0);
- ezxml_set_txt(node, szPicData);
- node = ezxml_add_child(doc, "DataSize", 0);
- ezxml_set_txt(node, "0");
-
- node = ezxml_add_child(tbdy, "relationshipName", 0);
- ezxml_set_txt(node, "Messenger User Tile");
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *storeUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(storeUrl);
- storeUrl = GetStoreHost("CreateDocument");
- tResult = getSslResult(&storeUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateStoreHost("CreateDocument", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateStoreHost("CreateDocument", storeUrl);
- if (status == 200) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- ezxml_t bdy = getSoapResponse(xmlm, "CreateDocument");
- strncpy_s(photoid, ezxml_txt(bdy), _TRUNCATE);
- ezxml_free(xmlm);
- }
- else if (status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_StoreCreateDocument(sztName, szMimeType, szPicData, false) ? 200 : 500;
- }
- ezxml_free(xmlm);
- }
- }
-
- mir_free(tResult);
- mir_free(storeUrl);
-
- return status == 200;
-}
-
-
-bool CMsnProto::MSN_StoreUpdateDocument(const wchar_t *sztName, const char *szMimeType, const char *szPicData, bool allowRecurse)
-{
- char* reqHdr;
- T2Utf szName(sztName);
- ezxml_t tbdy;
- ezxml_t xmlp = storeSoapHdr("UpdateDocument", "RoamingIdentityChanged", tbdy, reqHdr);
-
- ezxml_t doc = ezxml_add_child(tbdy, "document", 0);
- ezxml_set_attr(doc, "xsi:type", "Photo");
- ezxml_t node = ezxml_add_child(doc, "ResourceID", 0);
- ezxml_set_txt(node, photoid);
- node = ezxml_add_child(doc, "Name", 0);
- ezxml_set_txt(node, szName);
-
- doc = ezxml_add_child(doc, "DocumentStreams", 0);
- doc = ezxml_add_child(doc, "DocumentStream", 0);
- ezxml_set_attr(doc, "xsi:type", "PhotoStream");
-
- node = ezxml_add_child(doc, "MimeType", 0);
- ezxml_set_txt(node, szMimeType);
- node = ezxml_add_child(doc, "Data", 0);
- ezxml_set_txt(node, szPicData);
- node = ezxml_add_child(doc, "DataSize", 0);
- ezxml_set_txt(node, "0");
- node = ezxml_add_child(doc, "DocumentStreamType", 0);
- ezxml_set_txt(node, "UserTileStatic");
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *storeUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(storeUrl);
- storeUrl = GetStoreHost("UpdateDocument");
- tResult = getSslResult(&storeUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateStoreHost("UpdateDocument", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateStoreHost("UpdateDocument", storeUrl);
- if (status == 500 && allowRecurse) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0) {
- MSN_GetPassportAuth();
- status = MSN_StoreUpdateDocument(sztName, szMimeType, szPicData, false) ? 200 : 500;
- }
- else if (szErr[0]) {
- MSN_StoreDeleteRelationships(true);
- MSN_StoreDeleteRelationships(false);
-
- MSN_StoreCreateDocument(sztName, szMimeType, szPicData);
- MSN_StoreCreateRelationships();
- }
- ezxml_free(xmlm);
- }
- }
-
- mir_free(tResult);
- mir_free(storeUrl);
-
- return status == 200;
-}
-
-bool CMsnProto::MSN_StoreFindDocuments(bool allowRecurse)
-{
- char* reqHdr;
- ezxml_t tbdy;
- ezxml_t xmlp = storeSoapHdr("FindDocuments", "RoamingIdentityChanged", tbdy, reqHdr);
-
- ezxml_t srch = ezxml_add_child(tbdy, "objectHandle", 0);
- ezxml_t node = ezxml_add_child(srch, "RelationshipName", 0);
- ezxml_set_txt(node, "/UserTiles");
-
- ezxml_t alias = ezxml_add_child(srch, "Alias", 0);
- node = ezxml_add_child(alias, "Name", 0);
- ezxml_set_txt(node, mycid);
- node = ezxml_add_child(alias, "NameSpace", 0);
- ezxml_set_txt(node, "MyCidStuff");
-
- ezxml_t doc = ezxml_add_child(tbdy, "documentAttributes", 0);
- node = ezxml_add_child(doc, "ResourceID", 0);
- ezxml_set_txt(node, "true");
- node = ezxml_add_child(doc, "Name", 0);
- ezxml_set_txt(node, "true");
-
- doc = ezxml_add_child(tbdy, "documentFilter", 0);
- node = ezxml_add_child(doc, "FilterAttributes", 0);
- ezxml_set_txt(node, "None");
-
- doc = ezxml_add_child(tbdy, "documentSort", 0);
- node = ezxml_add_child(doc, "SortBy", 0);
- ezxml_set_txt(node, "DateModified");
-
- doc = ezxml_add_child(tbdy, "findContext", 0);
- node = ezxml_add_child(doc, "FindMethod", 0);
- ezxml_set_txt(node, "Default");
- node = ezxml_add_child(doc, "ChunkSize", 0);
- ezxml_set_txt(node, "25");
-
- char* szData = ezxml_toxml(xmlp, true);
-
- ezxml_free(xmlp);
-
- unsigned status = 0;
- char *storeUrl = nullptr, *tResult = nullptr;
-
- for (int k = 4; --k;) {
- mir_free(storeUrl);
- storeUrl = GetStoreHost("FindDocuments");
- tResult = getSslResult(&storeUrl, szData, reqHdr, status);
- if (tResult == nullptr) UpdateStoreHost("FindDocuments", nullptr);
- else break;
- }
-
- mir_free(reqHdr);
- free(szData);
-
- if (tResult != nullptr) {
- UpdateStoreHost("FindDocuments", storeUrl);
- if (status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
- const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
- if (mir_strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
- MSN_GetPassportAuth();
- status = MSN_StoreFindDocuments(false) ? 200 : 500;
- }
- ezxml_free(xmlm);
- }
- }
-
- mir_free(tResult);
- mir_free(storeUrl);
-
- return status == 200;
-}
diff --git a/protocols/MSN/src/msn_srv.cpp b/protocols/MSN/src/msn_srv.cpp
deleted file mode 100644
index eb95ba9f64..0000000000
--- a/protocols/MSN/src/msn_srv.cpp
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_AddGroup - adds new server group to the list
-
-void CMsnProto::MSN_AddGroup(const char* grpName, const char *grpId, bool init)
-{
- ServerGroupItem* p = m_arGroups.find((ServerGroupItem*)&grpId);
- if (p != nullptr) return;
-
- p = (ServerGroupItem*)mir_alloc(sizeof(ServerGroupItem));
- p->id = mir_strdup(grpId);
- p->name = mir_strdup(grpName);
-
- m_arGroups.insert(p);
-
- if (init)
- Clist_GroupCreate(0, ptrW(mir_utf8decodeW(grpName)));
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_DeleteGroup - deletes a group from the list
-
-void CMsnProto::MSN_DeleteGroup(const char* pId)
-{
- int i = m_arGroups.getIndex((ServerGroupItem*)&pId);
- if (i > -1) {
- ServerGroupItem *p = m_arGroups[i];
- mir_free(p->id);
- mir_free(p->name);
- mir_free(p);
- m_arGroups.remove(i);
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_DeleteServerGroup - deletes group from the server
-
-void CMsnProto::MSN_DeleteServerGroup(LPCSTR szId)
-{
- if (!MyOptions.ManageServer) return;
-
- MSN_ABAddDelContactGroup(nullptr, szId, "ABGroupDelete");
-
- int count = -1;
- for (;;) {
- MsnContact *msc = Lists_GetNext(count);
- if (msc == nullptr) break;
-
- char szGroupID[100];
- if (!db_get_static(msc->hContact, m_szModuleName, "GroupID", szGroupID, sizeof(szGroupID))) {
- if (mir_strcmp(szGroupID, szId) == 0)
- delSetting(msc->hContact, "GroupID");
- }
- }
- MSN_DeleteGroup(szId);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_FreeGroups - clears the server groups list
-
-void CMsnProto::MSN_FreeGroups(void)
-{
- for (auto &p : m_arGroups) {
- mir_free(p->id);
- mir_free(p->name);
- mir_free(p);
- }
- m_arGroups.destroy();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_GetGroupById - tries to return a group name associated with given UUID
-
-LPCSTR CMsnProto::MSN_GetGroupById(const char* pId)
-{
- ServerGroupItem* p = m_arGroups.find((ServerGroupItem*)&pId);
- return p ? p->name : nullptr;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_GetGroupByName - tries to return a group UUID associated with the given name
-
-LPCSTR CMsnProto::MSN_GetGroupByName(const char* pName)
-{
- for (auto &p : m_arGroups)
- if (mir_strcmp(p->name, pName) == 0)
- return p->id;
-
- return nullptr;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_SetGroupName - sets a new name to a server group
-
-void CMsnProto::MSN_SetGroupName(const char* pId, const char* pNewName)
-{
- ServerGroupItem* p = m_arGroups.find((ServerGroupItem*)&pId);
- if (p != nullptr)
- replaceStr(p->name, pNewName);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_MoveContactToGroup - sends a contact to the specified group
-
-void CMsnProto::MSN_MoveContactToGroup(MCONTACT hContact, const char* grpName)
-{
- if (!MyOptions.ManageServer) return;
-
- LPCSTR szId = nullptr;
- char szContactID[100], szGroupID[100];
- if (db_get_static(hContact, m_szModuleName, "ID", szContactID, sizeof(szContactID)))
- return;
-
- if (db_get_static(hContact, m_szModuleName, "GroupID", szGroupID, sizeof(szGroupID)))
- szGroupID[0] = 0;
-
- bool bInsert = false, bDelete = szGroupID[0] != 0;
-
- if (grpName != nullptr) {
- szId = MSN_GetGroupByName(grpName);
- if (szId == nullptr) {
- MSN_ABAddGroup(grpName);
- szId = MSN_GetGroupByName(grpName);
- }
- if (szId == nullptr) return;
- if (_stricmp(szGroupID, szId) == 0) bDelete = false;
- else bInsert = true;
- }
-
- if (bDelete) {
- MSN_ABAddDelContactGroup(szContactID, szGroupID, "ABGroupContactDelete");
- delSetting(hContact, "GroupID");
- }
-
- if (bInsert) {
- MSN_ABAddDelContactGroup(szContactID, szId, "ABGroupContactAdd");
- setString(hContact, "GroupID", szId);
- }
-
- if (bDelete)
- MSN_RemoveEmptyGroups();
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_RemoveEmptyGroups - removes empty groups from the server list
-
-void CMsnProto::MSN_RemoveEmptyGroups(void)
-{
- if (!MyOptions.ManageServer) return;
-
- unsigned *cCount = (unsigned*)mir_calloc(m_arGroups.getCount() * sizeof(unsigned));
-
- int count = -1;
- for (;;) {
- MsnContact *msc = Lists_GetNext(count);
- if (msc == nullptr)
- break;
-
- char szGroupID[100];
- if (!db_get_static(msc->hContact, m_szModuleName, "GroupID", szGroupID, sizeof(szGroupID))) {
- const char *pId = szGroupID;
- int i = m_arGroups.getIndex((ServerGroupItem*)&pId);
- if (i > -1)
- ++cCount[i];
- }
- }
-
- for (int i = m_arGroups.getCount(); i--;)
- if (cCount[i] == 0)
- MSN_DeleteServerGroup(m_arGroups[i]->id);
-
- mir_free(cCount);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_RenameServerGroup - renames group on the server
-
-void CMsnProto::MSN_RenameServerGroup(LPCSTR szId, const char* newName)
-{
- MSN_SetGroupName(szId, newName);
- MSN_ABRenameGroup(newName, szId);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_UploadServerGroups - adds a group to the server list and contacts into the group
-
-void CMsnProto::MSN_UploadServerGroups(char* group)
-{
- if (!MyOptions.ManageServer) return;
-
- int count = -1;
- for (;;) {
- MsnContact *msc = Lists_GetNext(count);
- if (msc == nullptr) break;
-
- DBVARIANT dbv;
- if (!db_get_utf(msc->hContact, "CList", "Group", &dbv)) {
- char szGroupID[100];
- if (group == nullptr || (mir_strcmp(group, dbv.pszVal) == 0 &&
- db_get_static(msc->hContact, m_szModuleName, "GroupID", szGroupID, sizeof(szGroupID)) != 0)) {
- MSN_MoveContactToGroup(msc->hContact, dbv.pszVal);
- }
- db_free(&dbv);
- }
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN_SyncContactToServerGroup - moves contact into appropriate group according to server
-// if contact in multiple server groups it get removed from all of them other them it's
-// in or the last one
-
-void CMsnProto::MSN_SyncContactToServerGroup(MCONTACT hContact, const char* szContId, ezxml_t cgrp)
-{
- if (!MyOptions.ManageServer) return;
-
- const char* szGrpName = "";
-
- DBVARIANT dbv;
- if (!db_get_utf(hContact, "CList", "Group", &dbv)) {
- szGrpName = NEWSTR_ALLOCA(dbv.pszVal);
- db_free(&dbv);
- }
-
- const char* szGrpIdF = nullptr;
- while (cgrp != nullptr) {
- const char* szGrpId = ezxml_txt(cgrp);
- cgrp = ezxml_next(cgrp);
-
- const char* szGrpNameById = MSN_GetGroupById(szGrpId);
-
- if (szGrpNameById && (mir_strcmp(szGrpNameById, szGrpName) == 0 ||
- (cgrp == nullptr && szGrpIdF == nullptr)))
- szGrpIdF = szGrpId;
- else
- MSN_ABAddDelContactGroup(szContId, szGrpId, "ABGroupContactDelete");
- }
-
- if (szGrpIdF != nullptr) {
- setString(hContact, "GroupID", szGrpIdF);
- const char* szGrpNameById = MSN_GetGroupById(szGrpIdF);
- if (mir_strcmp(szGrpNameById, szGrpName))
- db_set_utf(hContact, "CList", "Group", szGrpNameById);
- }
- else {
- if (szGrpName[0])
- db_unset(hContact, "CList", "Group");
- delSetting(hContact, "GroupID");
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Msn_SendNickname - update our own nickname on the server
-
-void CMsnProto::MSN_SendNicknameUtf(const char* nickname)
-{
- if (nickname[0])
- setStringUtf(NULL, "Nick", nickname);
- else
- delSetting("Nick");
-
- ForkThread(&CMsnProto::msn_storeProfileThread, (void*)1);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// msn_storeAvatarThread - update our own avatar on the server
-
-void CMsnProto::msn_storeAvatarThread(void* arg)
-{
- StoreAvatarData* dat = (StoreAvatarData*)arg;
- ptrA szEncBuf;
-
- if (dat)
- szEncBuf = mir_base64_encode(dat->data, dat->dataSize);
-
- if (photoid[0] && dat)
- MSN_StoreUpdateDocument(dat->szName, dat->szMimeType, szEncBuf);
- else {
- MSN_StoreUpdateProfile(nullptr, nullptr, 1);
-
- if (photoid[0]) {
- MSN_StoreDeleteRelationships(true);
- MSN_StoreDeleteRelationships(false);
- photoid[0] = 0;
- }
-
- if (dat) {
- MSN_StoreCreateDocument(dat->szName, dat->szMimeType, szEncBuf);
- MSN_StoreCreateRelationships();
- }
-
- MSN_StoreUpdateProfile(nullptr, nullptr, 0);
- }
-
- MSN_ABUpdateDynamicItem();
-
- if (dat) {
- mir_free(dat->szName);
- mir_free(dat->data);
- mir_free(dat);
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// msn_storeProfileThread - update our own avatar on the server
-
-void CMsnProto::msn_storeProfileThread(void* param)
-{
- DBVARIANT dbv;
- char *szNick = nullptr;
- bool needFree = false;
- if (!getStringUtf("Nick", &dbv)) {
- szNick = dbv.pszVal[0] ? dbv.pszVal : nullptr;
- needFree = true;
- }
-
- char** msgptr = GetStatusMsgLoc(m_iStatus);
- char *szStatus = msgptr ? *msgptr : nullptr;
-
- if (param || (msnLastStatusMsg != szStatus && (msnLastStatusMsg && szStatus && mir_strcmp(msnLastStatusMsg, szStatus))))
- if (MSN_StoreUpdateProfile(szNick, szStatus, false))
- MSN_ABUpdateDynamicItem();
-
- if (needFree) db_free(&dbv);
-}
diff --git a/protocols/MSN/src/msn_ssl.cpp b/protocols/MSN/src/msn_ssl.cpp
deleted file mode 100644
index fadba88791..0000000000
--- a/protocols/MSN/src/msn_ssl.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-char* CMsnProto::getSslResult(char** parUrl, const char* parAuthInfo, const char* hdrs, unsigned& status)
-{
- mHttpsTS = clock();
-
- char* result = nullptr;
- NETLIBHTTPREQUEST nlhr = { 0 };
-
- // initialize the netlib request
- nlhr.cbSize = sizeof(nlhr);
- nlhr.requestType = REQUEST_POST;
- nlhr.flags = NLHRF_HTTP11 | NLHRF_DUMPASTEXT | NLHRF_PERSISTENT | NLHRF_REDIRECT;
- nlhr.szUrl = *parUrl;
- nlhr.dataLength = (int)mir_strlen(parAuthInfo);
- nlhr.pData = (char*)parAuthInfo;
- nlhr.nlc = hHttpsConnection;
-
-#ifndef _DEBUG
- if (strstr(*parUrl, "login")) nlhr.flags |= NLHRF_NODUMPSEND;
-#endif
-
- nlhr.headersCount = 4;
- nlhr.headers = (NETLIBHTTPHEADER*)alloca(sizeof(NETLIBHTTPHEADER) * (nlhr.headersCount + 5));
- nlhr.headers[0].szName = "User-Agent";
- nlhr.headers[0].szValue = (char*)MSN_USER_AGENT;
- nlhr.headers[1].szName = "Accept";
- nlhr.headers[1].szValue = "text/*";
- nlhr.headers[2].szName = "Content-Type";
- nlhr.headers[2].szValue = "text/xml; charset=utf-8";
- nlhr.headers[3].szName = "Cache-Control";
- nlhr.headers[3].szValue = "no-cache";
-
- if (hdrs) {
- unsigned count = 0;
- char* hdrprs = NEWSTR_ALLOCA(hdrs);
- for (;;) {
- char* fnd = strchr(hdrprs, ':');
- if (fnd == nullptr) break;
- *fnd = 0;
- fnd += 2;
-
- nlhr.headers[nlhr.headersCount].szName = hdrprs;
- nlhr.headers[nlhr.headersCount].szValue = fnd;
-
- fnd = strchr(fnd, '\r');
- if (fnd == nullptr) break;
- *fnd = 0;
- hdrprs = fnd + 2;
- ++nlhr.headersCount;
- if (++count >= 5) break;
- }
- }
-
- // download the page
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- if (nlhrReply) {
- hHttpsConnection = nlhrReply->nlc;
- status = nlhrReply->resultCode;
-
- if (nlhrReply->szUrl) {
- mir_free(*parUrl);
- *parUrl = nlhrReply->szUrl;
- nlhrReply->szUrl = nullptr;
- }
-
- result = nlhrReply->pData;
-
- nlhrReply->dataLength = 0;
- nlhrReply->pData = nullptr;
- }
- else hHttpsConnection = nullptr;
-
- mHttpsTS = clock();
-
- return result;
-}
-
-bool CMsnProto::getMyAvatarFile(char *url, wchar_t *fname)
-{
- // initialize the netlib request
- NETLIBHTTPREQUEST nlhr = {};
- nlhr.cbSize = sizeof(nlhr);
- nlhr.requestType = REQUEST_GET;
- nlhr.flags = NLHRF_HTTP11 | NLHRF_REDIRECT;
- nlhr.szUrl = url;
- nlhr.headersCount = 1;
- nlhr.headers = (NETLIBHTTPHEADER*)alloca(sizeof(NETLIBHTTPHEADER) * nlhr.headersCount);
- nlhr.headers[0].szName = "User-Agent";
- nlhr.headers[0].szValue = (char*)MSN_USER_AGENT;
-
- // download the page
- NLHR_PTR nlhrReply(Netlib_HttpTransaction(m_hNetlibUser, &nlhr));
- if (nlhrReply) {
- if (nlhrReply->resultCode == 200 && nlhrReply->dataLength) {
- MSN_SetMyAvatar(fname, nlhrReply->pData, nlhrReply->dataLength);
- return true;
- }
- }
- return false;
-}
diff --git a/protocols/MSN/src/msn_std.cpp b/protocols/MSN/src/msn_std.cpp
deleted file mode 100644
index fde1b41e09..0000000000
--- a/protocols/MSN/src/msn_std.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Standard functions
-
-int CMsnProto::getStringUtf(MCONTACT hContact, const char *name, DBVARIANT *result)
-{
- return db_get_utf(hContact, m_szModuleName, name, result);
-}
-
-int CMsnProto::getStringUtf(const char *name, DBVARIANT *result)
-{
- return db_get_utf(NULL, m_szModuleName, name, result);
-}
-
-void CMsnProto::setStringUtf(MCONTACT hContact, const char *name, const char *value)
-{
- db_set_utf(hContact, m_szModuleName, name, value);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-wchar_t* CMsnProto::GetContactNameT(MCONTACT hContact)
-{
- if (hContact)
- return (wchar_t*)Clist_GetContactDisplayName(hContact);
-
- wchar_t *str = Contact_GetInfo(CNF_DISPLAY, NULL, m_szModuleName);
- if (str != nullptr) {
- mir_free(m_DisplayNameCache);
- return m_DisplayNameCache = str;
- }
-
- return L"Me";
-}
-
-unsigned MSN_GenRandom(void)
-{
- unsigned rndnum;
- Utils_GetRandom(&rndnum, sizeof(rndnum));
- return rndnum & 0x7FFFFFFF;
-}
diff --git a/protocols/MSN/src/msn_svcs.cpp b/protocols/MSN/src/msn_svcs.cpp
deleted file mode 100644
index 9c20fd7c50..0000000000
--- a/protocols/MSN/src/msn_svcs.cpp
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-extern int avsPresent;
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// GetMyAwayMsg - obtain the current away message
-
-INT_PTR CMsnProto::GetMyAwayMsg(WPARAM wParam, LPARAM lParam)
-{
- char** msgptr = GetStatusMsgLoc(wParam ? wParam : m_iStatus);
- if (msgptr == nullptr) return 0;
-
- return (lParam & SGMA_UNICODE) ? (INT_PTR)mir_utf8decodeW(*msgptr) : (INT_PTR)mir_utf8decodeA(*msgptr);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnGetAvatar - retrieves the file name of my own avatar
-
-INT_PTR CMsnProto::GetAvatar(WPARAM wParam, LPARAM lParam)
-{
- wchar_t* buf = (wchar_t*)wParam;
- int size = (int)lParam;
-
- if (buf == nullptr || size <= 0)
- return -1;
-
- MSN_GetAvatarFileName(NULL, buf, size, nullptr);
- return _waccess(buf, 0);
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnGetAvatarInfo - retrieve the avatar info
-
-INT_PTR CMsnProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
-{
- PROTO_AVATAR_INFORMATION *pai = (PROTO_AVATAR_INFORMATION*)lParam;
- wchar_t filename[MAX_PATH];
- MsnContact *cont = nullptr;
-
- if (pai->hContact) {
- cont = Lists_Get(pai->hContact);
- if (cont == nullptr)
- return GAIR_NOAVATAR;
-
- /*
- if ((cont->cap1 & 0xf0000000) == 0)
- return GAIR_NOAVATAR;
- */
- }
-
- if (pai->hContact == NULL || _stricmp(cont->email, MyOptions.szEmail) == 0) {
- MSN_GetAvatarFileName(NULL, filename, _countof(filename), nullptr);
- pai->format = ProtoGetAvatarFormat(filename);
- if (pai->format != PA_FORMAT_UNKNOWN)
- mir_wstrcpy(pai->filename, filename);
- return pai->format == PA_FORMAT_UNKNOWN ? GAIR_NOAVATAR : GAIR_SUCCESS;
- }
-
- char *szContext;
- DBVARIANT dbv;
- if (getString(pai->hContact, pai->hContact ? "PictContext" : "PictObject", &dbv) == 0) {
- szContext = (char*)NEWSTR_ALLOCA(dbv.pszVal);
- db_free(&dbv);
- }
- else return GAIR_NOAVATAR;
-
- MSN_GetAvatarFileName(pai->hContact, filename, _countof(filename), nullptr);
- pai->format = ProtoGetAvatarFormat(filename);
-
- if (pai->format != PA_FORMAT_UNKNOWN) {
- bool needupdate = true;
- if (getString(pai->hContact, "PictSavedContext", &dbv) == 0) {
- needupdate = mir_strcmp(dbv.pszVal, szContext) != 0;
- db_free(&dbv);
- }
-
- if (needupdate) {
- setString(pai->hContact, "PictSavedContext", szContext);
-
- // Store also avatar hash
- char* szAvatarHash = MSN_GetAvatarHash(szContext);
- if (szAvatarHash != nullptr) {
- setString(pai->hContact, "AvatarSavedHash", szAvatarHash);
- mir_free(szAvatarHash);
- }
- }
- mir_wstrcpy(pai->filename, filename);
- return GAIR_SUCCESS;
- }
-
- if ((wParam & GAIF_FORCE) != 0 && pai->hContact != NULL) {
- if (avsPresent < 0) avsPresent = ServiceExists(MS_AV_SETMYAVATARW) != 0;
- if (!avsPresent)
- return GAIR_NOAVATAR;
-
- WORD wStatus = getWord(pai->hContact, "Status", ID_STATUS_OFFLINE);
- if (wStatus == ID_STATUS_OFFLINE) {
- delSetting(pai->hContact, "AvatarHash");
- ProtoBroadcastAck(pai->hContact, ACKTYPE_AVATAR, ACKRESULT_FAILED, pai);
- }
- else if (!getString(pai->hContact, "AvatarUrl", &dbv)) {
- pushAvatarRequest(pai->hContact, dbv.pszVal);
- db_free(&dbv);
- }
- return GAIR_WAITFOR;
- }
- return GAIR_NOAVATAR;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnGetAvatarCaps - retrieves avatar capabilities
-
-INT_PTR CMsnProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam)
-{
- int res = 0;
-
- switch (wParam) {
- case AF_MAXSIZE:
- ((POINT*)lParam)->x = 96;
- ((POINT*)lParam)->y = 96;
- break;
-
- case AF_FORMATSUPPORTED:
- res = lParam == PA_FORMAT_PNG || lParam == PA_FORMAT_GIF || lParam == PA_FORMAT_JPEG;
- break;
-
- case AF_ENABLED:
- res = 1;
- break;
- }
-
- return res;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnSetAvatar - sets an avatar without UI
-
-INT_PTR CMsnProto::SetAvatar(WPARAM, LPARAM lParam)
-{
- wchar_t* szFileName = (wchar_t*)lParam;
-
- wchar_t tFileName[MAX_PATH];
- MSN_GetAvatarFileName(NULL, tFileName, _countof(tFileName), nullptr);
- _wremove(tFileName);
-
- if (szFileName == nullptr) {
- delSetting("PictObject");
- delSetting("AvatarHash");
- ForkThread(&CMsnProto::msn_storeAvatarThread, nullptr);
- }
- else {
- int fileId = _wopen(szFileName, _O_RDONLY | _O_BINARY, _S_IREAD);
- if (fileId < 0) return 1;
-
- size_t dwPngSize = _filelengthi64(fileId);
- unsigned char* pData = (unsigned char*)mir_alloc(dwPngSize);
- if (pData == nullptr) {
- _close(fileId);
- return 2;
- }
-
- _read(fileId, pData, (unsigned)dwPngSize);
- _close(fileId);
-
- wchar_t drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT];
- _wsplitpath(szFileName, drive, dir, fname, ext);
-
- MSN_SetMyAvatar(fname, pData, dwPngSize);
-
- StoreAvatarData* par = (StoreAvatarData*)mir_alloc(sizeof(StoreAvatarData));
- par->szName = mir_wstrdup(fname);
- par->data = pData;
- par->dataSize = dwPngSize;
- par->szMimeType = "image/png";
-
- ForkThread(&CMsnProto::msn_storeAvatarThread, par);
- }
-
- MSN_SetServerStatus(m_iStatus);
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// SetNickname - sets a nick name without UI
-
-INT_PTR CMsnProto::SetNickName(WPARAM wParam, LPARAM lParam)
-{
- if (wParam & SMNN_UNICODE)
- MSN_SendNickname((wchar_t*)lParam);
- else
- MSN_SendNickname((char*)lParam);
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnSendNudge - Sending a nudge
-
-INT_PTR CMsnProto::SendNudge(WPARAM hContact, LPARAM)
-{
- if (!msnLoggedIn) return 0;
-
- char tEmail[MSN_MAX_EMAIL_LEN];
- if (MSN_IsMeByContact(hContact, tEmail)) return 0;
-
- int netId = Lists_GetNetId(tEmail);
- msnNsThread->sendMessage('3', tEmail, netId, "", MSG_NUDGE);
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnContactDeleted - called when a contact is deleted from list
-
-void CMsnProto::OnContactDeleted(MCONTACT hContact)
-{
- if (!msnLoggedIn) //should never happen for MSN contacts
- return;
-
- if (isChatRoom(hContact)) {
- DBVARIANT dbv;
- if (!getWString(hContact, "ChatRoomID", &dbv)) {
- MSN_KillChatSession(dbv.pwszVal);
- db_free(&dbv);
- }
- }
- else {
- char szEmail[MSN_MAX_EMAIL_LEN];
- if (MSN_IsMeByContact(hContact, szEmail))
- g_clistApi.pfnRemoveEvent(hContact, 1);
-
- if (szEmail[0]) {
- debugLogA("Deleted Handler Email");
-
- if (Lists_IsInList(LIST_FL, szEmail)) {
- DeleteParam param = { this, MCONTACT(hContact) };
- DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_DELETECONTACT), nullptr, DlgDeleteContactUI, (LPARAM)&param);
-
- MsnContact *msc = Lists_Get(szEmail);
- if (msc)
- msc->hContact = NULL;
- }
-
- if (Lists_IsInList(LIST_LL, szEmail))
- MSN_AddUser(hContact, szEmail, 0, LIST_LL | LIST_REMOVE);
- }
- }
-}
-
-
-int CMsnProto::OnGroupChange(WPARAM hContact, LPARAM lParam)
-{
- if (!msnLoggedIn || !MyOptions.ManageServer) return 0;
-
- const CLISTGROUPCHANGE* grpchg = (CLISTGROUPCHANGE*)lParam;
-
- if (hContact == NULL) {
- if (grpchg->pszNewName == nullptr && grpchg->pszOldName != nullptr) {
- LPCSTR szId = MSN_GetGroupByName(UTF8(grpchg->pszOldName));
- if (szId != nullptr)
- MSN_DeleteServerGroup(szId);
- }
- else if (grpchg->pszNewName != nullptr && grpchg->pszOldName != nullptr) {
- LPCSTR szId = MSN_GetGroupByName(UTF8(grpchg->pszOldName));
- if (szId != nullptr)
- MSN_RenameServerGroup(szId, UTF8(grpchg->pszNewName));
- }
- }
- else {
- if (MSN_IsMyContact(hContact))
- MSN_MoveContactToGroup(hContact, T2Utf(grpchg->pszNewName));
- }
- return 0;
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnDbSettingChanged - look for contact's settings changes
-
-int CMsnProto::OnDbSettingChanged(WPARAM hContact, LPARAM lParam)
-{
- DBCONTACTWRITESETTING* cws = (DBCONTACTWRITESETTING*)lParam;
-
- if (!msnLoggedIn || MyOptions.netId != NETID_MSN)
- return 0;
-
- if (hContact == NULL) {
- if (MyOptions.SlowSend && strcmp(cws->szSetting, "MessageTimeout") == 0 &&
- (strcmp(cws->szModule, "SRMM") == 0 || strcmp(cws->szModule, "SRMsg") == 0)) {
- if (cws->value.dVal < 60000)
- MessageBox(nullptr, TranslateT("MSN requires message send timeout in your Message window plugin to be not less then 60 sec. Please correct the timeout value."),
- TranslateT("MSN Protocol"), MB_OK | MB_ICONINFORMATION);
- }
- return 0;
- }
-
- if (!strcmp(cws->szSetting, "ApparentMode")) {
- char tEmail[MSN_MAX_EMAIL_LEN];
- if (!db_get_static(hContact, m_szModuleName, "wlid", tEmail, sizeof(tEmail)) ||
- !db_get_static(hContact, m_szModuleName, "e-mail", tEmail, sizeof(tEmail))) {
- bool isBlocked = Lists_IsInList(LIST_BL, tEmail);
-
- if (isBlocked && (cws->value.type == DBVT_DELETED || cws->value.wVal == 0)) {
- MSN_AddUser(hContact, tEmail, 0, LIST_BL + LIST_REMOVE);
- MSN_AddUser(hContact, tEmail, 0, LIST_AL);
- }
- else if (!isBlocked && cws->value.wVal == ID_STATUS_OFFLINE) {
- MSN_AddUser(hContact, tEmail, 0, LIST_AL + LIST_REMOVE);
- MSN_AddUser(hContact, tEmail, 0, LIST_BL);
- }
- }
- }
-
- if (!strcmp(cws->szSetting, "MyHandle") && !strcmp(cws->szModule, "CList")) {
- bool isMe = MSN_IsMeByContact(hContact);
- if (!isMe || !nickChg) {
- char szContactID[100];
- if (!db_get_static(hContact, m_szModuleName, "ID", szContactID, sizeof(szContactID))) {
- if (cws->value.type != DBVT_DELETED) {
- if (cws->value.type == DBVT_UTF8)
- MSN_ABUpdateNick(cws->value.pszVal, szContactID);
- else
- MSN_ABUpdateNick(UTF8(cws->value.pszVal), szContactID);
- }
- else MSN_ABUpdateNick(nullptr, szContactID);
- }
-
- if (isMe)
- displayEmailCount(hContact);
- }
- }
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// OnIdleChanged - transitions to Idle
-
-int CMsnProto::OnIdleChanged(WPARAM, LPARAM lParam)
-{
- if (m_iStatus == ID_STATUS_INVISIBLE || m_iStatus <= ID_STATUS_OFFLINE)
- return 0;
-
- bool bIdle = (lParam & IDF_ISIDLE) != 0;
- bool bPrivacy = (lParam & IDF_PRIVACY) != 0;
-
- if (isIdle && !bIdle) {
- isIdle = false;
- MSN_SetServerStatus(m_iDesiredStatus);
- }
- else if (!isIdle && bIdle && !bPrivacy && m_iDesiredStatus != ID_STATUS_AWAY) {
- isIdle = true;
- MSN_SetServerStatus(ID_STATUS_IDLE);
- }
-
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// OnWindowEvent - creates session on window open
-
-int CMsnProto::OnWindowPopup(WPARAM, LPARAM lParam)
-{
- MessageWindowPopupData *mwpd = (MessageWindowPopupData *)lParam;
- if (!MSN_IsMyContact(mwpd->hContact) || isChatRoom(mwpd->hContact))
- return 0;
-
- switch (mwpd->uType) {
- case MSG_WINDOWPOPUP_SHOWING:
- AppendMenu(mwpd->hMenu, MF_STRING, 13465, TranslateT("Convert to Chat"));
- break;
-
- case MSG_WINDOWPOPUP_SELECTED:
- if (mwpd->selection == 13465)
- DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_CHATROOM_INVITE), nullptr, DlgInviteToChat, LPARAM(new InviteChatParam(nullptr, mwpd->hContact, this)));
- break;
- }
-
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MsnGetUnread - returns the actual number of unread emails in the INBOX
-
-INT_PTR CMsnProto::GetUnreadEmailCount(WPARAM, LPARAM)
-{
- if (!msnLoggedIn)
- return 0;
- return mUnreadMessages;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// OnLeaveChat - closes MSN chat window
-
-INT_PTR CMsnProto::OnLeaveChat(WPARAM hContact, LPARAM)
-{
- if (isChatRoom(hContact) != 0) {
- DBVARIANT dbv;
- if (getWString(hContact, "ChatRoomID", &dbv) == 0) {
- MSN_KillChatSession(dbv.pwszVal);
- db_free(&dbv);
- }
- }
- return 0;
-}
diff --git a/protocols/MSN/src/msn_threads.cpp b/protocols/MSN/src/msn_threads.cpp
deleted file mode 100644
index 0e04201d26..0000000000
--- a/protocols/MSN/src/msn_threads.cpp
+++ /dev/null
@@ -1,500 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Keep-alive thread for the main connection
-
-void __cdecl CMsnProto::msn_keepAliveThread(void*)
-{
- bool keepFlag = true;
-
- hKeepAliveThreadEvt = CreateEvent(nullptr, FALSE, FALSE, nullptr);
-
- msnPingTimeout = 45;
-
- while (keepFlag) {
- switch (WaitForSingleObject(hKeepAliveThreadEvt, msnPingTimeout * 1000)) {
- case WAIT_TIMEOUT:
- keepFlag = msnNsThread != nullptr;
- msnPingTimeout = 20;
-
- if (msnNsThread) {
- if (lastMsgId)
- keepFlag = msnNsThread->sendPacketPayload("PNG", "CON", "\bLast-Msg-Id: %I64u\r\n\r\n", lastMsgId);
- else if (msnRegistration)
- keepFlag = msnNsThread->sendPacketPayload("PNG", "CON", "\b\r\n");
- else
- keepFlag = msnNsThread->sendPacket("PNG", "CON 0");
- }
-
- if (hHttpsConnection && (clock() - mHttpsTS) > 60 * CLOCKS_PER_SEC) {
- HNETLIBCONN hConn = hHttpsConnection;
- hHttpsConnection = nullptr;
- Netlib_Shutdown(hConn);
- }
-
- if (mStatusMsgTS && (clock() - mStatusMsgTS) > 60 * CLOCKS_PER_SEC) {
- mStatusMsgTS = 0;
- ForkThread(&CMsnProto::msn_storeProfileThread, nullptr);
- }
- if (keepFlag && MyOptions.netId != NETID_SKYPE && MSN_RefreshOAuthTokens(true))
- ForkThread(&CMsnProto::msn_refreshOAuthThread, msnNsThread);
- break;
-
- case WAIT_OBJECT_0:
- keepFlag = msnPingTimeout > 0;
- break;
-
- default:
- keepFlag = false;
- break;
- }
- }
-
- CloseHandle(hKeepAliveThreadEvt); hKeepAliveThreadEvt = nullptr;
- debugLogA("Closing keep-alive thread");
-}
-
-void __cdecl CMsnProto::msn_loginThread(void*)
-{
- MSN_RefreshContactList();
- MSN_FetchRecentMessages();
-}
-
-void __cdecl CMsnProto::msn_refreshOAuthThread(void *param)
-{
- if (MSN_RefreshOAuthTokens(false) > 0) {
- bIgnoreATH = true;
- MSN_SendATH((ThreadData*)param);
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN server thread - read and process commands from a server
-
-static bool ReallocInfoBuffer(ThreadData *info, size_t mDataSize)
-{
- char *mData = (char*)mir_realloc(info->mData, mDataSize + 1);
- if (mData == nullptr)
- return false;
-
- info->mData = mData;
- info->mDataSize = mDataSize;
- ZeroMemory(&mData[info->mBytesInData], info->mDataSize - info->mBytesInData + 1);
- return true;
-}
-
-void __cdecl CMsnProto::MSNServerThread(void* arg)
-{
- ThreadData* info = (ThreadData*)arg;
- if (info->mIsMainThread)
- isConnectSuccess = false;
-
- int tPortNumber = -1;
- {
- char* tPortDelim = strrchr(info->mServer, ':');
- if (tPortDelim != nullptr) {
- *tPortDelim = '\0';
- if ((tPortNumber = atoi(tPortDelim + 1)) == 0)
- tPortNumber = -1;
- }
- }
-
- if (info->mServer[0] == 0 && db_get_static(NULL, m_szModuleName, "DirectServer", info->mServer, sizeof(info->mServer)))
- mir_strcpy(info->mServer, MSN_DEFAULT_LOGIN_SERVER);
-
- NETLIBOPENCONNECTION tConn = { 0 };
- tConn.flags = NLOCF_V2;
- tConn.timeout = 5;
- tConn.flags = NLOCF_SSL;
- tConn.szHost = info->mServer;
- tConn.wPort = MSN_DEFAULT_PORT;
-
- if (tPortNumber != -1)
- tConn.wPort = (WORD)tPortNumber;
-
- debugLogA("Thread started: server='%s:%d', type=%d", tConn.szHost, tConn.wPort, info->mType);
-
- info->s = Netlib_OpenConnection(m_hNetlibUser, &tConn);
- if (info->s == nullptr) {
- debugLogA("Connection Failed (%d) server='%s:%d'", WSAGetLastError(), tConn.szHost, tConn.wPort);
-
- switch (info->mType) {
- case SERVER_NOTIFICATION:
- goto LBL_Exit;
- break;
- }
- return;
- }
-
- debugLogA("Connected with handle=%08X", info->s);
-
- if (info->mType == SERVER_NOTIFICATION)
- info->sendPacketPayload("CNT", "CON", "<connect>%s%s%s<ver>2</ver><agent><os>winnt</os><osVer>5.2</osVer><proc>x86</proc><lcid>en-us</lcid></agent></connect>\r\n",
- *info->mState ? "<xfr><state>" : "", *info->mState ? info->mState : "", *info->mState ? "</state></xfr>" : "");
-
- if (info->mIsMainThread)
- msnNsThread = info;
-
- debugLogA("Entering main recv loop");
- info->mBytesInData = 0;
- for (;;) {
- int recvResult = info->recv(info->mData + info->mBytesInData, info->mDataSize - info->mBytesInData);
- if (recvResult == SOCKET_ERROR) {
- debugLogA("Connection %08p [%08X] was abortively closed", info->s, GetCurrentThreadId());
- break;
- }
-
- if (!recvResult) {
- debugLogA("Connection %08p [%08X] was gracefully closed", info->s, GetCurrentThreadId());
- break;
- }
-
- info->mBytesInData += recvResult;
-
- for (;;) {
- char* peol = strchr(info->mData, '\r');
- if (peol == nullptr)
- break;
-
- int msgLen = (int)(peol - info->mData);
- if (info->mBytesInData < msgLen + 2)
- break; //wait for full line end
-
- char msg[1024];
- strncpy_s(msg, info->mData, msgLen);
-
- if (*++peol != '\n')
- debugLogA("Dodgy line ending to command: ignoring");
- else
- peol++;
-
- info->mBytesInData -= peol - info->mData;
- memmove(info->mData, peol, info->mBytesInData);
- debugLogA("RECV: %s", msg);
-
- if (!isalnum(msg[0]) || !isalnum(msg[1]) || !isalnum(msg[2]) || (msg[3] && msg[3] != ' ')) {
- debugLogA("Invalid command name");
- continue;
- }
-
- int handlerResult;
- if (isdigit(msg[0]) && isdigit(msg[1]) && isdigit(msg[2])) //all error messages
- handlerResult = MSN_HandleErrors(info, msg);
- else
- handlerResult = MSN_HandleCommands(info, msg);
-
- if (handlerResult) {
- if (info->sessionClosed) goto LBL_Exit;
- info->sendTerminate();
- }
- }
-
- if (info->mBytesInData == info->mDataSize) {
- if (!ReallocInfoBuffer(info, info->mDataSize * 2)) {
- debugLogA("sizeof(data) is too small: the longest line won't fit");
- break;
- }
- }
- }
-
-LBL_Exit:
- if (info->mIsMainThread) {
- msnNsThread = nullptr;
-
- if (hKeepAliveThreadEvt) {
- msnPingTimeout *= -1;
- SetEvent(hKeepAliveThreadEvt);
- }
-
- if (info->s == nullptr)
- ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, nullptr, LOGINERR_NONETWORK);
- else
- MSN_CloseConnections();
-
- if (hHttpsConnection) {
- Netlib_CloseHandle(hHttpsConnection);
- hHttpsConnection = nullptr;
- }
-
- MSN_GoOffline();
- }
-
- debugLogA("Thread [%08X] ending now", GetCurrentThreadId());
-}
-
-void CMsnProto::MSN_CloseConnections(void)
-{
- mir_cslockfull lck(m_csThreads);
-
- NETLIBSELECTEX nls = {};
-
- for (auto &it : m_arThreads) {
- switch (it->mType) {
- case SERVER_NOTIFICATION:
- if (it->s != nullptr && !it->sessionClosed && !it->termPending) {
- nls.hReadConns[0] = it->s;
- int res = Netlib_SelectEx(&nls);
- if (res >= 0 || nls.hReadStatus[0] == 0)
- it->sendTerminate();
- }
- break;
- }
- }
-
- lck.unlock();
-
- if (hHttpsConnection)
- Netlib_Shutdown(hHttpsConnection);
-}
-
-void CMsnProto::Threads_Uninit(void)
-{
- mir_cslock lck(m_csThreads);
- m_arThreads.destroy();
-}
-
-GCThreadData* CMsnProto::MSN_GetThreadByChatId(const wchar_t* chatId)
-{
- if (mir_wstrlen(chatId) == 0)
- return nullptr;
-
- mir_cslock lck(m_csThreads);
- for (auto &it : m_arGCThreads)
- if (mir_wstrcmpi(it->mChatID, chatId) == 0)
- return it;
-
- return nullptr;
-}
-
-ThreadData* CMsnProto::MSN_GetThreadByConnection(HANDLE s)
-{
- mir_cslock lck(m_csThreads);
-
- for (auto &it : m_arThreads)
- if (it->s == s)
- return it;
-
- return nullptr;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// class ThreadData members
-
-ThreadData::ThreadData()
-{
- memset(&mInitialContactWLID, 0, sizeof(ThreadData) - 2 * sizeof(STRLIST));
- resetTimeout();
- hWaitEvent = CreateSemaphore(nullptr, 0, MSN_PACKETS_COMBINE, nullptr);
- mData = (char*)mir_calloc((mDataSize = 8192) + 1);
-}
-
-ThreadData::~ThreadData()
-{
- if (s != nullptr) {
- proto->debugLogA("Closing connection handle %08X", s);
- Netlib_CloseHandle(s);
- }
-
- if (mIncomingBoundPort != nullptr) {
- Netlib_CloseHandle(mIncomingBoundPort);
- }
-
- if (mMsnFtp != nullptr) {
- delete mMsnFtp;
- mMsnFtp = nullptr;
- }
-
- if (hWaitEvent != INVALID_HANDLE_VALUE)
- CloseHandle(hWaitEvent);
-
- if (mTimerId != 0)
- KillTimer(nullptr, mTimerId);
-
- mJoinedContactsWLID.destroy();
- mJoinedIdentContactsWLID.destroy();
-
- mir_free(mInitialContactWLID); mInitialContactWLID = nullptr;
- mir_free(mData);
-}
-
-void ThreadData::applyGatewayData(HNETLIBCONN hConn, bool isPoll)
-{
- char szHttpPostUrl[300];
- getGatewayUrl(szHttpPostUrl, sizeof(szHttpPostUrl), isPoll);
-
- proto->debugLogA("applying '%s' to %08X [%08X]", szHttpPostUrl, this, GetCurrentThreadId());
-
- NETLIBHTTPPROXYINFO nlhpi = {};
- nlhpi.flags = NLHPIF_HTTP11;
- nlhpi.szHttpGetUrl = nullptr;
- nlhpi.szHttpPostUrl = szHttpPostUrl;
- nlhpi.combinePackets = 5;
- Netlib_SetHttpProxyInfo(hConn, &nlhpi);
-}
-
-MCONTACT ThreadData::getContactHandle(void)
-{
- return mJoinedContactsWLID.getCount() ? proto->MSN_HContactFromEmail(mJoinedContactsWLID[0]) : NULL;
-}
-
-void ThreadData::getGatewayUrl(char* dest, int destlen, bool isPoll)
-{
- static const char openFmtStr[] = "http://%s/gateway/gateway.dll?Action=open&Server=%s&IP=%s";
- static const char pollFmtStr[] = "http://%s/gateway/gateway.dll?Action=poll&SessionID=%s";
- static const char cmdFmtStr[] = "http://%s/gateway/gateway.dll?SessionID=%s";
-
- if (mSessionID[0] == 0) {
- const char* svr = mType == SERVER_NOTIFICATION ? "NS" : "SB";
- mir_snprintf(dest, destlen, openFmtStr, mGatewayIP, svr, mServer);
- }
- else mir_snprintf(dest, destlen, isPoll ? pollFmtStr : cmdFmtStr, mGatewayIP, mSessionID);
-}
-
-void ThreadData::processSessionData(const char* xMsgr, const char* xHost)
-{
- char tSessionID[40], tGateIP[80];
-
- char* tDelim = (char*)strchr(xMsgr, ';');
- if (tDelim == nullptr)
- return;
-
- *tDelim = 0; tDelim += 2;
-
- if (!sscanf(xMsgr, "SessionID=%s", tSessionID))
- return;
-
- char* tDelim2 = strchr(tDelim, ';');
- if (tDelim2 != nullptr)
- *tDelim2 = '\0';
- if (xHost)
- mir_strcpy(tGateIP, xHost);
- else if (!sscanf(tDelim, "GW-IP=%s", tGateIP))
- return;
-
- mir_strcpy(mGatewayIP, tGateIP);
- if (gatewayType) mir_strcpy(mServer, tGateIP);
- mir_strcpy(mSessionID, tSessionID);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// thread start code
-/////////////////////////////////////////////////////////////////////////////////////////
-
-void __cdecl CMsnProto::ThreadStub(void* arg)
-{
- ThreadData* info = (ThreadData*)arg;
-
- debugLogA("Starting thread %08X (%08X)", GetCurrentThreadId(), info->mFunc);
-
- (this->*(info->mFunc))(info);
-
- debugLogA("Leaving thread %08X (%08X)", GetCurrentThreadId(), info->mFunc);
- {
- mir_cslock lck(m_csThreads);
- m_arThreads.remove(info);
- }
-}
-
-void ThreadData::startThread(MsnThreadFunc parFunc, CMsnProto *prt)
-{
- mFunc = parFunc;
- proto = prt;
- {
- mir_cslock lck(prt->m_csThreads);
- proto->m_arThreads.insert(this);
- }
- proto->ForkThread(&CMsnProto::ThreadStub, this);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// HReadBuffer members
-
-HReadBuffer::HReadBuffer(ThreadData *T, int iStart)
-{
- owner = T;
- buffer = (BYTE*)T->mData;
- totalDataSize = T->mBytesInData;
- startOffset = iStart;
-}
-
-HReadBuffer::~HReadBuffer()
-{
- if (totalDataSize > startOffset) {
- memmove(buffer, buffer + startOffset, (totalDataSize -= startOffset));
- owner->mBytesInData = (int)totalDataSize;
- }
- else owner->mBytesInData = 0;
-
- buffer[owner->mBytesInData] = 0;
-}
-
-BYTE* HReadBuffer::surelyRead(size_t parBytes)
-{
- if ((startOffset + parBytes) > owner->mDataSize) {
- if (totalDataSize > startOffset)
- memmove(buffer, buffer + startOffset, (totalDataSize -= startOffset));
- else
- totalDataSize = 0;
-
- startOffset = 0;
-
- if (parBytes > owner->mDataSize) {
- size_t mDataSize = owner->mDataSize;
- while (parBytes > mDataSize) mDataSize *= 2;
- if (!ReallocInfoBuffer(owner, mDataSize)) {
- owner->proto->debugLogA("HReadBuffer::surelyRead: not enough memory, %d %d %d", parBytes, owner->mDataSize, startOffset);
- return nullptr;
- }
- buffer = (BYTE*)owner->mData;
- }
- }
-
- while ((startOffset + parBytes) > totalDataSize) {
- int recvResult = owner->recv((char*)buffer + totalDataSize, owner->mDataSize - totalDataSize);
-
- if (recvResult <= 0)
- return nullptr;
-
- totalDataSize += recvResult;
- }
-
- BYTE *result = buffer + startOffset; startOffset += parBytes;
- buffer[totalDataSize] = 0;
- return result;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// class GCThreadData members
-
-GCThreadData::GCThreadData() :
- mJoinedContacts(10, PtrKeySortT)
-{
- memset(&mCreator, 0, sizeof(GCThreadData) - sizeof(mJoinedContacts));
-}
-
-GCThreadData::~GCThreadData()
-{
-}
diff --git a/protocols/MSN/src/msn_ws.cpp b/protocols/MSN/src/msn_ws.cpp
deleted file mode 100644
index 1b06316a44..0000000000
--- a/protocols/MSN/src/msn_ws.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2012 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h"
-#include "msn_proto.h"
-
-//=======================================================================================
-
-int ThreadData::send(const char data[], size_t datalen)
-{
- resetTimeout();
-
- int rlen = Netlib_Send(s, data, (int)datalen);
- if (rlen == SOCKET_ERROR) {
- // should really also check if sendlen is the same as datalen
- proto->debugLogA("Send failed: %d", WSAGetLastError());
- return FALSE;
- }
-
- return TRUE;
-}
-
-void ThreadData::resetTimeout(bool term)
-{
- int timeout = term ? 10 : mIsMainThread ? 65 : 120;
- mWaitPeriod = clock() + timeout * CLOCKS_PER_SEC;
-}
-
-bool ThreadData::isTimeout(void)
-{
- if (mWaitPeriod >= clock())
- return false;
-
- bool res = false;
- if (mIsMainThread)
- res = true;
- else if (mJoinedContactsWLID.getCount() <= 1 || mChatID[0] == 0)
- res = true;
-
- if (res) {
- proto->debugLogA("Dropping the idle p2p due to inactivity");
- if (termPending)
- return true;
- }
- else resetTimeout();
-
- return false;
-}
-
-int ThreadData::recv(char* data, size_t datalen)
-{
- resetTimeout();
-
- NETLIBSELECT nls = {};
- nls.dwTimeout = 1000;
- nls.hReadConns[0] = s;
-
- for (;;) {
- int ret = Netlib_Select(&nls);
- if (ret < 0) {
- proto->debugLogA("Connection abortively closed, error %d", WSAGetLastError());
- return ret;
- }
- else if (ret == 0) {
- if (isTimeout()) return 0;
- }
- else
- break;
- }
-
- int ret = Netlib_Recv(s, data, (int)datalen);
- if (ret == 0) {
- proto->debugLogA("Connection closed gracefully");
- return 0;
- }
-
- if (ret < 0) {
- proto->debugLogA("Connection abortively closed, error %d", WSAGetLastError());
- return ret;
- }
-
- return ret;
-}
diff --git a/protocols/MSN/src/resource.h b/protocols/MSN/src/resource.h
deleted file mode 100644
index 938a0124b7..0000000000
--- a/protocols/MSN/src/resource.h
+++ /dev/null
@@ -1,100 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by ..\res\msn.rc
-//
-#define IDD_CHATROOM_INVITE 40
-#define IDI_MSN 101
-#define IDD_USEROPTS 104
-#define IDD_OPT_MSN_CONN 106
-#define IDD_OPT_NOTIFY 107
-#define IDI_MSNBLOCK 108
-#define IDI_SERVICES 109
-#define IDI_INBOX 112
-#define IDI_INVITE 113
-#define IDI_NETMEETING 114
-#define IDI_PROFILE 115
-#define IDD_LISTSMGR 119
-#define IDI_LIST_FL 120
-#define IDI_LIST_AL 121
-#define IDI_LIST_BL 122
-#define IDI_LIST_RL 123
-#define IDD_CARD_GEN 133
-#define IDD_CARD_CONTACT 134
-#define IDD_ACCMGRUI 135
-#define IDD_DELETECONTACT 136
-#define IDI_LIST_LC 138
-#define IDC_MSG 158
-#define IDC_CCLIST 173
-#define IDC_EDITSCR 174
-#define IDC_ADDSCR 175
-#define IDD_OPT_MSN 185
-#define IDD_SETNICKNAME 226
-#define IDC_STMSNGROUP 1002
-#define IDC_LIST 1015
-#define IDC_ICON_FL 1016
-#define IDC_ICON_LC 1017
-#define IDC_ICON_AL 1018
-#define IDC_ICON_BL 1019
-#define IDC_PASSWORD 1020
-#define IDC_ICON_RL 1021
-#define IDC_PLACE 1021
-#define IDC_HANDLE 1022
-#define IDC_HANDLE2 1023
-#define IDC_SLOWSEND 1033
-#define IDC_MANAGEGROUPS 1034
-#define IDC_NOTIFY_ENDSESSION 1035
-#define IDC_MOBILESEND 1035
-#define IDC_HOSTOPT 1038
-#define IDC_CCARD_TAB1 1039
-#define IDC_CARD_GEN_PHONE 1043
-#define IDC_EDIT1 1043
-#define IDC_CARD_GEN_IM2 1044
-#define IDC_EDIT2 1044
-#define IDC_EDIT3 1045
-#define IDC_COMBO1 1045
-#define IDC_SENDFONTINFO 1046
-#define IDC_EDIT4 1046
-#define IDC_REMOVEHOT 1046
-#define IDC_EDIT5 1047
-#define IDC_REMOVEBLOCK 1047
-#define IDC_LISTREFRESH 1047
-#define IDC_NICKNAME 1048
-#define IDC_EDIT6 1048
-#define IDC_DISABLEHOTJUNK 1049
-#define IDC_EDIT7 1049
-#define IDC_EDIT8 1050
-#define IDC_COMBO2 1050
-#define IDC_EDIT9 1051
-#define IDC_CARD_GEN_IM3 1051
-#define IDC_EDIT10 1052
-#define IDC_COMBO3 1052
-#define IDC_NOTIFY_FIRSTMSG 1053
-#define IDC_COMBO4 1053
-#define IDC_DISABLE_ANOTHER_CONTACTS 1054
-#define IDC_CARD_GEN_IM4 1054
-#define IDC_ERRORS_USING_POPUPS 1056
-#define IDC_CARD_GEN_IM5 1056
-#define IDC_MAILER_APP 1057
-#define IDC_RUN_APP_ON_HOTMAIL 1058
-#define IDC_ENTER_MAILER_APP 1059
-#define IDC_DIRECTSERVER 1171
-#define IDC_YOURHOST 1172
-#define IDC_GATEWAYSERVER 1174
-#define IDC_DISABLEHOTMAILPOPUP 1301
-#define IDC_DISABLEHOTMAILTRAY 1302
-#define IDC_DISABLEHOTMAILCL 1303
-#define IDC_NEWMSNACCOUNTLINK 1438
-#define IDC_RESETSERVER 1472
-#define IDC_STATIC -1
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 139
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1048
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/protocols/MSN/src/skylogin/README.md b/protocols/MSN/src/skylogin/README.md
deleted file mode 100644
index 2139b870d7..0000000000
--- a/protocols/MSN/src/skylogin/README.md
+++ /dev/null
@@ -1,2 +0,0 @@
-# skylogin
-C Code to login to Skype for UIC generation needed for msnp24
diff --git a/protocols/MSN/src/skylogin/common.c b/protocols/MSN/src/skylogin/common.c
deleted file mode 100644
index 4aa14956e8..0000000000
--- a/protocols/MSN/src/skylogin/common.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Skype Login
- *
- * Based on:
- * FakeSkype : Skype reverse engineering proof-of-concept client
- * Ouanilo MEDEGAN (c) 2006 http://www.oklabs.net
- * pyskype : Skype login Python script by uunicorn
- *
- * Written by: leecher@dose.0wnz.at (c) 2015
- *
- * Module: Common stuff, especially Skype Modulus
- *
- */
-#include "common.h"
-
-char *SkypeModulus1536[] = {"c095de9e868dc9fe1de94ab5e38e8dbdcae7e6249ef147de503f3e1c76e65af06f7714872f3527ee16410170196e4b2277db206827505bc48b4b63159f8eb0d56d14de686e5f6840e32522f8b7dafc6b901b83495757f4269b59440bc7824d4543eae2b00b9d4d21b0b056ae53d6cc6c3a35a5b10e72710cad00db5a42903e277e361cd1761a074afe997cc4a2c77427854ea1176da481cadb981ee145711c7160c5b31f5194f64ec919bf57dc544656f39bad7bbdacb6e46f22c30173df2ea7",
- "a8f223612f4f5fc81ef1ca5e310b0b21532a72df6c1af0fbec87304aec983aab5d74a14cc72e53ef7752a248c0e5abe09484b597692015e796350989c88b3cae140ca82ccd9914e540468cf0edb35dcba4c352890e7a9eafac550b3978627651ad0a804f385ef5f4093ac6ee66b23e1f8202c61c6c0375eeb713852397ced2e199492aa61a3eab163d4c2625c873e95cafd95b80dd2d8732c8e25638a2007acfa6c8f1ff31cc2bc4ca8f4446f51da404335a48c955aaa3a4b57250d7ba29700b",
- "aa4bc22ba5b925573c48bf886efad103a37d697283a3d37b8bf5a3eb2d09a9ae73e6905fcb3c6af06e4170b7a1856c70eab972cd3a468a28d7a87ceaad2404126dd5843f8895a0cfd9b07085afe60b8ae391a703479846d800737ab02fca5ead5673f416d5fb4a95e1d27bb4b7ca5411e74e98623f563b1d3709d749b3ee6d87242a8da04f39fd61ea679acc8e28601dadcc4434918dc544cd365f7b897600b3fb62875f4517ae32601764ae8d28b924074e47ebc2bcaaa42d9d8feb82137787",
- NULL
- };
-
-char *SkypeModulus2048[] = {"b8506aeed8ed30fe1c0e6774874b59206a77329042a49be2403da47d50052441067f87bcd57e6579b83df0bade2beff5b5cd8d87e8b3edac5f57fabccd49695974e2b5e5f0287d6c19ecc31b4504a9f8be25da78fa4ef345f91d339b73cc2d70b3904e11ca570ce9b5dc4b08b3c44b74dc463587ea637ef4456e61462b72042fc2f4ad5510a9850c06dc9a7374412fcadda955bd9800f9754cb3b8cc62d0e98d8282180971055b457c06f351e61164fc5a9de9d83d1d1378964001380b5b99ee4c5c7d50ac2462a4b7ea34fd32d90bd8d4b46410263673f900d1c60470165df9f3cb48016ab8ca45ce6875a71d977915ca8251b50258748dbc37fe332edc2855",
- "bfe2db4bdf48358d3ae7c7d260989e4c7c1d81e6d9bd62e3a34dcaaa55f16c8c976a8862bc2462ae1b4063fd3d0de97e8aee5b793e171e22136319ff3474667c47ed1c14a892a19644005401cef46b5a8bd9510b3c8eeff80755decd2932cdca9119d96c5e16f6603b24ccc062822ca250336915a77aeab693268e1e22b1209d22f65a54cf7bcc7a4f9677eab54df8c33b16755ce1cf907efae988df8a4b4fad0591d95617189cd5ae0ef0935b2b458d72c7cc3de19a6268af4b06a8ce324292ca01b6a3adf7d133101a1e6659b03e0a1e14f07f8a11f5ec945c1a6f1eff06e75764262749acd6c3bf59503d970b038f77018cb09eb924fc2045db9b3248d6d5",
- "9f2a6038e8132c3545bc7c5fbe56903e08e83353b1defe7042b5c8457ba5a40254b2812a843be54993dafed5fa55a415be652e2ff533483a1ab3907c5603df47a59311973c2b4c39cf942a58f12149ce0437b341aa58add6dc2ab27800f1f529975506c10925e5254ff0766ed276b194d36c783a7d426672e32e7d6881c91e167ccbb38f4f9ee703d621712b7de384c6c97fe5cf557c839d47ebf1c45db2ec554b4aebf203d00896e9b202e564251f6fc623f6810208ffd1497c4de673d87d693febc17ec5157aa5aa8a0055976fd4817b6ccef76d4525741820d72ef89c2558971189c5e42cdeb271590f6bb0e2bede43a28003f54298be689a39791ec8a919",
- "bf137933ab269e3bacbea76da16f6ff06748028e79efe20aa696368fc88f6abca4571790f3d67ea4b6f382850f8f27a2ee4c044be541083d74ecbb30142070a7bc2746ff01fb243c4ec2a5fba296c3fb9c357429b4d511741bd2bf97034d29fe4fbd9013df87b725941e9696635fd53caf2f56b7b3609c51b8448256c4fb6078dde89f06d54c8bb4e2f6fbfb6ee42e698649e32e74dc542c94c2be3f9833ef22f988f9aa9c4fa5267b8aaf455ef06c693a36ca4447763e865086070713328e2f835649e1a15d78eaa6f90f9b5a6fac3f2eb3e24979bdacc4843956ef44c186f5007278c7d6cc1ceaefd8c56121ffa39c8d75873ae5a853b7cd1002885b49b209",
- "d7edafe450023e3a4b0f7f1925196943ce1defd4d158cc868a29973bbedb9b90d203331b01c9752f254d7c922f8b5bdba2d25bd5955b887f26532afda73e37527f1265925ddbb6f1ed5efd660b1cad6ecb94628e1c90311a320db1a758ec36e3df926df48ebc1c099714dfe5e7541eec3ce96dd7d6f8b55288c081646c51a6b77f5c1ef1025b7862ee9d5e7d491293471ae7159daa40ccd7db2753071c11264aa5cc861d5fedc8fed6f2503b0a68a17d78cdfe3f698bd8af21ac1152f2dcef7c515bd9c9e4934cd9c9977ade4c77fbcd184111332f2737847b5ee713b6568d55c14618ae1e4ce088431709d9ad8fae987887ac829c3f7968bee8d1cfd347e341",
- "d52af9c4194936e76ca66fd276533926d073b261c8de4cba4ea8f758dcce63e1c391220085ac94492926fde61ac0ca4b7b1acdd90a4d601b242cd2f890d8f826ab0c269bf1d23f497f2c236f1f57c01b881b88616eab2aa2028d533bb449b579063fcd287fba64ab0d64f4c1f38845d22017be45b7942348b494b1dd73982719be5ee37384b9feb41473e8bf71c8c4edab7a486907879e6a797baa2d7d9462fc24a7ad6a00598646064beb19f27513bee559f0316a398eaa5d5e618a41fc0d16ee1c6cf17e84bf7571227fe98a29d205c0ffd5546bed9f87e22e49ebee6d58e908e268d258d7520589f2b730d72639bb751ac4fb4d39125bb5b205bacfb423df",
- "a4deafb40a982a87c989fe919b888dfe185113b17106b3241e7d166177b322b790131ddebae8d878bd8ae7e2e39794cab70988778cb13d121528e260eedabb3df35a320a02b7e68b63d4cd143d0ef93ab565d2163e467b77ae4644e9850e922fcdc61c58020e236a70557188e8ff2c332ff9e4f3d984042a2c802917ba9bcdf9277b4de3bf7055423bcac61332f2983d3fd9074dcb610e4c8d751bb38d4c20b470a8314d44790462e62c3b45a77cc290aab52b0a237fccd7513b5e8fd50ec4e79dac5047191417ffd68ebfa023f275a0fff93531cdda7b6287d34e41e89227c2942b6aeca11956fdb566f65be7f1c456b1b07b731cb78698b08478f5e7c856cb",
- "a903c6079aac211634af60c85955889da69a552a2e994ef9395a53fc258c78c6308961d7bf3e87dd85ebb55087ffa151433514901e5b8e79458209864e82d839de8793002e15528d979a4b853a47a7d74e463ebdc321827308559c68a81f6de72660625f577ac42fc0addd31ad8697155de21d977bd9874ce65a6232cad0c08a21b9a2a3d4d14923115ff0d9b5f09e645f4d3a6c45ca1838a8f7a519b2d82fd82282678260d934bc8d42314ac6c703189ad734b2e9c8d285a50447fda2d01bd26452e63ce290ca1f88b1237abdd942372a384902ab3495a37bfd68c45d46008d134984f06f9114d411bd560fe48ec3a16a3f4ff0127ca52928f3261ddbb76b9d",
- "b4792d7289d6aaba727b338d6ed91f7fa34f9d9abca23795bff72f7f38f4c27b416149489891c2b615d0b5db19a09d6462d26ee12526f93f4bd129655ecc890727f8a6ec71c17a82b02f68afe8dab6e40620236753784d4a279159dc613b2eebc1bbf9fa65b8ca1d13ded28ea575c591738772369ca4049329d10c06c194e92e13394f8b53c890235b922f18b24ccc71d59065aa6e45889da11d33feee17bd994c456d7635238f431403badb45b9ea907e4385ae2ef178dd5154c77895e9a8f60eef3c3969b356a0c11e6d3d4d0563c1e76d8268117f0eb4c160b3b941e77518a6361d17241f28c7f84ee0e378a831782e9dc688584a0ef9b383835e202bd67f",
- NULL
- };
-
-char *SkypeModulus4096[] = {"c3ac2b9912720fd9d5d121570bb8acb6c5b9b5ad4af08b75a68728860759a256f1c4357a329ac61528e968b7b41cae0f7c61784e0e72e465828fbb4e92931a2e14856d4a9600045df661cca37ccd6b993c93fcf62c0eab46882460df70b6f866293bd6d8fe35bcbd9c63ca4909c30652933d2b1943e67633af7ad0599ac8a61b914e2b97d9b1736683f1457695842951fff68e36fc170a54ddbb6b4f7d0361f5a6c36ad2837281aa9359460e6e15aa84d0e17ba9f1a9de3c88cc9233e371a6f18e48892e570679be601ddc134669967e2c550895ed97e49189b7164997eb266540b6b19d259188ddb9224ee846d1d2ca4e86eba4be39a7b1662f7e230b9d8a8f2553f3394a8b6f0668c3372bbba713064543b8f932ca34b3eb44bd8533191550b06960553a0e69386770569c1bc087d21976ef570f6634a5dd127407af32f39a56f5e72aed3590fa4722dc0a55e475b2d1ab39b2f0904168f97a16f4762d6804f7164feecc1a57823a3786c53bcdd73a7086ecd56142af052b86dec233ef8abeab437436c6c1c6ce231aa93bdf669f25c1c30b12df932df4b9662f90b1e1aaeca77a6c773dcb28669cf1852b8c14615e52905ccf3beac1546f499778dd01fc060876afe3f5f97de6d3cccae7a686222c17699f5968c453fd6f692e8254961018f5986d98c01c357d624d3d6c44e3b4ca344de00b2d8bf3939c2758b057bd4985",
- "ba7463f3b6ccfd1327750915654e4823a5594b656cb9114b17146425bf5d720c9d94ca0bd2ca74ee8ac1af7940950ceebd161b1a631e4a6c98015a056d7af2decc2fc582a0b04ccb5eebb06a438816fbc594de942f9a90fb5c89bdcf215f0ddd59afba36b03538f5ef348dd96366900419c488263dbc547f26ffb54e9fb8faa5a9fed038bc2bd3b14a6b4ffaa5e01e84a029df338e47b267e15976508abb83b4bf88c523b5af7ba597fc4f4b07da84cd4eafb06cd9dee246854bb82be2620981e0c1491d0ed9ad67810cbf1ee7ad7d89a4c66ecb24f10d1c57e7a6947566a8a9739b2ca0af160761cddb4bf279ff6668a46c6c38a365dfeac5ba0f130418fe6234ae0642bff18c9a3422b0ef0f64373f7414ccf80cfd5440b3752de911542cdc10a25899ef7ff7ef32e8d6626caf5d8887d593a7323d663d5c1cd4885b48f3adfa529c42c9177519a2c283db8b68791dd8020cf2fb047fcf58d4605d3891074598eadf1b9c8da1a88b7fd7635d419c16ad109ed288f461d64325ae4929298c204e877515417645057bca10c6ceb3de4bd63441f2e2e2b03bad33781bf4e242f30da3e2407736668ced9193e022b75ab4f65d7201999fa317e9ad30a80080797279bfebd89614827c323979ec5141a25c15bf800f337907fe50b0cdb9eb07b9665958cc9373188dd58eb6571f1f41c4aa7b6357138557a37d122ab6c3f7cd2de9",
- NULL
- };
-
-
-uchar KeyDescTable[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x01, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x02, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x03, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x04, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x05, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x06, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x07, 0x10, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x01, 0x20, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF
- };
-
-
-char *KeySelect(uint KeyIndex)
-{
- uint *pKeyDescTable = (uint*)KeyDescTable;
- char *pRet;
-
- if (pKeyDescTable[1] <= 0x1000)
- {
- while (pKeyDescTable[2]<0xFFFFFFFF)
- {
- switch (pKeyDescTable[1])
- {
- case 0x600:
- pRet = SkypeModulus1536[pKeyDescTable[2]]; break;
- case 0x800:
- pRet = SkypeModulus2048[pKeyDescTable[2]]; break;
- case 0x1000:
- pRet = SkypeModulus4096[pKeyDescTable[2]]; break;
- default:
- return NULL;
- }
- if (pKeyDescTable[0] == KeyIndex) return pRet;
- pKeyDescTable += 3;
- if (pKeyDescTable[1]>0x1000) return pRet;
- }
- }
- return NULL;
-}
-
-
-
-
-#ifdef CRYPT_WOLFSSL
-#include "wolfssl.c"
-#endif
diff --git a/protocols/MSN/src/skylogin/common.h b/protocols/MSN/src/skylogin/common.h
deleted file mode 100644
index 5396000603..0000000000
--- a/protocols/MSN/src/skylogin/common.h
+++ /dev/null
@@ -1,131 +0,0 @@
-#ifndef __COMMON_H__
-#define __COMMON_H__
-
-#ifdef _WIN32
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winsock.h>
-#pragma comment (lib,"ws2_32.lib")
-#define int64_t __int64
-
-#else
-
-#include <sys/socket.h>
-#include <netinet/ip.h>
-#include <arpa/inet.h>
-#include <string.h>
-typedef int SOCKET;
-#define closesocket close
-typedef int BOOL;
-#define TRUE 1
-#define FALSE 0
-
-#endif
-
-#ifdef DEBUG
-#include <stdio.h>
-#define DBGPRINT printf
-#else
-#define DBGPRINT
-#endif
-
-/* Use Skype 5+ Diffie-Hellmann RC4 wrapped login comunication.
- * Fortunately Login servers also still work without it too.
- * To keep library small and clean, we keep it disabled too,
- * but you can enable it if you want.
- */
-//#define USE_RC4
-
-#ifdef CRYPT_WOLFSSL
-#include "wolfssl.h"
-#else
-#include <openssl/md5.h>
-#include <openssl/aes.h>
-#include <openssl/rsa.h>
-#include <openssl/sha.h>
-#include <openssl/err.h>
-#ifdef USE_RC4
-#include <openssl/rc4.h>
-#include <openssl/dh.h>
-#endif
-#endif
-
-typedef unsigned char uchar;
-typedef unsigned short ushort;
-typedef unsigned int uint;
-typedef unsigned long ulong;
-
-#define MAX_IP_LEN 15
-#define HTTPS_PORT 443
-
-#define NODEID_SZ 8
-#define HANDSHAKE_SZ 0x05
-#define CONCAT_SALT "\nskyper\n"
-#define KEYSZ 0x200
-#define SK_SZ 0xC0
-#define MODULUS_SZ 0x80
-#define HTTPS_HSR_MAGIC "\x16\x03\x01"
-#define HTTPS_HSRR_MAGIC "\x17\x03\x01"
-#define LOGIN_OK 4200
-
-#define RAW_PARAMS 0x41
-#define EXT_PARAMS 0x42
-
-#define VER_STR "0/7.44.0.104"
-
-typedef struct
-{
- char ip[MAX_IP_LEN + 1];
- int port;
-} Host;
-
-typedef struct
-{
- uchar *Memory;
- unsigned long MsZ;
-} Memory_U;
-
-typedef struct
-{
- uchar *User;
- uchar LoginHash[MD5_DIGEST_LENGTH];
- uint Expiry;
- RSA *RSAKeys;
- //Memory_U Modulus;
- Memory_U SignedCredentials;
-} SLoginDatas;
-
-typedef struct
-{
- uchar SessionKey[SK_SZ];
- uchar NodeID[NODEID_SZ];
- uchar Language[2];
- uint PublicIP;
- SLoginDatas LoginD;
- int (__cdecl *pfLog)(void *stream, const char *format, ...);
- void *pLogStream;
-} Skype_Inst;
-
-typedef struct
-{
- SOCKET LSSock;
-#ifdef USE_RC4
- RC4_KEY rc4_send;
- RC4_KEY rc4_recv;
-#endif
-} LSConnection;
-
-#pragma pack(1)
-typedef struct
-{
- unsigned char MAGIC[3];
- unsigned short ResponseLen;
-} HttpsPacketHeader;
-
-#pragma pack()
-
-extern char *SkypeModulus1536[];
-
-char *KeySelect(uint KeyIndex);
-#endif
diff --git a/protocols/MSN/src/skylogin/crc.c b/protocols/MSN/src/skylogin/crc.c
deleted file mode 100644
index 48cf20762c..0000000000
--- a/protocols/MSN/src/skylogin/crc.c
+++ /dev/null
@@ -1,113 +0,0 @@
-#include "crc.h"
-
- /* ============================================================= */
- /* COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or */
- /* code or tables extracted from it, as desired without restriction. */
- /* */
- /* First, the polynomial itself and its table of feedback terms. The */
- /* polynomial is */
- /* X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0 */
- /* */
- /* Note that we take it "backwards" and put the highest-order term in */
- /* the lowest-order bit. The X^32 term is "implied"; the LSB is the */
- /* X^31 term, etc. The X^0 term (usually shown as "+1") results in */
- /* the MSB being 1. */
- /* */
- /* Note that the usual hardware shift register implementation, which */
- /* is what we're using (we're merely optimizing it by doing eight-bit */
- /* chunks at a time) shifts bits into the lowest-order term. In our */
- /* implementation, that means shifting towards the right. Why do we */
- /* do it this way? Because the calculated CRC must be transmitted in */
- /* order from highest-order term to lowest-order term. UARTs transmit */
- /* characters in order from LSB to MSB. By storing the CRC this way, */
- /* we hand it to the UART in the order low-byte to high-byte; the UART */
- /* sends each low-bit to hight-bit; and the result is transmission bit */
- /* by bit from highest- to lowest-order term without requiring any bit */
- /* shuffling on our part. Reception works similarly. */
- /* */
- /* The feedback terms table consists of 256, 32-bit entries. Notes: */
- /* */
- /* The table can be generated at runtime if desired; code to do so */
- /* is shown later. It might not be obvious, but the feedback */
- /* terms simply represent the results of eight shift/xor opera- */
- /* tions for all combinations of data and CRC register values. */
- /* */
- /* The values must be right-shifted by eight bits by the "updcrc" */
- /* logic; the shift must be unsigned (bring in zeroes). On some */
- /* hardware you could probably optimize the shift in assembler by */
- /* using byte-swap instructions. */
- /* polynomial $edb88320 */
- /* */
- /* -------------------------------------------------------------------- */
-
-static unsigned int crc32_tab[] = {
- 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
- 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
- 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
- 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
- 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
- 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
- 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
- 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
- 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
- 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
- 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
- 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
- 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
- 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
- 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
- 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
- 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
- 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
- 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
- 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
- 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
- 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
- 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
- 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
- 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
- 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
- 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
- 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
- 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
- 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
- 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
- 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
- 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
- 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
- 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
- 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
- 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
- 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
- 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
- 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
- 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
- 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
- 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
- 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
- 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
- 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
- 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
- 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
- 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
- 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
- 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
- 0x2d02ef8dL
- };
-
-/* Return a 32-bit CRC of the contents of the buffer. */
-
-unsigned int crc32(const unsigned char *s, unsigned int len, int salt)
-{
- unsigned int crc32val;
- unsigned int i;
-
- crc32val = salt;
- for (i = 0; i < len; i ++)
- {
- crc32val =
- crc32_tab[(crc32val ^ s[i]) & 0xff] ^
- (crc32val >> 8);
- }
- return crc32val;
-}
diff --git a/protocols/MSN/src/skylogin/crc.h b/protocols/MSN/src/skylogin/crc.h
deleted file mode 100644
index 27b997d314..0000000000
--- a/protocols/MSN/src/skylogin/crc.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef CRC_H
-#define CRC_H
-/* This computes a 32 bit CRC of the data in the buffer, and returns the
- CRC. The polynomial used is 0xedb88320. */
-unsigned int crc32(const unsigned char *buf, unsigned int len, int salt);
-#endif /* CRC_H */
diff --git a/protocols/MSN/src/skylogin/credentials.c b/protocols/MSN/src/skylogin/credentials.c
deleted file mode 100644
index df80f2cafb..0000000000
--- a/protocols/MSN/src/skylogin/credentials.c
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Skype Login
- *
- * Based on:
- * FakeSkype : Skype reverse engineering proof-of-concept client
- * Ouanilo MEDEGAN (c) 2006 http://www.oklabs.net
- * pyskype : Skype login Python script by uunicorn
- *
- * Written by: leecher@dose.0wnz.at (c) 2015
- *
- * Module: Credentials handling, reads/writes old Skype credentials format
- *
- */
-#include "common.h"
-#include "objects.h"
-#include "random.h"
-#include "crc.h"
-#include "credentials.h"
-#ifdef _WIN32
-#define CRC_SIZE sizeof(short)
-#else
-#define CRC_SIZE 0
-#endif
-
-
-Memory_U Credentials_Write(Skype_Inst *pInst)
-{
- Memory_U creds;
- uchar *Browser;
- uint Crc;
-
- creds.MsZ = sizeof(pInst->LoginD.LoginHash) + MODULUS_SZ + pInst->LoginD.SignedCredentials.MsZ + CRC_SIZE;
- if (!(Browser = creds.Memory = malloc(creds.MsZ)))
- {
- creds.MsZ = 0;
- return creds;
- }
- memcpy(Browser, pInst->LoginD.LoginHash, sizeof(pInst->LoginD.LoginHash));
- Browser+=sizeof(pInst->LoginD.LoginHash);
- BN_bn2bin(pInst->LoginD.RSAKeys->d, Browser);
- Browser+=MODULUS_SZ;
- memcpy(Browser, pInst->LoginD.SignedCredentials.Memory, pInst->LoginD.SignedCredentials.MsZ);
- Browser+=pInst->LoginD.SignedCredentials.MsZ;
-#ifdef _WIN32
- Crc = crc32(creds.Memory, Browser-creds.Memory, -1);
- *Browser++ = *((uchar *)(&Crc) + 0);
- *Browser++ = *((uchar *)(&Crc) + 1);
-#endif
- return creds;
-}
-
-/*
- 0 - OK
- -1 - Invalid size of credentials blob
- -2 - Invalid CRC
- -3 - Out of memory
- -4 - Unable to parse Signed credentials
- -5 - RSA public key not found
-*/
-int Credentials_Read(Skype_Inst *pInst, Memory_U creds, SResponse *LoginDatas)
-{
- uchar *Browser;
- uint Crc, Idx;
- RSA *Keys;
-
- if (creds.MsZ < sizeof(pInst->LoginD.LoginHash) + MODULUS_SZ + 16 + CRC_SIZE)
- return -1;
-
-#ifdef _WIN32
- Crc = crc32(creds.Memory, creds.MsZ-2, -1);
- if (*((uchar *)(&Crc) + 0) != *((uchar*)creds.Memory+creds.MsZ-2) ||
- *((uchar *)(&Crc) + 1) != *((uchar*)creds.Memory+creds.MsZ-1))
- {
- pInst->pfLog(pInst->pLogStream, "Credentials: Bad CRC!");
- return -2;
- }
-#endif
-
- Browser = creds.Memory;
- memcpy (pInst->LoginD.LoginHash, Browser, sizeof(pInst->LoginD.LoginHash));
- Browser+=sizeof(pInst->LoginD.LoginHash);
- Keys=RSA_new();
- BN_hex2bn(&(Keys->e), "010001");
- Keys->d = BN_bin2bn(Browser, MODULUS_SZ, NULL);
- Browser+=MODULUS_SZ;
- if (pInst->LoginD.SignedCredentials.Memory) free(pInst->LoginD.SignedCredentials.Memory);
- pInst->LoginD.SignedCredentials.MsZ = creds.MsZ - CRC_SIZE - (Browser-creds.Memory);
- if (!(pInst->LoginD.SignedCredentials.Memory = malloc(pInst->LoginD.SignedCredentials.MsZ)))
- {
- pInst->LoginD.SignedCredentials.MsZ = 0;
- RSA_free(Keys);
- return -3;
- }
- memcpy(pInst->LoginD.SignedCredentials.Memory, Browser, pInst->LoginD.SignedCredentials.MsZ);
-
- // Now credentials are read, but we need to finish LoginD.RSAKeys by unpacking Signed Credentials
- if (Credentials_Parse(pInst, pInst->LoginD.SignedCredentials, LoginDatas)<0)
- {
- RSA_free(Keys);
- return -4;
- }
-
- for (Idx = 0; Idx < LoginDatas->NbObj; Idx++)
- {
- if (LoginDatas->Objs[Idx].Id == OBJ_ID_LDMODULUS)
- {
- Keys->n = BN_bin2bn(LoginDatas->Objs[Idx].Value.Memory.Memory,
- LoginDatas->Objs[Idx].Value.Memory.MsZ, NULL);
- if (pInst->LoginD.RSAKeys) RSA_free(pInst->LoginD.RSAKeys);
- pInst->LoginD.RSAKeys = Keys;
- return 0;
- }
- }
-
- RSA_free(Keys);
- return -5;
-}
-
-int Credentials_Parse(Skype_Inst *pInst, Memory_U Pcred, SResponse *LoginDatas)
-{
- uchar *PostProcessed, *Browser;
- char *Key;
- uint KeyIdx, PPsZ;
- RSA *SkypeRSA;
- Memory_U creds = Pcred;
-
- if (!(creds.Memory = malloc(creds.MsZ)))
- return -2;
- KeyIdx = htonl(*(uint *)Pcred.Memory);
- Pcred.Memory += sizeof(uint);
- Pcred.MsZ -= sizeof(uint);
-
- SkypeRSA = RSA_new();
- Key = KeySelect(KeyIdx);
- BN_hex2bn(&(SkypeRSA->n), Key);
- BN_hex2bn(&(SkypeRSA->e), "010001");
- PPsZ = RSA_public_decrypt(Pcred.MsZ, Pcred.Memory, creds.Memory, SkypeRSA, RSA_NO_PADDING);
- RSA_free(SkypeRSA);
- if (PPsZ == -1)
- {
- char szErr[256];
-
- ERR_load_crypto_strings();
- ERR_error_string(ERR_get_error(), szErr);
- pInst->pfLog(pInst->pLogStream, "Credentials decryption failed: %s\n", szErr);
- free(creds.Memory);
- return -1;
- }
-
- PostProcessed = FinalizeLoginDatas(pInst, creds.Memory, &PPsZ, NULL, 0);
-
- if (PostProcessed == NULL)
- {
- pInst->pfLog(pInst->pLogStream, "Bad Datas Finalization..\n");
- free (creds.Memory);
- return -1;
- }
-
- LoginDatas->Objs = NULL;
- LoginDatas->NbObj = 0;
- Browser = PostProcessed;
-
- ManageObjects(&Browser, PPsZ, LoginDatas);
- free(PostProcessed);
- free(creds.Memory);
- return 0;
-}
diff --git a/protocols/MSN/src/skylogin/credentials.h b/protocols/MSN/src/skylogin/credentials.h
deleted file mode 100644
index b6c323089d..0000000000
--- a/protocols/MSN/src/skylogin/credentials.h
+++ /dev/null
@@ -1,3 +0,0 @@
-Memory_U Credentials_Write(Skype_Inst *pInst);
-int Credentials_Read(Skype_Inst *pInst, Memory_U creds, SResponse *LoginDatas);
-int Credentials_Parse(Skype_Inst *pInst, Memory_U creds, SResponse *LoginDatas);
diff --git a/protocols/MSN/src/skylogin/login.c b/protocols/MSN/src/skylogin/login.c
deleted file mode 100644
index 348c582b7b..0000000000
--- a/protocols/MSN/src/skylogin/login.c
+++ /dev/null
@@ -1,417 +0,0 @@
-/*
- * Skype Login
- *
- * Based on:
- * FakeSkype : Skype reverse engineering proof-of-concept client
- * Ouanilo MEDEGAN (c) 2006 http://www.oklabs.net
- * pyskype : Skype login Python script by uunicorn
- *
- * Written by: leecher@dose.0wnz.at (c) 2015
- *
- * Module: Skype server login
- *
- */
-#include "common.h"
-#include "objects.h"
-#include "random.h"
-#include "platform.h"
-#include "crc.h"
-#ifdef _DEBUG
-#include <time.h>
-#include <stdio.h>
-#endif
-
-#ifdef USE_RC4
-#include "rc4comm.c"
-#else
-#define RC4Comm_Init(conn) 0
-#define RC4Comm_Send(conn,buf,len) send(conn->LSSock,buf,len,0)
-#define RC4Comm_Recv(conn,buf,len) recv(conn->LSSock,buf,len,0)
-#endif
-
-static Host LoginServers[] = {
- {"91.190.216.17", 33033},
- {"91.190.218.40", 33033},
-};
-
-static BOOL SendHandShake2LS(Skype_Inst *pInst, LSConnection *pConn, Host *CurLS)
-{
- uchar HandShakePkt[HANDSHAKE_SZ] = {0};
- HttpsPacketHeader *HSHeader, Response;
- struct sockaddr_in Sender={0};
-
- HSHeader = (HttpsPacketHeader *)HandShakePkt;
- memcpy(HSHeader->MAGIC, HTTPS_HSR_MAGIC, sizeof(HSHeader->MAGIC));
- HSHeader->ResponseLen = 0;
- pInst->pfLog(pInst->pLogStream, "Sending Handshake to Login Server %s..\n", CurLS->ip);
- Sender.sin_family = AF_INET;
- Sender.sin_port = htons((short)CurLS->port);
- Sender.sin_addr.s_addr = inet_addr(CurLS->ip);
- if (connect(pConn->LSSock, (struct sockaddr *)&Sender, sizeof(Sender)) < 0)
- {
- pInst->pfLog(pInst->pLogStream, "Connection refused..\n");
- return FALSE;
- }
- if (RC4Comm_Init(pConn) < 0 ||
- RC4Comm_Send(pConn, (const char *)HandShakePkt, HANDSHAKE_SZ)<=0 ||
- RC4Comm_Recv(pConn, (char*)&Response, sizeof(Response))<=0 ||
- memcmp(Response.MAGIC, HTTPS_HSRR_MAGIC, sizeof(Response.MAGIC)))
- return FALSE;
- return TRUE;
-}
-
-/* If Pass is NULL, User is assumed to be OAuth string and OAuth logon is performed */
-static int SendAuthentificationBlobLS(Skype_Inst *pInst, LSConnection *pConn, const char *User, const char *Pass)
-{
- int64_t PlatForm;
- uchar AuthBlob[0xFFFF] = {0};
- uchar SHAResult[32] = {0};
- uchar Modulus[MODULUS_SZ * 2] = {0};
- uchar ivec[AES_BLOCK_SIZE] = {0};
- uchar ecount_buf[AES_BLOCK_SIZE] = {0};
- uint MiscDatas[0x05] = {0};
- uchar SessionKey[SK_SZ];
- uchar *Browser;
- uchar *Mark;
- uchar *MarkObjL;
- uint Size, Crc, BSize, ret = 0;
- int Idx;
- HttpsPacketHeader *HSHeader;
- uchar HSHeaderBuf[sizeof(HttpsPacketHeader)], RecvBuf[0x1000];
- AES_KEY AesKey;
- MD5_CTX Context;
- RSA *SkypeRSA;
- ObjectDesc Obj2000, ObjSessionKey, ObjZBool1, ObjRequestCode, ObjZBool2, ObjModulus, ObjPlatForm, ObjLang, ObjMiscDatas, ObjVer, ObjPubAddr;
- SResponse Response={0};
-
-
- if (!pInst->LoginD.RSAKeys)
- {
- BIGNUM *KeyExp;
-
- pInst->pfLog(pInst->pLogStream, "Generating RSA Keys Pair (Size = %d Bits)..\n", KEYSZ);
- pInst->LoginD.RSAKeys = RSA_new();
- KeyExp = BN_new();
- BN_set_word(KeyExp, RSA_F4);
- Idx = RSA_generate_key_ex(pInst->LoginD.RSAKeys, KEYSZ * 2, KeyExp, NULL);
- BN_free(KeyExp);
- if (Idx == -1)
- {
- pInst->pfLog(pInst->pLogStream, "Error generating Keys..\n\n");
- RSA_free(pInst->LoginD.RSAKeys);
- pInst->LoginD.RSAKeys = NULL;
- return (0);
- }
- }
-
- Idx = BN_bn2bin(pInst->LoginD.RSAKeys->n, Modulus);
- Idx = BN_bn2bin(pInst->LoginD.RSAKeys->d, Modulus + Idx);
-
- Browser = AuthBlob;
-
- HSHeader = (HttpsPacketHeader *)Browser;
- memcpy(HSHeader->MAGIC, HTTPS_HSR_MAGIC, sizeof(HSHeader->MAGIC));
- HSHeader->ResponseLen = htons(0xCD);
- Browser += sizeof(HttpsPacketHeader);
-
- *Browser++ = RAW_PARAMS;
- *Browser++ = 0x03;
-
- Obj2000.Family = OBJ_FAMILY_NBR;
- Obj2000.Id = OBJ_ID_2000;
- Obj2000.Value.Nbr = 0x2000;
- WriteObject(&Browser, Obj2000);
-
- SpecialSHA(pInst->SessionKey, SK_SZ, SHAResult, 32);
- AES_set_encrypt_key(SHAResult, 256, &AesKey);
-
- SkypeRSA = RSA_new();
- BN_hex2bn(&(SkypeRSA->n), SkypeModulus1536[1]);
- BN_hex2bn(&(SkypeRSA->e), "010001");
- Idx = RSA_public_encrypt(SK_SZ, pInst->SessionKey, SessionKey, SkypeRSA, RSA_NO_PADDING);
- RSA_free(SkypeRSA);
- if (Idx < 0)
- {
- pInst->pfLog(pInst->pLogStream, "RSA_public_encrypt failed..\n\n");
- return (0);
- }
-
- ObjSessionKey.Family = OBJ_FAMILY_BLOB;
- ObjSessionKey.Id = OBJ_ID_SK;
- ObjSessionKey.Value.Memory.Memory = (uchar *)&SessionKey;
- ObjSessionKey.Value.Memory.MsZ = SK_SZ;
- WriteObject(&Browser, ObjSessionKey);
-
- ObjZBool1.Family = OBJ_FAMILY_NBR;
- ObjZBool1.Id = OBJ_ID_ZBOOL1;
- ObjZBool1.Value.Nbr = 0x01;
- WriteObject(&Browser, ObjZBool1);
-
- Mark = Browser;
- HSHeader = (HttpsPacketHeader *)Browser;
- memcpy(HSHeader->MAGIC, HTTPS_HSRR_MAGIC, sizeof(HSHeader->MAGIC));
- HSHeader->ResponseLen = 0x00;
- Browser += sizeof(HttpsPacketHeader);
-
- MarkObjL = Browser;
- if (Pass)
- {
- ObjectDesc ObjUserName, ObjSharedSecret;
-
- *Browser++ = RAW_PARAMS;
- *Browser++ = 0x04;
-
- ObjRequestCode.Family = OBJ_FAMILY_NBR;
- ObjRequestCode.Id = OBJ_ID_REQCODE;
- ObjRequestCode.Value.Nbr = 0x1399;
- WriteObject(&Browser, ObjRequestCode);
-
- ObjZBool2.Family = OBJ_FAMILY_NBR;
- ObjZBool2.Id = OBJ_ID_ZBOOL2;
- ObjZBool2.Value.Nbr = 0x01;
- WriteObject(&Browser, ObjZBool2);
-
- ObjUserName.Family = OBJ_FAMILY_STRING;
- ObjUserName.Id = OBJ_ID_USERNAME;
- ObjUserName.Value.Memory.Memory = (uchar *)User;
- ObjUserName.Value.Memory.MsZ = (uchar)strlen(User);
- WriteObject(&Browser, ObjUserName);
-
- MD5_Init(&Context);
- MD5_Update(&Context, User, (ulong)strlen(User));
- MD5_Update(&Context, CONCAT_SALT, (ulong)strlen(CONCAT_SALT));
- MD5_Update(&Context, Pass, (ulong)strlen(Pass));
- MD5_Final(pInst->LoginD.LoginHash, &Context);
-
- ObjSharedSecret.Family = OBJ_FAMILY_BLOB;
- ObjSharedSecret.Id = OBJ_ID_USERPASS;
- ObjSharedSecret.Value.Memory.Memory = (uchar *)pInst->LoginD.LoginHash;
- ObjSharedSecret.Value.Memory.MsZ = MD5_DIGEST_LENGTH;
- WriteObject(&Browser, ObjSharedSecret);
-
- *Browser++ = RAW_PARAMS;
- *Browser++ = 0x06;
-
- ObjModulus.Family = OBJ_FAMILY_BLOB;
- ObjModulus.Id = OBJ_ID_MODULUS;
- ObjModulus.Value.Memory.Memory = (uchar *)Modulus;
- ObjModulus.Value.Memory.MsZ = MODULUS_SZ;
- WriteObject(&Browser, ObjModulus);
-
- PlatForm = PlatFormSpecific();
-
- ObjPlatForm.Family = OBJ_FAMILY_TABLE;
- ObjPlatForm.Id = OBJ_ID_PLATFORM;
- memcpy(ObjPlatForm.Value.Table, (uchar *)&PlatForm, sizeof(ObjPlatForm.Value.Table));
- WriteObject(&Browser, ObjPlatForm);
-
- ObjLang.Family = OBJ_FAMILY_STRING;
- ObjLang.Id = OBJ_ID_LANG;
- ObjLang.Value.Memory.Memory = pInst->Language;
- ObjLang.Value.Memory.MsZ = sizeof(pInst->Language);
- WriteObject(&Browser, ObjLang);
-
- FillMiscDatas(pInst, MiscDatas);
- ObjMiscDatas.Family = OBJ_FAMILY_INTLIST;
- ObjMiscDatas.Id = OBJ_ID_MISCD;
- ObjMiscDatas.Value.Memory.Memory = (uchar *)MiscDatas;
- ObjMiscDatas.Value.Memory.MsZ = 0x05;
- WriteObject(&Browser, ObjMiscDatas);
-
- ObjVer.Family = OBJ_FAMILY_STRING;
- ObjVer.Id = OBJ_ID_VERSION;
- ObjVer.Value.Memory.Memory = (uchar *)VER_STR;
- ObjVer.Value.Memory.MsZ = (uchar)strlen(VER_STR);
- WriteObject(&Browser, ObjVer);
-
- ObjPubAddr.Family = OBJ_FAMILY_NBR;
- ObjPubAddr.Id = OBJ_ID_PUBADDR;
- ObjPubAddr.Value.Nbr = pInst->PublicIP;
- WriteObject(&Browser, ObjPubAddr);
- }
- else
- {
- int64_t PartnerId = 999;
- ObjectDesc ObjPartnerId, ObjOauth;
-
- // OAuth logon
- *Browser++ = RAW_PARAMS;
- *Browser++ = 0x02;
-
- ObjRequestCode.Family = OBJ_FAMILY_NBR;
- ObjRequestCode.Id = OBJ_ID_REQCODE;
- ObjRequestCode.Value.Nbr = 0x13a3;
- WriteObject(&Browser, ObjRequestCode);
-
- ObjZBool2.Family = OBJ_FAMILY_NBR;
- ObjZBool2.Id = OBJ_ID_ZBOOL2;
- ObjZBool2.Value.Nbr = 0x3d;
- WriteObject(&Browser, ObjZBool2);
-
- *Browser++ = RAW_PARAMS;
- *Browser++ = 0x08;
-
- ObjModulus.Family = OBJ_FAMILY_BLOB;
- ObjModulus.Id = OBJ_ID_MODULUS;
- ObjModulus.Value.Memory.Memory = (uchar *)Modulus;
- ObjModulus.Value.Memory.MsZ = MODULUS_SZ;
- WriteObject(&Browser, ObjModulus);
-
- PlatForm = PlatFormSpecific();
-
- ObjPlatForm.Family = OBJ_FAMILY_TABLE;
- ObjPlatForm.Id = OBJ_ID_PLATFORM;
- memcpy(ObjPlatForm.Value.Table, (uchar *)&PlatForm, sizeof(ObjPlatForm.Value.Table));
- WriteObject(&Browser, ObjPlatForm);
-
- FillMiscDatas(pInst, MiscDatas);
- ObjMiscDatas.Family = OBJ_FAMILY_INTLIST;
- ObjMiscDatas.Id = OBJ_ID_MISCD;
- ObjMiscDatas.Value.Memory.Memory = (uchar *)MiscDatas;
- ObjMiscDatas.Value.Memory.MsZ = 0x05;
- WriteObject(&Browser, ObjMiscDatas);
-
- ObjLang.Family = OBJ_FAMILY_STRING;
- ObjLang.Id = OBJ_ID_LANG;
- ObjLang.Value.Memory.Memory = pInst->Language;
- ObjLang.Value.Memory.MsZ = sizeof(pInst->Language);
- WriteObject(&Browser, ObjLang);
-
- ObjPartnerId.Family = OBJ_FAMILY_TABLE;
- ObjPlatForm.Id = OBJ_ID_PARTNERID;
- memcpy(ObjPlatForm.Value.Table, (uchar *)&PartnerId, sizeof(ObjPlatForm.Value.Table));
- WriteObject(&Browser, ObjPlatForm);
-
- ObjOauth.Family = OBJ_FAMILY_STRING;
- ObjOauth.Id = OBJ_ID_OAUTH;
- ObjOauth.Value.Memory.Memory = (uchar *)User;
- ObjOauth.Value.Memory.MsZ = (ulong)strlen(User);
- WriteObject(&Browser, ObjOauth);
-
- ObjVer.Family = OBJ_FAMILY_STRING;
- ObjVer.Id = OBJ_ID_VERSION;
- ObjVer.Value.Memory.Memory = (uchar *)VER_STR;
- ObjVer.Value.Memory.MsZ = (uchar)strlen(VER_STR);
- WriteObject(&Browser, ObjVer);
-
- ObjPubAddr.Family = OBJ_FAMILY_NBR;
- ObjPubAddr.Id = OBJ_ID_PUBADDR;
- ObjPubAddr.Value.Nbr = pInst->PublicIP;
- WriteObject(&Browser, ObjPubAddr);
- }
-
- Size = (uint)(Browser - MarkObjL);
- HSHeader->ResponseLen = htons((u_short)(Size + 0x02));
-
- Idx = 0;
- memset(ivec, 0, AES_BLOCK_SIZE);
- memset(ecount_buf, 0, AES_BLOCK_SIZE);
- AES_ctr128_encrypt(MarkObjL, MarkObjL, Size, &AesKey, ivec, ecount_buf, &Idx);
-
- Crc = crc32(MarkObjL, Size, -1);
- *Browser++ = *((uchar *)(&Crc) + 0);
- *Browser++ = *((uchar *)(&Crc) + 1);
-
- Size = (uint)(Browser - AuthBlob);
-
- if (RC4Comm_Send(pConn, (const char *)AuthBlob, Size)<=0)
- {
- pInst->pfLog(pInst->pLogStream, "Sending to LS failed :'(..\n");
- return (-1);
- }
-
- while (!ret && RC4Comm_Recv(pConn, (char *)&HSHeaderBuf, sizeof(HSHeaderBuf))>0)
- {
- HSHeader = (HttpsPacketHeader *)HSHeaderBuf;
- if (strncmp((const char *)HSHeader->MAGIC, HTTPS_HSRR_MAGIC, strlen(HTTPS_HSRR_MAGIC)) ||
- RC4Comm_Recv(pConn, (char *)RecvBuf, (BSize=htons(HSHeader->ResponseLen)))<=0)
- {
- pInst->pfLog(pInst->pLogStream, "Bad Response..\n");
- return (-2);
- }
- pInst->pfLog(pInst->pLogStream, "Auth Response Got..\n\n");
-
- Idx = 0;
- memset(ivec, 0, AES_BLOCK_SIZE);
- memset(ecount_buf, 0, AES_BLOCK_SIZE);
- BSize-=2;
- ivec[3] = 0x01;
- ivec[7] = 0x01;
- AES_ctr128_encrypt(RecvBuf, RecvBuf, BSize, &AesKey, ivec, ecount_buf, &Idx);
-
- Browser = RecvBuf;
- while (Browser<RecvBuf+BSize)
- ManageObjects(&Browser, BSize, &Response);
- for (Idx = 0; Idx < Response.NbObj; Idx++)
- {
- switch (Response.Objs[Idx].Id)
- {
- case OBJ_ID_LOGINANSWER:
- switch (Response.Objs[Idx].Value.Nbr)
- {
- case LOGIN_OK:
- pInst->pfLog(pInst->pLogStream, "Login Successful..\n");
- ret = 1;
- break;
- default :
- pInst->pfLog(pInst->pLogStream, "Login Failed.. Bad Credentials..\n");
- FreeResponse(&Response);
- return 0;
- }
- break;
- case OBJ_ID_CIPHERDLOGD:
- if (pInst->LoginD.SignedCredentials.Memory) free(pInst->LoginD.SignedCredentials.Memory);
- if (!(pInst->LoginD.SignedCredentials.Memory = malloc(Response.Objs[Idx].Value.Memory.MsZ)))
- {
- FreeResponse(&Response);
- return -2;
- }
- memcpy (pInst->LoginD.SignedCredentials.Memory, Response.Objs[Idx].Value.Memory.Memory,
- (pInst->LoginD.SignedCredentials.MsZ = Response.Objs[Idx].Value.Memory.MsZ));
- break;
- }
- }
- FreeResponse(&Response);
- }
-
- return ret;
-}
-
-
-int PerformLogin(Skype_Inst *pInst, const char *User, const char *Pass)
-{
- uint ReUse = 1;
- int i;
- LSConnection conn={0};
- int iRet = 0;
-
- for (i=0; !iRet && i<sizeof(LoginServers)/sizeof(LoginServers[0]); i++)
- {
- conn.LSSock = socket(AF_INET, SOCK_STREAM, 0);
- setsockopt(conn.LSSock, SOL_SOCKET, SO_REUSEADDR, (const char *)&ReUse, sizeof(ReUse));
-
- if (SendHandShake2LS(pInst, &conn, &LoginServers[i]))
- {
- pInst->pfLog(pInst->pLogStream, "Login Server %s OK ! Let's authenticate..\n", LoginServers[i].ip);
- iRet = SendAuthentificationBlobLS(pInst, &conn, User, Pass);
- }
- closesocket(conn.LSSock);
- }
-
- if (!iRet) pInst->pfLog(pInst->pLogStream, "Login Failed..\n");
- return iRet;
-}
-
-
-void InitInstance(Skype_Inst *pInst)
-{
- memset(pInst, 0, sizeof(Skype_Inst));
- GenSessionKey(pInst->SessionKey, sizeof(pInst->SessionKey));
- InitNodeId(pInst);
- memcpy(pInst->Language, "en", 2);
- pInst->PublicIP = 0x7F000001; // 127.0.0.1, we could use hostscan to get real IP, but not necessary for just login
-#ifdef DEBUG
- pInst->pfLog = (int (__cdecl *)(void *, const char *, ...))fprintf;
- pInst->pLogStream = stdout;
-#endif
-}
diff --git a/protocols/MSN/src/skylogin/login.h b/protocols/MSN/src/skylogin/login.h
deleted file mode 100644
index 6d5113466d..0000000000
--- a/protocols/MSN/src/skylogin/login.h
+++ /dev/null
@@ -1,2 +0,0 @@
-int PerformLogin(Skype_Inst *pInst, const char *User, const char *Pass);
-void InitInstance(Skype_Inst *pInst);
diff --git a/protocols/MSN/src/skylogin/objects.c b/protocols/MSN/src/skylogin/objects.c
deleted file mode 100644
index f5941128f0..0000000000
--- a/protocols/MSN/src/skylogin/objects.c
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * Skype Login
- *
- * Based on:
- * FakeSkype : Skype reverse engineering proof-of-concept client
- * Ouanilo MEDEGAN (c) 2006 http://www.oklabs.net
- * pyskype : Skype login Python script by uunicorn
- *
- * Written by: leecher@dose.0wnz.at (c) 2015
- *
- * Module: Object management functions
- *
- */
-#include "common.h"
-#include "objects.h"
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winsock.h>
-#endif
-
-void WriteValue(uchar **BufferAddr, uint Value)
-{
- uint a;
-
- for (a = Value; a > 0x7F; a >>= 7, (*BufferAddr)++) **BufferAddr = (uchar)a | 0x80;
- **BufferAddr = (uchar) a;
- (*BufferAddr)++;
-}
-
-void ReadValue(uchar **BufferAddr, uint *Value)
-{
- uint a=0;
- uchar c;
-
- for (*Value=0, c=**BufferAddr; a==0 || (c & 0x80); a+=7, (*BufferAddr)++) *Value|=((c=**BufferAddr) & 0x7F) << a;
-}
-
-
-void WriteObject(uchar **Buffer, ObjectDesc Object)
-{
- int IdxDown, IdxUp;
-
- Object.ObjListInfos.Id = -1;
- Object.ObjListInfos.Rank = 0;
-
- WriteValue(Buffer, Object.Family);
- WriteValue(Buffer, Object.Id);
- switch(Object.Family)
- {
- case OBJ_FAMILY_NBR:
- WriteValue(Buffer, Object.Value.Nbr);
- break;
- case OBJ_FAMILY_TABLE:
- IdxUp = 0;
- IdxDown = sizeof(Object.Value.Table) - 1;
- while (IdxDown >= 0)
- (*Buffer)[IdxDown--] = Object.Value.Table[IdxUp++];
- *Buffer += sizeof(Object.Value.Table);
- break;
- case OBJ_FAMILY_NETADDR:
- *(unsigned int *)(*Buffer) = inet_addr(Object.Value.Addr.ip);
- *Buffer += 4;
- *(unsigned short *)(*Buffer) = htons((u_short)Object.Value.Addr.port);
- *Buffer += 2;
- break;
- case OBJ_FAMILY_BLOB:
- WriteValue(Buffer, Object.Value.Memory.MsZ);
- memcpy(*Buffer, Object.Value.Memory.Memory, Object.Value.Memory.MsZ);
- *Buffer += Object.Value.Memory.MsZ;
- break;
- case OBJ_FAMILY_STRING:
- memcpy(*Buffer, Object.Value.Memory.Memory, Object.Value.Memory.MsZ);
- *Buffer += Object.Value.Memory.MsZ;
- *(*Buffer) = 0x00;
- *Buffer += 1;
- break;
- case OBJ_FAMILY_INTLIST:
- {
- uint *IntList;
-
- IdxUp = 0;
- IntList = (uint *)Object.Value.Memory.Memory;
- WriteValue(Buffer, Object.Value.Memory.MsZ);
- while (IdxUp < Object.Value.Memory.MsZ)
- {
- WriteValue(Buffer, IntList[IdxUp]);
- IdxUp++;
- }
- break;
- }
- default:
- DBGPRINT("WriteObject : Unmanaged Object Family\n");
- break;
- }
-}
-
-int DecodeRawObjects(uchar **Buffer, uint Size, SResponse *Response, ObjectDesc **Objs, int Suffix)
-{
- int NbObjs, lIdx, IdxUp, IdxDown;
- uint Family, Id;
- uchar *Str, *Mark;
- struct in_addr IP;
- ObjectDesc *Object;
- static int Idx = 0;
- static int Level = 0;
- static int CurObjListId = -1;
- static uint CurObjListRank = 0;
- uint LocalObjListRank;
-
- LocalObjListRank = CurObjListRank;
- NbObjs = Family = Id = lIdx = 0;
- Mark = *Buffer;
-
- ReadValue(Buffer, &NbObjs);
- Level += 1;
-
- if (Level == 1)
- Idx += Suffix;
-
- while (lIdx < NbObjs)
- {
- Family = **Buffer;
- *Buffer += 1;
- ReadValue(Buffer, &Id);
- *Objs = (ObjectDesc *)realloc(*Objs, sizeof(ObjectDesc) * (Idx + 1));
- Object = &((*Objs)[Idx]);
- Object->Family = Family;
- Object->Id = Id;
- Object->ObjListInfos.Id = CurObjListId;
- Object->ObjListInfos.Rank = LocalObjListRank;
-
- switch (Family)
- {
- case OBJ_FAMILY_NBR:
- ReadValue(Buffer, &(Object->Value.Nbr));
- break;
- case OBJ_FAMILY_TABLE:
- IdxUp = 0;
- IdxDown = sizeof(Object->Value.Table) - 1;
- while (IdxDown >= 0)
- Object->Value.Table[IdxUp++] = (*Buffer)[IdxDown--];
- *Buffer += sizeof(Object->Value.Table);
- break;
- case OBJ_FAMILY_NETADDR:
-#ifdef _WIN32
- IP.S_un.S_addr = *(unsigned int *)*Buffer;
-#else
- IP.s_addr = *(unsigned int *)*Buffer;
-#endif
- memset(Object->Value.Addr.ip, 0, MAX_IP_LEN + 1);
- strncpy(Object->Value.Addr.ip, inet_ntoa(IP), MAX_IP_LEN + 1);
- *Buffer += 4;
- Object->Value.Addr.port = htons(*(unsigned short *)(*Buffer));
- *Buffer += 2;
- break;
- case OBJ_FAMILY_BLOB:
- ReadValue(Buffer, &(Object->Value.Memory.MsZ));
- Object->Value.Memory.Memory = (uchar *)malloc(Object->Value.Memory.MsZ);
- memcpy(Object->Value.Memory.Memory, *Buffer, Object->Value.Memory.MsZ);
- *Buffer += Object->Value.Memory.MsZ;
- break;
- case OBJ_FAMILY_STRING:
- Str = *Buffer;
- Object->Value.Memory.MsZ = 1;
- while (*Str++ != 0)
- Object->Value.Memory.MsZ += 1;
- Object->Value.Memory.Memory = (uchar *)malloc(Object->Value.Memory.MsZ);
- memcpy(Object->Value.Memory.Memory, *Buffer, Object->Value.Memory.MsZ);
- *Buffer += Object->Value.Memory.MsZ;
- break;
- case OBJ_FAMILY_INTLIST:
- ReadValue(Buffer, &(Object->Value.Memory.MsZ));
- Object->Value.Memory.Memory = (uchar *)malloc(Object->Value.Memory.MsZ * sizeof(uint));
- for (IdxUp = 0; IdxUp < Object->Value.Memory.MsZ; IdxUp++)
- ReadValue(Buffer, (uint*)(Object->Value.Memory.Memory + (IdxUp * sizeof(uint))));
- break;
- case OBJ_FAMILY_OBJLIST:
- {
- uint OldNbObj;
- int OldCurObjListId;
-
- OldCurObjListId = CurObjListId;
- CurObjListId = (int)Id;
- CurObjListRank += 1;
- OldNbObj = Response->NbObj;
- ManageObjects(Buffer, Size - (*Buffer - Mark), Response);
- CurObjListId = OldCurObjListId;
- //Suffix += Response->NbObj - OldNbObj;
- NbObjs -= 1;
- //Idx += (Response->NbObj - OldNbObj);
- goto ContinueDecode;
- break;
- }
- default :
- break;
- }
- Idx += 1;
- lIdx += 1;
-ContinueDecode:
- continue ;
- }
-
- Level -= 1;
- if (Level == 0)
- {
- Idx = 0;
- CurObjListId = -1;
- CurObjListRank = 0;
- }
- return (NbObjs);
-}
-
-int ManageObjects(uchar **Buffer, uint Size, SResponse *Response)
-{
- uchar Mode;
-
- Mode = **Buffer;
- *Buffer += 1;
- switch (Mode)
- {
- case RAW_PARAMS:
- Response->NbObj += DecodeRawObjects(Buffer, Size - 1, Response, &(Response->Objs), Response->NbObj);
- return 0;
- case EXT_PARAMS:
- // Not supported as not needed by plain login
- //Response->NbObj += DecodeExtObjects(Buffer, Size - 1, Response, &(Response->Objs), Response->NbObj);
- break;
- default:
- break;
- }
- return -1;
-}
-
-void FreeResponse(SResponse *Response)
-{
- uint Idx;
-
- for (Idx=0; Idx<Response->NbObj; Idx++)
- {
- switch (Response->Objs[Idx].Family)
- {
- case OBJ_FAMILY_BLOB:
- case OBJ_FAMILY_STRING:
- case OBJ_FAMILY_INTLIST:
- if (Response->Objs[Idx].Value.Memory.Memory) free (Response->Objs[Idx].Value.Memory.Memory);
- break;
- }
- }
- free (Response->Objs);
- memset(Response, 0, sizeof(SResponse));
-}
diff --git a/protocols/MSN/src/skylogin/objects.h b/protocols/MSN/src/skylogin/objects.h
deleted file mode 100644
index 1c11ef9a8e..0000000000
--- a/protocols/MSN/src/skylogin/objects.h
+++ /dev/null
@@ -1,136 +0,0 @@
-#include "common.h"
-
-typedef struct
-{
- int Id;
- uint Rank;
-} ObjListInfos_S;
-
-typedef struct
-{
- uint Family;
- uint Id;
- union
- {
- Memory_U Memory;
- uchar Table[8]; /* Actually DOUBLE int */
- uint Nbr;
- Host Addr;
- } Value;
- ObjListInfos_S ObjListInfos;
-} ObjectDesc;
-
-typedef struct
-{
- ushort Cmd;
- ushort PacketID;
- ushort Reply2ID;
- uint NbObj;
- ObjectDesc *Objs;
-} SResponse;
-
-
-
-#define OBJ_FAMILY_NBR 0x00
-#define OBJ_FAMILY_TABLE 0x01
-#define OBJ_FAMILY_NETADDR 0x02
-#define OBJ_FAMILY_STRING 0x03
-#define OBJ_FAMILY_BLOB 0x04
-#define OBJ_FAMILY_OBJLIST 0x05
-#define OBJ_FAMILY_INTLIST 0x06
-
-#define OBJ_ID_NODEID 0x0D
-#define OBJ_ID_LPORT 0x10
-#define OBJ_ID_UPTIME 0x01
-#define OBJ_ID_STVL 0x23
-#define OBJ_ID_2000 0x09
-#define OBJ_ID_SK 0x08
-#define OBJ_ID_ZBOOL1 0x0C
-#define OBJ_ID_REQCODE 0x00
-#define OBJ_ID_ZBOOL2 0x02
-#define OBJ_ID_USERNAME 0x04
-#define OBJ_ID_USERPASS 0x05
-#define OBJ_ID_MODULUS 0x21
-#define OBJ_ID_PLATFORM 0x31
-#define OBJ_ID_LANG 0x36
-#define OBJ_ID_VERSION 0x0D
-#define OBJ_ID_PUBADDR 0x0E
-#define OBJ_ID_MISCD 0x33
-#define OBJ_ID_OAUTH 0x3D
-#define OBJ_ID_PARTNERID 0x3E
-#define OBJ_ID_STACKVER 0x0B
-#define OBJ_ID_STACKTS 0x0C
-#define OBJ_ID_PEERLPORT 0x10
-#define OBJ_ID_PUBNETADDR 0x11
-#define OBJ_ID_NBCONNECTED 0x09
-#define OBJ_ID_LOGINANSWER 0x01
-#define OBJ_ID_CIPHERDLOGD 0x24
-#define OBJ_ID_LDUSER 0x00
-#define OBJ_ID_LDEXPIRY 0x04
-#define OBJ_ID_LDMODULUS 0x01
-#define OBJ_ID_ESAUTHANSWR 0x0A
-#define OBJ_ID_ESHASHLIST 0x35
-#define OBJ_ID_HASH 0x32
-#define OBJ_ID_DISPLAYNAME 0x34
-#define OBJ_ID_UBLOB 0x33
-#define OBJ_ID_INTERNALNAM 0x10
-#define OBJ_ID_BUDDYSTATUS 0x79 // BUDDYSTATUS
-#define OBJ_ID_AUTHCERT 0x03
-#define OBJ_ID_USER2SEARCH 0x00
-#define OBJ_ID_BCMID 0x00
-#define OBJ_ID_BCMVER 0x01
-#define OBJ_ID_SLOTID 0x00
-#define OBJ_ID_SLOTNBSN 0x07
-#define OBJ_ID_SLOTSNADDR 0x03
-#define OBJ_ID_DIRBLOB 0x0B
-
-#define OBJ_ID_CIRNAME 0x14 // FULLNAME
-#define OBJ_ID_CILANG 0x24 // LANGUAGES
-#define OBJ_ID_CICOUNTRY 0x28 // COUNTRY
-#define OBJ_ID_CIREGION 0x2C // PROVINCE
-#define OBJ_ID_CIVILLE 0x30 // CITY
-#define OBJ_ID_CILOCATION 0x03
-#define OBJ_ID_CIPSTN_BAL 0x12D // PSTN_BALANCE
-#define OBJ_ID_CIPSTN_BALC 0x128 // PSTN_BALANCE_CURRENCY
-#define OBJ_ID_CIBIRTHDAY 0x1D // BIRTHDAY
-#define OBJ_ID_CIPHONE_H 0x34 // PHONE_HOME
-#define OBJ_ID_CIPHONE_O 0x38 // PHONE_OFFICE
-#define OBJ_ID_CIPHONE_M 0x3C // PHONE_MOBILE
-#define OBJ_ID_CIHOMEPAGE 0x44 // HOMEPAGE
-#define OBJ_ID_CIABOUT 0x48 // ABOUT
-#define OBJ_ID_CIALIASES 0x60 // ALIASES
-#define OBJ_ID_CIMOOD_TEXT 0x68 // MOOD_TEXT
-#define OBJ_ID_CIRICH_MOOD 0x334 // RICH_MOOD_TEXT
-#define OBJ_ID_CITIMEZONE 0x6D // TIMEZONE
-
-#define OBJ_ID_AUTHEDBUDD 0x71 // NROF_AUTHED_BUDDIES
-#define OBJ_ID_RCVDAUTHREQ 0x50 // RECEIVEDAUTHREQUEST
-#define OBJ_ID_ISAUTHORIZD 0x5D // ISAUTHORIZED / ISBLOCKED
-//#define OBJ_ID_DISPLAYNAME 0x84 // DISPLAYNAME
-#define OBJ_ID_ONLINESTAT 0x89 // ONLINESTATUS
-#define OBJ_ID_LASTONLINET 0x8D // LASTONLINETIMESTAMP
-#define OBJ_ID_CISEX 0x21 // SEX (MALE=1, FEMALE=2, UNKNOWN=0)
-
-
-#define OBJ_ID_FWTESTID 0x19
-#define OBJ_ID_FWTESTER 0x11
-#define OBJ_ID_PINGER 0x02
-#define OBJ_ID_TESTED 0x02
-#define OBJ_ID_TESTER 0x00
-#define OBJ_ID_RELAY 0x08
-#define OBJ_ID_SESPROPOSER 0x01
-#define OBJ_ID_SESCHALLENG 0x09
-#define OBJ_ID_SID2DEC 0x03
-#define OBJ_ID_SOLVEDCHALL 0x0A
-#define OBJ_ID_USRDBLOB 0x05
-#define OBJ_ID_AESPART1 0x06
-#define OBJ_ID_PEERLOGIN 0x00
-#define OBJ_ID_PEERSESSID 0x03
-
-#define OBJ_ID_GROUPID 0x269
-#define OBJ_ID_GROUPNAME 0x25C
-
-void WriteValue(uchar **BufferAddr, uint Value);
-void WriteObject(uchar **Buffer, ObjectDesc Object);
-int ManageObjects(uchar **Buffer, uint Size, SResponse *Response);
-void FreeResponse(SResponse *Response);
diff --git a/protocols/MSN/src/skylogin/platform.h b/protocols/MSN/src/skylogin/platform.h
deleted file mode 100644
index c5cf2d4438..0000000000
--- a/protocols/MSN/src/skylogin/platform.h
+++ /dev/null
@@ -1,6 +0,0 @@
-int64_t PlatFormSpecific();
-void InitNodeId(Skype_Inst *pInst);
-void FillMiscDatas(Skype_Inst *pInst, unsigned int *Datas);
-void FillRndBuffer(unsigned char *Buffer);
-Memory_U Credentials_Load(char *pszUser);
-int Credentials_Save(Memory_U creds, char *pszUser);
diff --git a/protocols/MSN/src/skylogin/platform_w32.c b/protocols/MSN/src/skylogin/platform_w32.c
deleted file mode 100644
index bbddc270ef..0000000000
--- a/protocols/MSN/src/skylogin/platform_w32.c
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Skype Login
- *
- * Based on:
- * FakeSkype : Skype reverse engineering proof-of-concept client
- * Ouanilo MEDEGAN (c) 2006 http://www.oklabs.net
- * pyskype : Skype login Python script by uunicorn
- *
- * Written by: leecher@dose.0wnz.at (c) 2015
- *
- * Module: WINDOWS platform specific functions
- *
- */
-#include <rpc.h>
-#include "common.h"
-#include "random.h"
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#pragma comment (lib,"rpcrt4.lib")
-
-static uchar RandomSeed[SHA_DIGEST_LENGTH] = {0};
-
-static BOOL QueryRegValue(HKEY hKey, LPCSTR lpSubKey, LPBYTE lpValue, LPDWORD pCbValue)
-{
- char *pSubKey, *pTok, szKey[256]={0};
- DWORD dwIndex;
- LONG ret;
-
- if ( !lpSubKey || !*lpSubKey ) return FALSE;
- if ( *lpSubKey != '*' )
- {
- for (pSubKey = (char*)lpSubKey; *pSubKey != '*'; pSubKey = pTok + 1)
- if (!(pTok = strchr(pSubKey, '\\'))) break;
- if ( pSubKey > lpSubKey )
- {
- if ( pSubKey - lpSubKey == 1 ) return FALSE;
- strncpy (szKey, lpSubKey, pSubKey - lpSubKey - 1);
- if (RegOpenKeyA (hKey, szKey, &hKey) == ERROR_SUCCESS)
- {
- ret = QueryRegValue(hKey, pSubKey, lpValue, pCbValue);
- RegCloseKey(hKey);
- return ret;
- }
- return FALSE;
- }
- if ( *lpSubKey != '*' ) return RegQueryValueExA (hKey, lpSubKey, NULL, NULL, lpValue, pCbValue) == ERROR_SUCCESS;
- }
- if (lpSubKey[1] != '\\')
- return RegQueryValueExA (hKey, lpSubKey, NULL, NULL, lpValue, pCbValue) == ERROR_SUCCESS;
- for (dwIndex = 0; (ret = RegEnumKeyA (hKey, dwIndex, szKey, sizeof(szKey))) == ERROR_SUCCESS; dwIndex++)
- {
- char szSubKey[256];
-
- sprintf (szSubKey, "%s%s", szKey, lpSubKey+1);
- if (QueryRegValue (hKey, szSubKey, lpValue, pCbValue)) break;
- }
- return ret == ERROR_SUCCESS;
-}
-
-int64_t PlatFormSpecific()
-{
- BYTE Buffer[0x400];
- DWORD BufSz = 0x400;
- int Idx, Used;
-
- Used = Idx = 0;
-
- if (QueryRegValue(HKEY_LOCAL_MACHINE,
- "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ProductId",
- (LPBYTE)Buffer, &BufSz))
- Used += BufSz;
- BufSz = sizeof(Buffer)-Used;
- if (QueryRegValue(HKEY_LOCAL_MACHINE,
- "HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter\\*\\DiskController\\*\\DiskPeripheral\\*\\Identifier",
- (LPBYTE)Buffer + Used, &BufSz))
- Used += BufSz;
- if (GetVolumeInformationA("C:\\", 0, 0, (LPDWORD)(Buffer + Used), 0, 0, 0, 0))
- Used+=4;
- return BytesSHA1I64(Buffer, Used);
-}
-
-void InitNodeId(Skype_Inst *pInst)
-{
- DWORD BufSz = sizeof(pInst->NodeID);
- HKEY hKey;
-
- if (QueryRegValue(HKEY_LOCAL_MACHINE,
- "SOFTWARE\\FakeSkype\\NodeId",
- (LPBYTE)&pInst->NodeID, &BufSz)) return;
- *(int64_t *)&pInst->NodeID = BytesRandomI64();
- if (RegCreateKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\FakeSkype", &hKey) == ERROR_SUCCESS)
- {
- RegSetValueExA(hKey, "NodeId", 0, REG_BINARY, (LPBYTE)&pInst->NodeID, sizeof(pInst->NodeID));
- RegCloseKey(hKey);
- }
-
- //FIXED NODEID
- //memcpy_s(NodeID, NODEID_SZ, "\x49\x63\xff\xee\xe0\x5c\x9d\xf8", NODEID_SZ);
- //memcpy_s(NodeID, NODEID_SZ, "\x97\xca\xb1\x72\x06\xf6\x72\xb4", NODEID_SZ);
-}
-
-Memory_U Credentials_Load(char *pszUser)
-{
- Memory_U creds={0};
- HKEY hKey;
- char szKey[MAX_PATH];
-
- sprintf (szKey, "SOFTWARE\\FakeSkype\\%s", pszUser);
- if (RegCreateKeyA(HKEY_LOCAL_MACHINE, szKey, &hKey) == ERROR_SUCCESS)
- {
- if (RegQueryValueExA(hKey, "Credentials", NULL, NULL, NULL, &creds.MsZ) == ERROR_SUCCESS &&
- creds.MsZ)
- {
- if (!(creds.Memory = malloc(creds.MsZ)))
- creds.MsZ = 0;
- if (creds.Memory && RegQueryValueExA(hKey, "Credentials", NULL, NULL, creds.Memory, &creds.MsZ) != ERROR_SUCCESS)
- {
- free(creds.Memory);
- ZeroMemory(&creds, sizeof(creds));
- }
- }
- RegCloseKey(hKey);
- }
- return creds;
-}
-
-int Credentials_Save(Memory_U creds, char *pszUser)
-{
- HKEY hKey;
- int iRet = 0;
-
- char szKey[MAX_PATH];
-
- sprintf (szKey, "SOFTWARE\\FakeSkype\\%s", pszUser);
- if (RegCreateKeyA(HKEY_LOCAL_MACHINE, szKey, &hKey) == ERROR_SUCCESS)
- {
- iRet = RegSetValueExA(hKey, "Credentials", 0, REG_BINARY, creds.Memory, creds.MsZ) == ERROR_SUCCESS;
- RegCloseKey(hKey);
- }
- return iRet;
-}
-
-void FillMiscDatas(Skype_Inst *pInst, unsigned int *Datas)
-{
- BYTE Buffer[0x400];
- DWORD BufSz = 0x400;
- int ret;
- int64_t PlatForm;
-
- PlatForm = PlatFormSpecific();
- Datas[0] = *(unsigned int *)&PlatForm;
- Datas[1] = *(unsigned int *)&pInst->NodeID;
-
- if (!QueryRegValue(HKEY_LOCAL_MACHINE,
- "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\ProductId",
- (LPBYTE)Buffer, &BufSz))
- return;
- Datas[2] = BytesSHA1(Buffer, BufSz);
-
- BufSz = 0x400;
- if (!QueryRegValue(HKEY_LOCAL_MACHINE,
- "HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter\\*\\DiskController\\*\\DiskPeripheral\\*\\Identifier",
- (LPBYTE)Buffer, &BufSz))
- return;
- Datas[3] = BytesSHA1(Buffer, BufSz);
-
- ret = GetVolumeInformationA("C:\\", 0, 0, (LPDWORD)Buffer, 0, 0, 0, 0);
- Datas[4] = BytesSHA1(Buffer, 0x04);
-}
-
-void FillRndBuffer(unsigned char *Buffer)
-{
- SHA_CTX Context;
- int idx;
-
- idx = 0;
- memcpy(Buffer, RandomSeed, SHA_DIGEST_LENGTH);
- idx += sizeof(RandomSeed);
- GlobalMemoryStatus((LPMEMORYSTATUS)&Buffer[idx]);
- idx += sizeof(MEMORYSTATUS);
- UuidCreate((UUID *)&Buffer[idx]);
- idx += sizeof(UUID);
- GetCursorPos((LPPOINT)&Buffer[idx]);
- idx += sizeof(POINT);
- *(DWORD *)(Buffer + idx) = GetTickCount();
- *(DWORD *)(Buffer + idx + 4) = GetMessageTime();
- *(DWORD *)(Buffer + idx + 8) = GetCurrentThreadId();
- *(DWORD *)(Buffer + idx + 12) = GetCurrentProcessId();
- idx += 16;
- QueryPerformanceCounter((LARGE_INTEGER *)&Buffer[idx]);
- SHA1_Init(&Context);
- SHA1_Update(&Context, Buffer, 0x464);
- SHA1_Update(&Context, "additional salt...", 0x13);
- SHA1_Final(RandomSeed, &Context);
-}
diff --git a/protocols/MSN/src/skylogin/random.c b/protocols/MSN/src/skylogin/random.c
deleted file mode 100644
index b13e6b79f3..0000000000
--- a/protocols/MSN/src/skylogin/random.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Skype Login
- *
- * Based on:
- * FakeSkype : Skype reverse engineering proof-of-concept client
- * Ouanilo MEDEGAN (c) 2006 http://www.oklabs.net
- * pyskype : Skype login Python script by uunicorn
- *
- * Written by: leecher@dose.0wnz.at (c) 2015
- *
- * Module: Data creation functions, i.e. random data
- *
- */
-#include <string.h>
-#include "common.h"
-#include "random.h"
-#include "platform.h"
-
-#define skrand(x) ((x)*0x00010DCD+0x00004271)
-
-unsigned int BytesSHA1(uchar *Data, uint Length)
-{
- uchar Buffer[SHA_DIGEST_LENGTH];
- SHA_CTX Context;
-
- SHA1_Init(&Context);
- SHA1_Update(&Context, Data, Length);
- SHA1_Final(Buffer, &Context);
- return *(unsigned int *)Buffer;
-}
-
-int64_t BytesSHA1I64(uchar *Data, uint Length)
-{
- uchar Buffer[SHA_DIGEST_LENGTH];
- SHA_CTX Context;
-
- SHA1_Init(&Context);
- SHA1_Update(&Context, Data, Length);
- SHA1_Final(Buffer, &Context);
- return *(int64_t *)Buffer;
-}
-
-unsigned int BytesRandom()
-{
- uchar Buffer[0x464];
-
- FillRndBuffer(Buffer);
- return BytesSHA1(Buffer, 0x464);
-}
-
-int64_t BytesRandomI64()
-{
- uchar Buffer[0x464];
-
- FillRndBuffer(Buffer);
- return BytesSHA1I64(Buffer, 0x464);
-}
-
-unsigned short BytesRandomWord()
-{
- unsigned short RandomW;
- unsigned int RandomDW;
-
- RandomDW = BytesRandom();
- RandomW = *(unsigned short *)&RandomDW;
- RandomW += 0;
- return (RandomW);
-}
-
-void SpecialSHA(uchar *SessionKey, uint SkSz, uchar *SHAResult, uint ResSz)
-{
- SHA_CTX Context;
- uchar Buffer[SHA_DIGEST_LENGTH];
- char *Salts[] = {"\x00\x00\x00\x00", "\x00\x00\x00\x01"};
- uint Idx = 0;
-
- if (ResSz > 40)
- return ;
- while (ResSz > 20)
- {
- SHA1_Init(&Context);
- SHA1_Update(&Context, Salts[Idx], 0x04);
- SHA1_Update(&Context, SessionKey, SkSz);
- SHA1_Final(Buffer, &Context);
- memcpy(SHAResult + (Idx * SHA_DIGEST_LENGTH), Buffer, SHA_DIGEST_LENGTH);
- Idx++;
- ResSz -= SHA_DIGEST_LENGTH;
- }
-
- SHA1_Init(&Context);
- SHA1_Update(&Context, Salts[Idx], 0x04);
- SHA1_Update(&Context, SessionKey, SkSz);
- SHA1_Final(Buffer, &Context);
- memcpy(SHAResult + (Idx * SHA_DIGEST_LENGTH), Buffer, ResSz);
-}
-
-void BuildUnFinalizedDatas(uchar *Datas, uint Size, uchar *Result)
-{
- uchar *Mark;
- uint Idx;
- SHA_CTX MDCtx;
-
- Result[0x00] = 0x4B;
- for (Idx = 1; Idx < (0x80 - (Size + SHA_DIGEST_LENGTH) - 2); Idx++)
- Result[Idx] = 0xBB;
- Result[Idx++] = 0xBA;
-
- Mark = Result + Idx;
-
- memcpy(Result + Idx, Datas, Size);
- Idx += Size;
-
- SHA1_Init(&MDCtx);
- SHA1_Update(&MDCtx, Mark, Size);
- SHA1_Final(Result + Idx, &MDCtx);
- Idx += SHA_DIGEST_LENGTH;
-
- Result[Idx] = 0xBC;
-}
-
-uchar *FinalizeLoginDatas(Skype_Inst *pInst, uchar *Buffer, uint *Size, uchar *Suite, int SuiteSz)
-{
- int Idx;
- uchar *Result;
- SHA_CTX Context;
- uchar SHARes[SHA_DIGEST_LENGTH] = {0};
-
- Idx = 0;
- if (Buffer[*Size - 1] != 0xBC)
- return (NULL);
- if (SuiteSz)
- {
- if (*Buffer != 0x6A)
- return (NULL);
- *Size = 0x6A + SuiteSz;
- Idx += 1;
- goto Copy;
- }
- while ((Buffer[Idx] & 0x0F) == 0x0B)
- Idx++;
- if ((Buffer[Idx] & 0x0F) != 0x0A)
- return (NULL);
- Idx += 1;
- *Size = (*Size - 0x15) - Idx;
-
-Copy:
- Result = (uchar *)malloc(*Size);
- memcpy(Result, Buffer + Idx, *Size - SuiteSz);
- if (SuiteSz) memcpy(Result + (*Size - SuiteSz), Suite, SuiteSz);
-
- SHA1_Init(&Context);
- SHA1_Update(&Context, Result, *Size);
- SHA1_Final(SHARes, &Context);
-
- if (strncmp((char *)SHARes, (char *)(Buffer + Idx + (*Size - SuiteSz)), SHA_DIGEST_LENGTH))
- {
- pInst->pfLog(pInst->pLogStream, "Bad SHA Digest for unencrypted Datas..\n");
- free(Result);
- return (NULL);
- }
-
- return (Result);
-}
-
-void GenSessionKey(uchar *Buffer, uint Size)
-{
- uint Idx, Rander;
-
- Rander = BytesRandom();
- for (Idx = 0; Idx < Size; Idx++)
- {
- Rander = skrand(Rander);
- Buffer[Idx] = ((uchar *)&Rander)[sizeof(Rander) - 1];
- //Buffer[Idx] = (uchar)(Idx + 1);
- }
- Buffer[0] = 0x01;
-}
-
diff --git a/protocols/MSN/src/skylogin/random.h b/protocols/MSN/src/skylogin/random.h
deleted file mode 100644
index adea8f9cf1..0000000000
--- a/protocols/MSN/src/skylogin/random.h
+++ /dev/null
@@ -1,7 +0,0 @@
-unsigned int BytesSHA1(uchar *Data, uint Length);
-void GenSessionKey(uchar *Buffer, uint Size);
-void SpecialSHA(uchar *SessionKey, uint SkSz, uchar *SHAResult, uint ResSz);
-uchar *FinalizeLoginDatas(Skype_Inst *pInst, uchar *Buffer, uint *Size, uchar *Suite, int SuiteSz);
-int64_t BytesSHA1I64(uchar *Data, uint Length);
-int64_t BytesRandomI64();
-void BuildUnFinalizedDatas(uchar *Datas, uint Size, uchar *Result);
diff --git a/protocols/MSN/src/skylogin/rc4comm.c b/protocols/MSN/src/skylogin/rc4comm.c
deleted file mode 100644
index d63676878f..0000000000
--- a/protocols/MSN/src/skylogin/rc4comm.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Skype Login
- *
- * Based on:
- * FakeSkype : Skype reverse engineering proof-of-concept client
- * Ouanilo MEDEGAN (c) 2006 http://www.oklabs.net
- * pyskype : Skype login Python script by uunicorn
- *
- * Written by: leecher@dose.0wnz.at (c) 2015
- *
- * Module: RC4 wrapped communication layer
- *
- */
-#include "common.h"
-#include "rc4comm.h"
-#ifdef USE_RC4
-#ifdef _WIN32
-#define alloca _alloca
-#endif
-
-static char *SkypeDHModulus348 = "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b13b202ffffffffffffffff";
-
-int RC4Comm_Init(LSConnection *pConn)
-{
- DH *dh;
- char pub_key[96], sec_key[48], ls_keybuf[1024];
- BIGNUM *ls_key;
- int ret = 0;
-
- if (!(dh = DH_new())) return -1;
- BN_hex2bn(&dh->g, "2");
- BN_hex2bn(&dh->p, SkypeDHModulus348);
- DH_generate_key(dh);
- if (send(pConn->LSSock, pub_key, BN_bn2bin(dh->pub_key, pub_key), 0)>0)
- {
- if (recv(pConn->LSSock, ls_keybuf, sizeof(ls_keybuf), 0)>0)
- {
- ls_key = BN_bin2bn(ls_keybuf, 48, NULL);
- if (DH_compute_key(sec_key, ls_key, dh)<=0) ret = -3; else
- {
- MD5_CTX Context;
- uchar BufHash[MD5_DIGEST_LENGTH];
-
- MD5_Init(&Context);
- MD5_Update(&Context, "O", 1);
- MD5_Update(&Context, sec_key, 48);
- MD5_Final(BufHash, &Context);
- if (send(pConn->LSSock, BufHash, 8, 0)>0)
- {
- /* Setup RC4 */
- RC4_set_key(&pConn->rc4_send, 48, sec_key);
- if (sec_key[0] == 0xFF) {pInst->pfLog(pInst->pLogStream, "First byte overflow, negotiation failed?");}
- sec_key[0]++;
- RC4_set_key(&pConn->rc4_recv, 48, sec_key);
- } else
- ret=-1;
- }
- BN_free(ls_key);
- } else
- ret=-1;
- } else
- ret=-1;
-
- DH_free(dh);
- return ret;
-}
-
-int RC4Comm_Send (LSConnection *pConn, const char * buf, int len)
-{
- char *out = alloca(len);
-
- RC4(&pConn->rc4_send, len, buf, out);
- return send(pConn->LSSock, out, len, 0);
-}
-
-int RC4Comm_Recv (LSConnection *pConn, char * buf, int len)
-{
- int ret = recv(pConn->LSSock, buf, len, 0);
- if (ret > 0) RC4(&pConn->rc4_recv, ret, buf, buf);
- return ret;
-}
-
-#endif
diff --git a/protocols/MSN/src/skylogin/rc4comm.h b/protocols/MSN/src/skylogin/rc4comm.h
deleted file mode 100644
index c9c24bb7b1..0000000000
--- a/protocols/MSN/src/skylogin/rc4comm.h
+++ /dev/null
@@ -1,3 +0,0 @@
-int RC4Comm_Init(LSConnection *pConn);
-int RC4Comm_Send (LSConnection *pConn, const char * buf, int len);
-int RC4Comm_Recv (LSConnection *pConn, char * buf, int len);
diff --git a/protocols/MSN/src/skylogin/skylogin.c b/protocols/MSN/src/skylogin/skylogin.c
deleted file mode 100644
index e0bab68c17..0000000000
--- a/protocols/MSN/src/skylogin/skylogin.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * Skype Login
- *
- * Based on:
- * FakeSkype : Skype reverse engineering proof-of-concept client
- * Ouanilo MEDEGAN (c) 2006 http://www.oklabs.net
- * pyskype : Skype login Python script by uunicorn
- *
- * Written by: leecher@dose.0wnz.at (c) 2015
- *
- * Module: Main module which contains public functions of library
- *
- */
-#ifdef _WIN32
-#define EXPORT
-#define strcasecmp stricmp
-#endif
-#include <time.h>
-#include "common.h"
-#include "login.h"
-#include "platform.h"
-#include "uic.h"
-#include "objects.h"
-#include "credentials.h"
-#include "skylogin.h"
-
-EXPORT SkyLogin SkyLogin_Init()
-{
- Skype_Inst *pInst = calloc(1, sizeof(Skype_Inst));
-
-#ifdef _WIN32
- WORD wVersionRequested;
- WSADATA wsaData;
-
- wVersionRequested = MAKEWORD( 2, 2 );
- WSAStartup( wVersionRequested, &wsaData);
-#endif
-
- if (pInst) InitInstance(pInst);
- return (SkyLogin*)pInst;
-}
-
-EXPORT void SkyLogin_Exit(SkyLogin pPInst)
-{
- Skype_Inst *pInst = (Skype_Inst*)pPInst;
- if (pInst->LoginD.User) free(pInst->LoginD.User);
- if (pInst->LoginD.RSAKeys) RSA_free(pInst->LoginD.RSAKeys);
- if (pInst->LoginD.SignedCredentials.Memory) free(pInst->LoginD.SignedCredentials.Memory);
- free(pInst);
-}
-
-EXPORT void SkyLogin_SetLogFunction(SkyLogin pPInst, int (__cdecl *pfLog)(void *stream, const char *format, ...), void *pLogStream)
-{
- Skype_Inst *pInst = (Skype_Inst*)pPInst;
-
- pInst->pfLog = pfLog;
- pInst->pLogStream = pLogStream;
-}
-
-EXPORT int SkyLogin_LoadCredentials(SkyLogin pPInst, char *User)
-{
- Skype_Inst *pInst = (Skype_Inst*)pPInst;
-
- Memory_U creds = Credentials_Load(User);
- int ret = 0;
-
- if (creds.Memory)
- {
- // Credentials were found and loaded, now let's parse them.
- SResponse LoginDatas;
-
- if (Credentials_Read(pInst, creds, &LoginDatas) == 0)
- {
- // Credentials were successfully read :)
- // Now verify if they are still valid
- uint Idx;
- time_t t;
-
- for (Idx = 0, ret = 1; ret && Idx < LoginDatas.NbObj; Idx++)
- {
- switch (LoginDatas.Objs[Idx].Id)
- {
- case OBJ_ID_LDUSER:
- // Credentials for wrong user?
- ret = !strcasecmp((char*)LoginDatas.Objs[Idx].Value.Memory.Memory, User);
- if (pInst->LoginD.User) free(pInst->LoginD.User);
- pInst->LoginD.User = strdup((char*)LoginDatas.Objs[Idx].Value.Memory.Memory);
- break;
- case OBJ_ID_LDEXPIRY:
- // Credentials expired?
- ret = (int)LoginDatas.Objs[Idx].Value.Nbr * 60 > time(&t)-60;
- break;
- }
- }
- FreeResponse(&LoginDatas);
- }
- free(creds.Memory);
- }
- return ret;
-}
-
-EXPORT int SkyLogin_PerformLogin(SkyLogin pPInst, char *User, char *Pass)
-{
- int ret;
- Skype_Inst *pInst = (Skype_Inst*)pPInst;
-
- if ((ret = PerformLogin(pInst, User, Pass)) > 0)
- {
- // On successful login, save login datas
- Memory_U creds = Credentials_Write(pInst);
- if (creds.Memory)
- {
- Credentials_Save(creds, User);
- free (creds.Memory);
- }
-
- if (pInst->LoginD.User) free(pInst->LoginD.User);
- pInst->LoginD.User = strdup(User);
- }
- return ret;
-}
-
-EXPORT int SkyLogin_PerformLoginOAuth(SkyLogin pPInst, const char *OAuth)
-{
- int ret;
- Skype_Inst *pInst = (Skype_Inst*)pPInst;
-
- if ((ret = PerformLogin(pInst, OAuth, NULL)) > 0)
- {
- // On successful login, save login datas
- Memory_U creds = Credentials_Write(pInst);
- if (creds.Memory)
- {
- SResponse LoginDatas;
-
- // We don't know user name, so read it from Credentials
- if (Credentials_Parse(pInst, pInst->LoginD.SignedCredentials, &LoginDatas) == 0)
- {
- uint Idx;
-
- for (Idx = 0; Idx < LoginDatas.NbObj; Idx++)
- {
- if (LoginDatas.Objs[Idx].Id == OBJ_ID_LDUSER)
- {
- Credentials_Save(creds, (char*)LoginDatas.Objs[Idx].Value.Memory.Memory);
- if (pInst->LoginD.User) free(pInst->LoginD.User);
- pInst->LoginD.User = (uchar*)strdup((char*)LoginDatas.Objs[Idx].Value.Memory.Memory);
- break;
- }
- }
- FreeResponse(&LoginDatas);
- }
- free (creds.Memory);
- }
- }
- return ret;
-}
-
-
-EXPORT int SkyLogin_CreateUICString(SkyLogin pInst, const char *pszNonce, char *pszOutUIC)
-{
- return CreateUICString((Skype_Inst*)pInst, pszNonce, "WS-SecureConversationSESSION KEY TOKEN", pszOutUIC);
-}
-
-EXPORT int SkyLogin_GetCredentialsUIC(SkyLogin pInst, char *pszOutUIC)
-{
- return GetCredentialsUIC((Skype_Inst*)pInst, pszOutUIC);
-}
-
-EXPORT char *SkyLogin_GetUser(SkyLogin pInst)
-{
- return (char*)((Skype_Inst*)pInst)->LoginD.User;
-}
diff --git a/protocols/MSN/src/skylogin/skylogin.h b/protocols/MSN/src/skylogin/skylogin.h
deleted file mode 100644
index 89e8e83b70..0000000000
--- a/protocols/MSN/src/skylogin/skylogin.h
+++ /dev/null
@@ -1,62 +0,0 @@
-typedef void* SkyLogin;
-
-/* Size of the buffer you should supply as pszOutUIC on SkyLogin_CreateUICString */
-#define UICSTR_SIZE 1024
-
-#ifndef EXPORT
-#define EXPORT
-#endif
-
-/* Initialize SkyLogin Instance */
-EXPORT SkyLogin SkyLogin_Init();
-
-/* Uninitialize Skylogin Instance */
-EXPORT void SkyLogin_Exit(SkyLogin pInst);
-
-/* Optionally sets a function that receives debug logging for diagnosis. i.e.
- * you can use fprintf and stderr here
- */
-EXPORT void SkyLogin_SetLogFunction(SkyLogin pPInst, int (__cdecl *pfLog)(void *stream, const char *format, ...), void *pLogStream);
-
-/* Load Credentials from cache, if they are available and valid
- * Returns:
- * 1 if credentials are successfully loaded,
- * 0 if they are invalid or don't exist */
-EXPORT int SkyLogin_LoadCredentials(SkyLogin pInst, char *pszUser);
-
-/* Perform login with Username and Password
- * Returns:
- * 1 on success, 0 on failure, -1 on socket error, -2 on bad response */
-EXPORT int SkyLogin_PerformLogin(SkyLogin pInst, char *pszUser, char *pszPass);
-
-/* Perform login with OAuth token
- * Returns:
- * 1 on success, 0 on failure, -1 on socket error, -2 on bad response */
-EXPORT int SkyLogin_PerformLoginOAuth(SkyLogin pInst, const char *OAuth);
-
-/* Creates UIC string from nonce pszNonce and places it in pszOutUIC
- * pszOutUIC buffer should be at least UICSTR_SIZE in size.
- *
- * Returns:
- * Size of UIC string in Bytes on success, 0 on failure
- */
-EXPORT int SkyLogin_CreateUICString(SkyLogin pInst, const char *pszNonce, char *pszOutUIC);
-
-/* Gets the base64 encoded signed Credentials after login. They are required if
- * you do OAUTH-Login instead of UICString from above.
- * pszOutUIC buffer should be at least UICSTR_SIZE in size.
- *
- * Returns:
- * Size of UIC string in Bytes on success, 0 on failure
- */
-EXPORT int SkyLogin_GetCredentialsUIC(SkyLogin pInst, char *pszOutUIC);
-
-/* Gets the Skype username of the currently loaded login credentials.
- * This can be useful if you do OAuth login and want to get the assigned
- * Skype username without the need to query it seperately so that you can
- * i.e. store it in your DB for later calls of SkyLogin_LoadCredentials()
- *
- * Returns:
- * Pointer to the username, NULL if it doesn't exist. Ne need to free()!
- */
-EXPORT char *SkyLogin_GetUser(SkyLogin pInst);
diff --git a/protocols/MSN/src/skylogin/uic.c b/protocols/MSN/src/skylogin/uic.c
deleted file mode 100644
index 6b32b70796..0000000000
--- a/protocols/MSN/src/skylogin/uic.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Skype Login
- *
- * Based on:
- * FakeSkype : Skype reverse engineering proof-of-concept client
- * Ouanilo MEDEGAN (c) 2006 http://www.oklabs.net
- * pyskype : Skype login Python script by uunicorn
- *
- * Written by: leecher@dose.0wnz.at (c) 2015
- *
- * Module: UIC generation
- *
- */
-#include "common.h"
-#include "random.h"
-#include "skylogin.h"
-
-#ifndef CRYPT_WOLFSSL
-/* OpenSSL Base64_Encode */
-#include <openssl/evp.h>
-#include <openssl/buffer.h>
-
-static int Base64_Encode(const uchar* in, uint inLen, uchar* out, uint* outLen)
-{
- BIO *bmem, *b64;
- BUF_MEM *bptr;
- int ret=0;
-
- b64 = BIO_new(BIO_f_base64());
- bmem = BIO_new(BIO_s_mem());
- b64 = BIO_push(b64, bmem);
- BIO_write(b64, in, inLen);
- BIO_flush(b64);
- BIO_get_mem_ptr(b64, &bptr);
- if (*outLen>(uint)bptr->length) *outLen=bptr->length; else ret=-1;
- memcpy(out, bptr->data, *outLen);
- BIO_free_all(b64);
- return ret;
-}
-#endif
-
-
-Memory_U CreateUIC(Skype_Inst *pInst, const char *pszNonce, const char *pszSalt)
-{
- Memory_U uic_pkt, uic={0};
- SHA_CTX CredCtx;
- uchar *p;
- uchar SignedChallenge[0x80] = {0};
- int cbSalt = strlen(pszSalt), cbNonce = strlen(pszNonce);
-
- if (!(uic_pkt.Memory = (uchar*)malloc(uic_pkt.MsZ = SHA_DIGEST_LENGTH + cbSalt + cbNonce)))
- return uic;
- SHA1_Init(&CredCtx);
- SHA1_Update(&CredCtx, pInst->LoginD.SignedCredentials.Memory, pInst->LoginD.SignedCredentials.MsZ);
- SHA1_Update(&CredCtx, pszSalt, cbSalt);
- SHA1_Final(uic_pkt.Memory, &CredCtx);
- p = uic_pkt.Memory + SHA_DIGEST_LENGTH;
- memcpy(p, pszSalt, cbSalt);
- p+=cbSalt;
- memcpy(p, pszNonce, cbNonce);
- BuildUnFinalizedDatas(uic_pkt.Memory, uic_pkt.MsZ, SignedChallenge);
- if (RSA_private_encrypt(sizeof(SignedChallenge), SignedChallenge, SignedChallenge,
- pInst->LoginD.RSAKeys, RSA_NO_PADDING)<0)
- return uic;
- free (uic_pkt.Memory);
- if (!(uic.Memory = (uchar*)malloc(uic.MsZ = sizeof(SignedChallenge) + pInst->LoginD.SignedCredentials.MsZ + 4)))
- {
- uic.MsZ=0;
- return uic;
- }
- p = uic.Memory;
- *((uint*)p) = htonl(pInst->LoginD.SignedCredentials.MsZ);
- p+=sizeof(uint);
- memcpy(p, pInst->LoginD.SignedCredentials.Memory, pInst->LoginD.SignedCredentials.MsZ);
- p+=pInst->LoginD.SignedCredentials.MsZ;
- memcpy(p, SignedChallenge, sizeof(SignedChallenge));
- return uic;
-}
-
-
-int CreateUICString(Skype_Inst *pInst, const char *pszNonce, const char *pszSalt, char *pszOutUIC)
-{
- Memory_U uic = CreateUIC(pInst, pszNonce, pszSalt);
- uint outlen = UICSTR_SIZE;
-
- if (uic.MsZ && uic.Memory)
- {
- Base64_Encode(uic.Memory, uic.MsZ, (uchar*)pszOutUIC, &outlen);
- pszOutUIC[outlen]=0;
- free(uic.Memory);
- } else return 0;
- return outlen;
-}
-
-int GetCredentialsUIC(Skype_Inst *pInst, char *pszOutUIC)
-{
- uint outlen = UICSTR_SIZE;
-
- if (pInst->LoginD.SignedCredentials.MsZ)
- {
- Base64_Encode(pInst->LoginD.SignedCredentials.Memory, pInst->LoginD.SignedCredentials.MsZ, (uchar*)pszOutUIC, &outlen);
- pszOutUIC[outlen]=0;
- } else return 0;
- return outlen;
-}
diff --git a/protocols/MSN/src/skylogin/uic.h b/protocols/MSN/src/skylogin/uic.h
deleted file mode 100644
index ad870035a8..0000000000
--- a/protocols/MSN/src/skylogin/uic.h
+++ /dev/null
@@ -1,3 +0,0 @@
-Memory_U CreateUIC(Skype_Inst *pInst, const char *pszNonce, const char *pszSalt);
-int CreateUICString(Skype_Inst *pInst, const char *pszNonce, const char *pszSalt, char *pszOutUIC);
-int GetCredentialsUIC(Skype_Inst *pInst, char *pszOutUIC);
diff --git a/protocols/MSN/src/stdafx.cxx b/protocols/MSN/src/stdafx.cxx
deleted file mode 100644
index b3191575f8..0000000000
--- a/protocols/MSN/src/stdafx.cxx
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
-Copyright (C) 2012-20 Miranda NG team (https://miranda-ng.org)
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation version 2
-of the License.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "stdafx.h" \ No newline at end of file
diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h
deleted file mode 100644
index 2541a56b48..0000000000
--- a/protocols/MSN/src/stdafx.h
+++ /dev/null
@@ -1,902 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2006-2011 Boris Krasnovskiy.
-Copyright (c) 2003-2005 George Hazan.
-Copyright (c) 2002-2003 Richard Hughes (original version).
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#pragma once
-
-#include <windows.h>
-#include <commctrl.h>
-
-#include <ctype.h>
-#include <malloc.h>
-#include <process.h>
-#include <stdio.h>
-#include <time.h>
-
-#include <direct.h>
-#include <io.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#include <newpluginapi.h>
-
-#include <m_clistint.h>
-#include <m_contacts.h>
-#include <m_idle.h>
-#include <m_icolib.h>
-#include <m_message.h>
-#include <m_options.h>
-#include <m_protocols.h>
-#include <m_protosvc.h>
-#include <m_protoint.h>
-#include <m_skin.h>
-#include <m_system.h>
-#include <m_userinfo.h>
-#include <m_utils.h>
-#include <win2k.h>
-#include <m_database.h>
-#include <m_langpack.h>
-#include <m_netlib.h>
-#include <m_popup.h>
-#include <m_chat_int.h>
-#include <m_avatars.h>
-#include <m_timezones.h>
-#include <m_extraicons.h>
-#include <m_nudge.h>
-#include <m_json.h>
-
-#include "m_proto_listeningto.h"
-#include "m_folders.h"
-#include "m_metacontacts.h"
-
-#include "ezxml.h"
-
-#include <openssl/hmac.h>
-#include <openssl/sha.h>
-#pragma comment(lib, "libeay32.lib")
-
-#include "resource.h"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN error codes
-
-#define ERR_SYNTAX_ERROR 200
-#define ERR_INVALID_PARAMETER 201
-#define ERR_INVALID_FEDERATED_USER 203
-#define ERR_UNROUTABLE_USER 204
-#define ERR_INVALID_USER 205
-#define ERR_FQDN_MISSING 206
-#define ERR_ALREADY_LOGIN 207
-#define ERR_INVALID_USERNAME 208
-#define ERR_INVALID_FRIENDLY_NAME 209
-#define ERR_LIST_FULL 210
-#define ERR_ALREADY_THERE 215
-#define ERR_NOT_ON_LIST 216
-#define ERR_NOT_ONLINE 217
-#define ERR_ALREADY_IN_THE_MODE 218
-#define ERR_ALREADY_IN_OPPOSITE_LIST 219
-#define ERR_NOT_ACCEPTING_PAGES 220
-#define ERR_INVALID_MSISDN 232
-#define ERR_UNKNOWN_MSISDN 233
-#define ERR_UNKNOWN_KEITAI_DOMAIN 234
-#define ERR_INVALID_XML_DATA 240
-#define ERR_DETAILED_ERR_IN_PAYLOAD 241
-#define ERR_SWITCHBOARD_FAILED 280
-#define ERR_NOTIFY_XFR_FAILED 281
-#define ERR_UNKNOWN_P2P_APP 282
-#define ERR_UNKNOWN_UUN_APP 283
-#define ERR_MESSAGE_TOO_LONG 285
-#define ERR_SMS_JUST_OUT_OF_FUNDS 290
-#define ERR_REQUIRED_FIELDS_MISSING 300
-#define ERR_NOT_LOGGED_IN 302
-#define ERR_ADDRESS_BOOK 403
-#define ERR_SMS_SUBSCRIPTION_REQUIRED 413
-#define ERR_SMS_SUBSCRIPTION_DISABLED 414
-#define ERR_SMS_OUT_OF_FUNDS 415
-#define ERR_SMS_DISABLED_MARKET 416
-#define ERR_SMS_DISABLED_GLOBAL 417
-#define ERR_TRY_AGAIN_LATER 418
-#define ERR_NO_MARKET_SPECIFIED 419
-#define ERR_INTERNAL_SERVER 500
-#define ERR_DB_SERVER 501
-#define ERR_UPSDOWN 504
-#define ERR_LIST_UNAVAILABLE 508
-#define ERR_PAGE_MODE_MESSAGE 509
-#define ERR_FILE_OPERATION 510
-#define ERR_DETAILED_ERR 511
-#define ERR_MEMORY_ALLOC 520
-#define ERR_OIM_NOT_SUPPORTED 537
-#define ERR_SMS_ACCOUNT_MUTED 550
-#define ERR_SMS_ACCOUNT_DISABLED 551
-#define ERR_SMS_ACCOUNT_MAXED 552
-#define ERR_SMS_INTERNAL_SERVER 580
-#define ERR_SMS_CARRIER_INVALID 590
-#define ERR_SMS_CARRIER_NO_ROUTE 591
-#define ERR_SMS_CARRIER_ERRORED 592
-#define ERR_SMS_ADDRESS_MAPPING_FULL 593
-#define ERR_SMS_INCORRECT_SOURCE_CTRY 594
-#define ERR_SMS_MOBILE_CACHE_FULL 595
-#define ERR_SMS_INCORRECT_FORMAT 596
-#define ERR_SMS_INVALID_TEXT 597
-#define ERR_SMS_MESSAGE_TOO_LONG 598
-#define ERR_SERVER_BUSY 600
-#define ERR_SERVER_UNAVAILABLE 601
-#define ERR_PEER_NS_DOWN 602
-#define ERR_DB_CONNECT 603
-#define ERR_SERVER_GOING_DOWN 604
-#define ERR_PAGING_UNAVAILABLE 606
-#define ERR_CREATE_CONNECTION 707
-#define ERR_INVALID_LOCALE 710
-#define ERR_BLOCKING_WRITE 711
-#define ERR_SESSION_OVERLOAD 712
-#define ERR_USER_TOO_ACTIVE 713
-#define ERR_TOO_MANY_SESSIONS 714
-#define ERR_NOT_EXPECTED 715
-#define ERR_BAD_FRIEND_FILE 717
-#define ERR_USER_RESTRICTED 718
-#define ERR_SESSION_FEDERATED 719
-#define ERR_USER_FEDERATED 726
-#define ERR_ROAMING_LOGOFF 733
-#define ERR_TOO_MANY_ENDPOINTS 734
-#define ERR_RATE_LIMIT_EXCEEDED 800
-#define ERR_PER_USER_LOGIN_LIMIT_EXCEED 803
-#define ERR_AUTHENTICATION_FAILED 911
-#define ERR_NOT_ALLOWED_WHEN_OFFLINE 913
-#define ERR_ACCOUNT_COMPROMISED 915
-#define ERR_NOT_ACCEPTING_NEW_USERS 920
-#define ERR_TIMEDOUT 921
-#define ERR_CHILD_WITHOUT_FULL_CONSENT 923
-#define ERR_EMAIL_ADDRESS_NOT_VERIFIED 924
-#define ERR_MGED_USER_LTD_ACC_WRONG_CLNT 926
-#define ERR_MGED_USER_ACCESS_DENIED 927
-#define ERR_AUTH 928
-#define ERR_DOMAIN_RESERVED 931
-#define ERR_INVALID_CONTACT_LIST 933
-#define ERR_INVALID_SIGNATURE 935
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Global definitions
-
-#define MSN_MAX_EMAIL_LEN 128
-#define MSN_GUID_LEN 40
-
-#define MSN_PACKETS_COMBINE 7
-#define MSN_DEFAULT_PORT 443
-#define MSN_DEFAULT_GATEWAY_PORT 443
-const char MSN_DEFAULT_LOGIN_SERVER[] = "s.gateway.messenger.live.com";
-const char MSN_DEFAULT_GATEWAY[] = "geo.gateway.messenger.live.com";
-const char MSN_USER_AGENT[] = NETLIB_USER_AGENT;
-
-#define MSN_BLOCK "/BlockCommand"
-#define MSN_INVITE "/InviteCommand"
-#define MSN_VIEW_PROFILE "/ViewProfile"
-
-#define MS_GOTO_INBOX "/GotoInbox"
-#define MS_EDIT_PROFILE "/EditProfile"
-#define MS_EDIT_ALERTS "/EditAlerts"
-#define MS_SET_NICKNAME_UI "/SetNicknameUI"
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN plugin functions
-
-struct CMsnProto;
-
-#define MSN_ALLOW_MSGBOX 1
-#define MSN_ALLOW_ENTER 2
-#define MSN_HOTMAIL_POPUP 4
-#define MSN_SHOW_ERROR 8
-#define MSN_ALERT_POPUP 16
-
-void HtmlDecode(char* str);
-char* HtmlEncode(const char* str);
-bool txtParseParam (const char* szData, const char* presearch, const char* start, const char* finish, char* param, const int size);
-void stripBBCode(char* src);
-void stripColorCode(char* src);
-void stripHTML(char* str);
-void parseWLID(char* wlid, char** net, char** email, char** inst);
-
-char* GetGlobalIp(void);
-
-char* MSN_GetAvatarHash(char* szContext, char** pszUrl = nullptr);
-bool MSN_MsgWndExist(MCONTACT hContact);
-
-#define MSN_SendNickname(a) MSN_SendNicknameUtf(UTF8(a))
-
-unsigned MSN_GenRandom(void);
-
-void MSN_InitContactMenu(void);
-void MSN_RemoveContactMenus(void);
-
-void MsnInitIcons(void);
-
-int sttDivideWords(char* parBuffer, int parMinItems, char** parDest);
-void MSN_MakeDigest(const char* chl, char* dgst);
-char* getNewUuid(void);
-time_t IsoToUnixTime(const char *stamp);
-time_t MsnTSToUnixtime(const char *pszTS);
-
-wchar_t* EscapeChatTags(const wchar_t* pszText);
-
-void overrideStr(wchar_t*& dest, const wchar_t* src, bool unicode, const wchar_t* def = nullptr);
-
-char* arrayToHex(BYTE* data, size_t datasz);
-
-inline unsigned short _htons(unsigned short s)
-{
- return s>>8|s<<8;
-}
-
-inline unsigned long _htonl(unsigned long s)
-{
- return s<<24|(s&0xff00)<<8|((s>>8)&0xff00)|s>>24;
-}
-
-inline unsigned __int64 _htonl64(unsigned __int64 s)
-{
- return (unsigned __int64)_htonl(s & 0xffffffff) << 32 | _htonl(s >> 32);
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Popup interface
-
-struct PopupData
-{
- unsigned flags;
- char* url;
- wchar_t* title;
- wchar_t* text;
- CMsnProto* proto;
-};
-
-struct STRLIST : public LIST<char>
-{
- static int compare(const char* p1, const char* p2)
- { return _stricmp(p1, p2); }
-
- STRLIST() : LIST<char>(2, compare) {}
- ~STRLIST() { destroy(); }
-
- void destroy( void )
- {
- for (int i=0; i < count; i++)
- mir_free(items[i]);
-
- List_Destroy((SortedList*)this);
- }
-
- int insertn(const char* p) { return insert(mir_strdup(p)); }
-
- int remove(int idx)
- {
- mir_free(items[idx]);
- return List_Remove((SortedList*)this, idx);
- }
-
- int remove(const char* p)
- {
- int idx;
- return List_GetIndex((SortedList*)this, (char*)p, &idx) == 1 ? remove(idx) : -1;
- }
-};
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MIME headers processing
-
-class MimeHeaders
-{
-public:
-
- MimeHeaders();
- MimeHeaders(unsigned);
- ~MimeHeaders();
-
- void clear(void);
- char* decodeMailBody(char* msgBody);
- const char* find(const char* fieldName);
- char* flipStr(const char* src, size_t len, char* dest);
- size_t getLength(void);
- char* readFromBuffer(char* src);
- char* writeToBuffer(char* dest);
-
- void addString(const char* name, const char* szValue, unsigned flags = 0);
- void addLong(const char* name, long lValue, unsigned flags = 0);
- void addULong(const char* name, unsigned lValue);
- void addBool(const char* name, bool lValue);
-
- const char* operator[](const char* fieldName) { return find(fieldName); }
-
- static wchar_t* decode(const char* val);
-
-private:
- typedef struct tag_MimeHeader
- {
- const char* name;
- const char* value;
- unsigned flags;
- } MimeHeader;
-
- unsigned mCount;
- unsigned mAllocCount;
- MimeHeader* mVals;
-
- unsigned allocSlot(void);
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// File transfer helper
-
-struct ThreadData;
-
-struct HReadBuffer
-{
- HReadBuffer(ThreadData* info, int iStart = 0);
- ~HReadBuffer();
-
- BYTE* surelyRead(size_t parBytes);
-
- ThreadData* owner;
- BYTE* buffer;
- size_t totalDataSize;
- size_t startOffset;
-};
-
-enum TInfoType
-{
- SERVER_NOTIFICATION,
- SERVER_HTTP
-};
-
-struct filetransfer
-{
- filetransfer(CMsnProto* prt);
- ~filetransfer(void);
-
- void close(void);
- void complete(void);
- int create(void);
- int openNext(void);
-
- CMsnProto* proto;
-
- PROTOFILETRANSFERSTATUS std;
-
- bool bCanceled; // flag to interrupt a transfer
- bool bCompleted; // was a FT ever completed?
-
- int fileId; // handle of file being transferring (r/w)
-
- HANDLE hLockHandle;
- HANDLE hResumeEvt;
-
- ThreadData *info;
- TInfoType tType;
- unsigned cf;
-
- //---- receiving a file
- char* szInvcookie; // cookie for receiving
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Thread handling functions and datatypes
-
-#define MSG_DISABLE_HDR 1
-#define MSG_REQUIRE_ACK 2
-#define MSG_RTL 4
-#define MSG_OFFLINE 8
-#define MSG_CONTACT 16
-#define MSG_NUDGE 32
-
-struct CMsnProto;
-typedef void (__cdecl CMsnProto::*MsnThreadFunc)(void*);
-
-/* Groupchat threadlist entry. As there is no more SB in MSNP21+,
- * this is no longer in ThreadData and there are no more new
- * Threads, but for code compatibility, we still have ThreadData
- * as a "main connection"
- */
-struct GCUserItem
-{
- char WLID[MSN_MAX_EMAIL_LEN];
- wchar_t role[8];
- BYTE btag;
-};
-
-struct GCThreadData
-{
- GCThreadData();
- ~GCThreadData();
-
- LIST<GCUserItem> mJoinedContacts;
- GCUserItem* mCreator;
- GCUserItem* mMe;
- wchar_t mChatID[MSN_MAX_EMAIL_LEN];
- int netId; // from mChatID
- char szEmail[MSN_MAX_EMAIL_LEN]; // frim mChatID
-};
-
-struct ThreadData
-{
- ThreadData();
- ~ThreadData();
-
- STRLIST mJoinedContactsWLID;
- STRLIST mJoinedIdentContactsWLID;
- char* mInitialContactWLID;
-
- TInfoType mType; // thread type
- MsnThreadFunc mFunc; // thread entry point
- char mServer[80]; // server name
- char mState[128]; // state on XFR
-
- HNETLIBCONN s; // NetLib connection for the thread
- HANDLE mIncomingBoundPort; // Netlib listen for the thread
- HANDLE hWaitEvent;
- WORD mIncomingPort;
- wchar_t mChatID[10];
- bool mIsMainThread;
- clock_t mWaitPeriod;
-
- CMsnProto* proto;
-
- //----| for gateways |----------------------------------------------------------------
- char mSessionID[50]; // Gateway session ID
- char mGatewayIP[80]; // Gateway IP address
- bool sessionClosed;
- bool termPending;
- bool gatewayType;
-
- //----| for switchboard servers only |------------------------------------------------
- bool firstMsgRecv;
- int mCaller;
- char mCookie[130]; // for switchboard servers only
- LONG mTrid; // current message ID
- UINT mTimerId; // typing notifications timer id
-
- //----| for file transfers only |-----------------------------------------------------
- filetransfer* mMsnFtp; // file transfer block
- bool mBridgeInit;
-
- //----| internal data buffer |--------------------------------------------------------
- int mBytesInData; // bytes available in data buffer
- char *mData; // data buffer for connection
- size_t mDataSize;
-
- //----| methods |---------------------------------------------------------------------
- void applyGatewayData(HNETLIBCONN hConn, bool isPoll);
- void getGatewayUrl(char* dest, int destlen, bool isPoll);
- void processSessionData(const char* xMsgr, const char* xHost);
- void startThread(MsnThreadFunc , CMsnProto *prt);
-
- int send(const char data[], size_t datalen);
- int recv(char* data, size_t datalen);
-
- void resetTimeout(bool term = false);
- bool isTimeout(void);
-
- void sendTerminate(void);
- int sendMessage(int msgType, const char* email, int netId, const char* msg, int parFlags);
- int sendRawMessage(int msgType, const char* data, int datLen);
- int sendPacket(const char* cmd, const char* fmt, ...);
- int sendPacketPayload(const char* cmd, const char *param, const char* fmt, ...);
-
- MCONTACT getContactHandle(void);
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// MSN P2P session support
-
-#define MSN_APPID_AVATAR 1
-#define MSN_APPID_AVATAR2 12
-#define MSN_APPID_FILE 2
-#define MSN_APPID_WEBCAM 4
-#define MSN_APPID_MEDIA_SHARING 35
-#define MSN_APPID_IMAGE 33
-
-#define MSN_APPID_CUSTOMSMILEY 3
-#define MSN_APPID_CUSTOMANIMATEDSMILEY 4
-
-#define MSN_TYPEID_FTPREVIEW 0
-#define MSN_TYPEID_FTNOPREVIEW 1
-#define MSN_TYPEID_CUSTOMSMILEY 2
-#define MSN_TYPEID_DISPLAYPICT 3
-#define MSN_TYPEID_BKGNDSHARING 4
-#define MSN_TYPEID_BKGNDIMG 5
-#define MSN_TYPEID_WINK 8
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Message queue
-
-#define MSGQUE_RAW 1
-
-struct MsgQueueEntry
-{
- char* wlid;
- char* message;
- filetransfer* ft;
- STRLIST* cont;
- int msgType;
- int msgSize;
- int seq;
- int allocatedToThread;
- time_t ts;
- int flags;
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// Avatars' queue
-struct AvatarQueueEntry
-{
- MCONTACT hContact;
- char *pszUrl;
-
- __forceinline AvatarQueueEntry(MCONTACT _contact, LPCSTR _url) :
- hContact(_contact),
- pszUrl( mir_strdup(_url))
- {}
-
- __forceinline ~AvatarQueueEntry()
- { mir_free(pszUrl);
- }
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// OAuth Token
-class GenericToken {
-public:
- GenericToken(const char *pszTokenName);
- ~GenericToken();
-
- __forceinline void Init(CMsnProto* proto) { m_proto = proto; }
- bool Load();
- void Save();
- virtual bool Refresh(bool = false) { return false; }
- bool Expired(time_t t = time(0));
- void Clear();
- const char *Token();
- __forceinline operator char*() const { return m_pszToken; }
- void SetToken(const char *pszToken, time_t tExpires);
-
-protected:
- const char *m_pszTokenName;
- char *m_pszToken;
- time_t m_tExpires;
- CMsnProto* m_proto;
-};
-
-class OAuthToken : public GenericToken {
-public:
- OAuthToken(const char *pszTokenName, const char *pszService, bool bPreprendT = false);
-
- virtual bool Refresh(bool bForce = false) override;
-
-private:
- const char *m_pszService;
- bool m_bPreprendT;
-};
-
-class SkypeToken : public GenericToken {
-public:
- SkypeToken(const char *pszTokenName);
- virtual bool Refresh(bool bForce = false) override;
- const char *XSkypetoken();
-};
-
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// User lists
-
-template< class T > int CompareId(const T* p1, const T* p2)
-{
- return _stricmp(p1->id, p2->id);
-}
-
-struct ServerGroupItem
-{
- char* id;
- char* name; // in UTF8
-};
-
-struct MsnPlace
-{
- char *id;
- unsigned cap1;
- unsigned cap2;
- unsigned client;
- char szClientVer[32];
- unsigned p2pMsgId;
- unsigned short p2pPktNum;
-
- ~MsnPlace() {
- mir_free(id);
- }
-};
-
-struct MsnContact
-{
- char *email;
- char *invite;
- char *nick;
- MCONTACT hContact;
- int list;
- int netId;
- int p2pMsgId;
- unsigned cap1;
- unsigned cap2;
-
- OBJLIST<MsnPlace> places;
-
- MsnContact() : email(nullptr), invite(nullptr), nick(nullptr),
- hContact(0), list(0), netId(0), p2pMsgId(0),
- cap1(0), cap2(0), places(1, CompareId) {
- }
-
- ~MsnContact() {
- mir_free(email);
- mir_free(nick);
- mir_free(invite);
- }
-};
-
-#define cap_OnlineViaMobile 0x00000001
-#define cap_OnlineMSN8User 0x00000002
-#define cap_SupportsGifInk 0x00000004
-#define cap_SupportsIsfInk 0x00000008
-#define cap_WebCamDetected 0x00000010
-#define cap_SupportsChunking 0x00000020
-#define cap_MobileEnabled 0x00000040
-#define cap_WebWatchEnabled 0x00000080
-#define cap_SupportsActivities 0x00000100
-#define cap_OnlineViaWebIM 0x00000200
-#define cap_MobileDevice 0x00000400
-#define cap_OnlineViaTGW 0x00000800
-#define cap_HasSpace 0x00001000
-#define cap_IsMceUser 0x00002000
-#define cap_SupportsDirectIM 0x00004000
-#define cap_SupportsWinks 0x00008000
-#define cap_SupportsSharedSearch 0x00010000
-#define cap_IsBot 0x00020000
-#define cap_SupportsVoiceIM 0x00040000
-#define cap_SupportsSChannel 0x00080000
-#define cap_SupportsSipInvite 0x00100000
-#define cap_SupportsMultipartyMedia 0x00200000
-#define cap_SupportsSDrive 0x00400000
-#define cap_SupportsPageModeMessaging 0x00800000
-#define cap_HasOneCare 0x01000000
-#define cap_SupportsTurn 0x02000000
-#define cap_SupportsP2PBootstrap 0x04000000
-#define cap_UsingAlias 0x08000000
-
-#define capex_IsSmsOnly 0x00000001
-#define capex_SupportsVoiceOverMsnp 0x00000002
-#define capex_SupportsUucpSipStack 0x00000004
-#define capex_SupportsApplicationMsg 0x00000008
-#define capex_RTCVideoEnabled 0x00000010
-#define capex_SupportsPeerToPeerV2 0x00000020
-#define capex_IsAuthWebIMUser 0x00000040
-#define capex_Supports1On1ViaGroup 0x00000080
-#define capex_SupportsOfflineIM 0x00000100
-#define capex_SupportsSharingVideo 0x00000200
-#define capex_SupportsNudges 0x00000400
-#define capex_CircleVoiceIMEnabled 0x00000800
-#define capex_SharingEnabled 0x00001000
-#define capex_MobileSuspendIMFanoutDisable 0x00002000
-#define capex_SupportsP2PMixerRelay 0x00008000
-#define capex_ConvWindowFileTransfer 0x00020000
-#define capex_VideoCallSupports16x9 0x00040000
-#define capex_SupportsP2PEnveloping 0x00080000
-#define capex_YahooIMDisabled 0x00400000
-#define capex_SIPTunnelVersion2 0x00800000
-#define capex_VoiceClipSupportsWMAFormat 0x01000000
-#define capex_VoiceClipSupportsCircleIM 0x02000000
-#define capex_SupportsSocialNewsObjectTypes 0x04000000
-#define capex_CustomEmoticonsCapable 0x08000000
-#define capex_SupportsUTF8MoodMessages 0x10000000
-#define capex_FTURNCapable 0x20000000
-#define capex_SupportsP4Activity 0x40000000
-#define capex_SupportsChats 0x80000000
-
-#define capexex_SupportsMissedConversations 0x00000001
-#define capexex_SupportsShortCircuit 0x00000020
-
-#define NETID_UNKNOWN 0
-#define NETID_MSN 1
-#define NETID_LCS 2
-#define NETID_ALIAS 3
-#define NETID_MOB 4
-#define NETID_DOMAIN 5
-#define NETID_SINK 6
-#define NETID_CONTACT 7
-#define NETID_SKYPE 8
-#define NETID_CIRCLE 9
-#define NETID_TMPCIRCLE 10
-#define NETID_CID 11
-#define NETID_APPID 12
-#define NETID_CONNECT 13
-#define NETID_REMOTE 14
-#define NETID_SMTP 16
-#define NETID_LVIDSINK 17
-#define NETID_MULTICAST 18
-#define NETID_THREAD 19
-#define NETID_1TO1TEXT 21
-#define NETID_GROUPTEXT 22
-#define NETID_BOT 28
-#define NETID_YAHOO 32
-#define NETID_PUBSUBTPC 33
-#define NETID_PUBSUBSUB 34
-#define NETID_WNSSID 35
-
-#define LIST_FL 0x0001
-#define LIST_AL 0x0002
-#define LIST_BL 0x0004
-#define LIST_RL 0x0008
-#define LIST_PL 0x0010
-#define LIST_LL 0x0080
-
-#define LIST_REMOVE 0x0100
-#define LIST_REMOVENH 0x0300
-
-// MSN plugin options
-typedef struct _tag_MYOPTIONS
-{
- bool EnableSounds;
-
- bool ShowErrorsAsPopups;
- bool SlowSend;
- bool ManageServer;
-
- char szEmail[MSN_MAX_EMAIL_LEN];
- int netId;
- char szMachineGuid[MSN_GUID_LEN];
- char szMachineGuidP2P[MSN_GUID_LEN];
-}
-MYOPTIONS;
-
-// Windows error class
-struct TWinErrorCode
-{
- WINAPI TWinErrorCode();
- WINAPI ~TWinErrorCode();
-
- char* WINAPI getText();
-
- long mErrorCode;
- char* mErrorText;
-};
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// External variables
-
-#define MSN_NUM_MODES 9
-
-const char msnProtChallenge[] = "YMM8C_H7KCQ2S_KL";
-const char msnProductID[] = "PROD0090YUAUV{2B";
-const char msnAppID[] = "F6D2794D-501F-443A-ADBE-8F1490FF30FD";
-const int msnP24Ver = 2;
-const char msnStoreAppId[] = "Skype";
-const char msnProductVer[] = "0/6.16.0.105/259/";
-const char msnProtID[] = "MSNP24";
-
-extern bool g_bTerminated;
-
-///////////////////////////////////////////////////////////////////////////////
-// UTF8 encode helper
-
-class UTFEncoder
-{
-private:
- char* m_body;
-
-public:
- UTFEncoder(const char* pSrc) :
- m_body(mir_utf8encode(pSrc)) {}
-
- UTFEncoder(const wchar_t* pSrc) :
- m_body(mir_utf8encodeW(pSrc)) {}
-
- ~UTFEncoder() { mir_free(m_body); }
- const char* str() const { return m_body; }
-};
-
-#define UTF8(A) UTFEncoder(A).str()
-
-
-typedef enum _tag_ConEnum
-{
- conUnknown,
- conDirect,
- conUnknownNAT,
- conIPRestrictNAT,
- conPortRestrictNAT,
- conSymmetricNAT,
- conFirewall,
- conISALike
-} ConEnum;
-
-#pragma pack(1)
-typedef struct _tag_UDPProbePkt
-{
- unsigned char version;
- unsigned char serviceCode;
- unsigned short clientPort;
- unsigned clientIP;
- unsigned short discardPort;
- unsigned short testPort;
- unsigned testIP;
- unsigned trId;
-} UDPProbePkt;
-#pragma pack()
-
-extern const char* conStr[];
-
-typedef struct _tag_MyConnectionType
-{
- unsigned intIP;
- unsigned extIP;
- ConEnum udpConType;
- ConEnum tcpConType;
- unsigned weight;
- bool upnpNAT;
- bool icf;
-
- const IN_ADDR GetMyExtIP(void) { return *((PIN_ADDR)&extIP); }
- const char* GetMyExtIPStr(void) { return inet_ntoa(GetMyExtIP()); }
- const char* GetMyUdpConStr(void) { return conStr[udpConType]; }
-} MyConnectionType;
-
-struct chunkedmsg
-{
- char* id;
- char* msg;
- size_t size;
- size_t recvsz;
- bool bychunk;
-
- chunkedmsg(const char* tid, const size_t totsz, const bool bychunk);
- ~chunkedmsg();
-
- void add(const char* msg, size_t offset, size_t portion);
- bool get(char*& tmsg, size_t& tsize);
-};
-
-struct DeleteParam
-{
- CMsnProto *proto;
- MCONTACT hContact;
-};
-
-INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
-struct InviteChatParam
-{
- wchar_t* id;
- MCONTACT hContact;
- CMsnProto* ppro;
-
- InviteChatParam(const wchar_t* id, MCONTACT hContact, CMsnProto* ppro)
- : id(mir_wstrdup(id)), hContact(hContact), ppro(ppro) {}
-
- ~InviteChatParam() {
- mir_free(id);
- }
-};
-
-INT_PTR CALLBACK DlgInviteToChat(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/protocols/MSN/src/version.h b/protocols/MSN/src/version.h
deleted file mode 100644
index d824dce8e4..0000000000
--- a/protocols/MSN/src/version.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
-Plugin of Miranda IM for communicating with users of the MSN Messenger protocol.
-
-Copyright (c) 2012-2020 Miranda NG team
-Copyright (c) 2008-2009 Boris Krasnovskiy.
-
-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, see <http://www.gnu.org/licenses/>.
-*/
-
-#define __MAJOR_VERSION 0
-#define __MINOR_VERSION 95
-#define __RELEASE_NUM 11
-#define __BUILD_NUM 1
-
-#include <stdver.h>
-
-#define __PLUGIN_NAME "MSN protocol"
-#define __FILENAME "MSN.dll"
-#define __DESCRIPTION "Microsoft Network (MSN) protocol support for Miranda NG."
-#define __AUTHOR "Boris Krasnovskiy, George Hazan, Richard Hughes, leecher"
-#define __COPYRIGHT "© 2001-20 Richard Hughes, George Hazan, Boris Krasnovskiy, leecher"
-#define __AUTHORWEB "https://miranda-ng.org/p/MSN/"
diff --git a/src/mir_app/src/db_ini.cpp b/src/mir_app/src/db_ini.cpp
index 47bb735af6..31b42e3225 100644
--- a/src/mir_app/src/db_ini.cpp
+++ b/src/mir_app/src/db_ini.cpp
@@ -501,7 +501,7 @@ static void DoAutoExec(void)
Profile_GetSetting(L"AutoExec/Safe", buf, L"CLC Icons CLUI CList SkinSounds");
ptrA szSafeSections(mir_u2a(buf));
- Profile_GetSetting(L"AutoExec/Unsafe", buf, L"Facebook GG ICQ IRC JABBER MSN SKYPE TWITTER VKontakte");
+ Profile_GetSetting(L"AutoExec/Unsafe", buf, L"Facebook GG ICQ IRC JABBER SKYPE TWITTER VKontakte");
ptrA szUnsafeSections(mir_u2a(buf));
Profile_GetSetting(L"AutoExec/Warn", szSecurity, L"notsafe");
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp
index 6bcb597307..207e74ecc8 100644
--- a/src/mir_app/src/newplugins.cpp
+++ b/src/mir_app/src/newplugins.cpp
@@ -118,6 +118,7 @@ static const MUUID pluginBannedList[] =
{ 0xcf97fd5d, 0xb911, 0x47a8, { 0xaf, 0x03, 0xd2, 0x19, 0x68, 0xb5, 0xb8, 0x94 } }, // sms
{ 0x26a9125d, 0x7863, 0x4e01, { 0xaf, 0x0e, 0xd1, 0x4e, 0xf9, 0x5c, 0x50, 0x54 } }, // old Popup.dll
{ 0x69b9443b, 0xdc58, 0x4876, { 0xad, 0x39, 0xe3, 0xf4, 0x18, 0xa1, 0x33, 0xc5 } }, // mTextControl
+ { 0x97724af9, 0xf3fb, 0x47d3, { 0xa3, 0xbf, 0xea, 0xa9, 0x35, 0xc7, 0x4e, 0x6d } }, // msn
};
bool isPluginBanned(const MUUID &u1)
diff --git a/tools/build_scripts/bin15/z2_PackPluginUpdater_x32.txt b/tools/build_scripts/bin15/z2_PackPluginUpdater_x32.txt
index 74e3b67c2f..dc17baaa7f 100644
--- a/tools/build_scripts/bin15/z2_PackPluginUpdater_x32.txt
+++ b/tools/build_scripts/bin15/z2_PackPluginUpdater_x32.txt
@@ -89,7 +89,6 @@ Plugins\mobilestate.dll
Plugins\mradio.dll
Plugins\msg_export.dll
Plugins\msgpopup.dll
-Plugins\msn.dll
Plugins\mydetails.dll
Plugins\new_gpg.dll
Plugins\newawaysys.dll
@@ -221,7 +220,6 @@ Icons\proto_metacontacts.dll
Icons\proto_minecraftdynmap.dll
Icons\proto_mra.dll
Icons\proto_mradio.dll
-Icons\proto_msn.dll
Icons\proto_newsaggregator.dll
Icons\proto_omegle.dll
Icons\proto_sametime.dll
diff --git a/tools/build_scripts/bin15/z2_PackPluginUpdater_x64.txt b/tools/build_scripts/bin15/z2_PackPluginUpdater_x64.txt
index ad5c832047..c71cdab0d6 100644
--- a/tools/build_scripts/bin15/z2_PackPluginUpdater_x64.txt
+++ b/tools/build_scripts/bin15/z2_PackPluginUpdater_x64.txt
@@ -88,7 +88,6 @@ Plugins\mobilestate.dll
Plugins\mradio.dll
Plugins\msg_export.dll
Plugins\msgpopup.dll
-Plugins\msn.dll
Plugins\mydetails.dll
Plugins\new_gpg.dll
Plugins\newawaysys.dll
@@ -220,7 +219,6 @@ Icons\proto_metacontacts.dll
Icons\proto_minecraftdynmap.dll
Icons\proto_mra.dll
Icons\proto_mradio.dll
-Icons\proto_msn.dll
Icons\proto_newsaggregator.dll
Icons\proto_omegle.dll
Icons\proto_sametime.dll
diff --git a/tools/build_scripts/bin15/z3_PackArchives.txt b/tools/build_scripts/bin15/z3_PackArchives.txt
index 6557460174..1bb9dd3496 100644
--- a/tools/build_scripts/bin15/z3_PackArchives.txt
+++ b/tools/build_scripts/bin15/z3_PackArchives.txt
@@ -79,7 +79,6 @@ Icons\Proto_IRC.dll
Icons\Proto_Jabber.dll
Icons\Proto_MetaContacts.dll
Icons\Proto_MRA.dll
-Icons\Proto_MSN.dll
Icons\TabSRMM_icons.dll
Icons\Toolbar_icons.dll
Icons\xStatus_Jabber.dll
@@ -95,7 +94,6 @@ Plugins\ICQ.dll
Plugins\Import.dll
Plugins\IRC.dll
Plugins\Jabber.dll
-Plugins\MSN.dll
Plugins\PluginUpdater.dll
Plugins\TabSRMM.dll
Plugins\TopToolBar.dll
diff --git a/tools/build_scripts/z2_PackPluginUpdater.bat b/tools/build_scripts/z2_PackPluginUpdater.bat
index 69ef395d7f..46ef0be9a3 100644
--- a/tools/build_scripts/z2_PackPluginUpdater.bat
+++ b/tools/build_scripts/z2_PackPluginUpdater.bat
@@ -63,7 +63,6 @@ for /f %%a in ('dir plugins\*.dll /B /L') do (
if /I "%%a"=="MinecraftDynmap.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_MinecraftDynmap.dll")
if /I "%%a"=="MirLua.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Scripts\*.dll" "Libs\lua*.dll")
if /I "%%a"=="mRadio.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_mRadio.dll" "Plugins\BASS\*.dll")
- if /I "%%a"=="MSN.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_MSN.dll")
if /I "%%a"=="NewsAggregator.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Icons\Proto_NewsAggregator.dll")
if /I "%%a"=="NotifyAnything.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "SendLog*.exe")
if /I "%%a"=="Nudge.dll" (%ZipIt% "%Arch%\Plugins\%%~na.zip" "Sounds\nudge.wav")
diff --git a/tools/installer_ng/Common/Files/Settings/autoexec_sounds.ini b/tools/installer_ng/Common/Files/Settings/autoexec_sounds.ini
index 2068f76f99..739d75cfac 100644
--- a/tools/installer_ng/Common/Files/Settings/autoexec_sounds.ini
+++ b/tools/installer_ng/Common/Files/Settings/autoexec_sounds.ini
@@ -36,10 +36,6 @@ NewsFeed=uSkins\Sounds\news_feed.wav
Notification=uSkins\Sounds\notification.wav
OtherEvent=uSkins\Sounds\other_event.wav
ChatJoin=uSkins\Sounds\user_connect.wav
-MSN:Alerts=uSkins\Sounds\live_alert.wav
-MSN:Hotmail=uSkins\Sounds\live_mail.wav
-MSN_1:Alerts=uSkins\Sounds\live_alert.wav
-MSN_1:Hotmail=uSkins\Sounds\live_mail.wav
UserOnline=uSkins\Sounds\online.wav
UserFromOffline=uSkins\Sounds\online.wav
WWIBirthdayNear=uSkins\Sounds\birthdaycoming.wav
diff --git a/tools/installer_ng/Common/Files/Settings/mirandaboot_default.ini b/tools/installer_ng/Common/Files/Settings/mirandaboot_default.ini
index f882174693..5949e904e6 100644
--- a/tools/installer_ng/Common/Files/Settings/mirandaboot_default.ini
+++ b/tools/installer_ng/Common/Files/Settings/mirandaboot_default.ini
@@ -74,8 +74,8 @@ Safe=CLC Icons CLUI CList Skin SkinSounds TopToolBar
;Unsafe
;A space-separated list of database module names that could be alter to
;malicious purposes (e.g., by faking a login server to steal passwords).
-;Default: Facebook GG ICQ IRC JABBER MSN SKYPE TWITTER VKontakte
-Unsafe=Facebook GG ICQ IRC JABBER MSN SKYPE TWITTER VKontakte
+;Default: Facebook GG ICQ IRC JABBER SKYPE TWITTER VKontakte
+Unsafe=Facebook GG ICQ IRC JABBER SKYPE TWITTER VKontakte
;OverrideSecurityFilename
;System admins may find it desirable to install settings without prompting
diff --git a/tools/installer_ng/Common/Files/Settings/mirandaboot_portable.ini b/tools/installer_ng/Common/Files/Settings/mirandaboot_portable.ini
index 783deba013..8f3fd4474e 100644
--- a/tools/installer_ng/Common/Files/Settings/mirandaboot_portable.ini
+++ b/tools/installer_ng/Common/Files/Settings/mirandaboot_portable.ini
@@ -74,8 +74,8 @@ Safe=CLC Icons CLUI CList Skin SkinSounds TopToolBar
;Unsafe
;A space-separated list of database module names that could be alter to
;malicious purposes (e.g., by faking a login server to steal passwords).
-;Default: Facebook GG ICQ IRC JABBER MSN SKYPE TWITTER VKontakte
-Unsafe=Facebook GG ICQ IRC JABBER MSN SKYPE TWITTER VKontakte
+;Default: Facebook GG ICQ IRC JABBER SKYPE TWITTER VKontakte
+Unsafe=Facebook GG ICQ IRC JABBER SKYPE TWITTER VKontakte
;OverrideSecurityFilename
;System admins may find it desirable to install settings without prompting
diff --git a/tools/installer_ng/MirandaNG.iss b/tools/installer_ng/MirandaNG.iss
index 71c02a7812..4b3919eeeb 100644
--- a/tools/installer_ng/MirandaNG.iss
+++ b/tools/installer_ng/MirandaNG.iss
@@ -59,7 +59,6 @@ Source: "Files\Icons\Proto_IRC.dll"; DestDir: "{app}\Icons"; Components: protoco
Source: "Files\Icons\Proto_Jabber.dll"; DestDir: "{app}\Icons"; Components: protocols\jabber; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Icons\Proto_MetaContacts.dll"; DestDir: "{app}\Icons"; Components: program; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Icons\Proto_MRA.dll"; DestDir: "{app}\Icons"; Components: protocols\icq; Flags: ignoreversion; AfterInstall: ShowPercent()
-Source: "Files\Icons\Proto_MSN.dll"; DestDir: "{app}\Icons"; Components: protocols\msn; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Icons\xStatus_Jabber.dll"; DestDir: "{app}\Icons"; Components: protocols\jabber; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Icons\TabSRMM_icons.dll"; DestDir: "{app}\Icons"; Components: messagewin\tabsrmm; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Icons\Toolbar_icons.dll"; DestDir: "{app}\Icons"; Components: clicts\modern; Flags: ignoreversion; AfterInstall: ShowPercent()
@@ -112,7 +111,6 @@ Source: "Files\Plugins\ICQ.dll"; DestDir: "{app}\Plugins"; Components: protocols
Source: "Files\Plugins\IRC.dll"; DestDir: "{app}\Plugins"; Components: protocols\irc; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Plugins\Jabber.dll"; DestDir: "{app}\Plugins"; Components: protocols\jabber; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Libs\libsignal.mir"; DestDir: "{app}\Libs"; Components: protocols\jabber; Flags: ignoreversion; AfterInstall: ShowPercent()
-Source: "Files\Plugins\MSN.dll"; DestDir: "{app}\Plugins"; Components: protocols\msn; Flags: ignoreversion; AfterInstall: ShowPercent()
; Clists
Source: "Files\Plugins\Clist_blind.dll"; DestDir: "{app}\Plugins"; Components: clicts\blind; Flags: ignoreversion; AfterInstall: ShowPercent()
@@ -150,7 +148,6 @@ Name: "protocols\gg"; Description: "{cm:Gg}"; Types: extended regular minimal
Name: "protocols\icq"; Description: "{cm:Icq}"; Types: extended regular minimal
Name: "protocols\irc"; Description: "{cm:Irc}"; Types: extended regular minimal
Name: "protocols\jabber"; Description: "{cm:Jabber}"; Types: extended regular minimal
-Name: "protocols\msn"; Description: "{cm:Msn}"; Types: extended regular minimal
Name: "clists"; Description: "{cm:Clists}"; Types: extended regular minimal custom; Flags: fixed
Name: "clicts\stdclist"; Description: "{cm:StdClist}"; Types: minimal; Flags: exclusive
Name: "clicts\blind"; Description: "{cm:BlindClist}"; Types: custom; Flags: exclusive
@@ -219,7 +216,6 @@ en.GG=GG protocol
en.Icq=ICQ protocol
en.Irc=IRC protocol
en.Jabber=Jabber protocol
-en.Msn=MSN protocol
en.Clists=Contact lists
en.StdClist=StdClist contact list
en.BlindClist=Contact list for blind folks
@@ -247,7 +243,6 @@ en.ProtocolsGGDescription=Gadu-Gadu protocol support for Miranda NG.
en.ProtocolsICQDescription=ICQ (OSCAR) protocol support for Miranda NG.
en.ProtocolsIRCDescription=Internet Relay Chat (IRC) protocol support for Miranda NG.
en.ProtocolsJabberDescription=Open-standard communications protocol (XMPP) for message-oriented middleware based on XML.
-en.ProtocolsMSNDescription=Microsoft Network (MSN) protocol support for Miranda NG.
en.ClistsDescription=Contact list plugins.
en.StdClistDescription=Basic contact list core module.
en.BlindClistDescription=This is a contact list for blind folks. It uses a list control to show all contacts, so screen readers can "read" the clist to the user.
@@ -293,7 +288,6 @@ ru.GG=Протокол GG
ru.Icq=Протокол ICQ
ru.Irc=Протокол IRC
ru.Jabber=Протокол Jabber
-ru.Msn=Протокол MSN
ru.Clists=Списки контактов
ru.StdClist=Список контактов StdClist
ru.BlindClist=Список контактов для слабовидящих
@@ -321,7 +315,6 @@ ru.ProtocolsGGDescription=Поддержка протокола Gadu-Gadu в Mir
ru.ProtocolsICQDescription=Поддержка протокола ICQ в Miranda NG.
ru.ProtocolsIRCDescription=Поддержка протокола Internet Relay Chat (IRC) в Miranda NG.
ru.ProtocolsJabberDescription=Поддержка протокола Jabber (XMPP) в Miranda NG. Протокол основан на открытых стандартах, базирующихся на XML.
-ru.ProtocolsMSNDescription=Поддержка протокола Microsoft Network (MSN) в Miranda NG.
ru.ClistsDescription=Плагины списков контактов.
ru.StdClistDescription=Список контактов, являющийся модулем ядра, обеспечивает базовый функционал.
ru.BlindClistDescription=Список контактов для слабовидящих. Вспомогательные программы для людей с проблемами зрения могут легко "считать" информацию пользователю.
@@ -367,7 +360,6 @@ cz.GG=GG protokol
cz.Icq=ICQ protokol
cz.Irc=IRC protokol
cz.Jabber=Jabber protokol
-cz.Msn=MSN protokol
cz.Clists=Seznamy kontaktů
cz.StdClist=StdClist
cz.BlindClist=Clist_blind (pro nevidomé)
@@ -395,7 +387,6 @@ cz.protocolsGGDescription=Gadu-Gadu protokol pro Mirandu NG.
cz.protocolsICQDescription=ICQ (OSCAR) protokol pro Mirandu NG.
cz.protocolsIRCDescription=Internet Relay Chat (IRC) protokol pro Mirandu NG.
cz.protocolsJabberDescription=Otevřený komunikační protokol Jabber (XMPP) pro Mirandu NG.
-cz.protocolsMSNDescription=Microsoft Network (MSN) protokol pro Mirandu NG.
cz.ClistsDescription=Doplňky pro seznamy kontaktů.
cz.StdClistDescription=Základní integrovaný modul pro seznam kontaktů.
cz.BlindClistDescription=Seznam kontaktů pro nevidomé uživatele. Pro zobrazení kontaktů využívá jednoduchý seznam, který může být jednoduše přečten.
@@ -441,7 +432,6 @@ de.GG=GG-Protokoll
de.Icq=ICQ-Protokoll
de.Irc=IRC-Protokoll
de.Jabber=Jabber-Protokoll
-de.Msn=MSN-Protokoll
de.Clists=Kontaktlisten
de.StdClist=Klassische Kontaktliste
de.BlindClist=Kontaktliste für Blinde
@@ -469,7 +459,6 @@ de.ProtocolsGGDescription=Gadu-Gadu-Protokollunterstützung für Miranda NG.
de.ProtocolsICQDescription=ICQ- (OSCAR-)Protokollunterstützung für Miranda NG.
de.ProtocolsIRCDescription=Internet-Relay-Chat- (IRC-)Protokollunterstützung für Miranda NG.
de.ProtocolsJabberDescription=Unterstützung des Extensible Messaging and Presence Protocols (XMPP) für Miranda NG.
-de.ProtocolsMSNDescription=Microsoft-Network- (MSN)-Protokollunterstützung für Miranda NG.
de.ClistsDescription=Kontaktlistenplugins.
de.StdClistDescription=Grundlegendes Kontaktlisten-Kernmodul.
de.BlindClistDescription=Dies ist eine Kontaktliste für Blinde. Sie benutzt eine Liste, um alle Kontakte anzuzeigen, so dass Bildschirmleser die Kontaktliste dem Benutzer "vorlesen" können.
@@ -515,7 +504,6 @@ pl.GG=GG
pl.Icq=ICQ
pl.Irc=IRC
pl.Jabber=Jabber
-pl.Msn=MSN
pl.Clists=Lista kontaktów
pl.StdClist=Lista klasyczna (StdClist)
pl.BlindClist=Dla niewidomych (Blind)
@@ -543,7 +531,6 @@ pl.ProtocolsGGDescription=Zapewnia obsługę protokołu Gadu-Gadu.
pl.ProtocolsICQDescription=Zapewnia obsługę protokołu ICQ (OSCAR).
pl.ProtocolsIRCDescription=Zapewnia obsługę protokołu Internet Relay Chat (IRC).
pl.ProtocolsJabberDescription=Zapewnia obsługę protokołu Jabber/XMPP.
-pl.ProtocolsMSNDescription=Zapewnia obsługę protokołu Microsoft Network (MSN).
pl.ClistsDescription=Wtyczki listy kontaktów.
pl.StdClistDescription=Podstawowy moduł listy kontaktów zawarty w rdzeniu.
pl.BlindClistDescription=Jest to lista kontaktów dla ludzi niewidomych. Używa kontrolki listy, aby pokazać wszystkie kontakty, dzięki temu czytnik ekranu może "czytać" listę użtkownikowi.
@@ -612,7 +599,7 @@ const
DRIVE_RAMDISK = 6; // The drive is a RAM disk.
// don't forget to increment it after adding new components!
- COMPONENTS_COUNT = 20; // Index of the first language
+ COMPONENTS_COUNT = 19; // Index of the first language
// Default installation check
function IsDefault: Boolean;
@@ -825,7 +812,6 @@ begin
ComponentList.Add('protocols\icq');
ComponentList.Add('protocols\irc');
ComponentList.Add('protocols\jabber');
- ComponentList.Add('protocols\msn');
ComponentList.Add('clists');
ComponentList.Add('clists\stdclist');
ComponentList.Add('clists\blind');
@@ -913,7 +899,6 @@ begin
ExpandConstant('{cm:ProtocolsICQDescription}') + ';' +
ExpandConstant('{cm:ProtocolsIRCDescription}') + ';' +
ExpandConstant('{cm:ProtocolsJabberDescription}') + ';' +
- ExpandConstant('{cm:ProtocolsMSNDescription}') + ';' +
ExpandConstant('{cm:ClistsDescription}') + ';' +
ExpandConstant('{cm:StdClistDescription}') + ';' +
ExpandConstant('{cm:BlindClistDescription}') + ';' +
diff --git a/tools/installer_ng_stable/Common/Files/Settings/autoexec_sounds.ini b/tools/installer_ng_stable/Common/Files/Settings/autoexec_sounds.ini
index 2068f76f99..739d75cfac 100644
--- a/tools/installer_ng_stable/Common/Files/Settings/autoexec_sounds.ini
+++ b/tools/installer_ng_stable/Common/Files/Settings/autoexec_sounds.ini
@@ -36,10 +36,6 @@ NewsFeed=uSkins\Sounds\news_feed.wav
Notification=uSkins\Sounds\notification.wav
OtherEvent=uSkins\Sounds\other_event.wav
ChatJoin=uSkins\Sounds\user_connect.wav
-MSN:Alerts=uSkins\Sounds\live_alert.wav
-MSN:Hotmail=uSkins\Sounds\live_mail.wav
-MSN_1:Alerts=uSkins\Sounds\live_alert.wav
-MSN_1:Hotmail=uSkins\Sounds\live_mail.wav
UserOnline=uSkins\Sounds\online.wav
UserFromOffline=uSkins\Sounds\online.wav
WWIBirthdayNear=uSkins\Sounds\birthdaycoming.wav
diff --git a/tools/installer_ng_stable/Common/Files/Settings/mirandaboot_default.ini b/tools/installer_ng_stable/Common/Files/Settings/mirandaboot_default.ini
index f882174693..5949e904e6 100644
--- a/tools/installer_ng_stable/Common/Files/Settings/mirandaboot_default.ini
+++ b/tools/installer_ng_stable/Common/Files/Settings/mirandaboot_default.ini
@@ -74,8 +74,8 @@ Safe=CLC Icons CLUI CList Skin SkinSounds TopToolBar
;Unsafe
;A space-separated list of database module names that could be alter to
;malicious purposes (e.g., by faking a login server to steal passwords).
-;Default: Facebook GG ICQ IRC JABBER MSN SKYPE TWITTER VKontakte
-Unsafe=Facebook GG ICQ IRC JABBER MSN SKYPE TWITTER VKontakte
+;Default: Facebook GG ICQ IRC JABBER SKYPE TWITTER VKontakte
+Unsafe=Facebook GG ICQ IRC JABBER SKYPE TWITTER VKontakte
;OverrideSecurityFilename
;System admins may find it desirable to install settings without prompting
diff --git a/tools/installer_ng_stable/Common/Files/Settings/mirandaboot_portable.ini b/tools/installer_ng_stable/Common/Files/Settings/mirandaboot_portable.ini
index 783deba013..8f3fd4474e 100644
--- a/tools/installer_ng_stable/Common/Files/Settings/mirandaboot_portable.ini
+++ b/tools/installer_ng_stable/Common/Files/Settings/mirandaboot_portable.ini
@@ -74,8 +74,8 @@ Safe=CLC Icons CLUI CList Skin SkinSounds TopToolBar
;Unsafe
;A space-separated list of database module names that could be alter to
;malicious purposes (e.g., by faking a login server to steal passwords).
-;Default: Facebook GG ICQ IRC JABBER MSN SKYPE TWITTER VKontakte
-Unsafe=Facebook GG ICQ IRC JABBER MSN SKYPE TWITTER VKontakte
+;Default: Facebook GG ICQ IRC JABBER SKYPE TWITTER VKontakte
+Unsafe=Facebook GG ICQ IRC JABBER SKYPE TWITTER VKontakte
;OverrideSecurityFilename
;System admins may find it desirable to install settings without prompting
diff --git a/tools/installer_ng_stable/MirandaNG.iss b/tools/installer_ng_stable/MirandaNG.iss
index c1edfff42f..04cd4d75a3 100644
--- a/tools/installer_ng_stable/MirandaNG.iss
+++ b/tools/installer_ng_stable/MirandaNG.iss
@@ -59,7 +59,6 @@ Source: "Files\Icons\Proto_IRC.dll"; DestDir: "{app}\Icons"; Components: protoco
Source: "Files\Icons\Proto_Jabber.dll"; DestDir: "{app}\Icons"; Components: protocols\jabber; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Icons\Proto_MetaContacts.dll"; DestDir: "{app}\Icons"; Components: program; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Icons\Proto_MRA.dll"; DestDir: "{app}\Icons"; Components: protocols\icq; Flags: ignoreversion; AfterInstall: ShowPercent()
-Source: "Files\Icons\Proto_MSN.dll"; DestDir: "{app}\Icons"; Components: protocols\msn; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Icons\xStatus_Jabber.dll"; DestDir: "{app}\Icons"; Components: protocols\jabber; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Icons\TabSRMM_icons.dll"; DestDir: "{app}\Icons"; Components: messagewin\tabsrmm; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Icons\Toolbar_icons.dll"; DestDir: "{app}\Icons"; Components: clicts\modern; Flags: ignoreversion; AfterInstall: ShowPercent()
@@ -112,7 +111,6 @@ Source: "Files\Plugins\ICQ.dll"; DestDir: "{app}\Plugins"; Components: protocols
Source: "Files\Plugins\IRC.dll"; DestDir: "{app}\Plugins"; Components: protocols\irc; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Plugins\Jabber.dll"; DestDir: "{app}\Plugins"; Components: protocols\jabber; Flags: ignoreversion; AfterInstall: ShowPercent()
Source: "Files\Libs\libsignal.mir"; DestDir: "{app}\Libs"; Components: protocols\jabber; Flags: ignoreversion; AfterInstall: ShowPercent()
-Source: "Files\Plugins\MSN.dll"; DestDir: "{app}\Plugins"; Components: protocols\msn; Flags: ignoreversion; AfterInstall: ShowPercent()
; Clists
Source: "Files\Plugins\Clist_blind.dll"; DestDir: "{app}\Plugins"; Components: clicts\blind; Flags: ignoreversion; AfterInstall: ShowPercent()
@@ -149,7 +147,6 @@ Name: "protocols\gg"; Description: "{cm:Gg}"; Types: extended regular minimal
Name: "protocols\icq"; Description: "{cm:Icq}"; Types: extended regular minimal
Name: "protocols\irc"; Description: "{cm:Irc}"; Types: extended regular minimal
Name: "protocols\jabber"; Description: "{cm:Jabber}"; Types: extended regular minimal
-Name: "protocols\msn"; Description: "{cm:Msn}"; Types: extended regular minimal
Name: "clists"; Description: "{cm:Clists}"; Types: extended regular minimal custom; Flags: fixed
Name: "clicts\stdclist"; Description: "{cm:StdClist}"; Types: minimal; Flags: exclusive
Name: "clicts\blind"; Description: "{cm:BlindClist}"; Types: custom; Flags: exclusive
@@ -218,7 +215,6 @@ en.GG=GG protocol
en.Icq=ICQ protocol
en.Irc=IRC protocol
en.Jabber=Jabber protocol
-en.Msn=MSN protocol
en.Clists=Contact lists
en.StdClist=StdClist contact list
en.BlindClist=Contact list for blind folks
@@ -246,7 +242,6 @@ en.ProtocolsGGDescription=Gadu-Gadu protocol support for Miranda NG.
en.ProtocolsICQDescription=ICQ (OSCAR) protocol support for Miranda NG.
en.ProtocolsIRCDescription=Internet Relay Chat (IRC) protocol support for Miranda NG.
en.ProtocolsJabberDescription=Open-standard communications protocol (XMPP) for message-oriented middleware based on XML.
-en.ProtocolsMSNDescription=Microsoft Network (MSN) protocol support for Miranda NG.
en.ClistsDescription=Contact list plugins.
en.StdClistDescription=Basic contact list core module.
en.BlindClistDescription=This is a contact list for blind folks. It uses a list control to show all contacts, so screen readers can "read" the clist to the user.
@@ -292,7 +287,6 @@ ru.GG=Протокол GG
ru.Icq=Протокол ICQ
ru.Irc=Протокол IRC
ru.Jabber=Протокол Jabber
-ru.Msn=Протокол MSN
ru.Clists=Списки контактов
ru.StdClist=Список контактов StdClist
ru.BlindClist=Список контактов для слабовидящих
@@ -320,7 +314,6 @@ ru.ProtocolsGGDescription=Поддержка протокола Gadu-Gadu в Mir
ru.ProtocolsICQDescription=Поддержка протокола ICQ в Miranda NG.
ru.ProtocolsIRCDescription=Поддержка протокола Internet Relay Chat (IRC) в Miranda NG.
ru.ProtocolsJabberDescription=Поддержка протокола Jabber (XMPP) в Miranda NG. Протокол основан на открытых стандартах, базирующихся на XML.
-ru.ProtocolsMSNDescription=Поддержка протокола Microsoft Network (MSN) в Miranda NG.
ru.ClistsDescription=Плагины списков контактов.
ru.StdClistDescription=Список контактов, являющийся модулем ядра, обеспечивает базовый функционал.
ru.BlindClistDescription=Список контактов для слабовидящих. Вспомогательные программы для людей с проблемами зрения могут легко "считать" информацию пользователю.
@@ -366,7 +359,6 @@ cz.GG=GG protokol
cz.Icq=ICQ protokol
cz.Irc=IRC protokol
cz.Jabber=Jabber protokol
-cz.Msn=MSN protokol
cz.Clists=Seznamy kontaktů
cz.StdClist=StdClist
cz.BlindClist=Clist_blind (pro nevidomé)
@@ -394,7 +386,6 @@ cz.protocolsGGDescription=Gadu-Gadu protokol pro Mirandu NG.
cz.protocolsICQDescription=ICQ (OSCAR) protokol pro Mirandu NG.
cz.protocolsIRCDescription=Internet Relay Chat (IRC) protokol pro Mirandu NG.
cz.protocolsJabberDescription=Otevřený komunikační protokol Jabber (XMPP) pro Mirandu NG.
-cz.protocolsMSNDescription=Microsoft Network (MSN) protokol pro Mirandu NG.
cz.ClistsDescription=Doplňky pro seznamy kontaktů.
cz.StdClistDescription=Základní integrovaný modul pro seznam kontaktů.
cz.BlindClistDescription=Seznam kontaktů pro nevidomé uživatele. Pro zobrazení kontaktů využívá jednoduchý seznam, který může být jednoduše přečten.
@@ -440,7 +431,6 @@ de.GG=GG-Protokoll
de.Icq=ICQ-Protokoll
de.Irc=IRC-Protokoll
de.Jabber=Jabber-Protokoll
-de.Msn=MSN-Protokoll
de.Clists=Kontaktlisten
de.StdClist=Klassische Kontaktliste
de.BlindClist=Kontaktliste für Blinde
@@ -468,7 +458,6 @@ de.ProtocolsGGDescription=Gadu-Gadu-Protokollunterstützung für Miranda NG.
de.ProtocolsICQDescription=ICQ- (OSCAR-)Protokollunterstützung für Miranda NG.
de.ProtocolsIRCDescription=Internet-Relay-Chat- (IRC-)Protokollunterstützung für Miranda NG.
de.ProtocolsJabberDescription=Unterstützung des Extensible Messaging and Presence Protocols (XMPP) für Miranda NG.
-de.ProtocolsMSNDescription=Microsoft-Network- (MSN)-Protokollunterstützung für Miranda NG.
de.ClistsDescription=Kontaktlistenplugins.
de.StdClistDescription=Grundlegendes Kontaktlisten-Kernmodul.
de.BlindClistDescription=Dies ist eine Kontaktliste für Blinde. Sie benutzt eine Liste, um alle Kontakte anzuzeigen, so dass Bildschirmleser die Kontaktliste dem Benutzer "vorlesen" können.
@@ -514,7 +503,6 @@ pl.GG=GG
pl.Icq=ICQ
pl.Irc=IRC
pl.Jabber=Jabber
-pl.Msn=MSN
pl.Clists=Lista kontaktów
pl.StdClist=Lista klasyczna (StdClist)
pl.BlindClist=Dla niewidomych (Blind)
@@ -542,7 +530,6 @@ pl.ProtocolsGGDescription=Zapewnia obsługę protokołu Gadu-Gadu.
pl.ProtocolsICQDescription=Zapewnia obsługę protokołu ICQ (OSCAR).
pl.ProtocolsIRCDescription=Zapewnia obsługę protokołu Internet Relay Chat (IRC).
pl.ProtocolsJabberDescription=Zapewnia obsługę protokołu Jabber/XMPP.
-pl.ProtocolsMSNDescription=Zapewnia obsługę protokołu Microsoft Network (MSN).
pl.ClistsDescription=Wtyczki listy kontaktów.
pl.StdClistDescription=Podstawowy moduł listy kontaktów zawarty w rdzeniu.
pl.BlindClistDescription=Jest to lista kontaktów dla ludzi niewidomych. Używa kontrolki listy, aby pokazać wszystkie kontakty, dzięki temu czytnik ekranu może "czytać" listę użtkownikowi.
@@ -611,7 +598,7 @@ const
DRIVE_RAMDISK = 6; // The drive is a RAM disk.
// don't forget to increment it after adding new components!
- COMPONENTS_COUNT = 20; // Index of the first language
+ COMPONENTS_COUNT = 19; // Index of the first language
// Default installation check
function IsDefault: Boolean;
@@ -824,7 +811,6 @@ begin
ComponentList.Add('protocols\icq');
ComponentList.Add('protocols\irc');
ComponentList.Add('protocols\jabber');
- ComponentList.Add('protocols\msn');
ComponentList.Add('clists');
ComponentList.Add('clists\stdclist');
ComponentList.Add('clists\blind');
@@ -912,7 +898,6 @@ begin
ExpandConstant('{cm:ProtocolsICQDescription}') + ';' +
ExpandConstant('{cm:ProtocolsIRCDescription}') + ';' +
ExpandConstant('{cm:ProtocolsJabberDescription}') + ';' +
- ExpandConstant('{cm:ProtocolsMSNDescription}') + ';' +
ExpandConstant('{cm:ClistsDescription}') + ';' +
ExpandConstant('{cm:StdClistDescription}') + ';' +
ExpandConstant('{cm:BlindClistDescription}') + ';' +
diff --git a/tools/lpgen/lpgen.js b/tools/lpgen/lpgen.js
index 2d997c5d47..87a017ed20 100644
--- a/tools/lpgen/lpgen.js
+++ b/tools/lpgen/lpgen.js
@@ -493,7 +493,7 @@ function ParseRCFile(FileTextVar, array) {
//now make a job, till end of matching regexp
while ((string = find.exec(FileTextVar)) !== null) {
// check for some garbage like "List1","Tab1" etc. in *.rc files, we do not need this.
- onestring = string[2].replace(/^(((List|Tab|Tree|Spin|Custom|Slider|DateTimePicker|Radio|Check|HotKey|Progress)\d)|(whiterect|IndSndList|&?[Oo][Kk]|APOP|BBS|Bing|CTCP|DCC|Foodnetwork|Google|Google Talk|GPG|Hotmail|ICQ|ICQ Corp|ID|IP|ISDN|iTunes|Jabber|JID|Miranda|Miranda NG|mRadio|MSN|NickServ|OSD|OTR|PCS|PGP|S.ms|SASL|SMS|SSL|Steam|Steam Guard|Tox|Twitter|Yahoo|Winamp \(\*\)|Windows|X400|&\w)|(%.(.*%)?))$/g, "");
+ onestring = string[2].replace(/^(((List|Tab|Tree|Spin|Custom|Slider|DateTimePicker|Radio|Check|HotKey|Progress)\d)|(whiterect|IndSndList|&?[Oo][Kk]|APOP|BBS|Bing|CTCP|DCC|Foodnetwork|Google|Google Talk|GPG|Hotmail|ICQ|ICQ Corp|ID|IP|ISDN|iTunes|Jabber|JID|Miranda|Miranda NG|mRadio|NickServ|OSD|OTR|PCS|PGP|S.ms|SASL|SMS|SSL|Steam|Steam Guard|Tox|Twitter|Yahoo|Winamp \(\*\)|Windows|X400|&\w)|(%.(.*%)?))$/g, "");
// ignore some popup menu craps
if (string[1] == "POPUP" && onestring.match(/^([a-zA-Z ]*(menu|context|popup(?!s)))|([A-Z][a-z]+([A-Z][a-z]*)+)|(new item)$/g)) {
continue;
@@ -552,7 +552,7 @@ function ParseSourceFile(FileTextVar, array) {
//filter _T() function results
function filter_T(string) {
//filter for exact matched strings
- var filter1 = /^(&?[Oo][Kk]|APOP|BBS|Bing|CTCP|DCC|Foodnetwork|Google|GPG|Hotmail|ICQ|ICQ Corp|ID|IP|ISDN|iTunes|Jabber|JID|Miranda|MirandaG15|Miranda NG|mRadio|MSN|NickServ|OSD|OTR|PCS|PGP|SASL|SMS|SSL|SteamID|Steam Guard|Tox|Twitter|Yahoo|Winamp \(\*\)|Windows|X400)$/g;
+ var filter1 = /^(&?[Oo][Kk]|APOP|BBS|Bing|CTCP|DCC|Foodnetwork|Google|GPG|Hotmail|ICQ|ICQ Corp|ID|IP|ISDN|iTunes|Jabber|JID|Miranda|MirandaG15|Miranda NG|mRadio|NickServ|OSD|OTR|PCS|PGP|SASL|SMS|SSL|SteamID|Steam Guard|Tox|Twitter|Yahoo|Winamp \(\*\)|Windows|X400)$/g;
//filter string starting from following words
var filter2 = /^(SOFTWARE\\|SYSTEM\\|http|ftp|UTF-|utf-|TEXT|EXE|exe|txt|css|html|dat[^a]|txt|MS\x20|CLVM|TM_|CLCB|CLSID|CLUI|HKEY_|MButton|BUTTON|WindowClass|MHeader|RichEdit|RICHEDIT|STATIC|EDIT|CList|listbox|LISTBOX|combobox|COMBOBOX|TitleB|std\w|iso-|windows-|<div|<html|<img|<span|<hr|<a\x20|<table|<td|miranda_|kernel32|user32|muc|pubsub|shlwapi|Tahoma|NBRichEdit|CreatePopup|&?[Oo][Kk]|<\/|<\w>|\w\\\w|urn\:|<\?xml|<\!|h\d|\.!\.).*$/g;
//filter string ending with following words