From 60756cd0f78592df310b4fff5d32fe5450e0ce4c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 25 Aug 2017 12:43:56 +0300 Subject: minus GTalkExt --- bin10/mir_dev.sln | 10 - bin10/mir_full.sln | 10 - bin10/mir_full_pro.sln | 11 - bin12/mir_dev.sln | 10 - bin12/mir_full.sln | 10 - bin15/mir_dev.sln | 10 - bin15/mir_full.sln | 10 - plugins/PluginUpdater/src/DlgUpdate.cpp | 1 + protocols/GTalkExt/GTalkExt.vcxproj | 29 -- protocols/GTalkExt/GTalkExt.vcxproj.filters | 4 - protocols/GTalkExt/res/PopupIcon.ico | Bin 1150 -> 0 bytes protocols/GTalkExt/res/Version.rc | 38 -- protocols/GTalkExt/res/pseudoava.png | Bin 21935 -> 0 bytes protocols/GTalkExt/res/settings.rc | 108 ------ protocols/GTalkExt/src/GTalkExt.cpp | 111 ------ protocols/GTalkExt/src/avatar.cpp | 159 -------- protocols/GTalkExt/src/db.cpp | 33 -- protocols/GTalkExt/src/db.h | 29 -- protocols/GTalkExt/src/dllmain.cpp | 48 --- protocols/GTalkExt/src/googletalk.h | 83 ----- protocols/GTalkExt/src/handlers.cpp | 475 ------------------------ protocols/GTalkExt/src/handlers.h | 28 -- protocols/GTalkExt/src/inbox.cpp | 214 ----------- protocols/GTalkExt/src/inbox.h | 27 -- protocols/GTalkExt/src/menu.cpp | 54 --- protocols/GTalkExt/src/notifications.cpp | 340 ----------------- protocols/GTalkExt/src/notifications.h | 44 --- protocols/GTalkExt/src/options.cpp | 252 ------------- protocols/GTalkExt/src/options.h | 39 -- protocols/GTalkExt/src/resources.h | 59 --- protocols/GTalkExt/src/stdafx.cxx | 25 -- protocols/GTalkExt/src/stdafx.h | 72 ---- protocols/GTalkExt/src/tipper_items.cpp | 137 ------- protocols/GTalkExt/src/version.h | 14 - src/mir_app/src/newplugins.cpp | 3 +- tools/build_scripts/bin10/full.sln | 10 - tools/build_scripts/z2_PackPluginUpater_x32.txt | 1 - tools/build_scripts/z2_PackPluginUpater_x64.txt | 1 - 38 files changed, 3 insertions(+), 2506 deletions(-) delete mode 100644 protocols/GTalkExt/GTalkExt.vcxproj delete mode 100644 protocols/GTalkExt/GTalkExt.vcxproj.filters delete mode 100644 protocols/GTalkExt/res/PopupIcon.ico delete mode 100644 protocols/GTalkExt/res/Version.rc delete mode 100644 protocols/GTalkExt/res/pseudoava.png delete mode 100644 protocols/GTalkExt/res/settings.rc delete mode 100644 protocols/GTalkExt/src/GTalkExt.cpp delete mode 100644 protocols/GTalkExt/src/avatar.cpp delete mode 100644 protocols/GTalkExt/src/db.cpp delete mode 100644 protocols/GTalkExt/src/db.h delete mode 100644 protocols/GTalkExt/src/dllmain.cpp delete mode 100644 protocols/GTalkExt/src/googletalk.h delete mode 100644 protocols/GTalkExt/src/handlers.cpp delete mode 100644 protocols/GTalkExt/src/handlers.h delete mode 100644 protocols/GTalkExt/src/inbox.cpp delete mode 100644 protocols/GTalkExt/src/inbox.h delete mode 100644 protocols/GTalkExt/src/menu.cpp delete mode 100644 protocols/GTalkExt/src/notifications.cpp delete mode 100644 protocols/GTalkExt/src/notifications.h delete mode 100644 protocols/GTalkExt/src/options.cpp delete mode 100644 protocols/GTalkExt/src/options.h delete mode 100644 protocols/GTalkExt/src/resources.h delete mode 100644 protocols/GTalkExt/src/stdafx.cxx delete mode 100644 protocols/GTalkExt/src/stdafx.h delete mode 100644 protocols/GTalkExt/src/tipper_items.cpp delete mode 100644 protocols/GTalkExt/src/version.h diff --git a/bin10/mir_dev.sln b/bin10/mir_dev.sln index 78fa4e0f5e..b7ea0be8e7 100644 --- a/bin10/mir_dev.sln +++ b/bin10/mir_dev.sln @@ -120,8 +120,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhenWasIt", "..\plugins\Whe EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MRA", "..\protocols\MRA\Mra.vcxproj", "{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTalkExt", "..\protocols\GTalkExt\GTalkExt.vcxproj", "{2A737817-2443-48FF-A2E8-CA8D69E450F3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Facebook", "..\protocols\FacebookRM\facebook.vcxproj", "{DADE9455-DC28-465A-9604-2CA28052B9FB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpellChecker", "..\plugins\SpellChecker\spellchecker.vcxproj", "{5DB86086-10E9-42E7-AC90-503D2678C2A2}" @@ -910,14 +908,6 @@ Global {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|Win32.Build.0 = Release|Win32 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.ActiveCfg = Release|x64 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.Build.0 = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.Build.0 = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.ActiveCfg = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.Build.0 = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.ActiveCfg = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.Build.0 = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.ActiveCfg = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.Build.0 = Release|x64 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.ActiveCfg = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.Build.0 = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/bin10/mir_full.sln b/bin10/mir_full.sln index f18f054b80..555a356811 100644 --- a/bin10/mir_full.sln +++ b/bin10/mir_full.sln @@ -120,8 +120,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhenWasIt", "..\plugins\Whe EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MRA", "..\protocols\MRA\Mra.vcxproj", "{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTalkExt", "..\protocols\GTalkExt\GTalkExt.vcxproj", "{2A737817-2443-48FF-A2E8-CA8D69E450F3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Facebook", "..\protocols\FacebookRM\facebook.vcxproj", "{DADE9455-DC28-465A-9604-2CA28052B9FB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpellChecker", "..\plugins\SpellChecker\spellchecker.vcxproj", "{5DB86086-10E9-42E7-AC90-503D2678C2A2}" @@ -908,14 +906,6 @@ Global {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|Win32.Build.0 = Release|Win32 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.ActiveCfg = Release|x64 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.Build.0 = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.Build.0 = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.ActiveCfg = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.Build.0 = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.ActiveCfg = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.Build.0 = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.ActiveCfg = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.Build.0 = Release|x64 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.ActiveCfg = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.Build.0 = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/bin10/mir_full_pro.sln b/bin10/mir_full_pro.sln index 6309e000b5..601c426a9b 100644 --- a/bin10/mir_full_pro.sln +++ b/bin10/mir_full_pro.sln @@ -120,8 +120,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhenWasIt", "..\plugins\Whe EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MRA", "..\protocols\MRA\Mra.vcxproj", "{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTalkExt", "..\protocols\GTalkExt\GTalkExt.vcxproj", "{2A737817-2443-48FF-A2E8-CA8D69E450F3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Facebook", "..\protocols\FacebookRM\facebook.vcxproj", "{DADE9455-DC28-465A-9604-2CA28052B9FB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpellChecker", "..\plugins\SpellChecker\spellchecker.vcxproj", "{5DB86086-10E9-42E7-AC90-503D2678C2A2}" @@ -942,14 +940,6 @@ Global {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|Win32.Build.0 = Release|Win32 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.ActiveCfg = Release|x64 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.Build.0 = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.Build.0 = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.ActiveCfg = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.Build.0 = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.ActiveCfg = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.Build.0 = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.ActiveCfg = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.Build.0 = Release|x64 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.ActiveCfg = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.Build.0 = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|x64.ActiveCfg = Debug|x64 @@ -2107,7 +2097,6 @@ Global {33276462-8313-4192-8306-13717ECCA60A} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} {7B0F213E-C15E-4219-8AE5-49DD3D3D553D} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} - {2A737817-2443-48FF-A2E8-CA8D69E450F3} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} {DADE9455-DC28-465A-9604-2CA28052B9FB} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} {D5E2FEC1-B29A-476C-BD41-469FE282EE0F} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} {12FFF2B0-0D0B-430B-A4C6-1577CA98F598} = {B913F0DC-E0A2-4973-A65C-BB00A51DB9E4} diff --git a/bin12/mir_dev.sln b/bin12/mir_dev.sln index 054de93c44..15f6d4b5ce 100644 --- a/bin12/mir_dev.sln +++ b/bin12/mir_dev.sln @@ -122,8 +122,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhenWasIt", "..\plugins\Whe EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MRA", "..\protocols\MRA\Mra.vcxproj", "{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTalkExt", "..\protocols\GTalkExt\GTalkExt.vcxproj", "{2A737817-2443-48FF-A2E8-CA8D69E450F3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Facebook", "..\protocols\FacebookRM\facebook.vcxproj", "{DADE9455-DC28-465A-9604-2CA28052B9FB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpellChecker", "..\plugins\SpellChecker\spellchecker.vcxproj", "{5DB86086-10E9-42E7-AC90-503D2678C2A2}" @@ -914,14 +912,6 @@ Global {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|Win32.Build.0 = Release|Win32 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.ActiveCfg = Release|x64 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.Build.0 = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.Build.0 = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.ActiveCfg = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.Build.0 = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.ActiveCfg = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.Build.0 = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.ActiveCfg = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.Build.0 = Release|x64 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.ActiveCfg = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.Build.0 = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/bin12/mir_full.sln b/bin12/mir_full.sln index 7b7f4a2e9f..7bbaed04a5 100644 --- a/bin12/mir_full.sln +++ b/bin12/mir_full.sln @@ -122,8 +122,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhenWasIt", "..\plugins\Whe EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MRA", "..\protocols\MRA\Mra.vcxproj", "{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTalkExt", "..\protocols\GTalkExt\GTalkExt.vcxproj", "{2A737817-2443-48FF-A2E8-CA8D69E450F3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Facebook", "..\protocols\FacebookRM\facebook.vcxproj", "{DADE9455-DC28-465A-9604-2CA28052B9FB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpellChecker", "..\plugins\SpellChecker\spellchecker.vcxproj", "{5DB86086-10E9-42E7-AC90-503D2678C2A2}" @@ -912,14 +910,6 @@ Global {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|Win32.Build.0 = Release|Win32 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.ActiveCfg = Release|x64 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.Build.0 = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.Build.0 = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.ActiveCfg = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.Build.0 = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.ActiveCfg = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.Build.0 = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.ActiveCfg = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.Build.0 = Release|x64 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.ActiveCfg = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.Build.0 = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/bin15/mir_dev.sln b/bin15/mir_dev.sln index 71af8fba69..ed91b1d29e 100644 --- a/bin15/mir_dev.sln +++ b/bin15/mir_dev.sln @@ -122,8 +122,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhenWasIt", "..\plugins\Whe EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MRA", "..\protocols\MRA\Mra.vcxproj", "{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTalkExt", "..\protocols\GTalkExt\GTalkExt.vcxproj", "{2A737817-2443-48FF-A2E8-CA8D69E450F3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Facebook", "..\protocols\FacebookRM\facebook.vcxproj", "{DADE9455-DC28-465A-9604-2CA28052B9FB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpellChecker", "..\plugins\SpellChecker\spellchecker.vcxproj", "{5DB86086-10E9-42E7-AC90-503D2678C2A2}" @@ -914,14 +912,6 @@ Global {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|Win32.Build.0 = Release|Win32 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.ActiveCfg = Release|x64 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.Build.0 = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.Build.0 = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.ActiveCfg = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.Build.0 = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.ActiveCfg = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.Build.0 = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.ActiveCfg = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.Build.0 = Release|x64 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.ActiveCfg = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.Build.0 = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/bin15/mir_full.sln b/bin15/mir_full.sln index d260a2c29c..e9f68eb1e3 100644 --- a/bin15/mir_full.sln +++ b/bin15/mir_full.sln @@ -122,8 +122,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhenWasIt", "..\plugins\Whe EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MRA", "..\protocols\MRA\Mra.vcxproj", "{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTalkExt", "..\protocols\GTalkExt\GTalkExt.vcxproj", "{2A737817-2443-48FF-A2E8-CA8D69E450F3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Facebook", "..\protocols\FacebookRM\facebook.vcxproj", "{DADE9455-DC28-465A-9604-2CA28052B9FB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpellChecker", "..\plugins\SpellChecker\spellchecker.vcxproj", "{5DB86086-10E9-42E7-AC90-503D2678C2A2}" @@ -912,14 +910,6 @@ Global {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|Win32.Build.0 = Release|Win32 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.ActiveCfg = Release|x64 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.Build.0 = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.Build.0 = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.ActiveCfg = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.Build.0 = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.ActiveCfg = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.Build.0 = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.ActiveCfg = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.Build.0 = Release|x64 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.ActiveCfg = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.Build.0 = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 5c8f7c9bf5..6d54f2e342 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -585,6 +585,7 @@ static renameTable[] = { L"firstrun.dll", NULL }, { L"flashavatars.dll", NULL }, { L"gender.dll", NULL }, + { L"gtalkext.dll", NULL }, { L"langman.dll", NULL }, { L"metacontacts.dll", NULL }, { L"modernopt.dll", NULL }, diff --git a/protocols/GTalkExt/GTalkExt.vcxproj b/protocols/GTalkExt/GTalkExt.vcxproj deleted file mode 100644 index fa554f0d27..0000000000 --- a/protocols/GTalkExt/GTalkExt.vcxproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {2A737817-2443-48FF-A2E8-CA8D69E450F3} - GTalkExt - GTalkExt - - - - - \ No newline at end of file diff --git a/protocols/GTalkExt/GTalkExt.vcxproj.filters b/protocols/GTalkExt/GTalkExt.vcxproj.filters deleted file mode 100644 index de5ad9f66c..0000000000 --- a/protocols/GTalkExt/GTalkExt.vcxproj.filters +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/protocols/GTalkExt/res/PopupIcon.ico b/protocols/GTalkExt/res/PopupIcon.ico deleted file mode 100644 index bfec99048d..0000000000 Binary files a/protocols/GTalkExt/res/PopupIcon.ico and /dev/null differ diff --git a/protocols/GTalkExt/res/Version.rc b/protocols/GTalkExt/res/Version.rc deleted file mode 100644 index 5bfbab4754..0000000000 --- a/protocols/GTalkExt/res/Version.rc +++ /dev/null @@ -1,38 +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 "afxres.h" -#include "..\src\version.h" - -VS_VERSION_INFO VERSIONINFO - FILEVERSION __FILEVERSION_STRING - PRODUCTVERSION __FILEVERSION_STRING - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x0L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "FileDescription", __DESCRIPTION - VALUE "InternalName", __PLUGIN_NAME - VALUE "LegalCopyright", __COPYRIGHT - VALUE "OriginalFilename", __FILENAME - VALUE "ProductName", __PLUGIN_NAME - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END diff --git a/protocols/GTalkExt/res/pseudoava.png b/protocols/GTalkExt/res/pseudoava.png deleted file mode 100644 index 26f7b8f2af..0000000000 Binary files a/protocols/GTalkExt/res/pseudoava.png and /dev/null differ diff --git a/protocols/GTalkExt/res/settings.rc b/protocols/GTalkExt/res/settings.rc deleted file mode 100644 index e3e1e41d17..0000000000 --- a/protocols/GTalkExt/res/settings.rc +++ /dev/null @@ -1,108 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "..\src\resources.h" -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_MAILSETTINGS DIALOGEX 0, 0, 304, 204 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "Popup notifications (needs popup plugin)",IDC_POPUPSENABLED, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,8,287,14 - CONTROL "Notify in fullscreen mode too",IDC_POPUPSINFULLSCREEN, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,22,275,14 - LTEXT "Use this if your popup plugin does not correctly detect fullscreen mode. It will take away your keyboard focus",IDC_POPUPSINFULLSCREENLABEL,18,38,275,21,NOT WS_GROUP - CONTROL "Notify in contact list",IDC_PSEUDOCONTACTENABLED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,60,287,14 - CONTROL "Clear pseudocontact history before adding new events",IDC_CLEARPSEUDOCONTACTLOG, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,74,275,15 - CONTROL "Mark history event read when popup closed",IDC_MARKEVENTREAD, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,88,287,15 - CONTROL "Add message snip to notification",IDC_ADDSNIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,102,287,15 - CONTROL "Try to login before open mailbox",IDC_AUTHONMAILBOX, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,116,287,15 - LTEXT "This works only if password is saved in the database. Has no effect on links in pseudocontact message log",IDC_AUTHONMAILBOXLABEL,18,130,275,22,NOT WS_GROUP - LTEXT "Choose GMail view you use in web interface",IDC_MAILBOXVIEWLABEL,6,154,287,9,NOT WS_GROUP - CONTROL "I don't know",IDC_UNKNOWNVIEW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,18,167,275,8 - CONTROL "Standard view",IDC_STANDARDVIEW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,18,178,275,8 - CONTROL "Basic HTML",IDC_HTMLVIEW,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,18,189,275,8 -END - -IDD_POPUPSETTINGS DIALOGEX 0, 0, 304, 105 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - GROUPBOX "",IDC_GROUP,0,0,298,97 - LTEXT "Background color",IDC_BACKCOLORLABEL,10,10,60,15,NOT WS_GROUP - CONTROL "",IDC_BACKCOLORPICKER,"ColourPicker",WS_TABSTOP,70,10,39,10 - LTEXT "Text color",IDC_TEXTCOLORLABEL,10,25,60,15,NOT WS_GROUP - CONTROL "",IDC_TEXTCOLORPICKER,"ColourPicker",WS_TABSTOP,70,25,39,10 - LTEXT "Timeout",IDC_TIMEOUTLABEL,10,40,60,13,NOT WS_GROUP - EDITTEXT IDC_TIMEOUTEDIT,70,40,39,12 - LTEXT "If both colors set to the same value, default colors will be used",IDC_DEFCOLORSLABEL,120,10,172,25,NOT WS_GROUP - LTEXT "0 means default timeout,\n-1 means no timeout",IDC_DEFTIMEOUTLABEL,120,40,172,20,NOT WS_GROUP - PUSHBUTTON "Test",IDC_TESTBUTTON,244,68,50,25 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_POPUP ICON "PopupIcon.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// PNG -// - -IDI_PSEUDOAVA PNG "pseudoava.png" - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_POPUPSETTINGS, DIALOG - BEGIN - VERTGUIDE, 120 - VERTGUIDE, 292 - BOTTOMMARGIN, 65 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/protocols/GTalkExt/src/GTalkExt.cpp b/protocols/GTalkExt/src/GTalkExt.cpp deleted file mode 100644 index a9fe6ec4c7..0000000000 --- a/protocols/GTalkExt/src/GTalkExt.cpp +++ /dev/null @@ -1,111 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** -// GTalkExt.cpp : Defines the exported functions for the DLL application. -//*************************************************************************************** - -#include "stdafx.h" -#include "options.h" -#include "notifications.h" -#include "handlers.h" -#include "Version.h" -#include "inbox.h" - -CLIST_INTERFACE *pcli; -int hLangpack; - -LIST g_accs(1, HandleKeySortT); - -IconItem iconList[] = -{ - { LPGEN("Popup icon"), "gtalk_popup_icon", IDI_POPUP } -}; - -PLUGININFOEX pluginInfo = -{ - sizeof(PLUGININFOEX), - __PLUGIN_NAME, - PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), - __DESCRIPTION, - __AUTHOR, - __AUTHOREMAIL, - __COPYRIGHT, - __AUTHORWEB, - UNICODE_AWARE, - //{08B86253-EC6E-4d09-B7A9-64ACDF0627B8} - { 0x08B86253, 0xEC6E, 0x4d09, { 0xB7, 0xA9, 0x64, 0xAC, 0xDF, 0x06, 0x27, 0xB8 } } -}; - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD) -{ - return &pluginInfo; -} - -///////////////////////////////////////////////////////////////////////////////////////// - -LRESULT CALLBACK WndProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_NCCREATE: - return 1; - - case WM_GETMINMAXINFO: - PMINMAXINFO info = (PMINMAXINFO)lParam; - info->ptMaxPosition.x = -100; - info->ptMaxPosition.y = -100; - info->ptMaxSize.x = 10; - info->ptMaxSize.y = 10; - info->ptMaxTrackSize.x = 10; - info->ptMaxTrackSize.y = 10; - info->ptMinTrackSize.x = 10; - info->ptMinTrackSize.y = 10; - return 0; - } - return DefWindowProc(wnd, msg, wParam, lParam); -} - -extern "C" int __declspec(dllexport) Load(void) -{ - mir_getLP(&pluginInfo); - pcli = Clist_GetInterface(); - - WNDCLASS cls = { 0 }; - cls.lpfnWndProc = WndProc; - cls.lpszClassName = TEMP_WINDOW_CLASS_NAME; - RegisterClass(&cls); - - Icon_Register(g_hInst, LPGEN("Protocols") "/GTalkExt", iconList, _countof(iconList)); - - InitAvaUnit(TRUE); - - HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); - HookEvent(ME_PROTO_ACCLISTCHANGED, AccListChanged); - - AddTipperItem(); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// - -extern "C" int __declspec(dllexport) Unload(void) -{ - InitAvaUnit(FALSE); - return 0; -} diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp deleted file mode 100644 index 621df70a90..0000000000 --- a/protocols/GTalkExt/src/avatar.cpp +++ /dev/null @@ -1,159 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#include "stdafx.h" -#include "resources.h" -#include "options.h" - -#define AVA_FILE_NAME_FORMAT L"%s\\%s\\AvatarCache\\Jabber\\" _T(SHORT_PLUGIN_NAME) L".pseudoava.png" -#define AVA_RES_TYPE L"PNG" -#define SRMM_MODULE_NAME "SRMM" -#define SRMM_AVATAR_SETTING_NAME "Avatar" - -#define SET_AVATAR_INTERVAL 2000 - -LPTSTR CreateAvaFile(HANDLE *hFile) -{ - wchar_t name[MAX_PATH + 2]; - if (Profile_GetNameW(_countof(name), name)) - return NULL; - - wchar_t *p = wcsrchr(name, '.'); - if (p) - *p = 0; - - wchar_t path[MAX_PATH + 2]; - Profile_GetPathW(_countof(path), path); - - wchar_t full[MAX_PATH + 2]; - mir_snwprintf(full, AVA_FILE_NAME_FORMAT, path, name); - CreateDirectoryTreeW(full); - - HANDLE h = CreateFile(full, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); - if (h == INVALID_HANDLE_VALUE) - return NULL; - - if (hFile) - *hFile = h; - else - CloseHandle(h); - - return mir_wstrdup(full); -} - -BOOL SaveAvatar(HANDLE hFile) -{ - HRSRC hres = FindResource(g_hInst, MAKEINTRESOURCE(IDI_PSEUDOAVA), AVA_RES_TYPE); - if (!hres) return FALSE; - - HGLOBAL hglob = LoadResource(g_hInst, hres); - if (!hglob) return FALSE; - - PVOID p = LockResource(hglob); - if (!p) return FALSE; - - DWORD l = SizeofResource(g_hInst, hres); - if (!l) return FALSE; - - DWORD written; - if (!WriteFile(hFile, p, l, &written, NULL)) return FALSE; - return written == l; -} - -struct AVACHANGED { - HANDLE hTimer; - MCONTACT hContact; -}; - -VOID CALLBACK CallSetAvatar(PVOID lpParameter, BOOLEAN) -{ - Thread_Push(0); - __try { - AVACHANGED *ach = (AVACHANGED*)lpParameter; - __try { - SetAvatar(ach->hContact); - DeleteTimerQueueTimer(NULL, ach->hTimer, NULL); - } - __finally { - free(ach); - } - } - __finally { - Thread_Pop(); - } -} - -int AvaChanged(WPARAM hContact, LPARAM lParam) -{ - if (!lParam && db_get_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) { - BOOL enqueued = FALSE; - AVACHANGED *ach = (AVACHANGED*)malloc(sizeof(AVACHANGED)); - __try { - ach->hContact = hContact; - enqueued = CreateTimerQueueTimer(&ach->hTimer, NULL, CallSetAvatar, ach, SET_AVATAR_INTERVAL, 0, WT_EXECUTEONLYONCE); - } - __finally { - if (!enqueued) free(ach); - } - } - return 0; -} - -mir_cs g_csSetAvatar; -HANDLE hAvaChanged = 0; - -BOOL InitAvaUnit(BOOL init) -{ - if (init) { - hAvaChanged = HookEvent(ME_AV_AVATARCHANGED, AvaChanged); - return hAvaChanged != 0; - } - - if (hAvaChanged) { - UnhookEvent(hAvaChanged); - hAvaChanged = 0; - } - return TRUE; -} - -void SetAvatar(MCONTACT hContact) -{ - mir_cslock lck(g_csSetAvatar); - - AVATARCACHEENTRY *ava = (AVATARCACHEENTRY*)CallService(MS_AV_GETAVATARBITMAP, hContact, 0); - if (ava && GetFileAttributes(&ava->szFilename[0]) != INVALID_FILE_ATTRIBUTES) - return; - - HANDLE hFile; - ptrW avaFile(CreateAvaFile(&hFile)); - if (avaFile == NULL) - return; - - BOOL saved = SaveAvatar(hFile); - CloseHandle(hFile); hFile = 0; - if (!saved) - return; - - if (ava) - CallService(MS_AV_SETAVATARW, hContact, (LPARAM)L""); - CallService(MS_AV_SETAVATARW, hContact, (LPARAM)avaFile); - db_set_ws(hContact, SRMM_MODULE_NAME, SRMM_AVATAR_SETTING_NAME, avaFile); -} diff --git a/protocols/GTalkExt/src/db.cpp b/protocols/GTalkExt/src/db.cpp deleted file mode 100644 index 1d18ed6121..0000000000 --- a/protocols/GTalkExt/src/db.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#include "StdAfx.h" -#include "options.h" - -LPTSTR ReadJidSetting(LPCSTR name, LPCTSTR jid) -{ - return db_get_wsa(0, name, _T2A(jid)); -} - -void WriteJidSetting(LPCSTR name, LPCTSTR jid, LPCTSTR setting) -{ - db_set_ws(0, name, _T2A(jid), setting); -} diff --git a/protocols/GTalkExt/src/db.h b/protocols/GTalkExt/src/db.h deleted file mode 100644 index d07b44e7ab..0000000000 --- a/protocols/GTalkExt/src/db.h +++ /dev/null @@ -1,29 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#pragma once -#include "resources.h" - -#define LAST_MAIL_TIME_FROM_JID SHORT_PLUGIN_NAME ".LastMailTimeFromJid" -#define LAST_THREAD_ID_FROM_JID SHORT_PLUGIN_NAME ".LastThreadIdFromJid" - -LPTSTR ReadJidSetting(LPCSTR name, LPCTSTR jid); -void WriteJidSetting(LPCSTR name, LPCTSTR jid, LPCTSTR setting); diff --git a/protocols/GTalkExt/src/dllmain.cpp b/protocols/GTalkExt/src/dllmain.cpp deleted file mode 100644 index a59974f883..0000000000 --- a/protocols/GTalkExt/src/dllmain.cpp +++ /dev/null @@ -1,48 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#include "stdafx.h" -#include "notifications.h" -#include "options.h" - -HINSTANCE g_hInst = 0; - -DWORD itlsSettings = TLS_OUT_OF_INDEXES; -DWORD itlsRecursion = TLS_OUT_OF_INDEXES; - -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID) -{ - switch (fdwReason) { - case DLL_PROCESS_ATTACH: - g_hInst = hinstDLL; - if (((itlsSettings = TlsAlloc()) == TLS_OUT_OF_INDEXES) || - ((itlsRecursion = TlsAlloc()) == TLS_OUT_OF_INDEXES)) - return FALSE; - break; - - case DLL_PROCESS_DETACH: - TlsFree(itlsSettings); - TlsFree(itlsRecursion); - break; - } - - return TRUE; -} diff --git a/protocols/GTalkExt/src/googletalk.h b/protocols/GTalkExt/src/googletalk.h deleted file mode 100644 index 7595e3de7c..0000000000 --- a/protocols/GTalkExt/src/googletalk.h +++ /dev/null @@ -1,83 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#pragma once - -#define MESSAGE_URL_FORMAT_STANDARD L"%s/#inbox/%x%08x" -#define MESSAGE_URL_FORMAT_HTML L"%s/h/?v=c&th=%x%08x" - -#define JABBER_FEAT_GTALK_SHARED_STATUS L"google:shared-status" - -#define JABBER_EXT_GTALK_PMUC L"pmuc-v1" - -#define NOTIFY_FEATURE_XMLNS L"google:mail:notify" -#define SETTING_FEATURE_XMLNS L"google:setting" -#define DISCOVERY_XMLNS L"http://jabber.org/protocol/disco#info" - -#define ATTRNAME_TYPE L"type" -#define ATTRNAME_FROM L"from" -#define ATTRNAME_TO L"to" -#define ATTRNAME_URL L"url" -#define ATTRNAME_TID L"tid" -#define ATTRNAME_UNREAD L"unread" -#define ATTRNAME_XMLNS L"xmlns" -#define ATTRNAME_ID L"id" -#define ATTRNAME_TOTAL_MATCHED L"total-matched" -#define ATTRNAME_NAME L"name" -#define ATTRNAME_ADDRESS L"address" -#define ATTRNAME_RESULT_TIME L"result-time" -#define ATTRNAME_NEWER_THAN_TIME L"newer-than-time" -#define ATTRNAME_NEWER_THAN_TID L"newer-than-tid" -#define ATTRNAME_VALUE L"value" -#define ATTRNAME_VAR L"var" - -#define IQTYPE_RESULT L"result" -#define IQTYPE_SET L"set" -#define IQTYPE_GET L"get" - -#define NODENAME_MAILBOX L"mailbox" -#define NODENAME_QUERY L"query" -#define NODENAME_IQ L"iq" -#define NODENAME_USERSETTING L"usersetting" -#define NODENAME_MAILNOTIFICATIONS L"mailnotifications" -#define NODENAME_SUBJECT L"subject" -#define NODENAME_SNIPPET L"snippet" -#define NODENAME_SENDERS L"senders" -#define NODENAME_FEATURE L"feature" -#define NODENAME_NEW_MAIL L"new-mail" - -#define SETTING_TRUE L"true" - -#define RESPONSE_TIMEOUT (1000 * 60 * 60) -#define TIMER_INTERVAL (1000 * 60 * 2) - -struct GoogleTalkAcc : public MZeroedObject -{ - IJabberInterface *m_japi; - PROTOACCOUNT *m_pa; - - // Google Shared Status - BOOL m_bGoogleSharedStatus; - BOOL m_bGoogleSharedStatusLock; - void SendIqGoogleSharedStatus(LPCTSTR status, LPCTSTR msg); -}; - -GoogleTalkAcc* isGoogle(LPARAM); diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp deleted file mode 100644 index 485dc454a4..0000000000 --- a/protocols/GTalkExt/src/handlers.cpp +++ /dev/null @@ -1,475 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#include "StdAfx.h" -#include "handlers.h" -#include "db.h" -#include "inbox.h" -#include "notifications.h" -#include "options.h" - -#define JABBER_IQID L"mir_" -#define JABBER_IQID_FORMAT L"mir_%d" - -LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam); - -GoogleTalkAcc* isGoogle(LPARAM lParam) -{ - return g_accs.find((GoogleTalkAcc*)&lParam); -} - -///////////////////////////////////////////////////////////////////////////////////////// - -void FormatMessageUrl(LPCTSTR format, LPTSTR buf, LPCTSTR mailbox, LPCTSTR tid) -{ - ULARGE_INTEGER iTid; iTid.QuadPart = _wtoi64(tid); - size_t l = mir_wstrlen(buf); - mir_snwprintf(buf, l, format, mailbox, iTid.HighPart, iTid.LowPart); - assert(l >= mir_wstrlen(buf)); -} - -void MakeUrlHex(LPTSTR url, LPCTSTR tid) -{ - ULARGE_INTEGER iTid; iTid.QuadPart = _wtoi64(tid); - LPTSTR tidInUrl = wcsstr(url, tid); - LPTSTR trail = tidInUrl + mir_wstrlen(tid); - wsprintf(tidInUrl, L"%x%08x", iTid.HighPart, iTid.LowPart); //!!!!!!!!!!!! - wmemmove(tidInUrl + mir_wstrlen(tidInUrl), trail, mir_wstrlen(trail) + 1); -} - -LPTSTR ExtractJid(LPCTSTR jidWithRes) -{ - LPCTSTR p = wcsrchr(jidWithRes, '/'); - if (p == NULL) - return mir_wstrdup(jidWithRes); - - size_t l = size_t(p - jidWithRes); - LPTSTR result = (LPTSTR)mir_alloc((l + 1) * sizeof(wchar_t)); - wcsncpy(result, jidWithRes, l); - result[l] = 0; - return result; -} - -BOOL TimerHandler(IJabberInterface *ji, HXML node, void *pUserData); - -BOOL InternalListHandler(HXML node, LPCTSTR jid, LPCTSTR mailboxUrl) -{ - ULONGLONG maxTid = 0; - LPCTSTR sMaxTid = NULL; - int unreadCount = 0; - for (int i = 0; i < xmlGetChildCount(node); i++) { - LPCTSTR sTid = xmlGetAttrValue(xmlGetChild(node, i), ATTRNAME_TID); - ULONGLONG tid = _tcstoui64(sTid, NULL, 10); - if (tid > maxTid) { - maxTid = tid; - sMaxTid = sTid; - } - - HXML senders = xmlGetChildByPath(xmlGetChild(node, i), NODENAME_SENDERS, FALSE); - for (int j = 0; j < xmlGetChildCount(senders); j++) - if (xmlGetAttrValue(xmlGetChild(senders, j), ATTRNAME_UNREAD)) { - unreadCount++; - break; - } - } - - LPCSTR acc = GetJidAcc(jid); - if (!acc) - return FALSE; - - if (!unreadCount) { - SetupPseudocontact(jid, xmlGetAttrValue(node, ATTRNAME_TOTAL_MATCHED), acc); - return TRUE; - } - - DWORD settings = ReadNotificationSettings(acc); - - if (unreadCount > 5) { - CloseNotifications(acc, mailboxUrl, jid, FALSE); - UnreadMailNotification(acc, jid, mailboxUrl, xmlGetAttrValue(node, ATTRNAME_TOTAL_MATCHED)); - } - else - for (int i = 0; i < xmlGetChildCount(node); i++) { - MAIL_THREAD_NOTIFICATION mtn = { 0 }; - HXML thread = xmlGetChild(node, i); - - mtn.subj = xmlGetText(xmlGetChildByPath(thread, NODENAME_SUBJECT, FALSE)); - mtn.snip = xmlGetText(xmlGetChildByPath(thread, NODENAME_SNIPPET, FALSE)); - - int threadUnreadCount = 0; - HXML senders = xmlGetChildByPath(thread, NODENAME_SENDERS, FALSE); - for (int j = 0; threadUnreadCount < SENDER_COUNT && j < xmlGetChildCount(senders); j++) { - HXML sender = xmlGetChild(senders, j); - if (xmlGetAttrValue(sender, ATTRNAME_UNREAD)) { - mtn.senders[threadUnreadCount].name = xmlGetAttrValue(sender, ATTRNAME_NAME); - mtn.senders[threadUnreadCount].addr = xmlGetAttrValue(sender, ATTRNAME_ADDRESS); - threadUnreadCount++; - } - } - - LPCTSTR url = xmlGetAttrValue(thread, ATTRNAME_URL); - LPCTSTR tid = xmlGetAttrValue(thread, ATTRNAME_TID); - - if (ReadCheckbox(0, IDC_STANDARDVIEW, settings)) - FormatMessageUrl(MESSAGE_URL_FORMAT_STANDARD, (LPTSTR)url, mailboxUrl, tid); - else if (ReadCheckbox(0, IDC_HTMLVIEW, settings)) - FormatMessageUrl(MESSAGE_URL_FORMAT_HTML, (LPTSTR)url, mailboxUrl, tid); - else - MakeUrlHex((LPTSTR)url, tid); - - CloseNotifications(acc, url, jid, i); - UnreadThreadNotification(acc, jid, url, xmlGetAttrValue(node, ATTRNAME_TOTAL_MATCHED), &mtn); - } - - LPCTSTR time = xmlGetAttrValue(node, ATTRNAME_RESULT_TIME); - WriteJidSetting(LAST_MAIL_TIME_FROM_JID, jid, time); - WriteJidSetting(LAST_THREAD_ID_FROM_JID, jid, sMaxTid); - return TRUE; -} - -BOOL MailListHandler(IJabberInterface *ji, HXML node, void *) -{ - LPCTSTR jidWithRes = xmlGetAttrValue(node, ATTRNAME_TO); - __try { - if (!node || mir_wstrcmp(xmlGetAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT)) return TRUE; - - LPCTSTR jid = xmlGetAttrValue(node, ATTRNAME_FROM); - assert(jid); - - node = xmlGetChildByPath(node, NODENAME_MAILBOX, FALSE); - if (!node) return TRUE; // empty list - - LPCTSTR url = xmlGetAttrValue(node, ATTRNAME_URL); - - return InternalListHandler(node, jid, url); - } - __finally { - if (jidWithRes) - ji->AddTemporaryIqHandler(TimerHandler, JABBER_IQ_TYPE_RESULT, 0, - (PVOID)wcsdup(jidWithRes), TIMER_INTERVAL); - // Never get a real result stanza. Results elapsed request after WAIT_TIMER_INTERVAL ms - } -} - -void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji) -{ - HXML child = NULL; - HXML node = xmlCreateNode(NODENAME_IQ, NULL, FALSE); - xmlAddAttr(node, ATTRNAME_TYPE, IQTYPE_GET); - xmlAddAttr(node, ATTRNAME_FROM, jidWithRes); - - UINT uID = ji->SerialNext(); - ptrW jid(ExtractJid(jidWithRes)); - xmlAddAttr(node, ATTRNAME_TO, jid); - - ptrW - lastMailTime(ReadJidSetting(LAST_MAIL_TIME_FROM_JID, jid)), - lastThreadId(ReadJidSetting(LAST_THREAD_ID_FROM_JID, jid)); - - wchar_t id[30]; - mir_snwprintf(id, JABBER_IQID_FORMAT, uID); - xmlAddAttr(node, ATTRNAME_ID, id); - - child = xmlAddChild(node, NODENAME_QUERY, NULL); - xmlAddAttr(child, ATTRNAME_XMLNS, NOTIFY_FEATURE_XMLNS); - xmlAddAttr(child, ATTRNAME_NEWER_THAN_TIME, lastMailTime); - xmlAddAttr(child, ATTRNAME_NEWER_THAN_TID, lastThreadId); - - if (ji->SendXmlNode(node)) - ji->AddTemporaryIqHandler(MailListHandler, JABBER_IQ_TYPE_RESULT, (int)uID, NULL, RESPONSE_TIMEOUT); - - if (child) xmlDestroyNode(child); - if (node) xmlDestroyNode(node); -} - -BOOL TimerHandler(IJabberInterface *ji, HXML, void *pUserData) -{ - RequestMail((LPCTSTR)pUserData, ji); - free(pUserData); - return FALSE; -} - -BOOL NewMailHandler(IJabberInterface *ji, HXML node, void *) -{ - HXML response = xmlCreateNode(NODENAME_IQ, NULL, FALSE); - __try { - xmlAddAttr(response, ATTRNAME_TYPE, IQTYPE_RESULT); - - LPCTSTR attr = xmlGetAttrValue(node, ATTRNAME_ID); - if (!attr) return FALSE; - xmlAddAttr(response, ATTRNAME_ID, attr); - - attr = xmlGetAttrValue(node, ATTRNAME_FROM); - if (attr) xmlAddAttr(response, ATTRNAME_TO, attr); - - attr = xmlGetAttrValue(node, ATTRNAME_TO); - if (!attr) return FALSE; - xmlAddAttr(response, ATTRNAME_FROM, attr); - - int bytesSent = ji->SendXmlNode(response); - RequestMail(attr, ji); - return bytesSent > 0; - } - __finally { - xmlDestroyNode(response); - } -} - -void SetNotificationSetting(LPCTSTR jidWithResource, IJabberInterface *ji) -{ - HXML child = NULL; - HXML node = xmlCreateNode(NODENAME_IQ, NULL, FALSE); - - xmlAddAttr(node, ATTRNAME_TYPE, IQTYPE_SET); - xmlAddAttr(node, ATTRNAME_FROM, jidWithResource); - - ptrW jid(ExtractJid(jidWithResource)); - xmlAddAttr(node, ATTRNAME_TO, jid); - - wchar_t id[30]; - mir_snwprintf(id, JABBER_IQID_FORMAT, ji->SerialNext()); - xmlAddAttr(node, ATTRNAME_ID, id); - - child = xmlAddChild(node, NODENAME_USERSETTING, NULL); - xmlAddAttr(child, ATTRNAME_XMLNS, SETTING_FEATURE_XMLNS); - - child = xmlAddChild(child, NODENAME_MAILNOTIFICATIONS, NULL); - xmlAddAttr(child, ATTRNAME_VALUE, SETTING_TRUE); - - ji->SendXmlNode(node); - - if (child) xmlDestroyNode(child); - if (node) xmlDestroyNode(node); -} - -BOOL DiscoverHandler(IJabberInterface *ji, HXML node, void *) -{ - if (!node) return FALSE; - - LPCTSTR jid = xmlGetAttrValue(node, ATTRNAME_TO); - assert(jid); - node = xmlGetChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS); - - HXML child = xmlGetChildByAttrValue(node, NODENAME_FEATURE, ATTRNAME_VAR, SETTING_FEATURE_XMLNS); - if (child) - SetNotificationSetting(jid, ji); - - child = xmlGetChildByAttrValue(node, NODENAME_FEATURE, ATTRNAME_VAR, NOTIFY_FEATURE_XMLNS); - if (child) { - ji->AddIqHandler(NewMailHandler, JABBER_IQ_TYPE_SET, NOTIFY_FEATURE_XMLNS, NODENAME_NEW_MAIL); - RequestMail(jid, ji); - } - - return FALSE; -} - -BOOL SendHandler(IJabberInterface *ji, HXML node, void *) -{ - GoogleTalkAcc *gta = isGoogle(LPARAM(ji)); - if (gta == NULL) - return FALSE; - - HXML queryNode = xmlGetChildByAttrValue(node, NODENAME_QUERY, ATTRNAME_XMLNS, DISCOVERY_XMLNS); - if (queryNode) { - LPCTSTR ptszId = xmlGetAttrValue(node, ATTRNAME_ID); - if (ptszId) - ji->AddTemporaryIqHandler(DiscoverHandler, JABBER_IQ_TYPE_RESULT, _wtoi(ptszId + 4), NULL, RESPONSE_TIMEOUT, 500); - } - - if (!mir_wstrcmp(xmlGetName(node), L"presence") && xmlGetAttrValue(node, ATTRNAME_TO) == 0) { - if (!gta->m_bGoogleSharedStatus) - return FALSE; - - HXML statNode = xmlGetChildByPath(node, L"status", 0); - HXML showNode = xmlGetChildByPath(node, L"show", 0); - if (statNode) { - LPCTSTR status = xmlGetText(showNode); - LPCTSTR msg = xmlGetText(statNode); - gta->SendIqGoogleSharedStatus(status, msg); - } - } - - return FALSE; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// Google shared status - -BOOL OnIqResultGoogleSharedStatus(IJabberInterface *ji, HXML node, void *) -{ - GoogleTalkAcc *gta = isGoogle(LPARAM(ji)); - if (gta != NULL) { - gta->m_bGoogleSharedStatus = mir_wstrcmp(xmlGetAttrValue(node, ATTRNAME_TYPE), IQTYPE_RESULT) == 0; - gta->m_bGoogleSharedStatusLock = FALSE; - } - return FALSE; -} - -BOOL OnIqSetGoogleSharedStatus(IJabberInterface *ji, HXML iqNode, void *) -{ - GoogleTalkAcc *gta = isGoogle(LPARAM(ji)); - if (gta == NULL) - return FALSE; - if (mir_wstrcmp(xmlGetAttrValue(iqNode, ATTRNAME_TYPE), IQTYPE_SET)) - return FALSE; - if (gta->m_bGoogleSharedStatusLock) - return TRUE; - - int status; - HXML query = xmlGetChildByPath(iqNode, NODENAME_QUERY, 0); - HXML node = xmlGetChildByPath(query, L"invisible", 0); - if (0 == mir_wstrcmpi(L"true", xmlGetAttrValue(node, L"value"))) - status = ID_STATUS_INVISIBLE; - else { - LPCTSTR txt = xmlGetText(xmlGetChildByPath(query, L"show", 0)); - if (txt && 0 == mir_wstrcmpi(L"dnd", txt)) - status = ID_STATUS_DND; - else if (gta->m_pa->ppro->m_iStatus == ID_STATUS_DND || gta->m_pa->ppro->m_iStatus == ID_STATUS_INVISIBLE) - status = ID_STATUS_ONLINE; - else - status = gta->m_pa->ppro->m_iStatus; - } - - if (status != gta->m_pa->ppro->m_iStatus) - CallProtoService(gta->m_pa->szModuleName, PS_SETSTATUS, status, 0); - - return TRUE; -} - -void GoogleTalkAcc::SendIqGoogleSharedStatus(LPCTSTR status, LPCTSTR msg) -{ - HXML iq = xmlCreateNode(NODENAME_IQ, NULL, FALSE); - xmlAddAttr(iq, ATTRNAME_TYPE, IQTYPE_GET); - - HXML query = xmlAddChild(iq, NODENAME_QUERY, NULL); - xmlAddChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS); - xmlAddAttrInt(query, L"version", 2); - - xmlAddChild(query, L"status", msg); - if (!mir_wstrcmp(status, L"invisible")) { - xmlAddChild(query, L"show", L"default"); - xmlAddAttr(xmlAddChild(query, L"invisible", 0), L"value", L"true"); - } - else { - if (!mir_wstrcmp(status, L"dnd")) - xmlAddChild(query, L"show", L"dnd"); - else - xmlAddChild(query, L"show", L"default"); - - xmlAddAttr(xmlAddChild(query, L"invisible", 0), L"value", L"false"); - } - m_bGoogleSharedStatusLock = TRUE; - m_japi->SendXmlNode(iq); - xmlDestroyNode(iq); -} - -int OnServerDiscoInfo(WPARAM wParam, LPARAM lParam) -{ - GoogleTalkAcc *gta = isGoogle(lParam); - if (gta == NULL) - return FALSE; - - // m_ThreadInfo->jabberServerCaps |= JABBER_CAPS_PING; - - JABBER_DISCO_FIELD *fld = (JABBER_DISCO_FIELD*)wParam; - if (!mir_wstrcmp(fld->category, L"server") && !mir_wstrcmp(fld->type, L"im") && !mir_wstrcmp(fld->name, L"Google Talk")) { - HXML iq = xmlCreateNode(NODENAME_IQ, NULL, FALSE); - xmlAddAttr(iq, ATTRNAME_TYPE, IQTYPE_GET); - - HXML query = xmlAddChild(iq, NODENAME_QUERY, NULL); - xmlAddChild(query, ATTRNAME_XMLNS, JABBER_FEAT_GTALK_SHARED_STATUS); - xmlAddAttrInt(query, L"version", 2); - gta->m_japi->SendXmlNode(iq); - xmlDestroyNode(iq); - } - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// adds Google extensions into the caps list - -int OnExtListInit(WPARAM wParam, LPARAM lParam) -{ - GoogleTalkAcc *gta = isGoogle(lParam); - if (gta != NULL) { - LIST *pList = (LIST*)wParam; - pList->insert(JABBER_EXT_GTALK_PMUC); - } - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// for our pseudo contact only our own popups are allowed -// 0 = allowed, 1 = disallowed - -int OnFilterPopup(WPARAM hContact, LPARAM lParam) -{ - if (!db_get_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) - return 0; - - return (lParam != (LPARAM)&PopupProc); -} - -///////////////////////////////////////////////////////////////////////////////////////// - -static void sttCreateInstance(LPCSTR szModuleName) -{ - IJabberInterface *japi = getJabberApi(szModuleName); - if (japi == NULL) - return; - - ptrA host(db_get_sa(NULL, szModuleName, "ManualHost")); - if (host == NULL || mir_strcmp(host, "talk.google.com")) - return; - - GoogleTalkAcc *gta = new GoogleTalkAcc(); - gta->m_japi = japi; - gta->m_pa = Proto_GetAccount(szModuleName); - g_accs.insert(gta); - - // Google Shared Status (http://code.google.com/apis/talk/jep_extensions/shared_status.html) - japi->AddIqHandler(::OnIqResultGoogleSharedStatus, JABBER_IQ_TYPE_SET, JABBER_FEAT_GTALK_SHARED_STATUS, NULL); - japi->AddIqHandler(::OnIqResultGoogleSharedStatus, JABBER_IQ_TYPE_GET, JABBER_FEAT_GTALK_SHARED_STATUS, NODENAME_QUERY); - - japi->AddSendHandler(SendHandler); -} - -int AccListChanged(WPARAM wParam, LPARAM lParam) -{ - if (wParam == PRAC_ADDED) - sttCreateInstance(((PROTOACCOUNT*)lParam)->szModuleName); - return 0; -} - -int ModulesLoaded(WPARAM, LPARAM) -{ - int count; - PROTOACCOUNT **protos; - Proto_EnumAccounts(&count, &protos); - for (int i = 0; i < count; i++) - sttCreateInstance(protos[i]->szModuleName); - - HookEvent(ME_JABBER_MENUINIT, InitMenus); - HookEvent(ME_POPUP_FILTER, OnFilterPopup); - HookEvent(ME_JABBER_EXTLISTINIT, OnExtListInit); - HookEvent(ME_OPT_INITIALISE, OptionsInitialization); - return 0; -} diff --git a/protocols/GTalkExt/src/handlers.h b/protocols/GTalkExt/src/handlers.h deleted file mode 100644 index 6c2ecf847c..0000000000 --- a/protocols/GTalkExt/src/handlers.h +++ /dev/null @@ -1,28 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#pragma once - -int ModulesLoaded(WPARAM wParam, LPARAM lParam); -int AccListChanged(WPARAM wParam, LPARAM lParam); -int OptionsInitialization(WPARAM wParam, LPARAM lParam); - -void AddTipperItem(); \ No newline at end of file diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp deleted file mode 100644 index b49d0e3854..0000000000 --- a/protocols/GTalkExt/src/inbox.cpp +++ /dev/null @@ -1,214 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#include "stdafx.h" -#include "inbox.h" -#include "notifications.h" -#include "db.h" -#include "options.h" - -#define COMMON_GMAIL_HOST1 L"gmail.com" -#define COMMON_GMAIL_HOST2 L"googlemail.com" - -#define AUTH_REQUEST_URL "https://www.google.com/accounts/ClientAuth" -#define AUTH_REQUEST_PARAMS "Email=%s&Passwd=%s&accountType=HOSTED_OR_GOOGLE&skipvpage=true&PersistentCookie=false" - -#define ISSUE_TOKEN_REQUEST_URL "https://www.google.com/accounts/IssueAuthToken" -#define ISSUE_TOKEN_REQUEST_PARAMS "SID=%s&LSID=%s&Session=true&skipvpage=true&service=gaia" - -#define TOKEN_AUTH_URL "https://www.google.com/accounts/TokenAuth?auth=%s&service=mail&continue=%s&source=googletalk" - -const NETLIBHTTPHEADER HEADER_URL_ENCODED = { "Content-Type", "application/x-www-form-urlencoded" }; -#define HTTP_OK 200 - -#define SID_KEY_NAME "SID=" -#define LSID_KEY_NAME "LSID=" - -#define LOGIN_PASS_SETTING_NAME "Password" - -#define INBOX_URL_FORMAT L"https://mail.google.com/%s%s/#inbox" - -// 3 lines from netlib.h -#define GetNetlibHandleType(h) (h?*(int*)h:NLH_INVALID) -#define NLH_INVALID 0 -#define NLH_USER 'USER' - -LPSTR HttpPost(HNETLIBUSER hUser, LPSTR reqUrl, LPSTR reqParams) -{ - NETLIBHTTPREQUEST nlhr = { sizeof(nlhr) }; - nlhr.requestType = REQUEST_POST; - nlhr.flags = NLHRF_HTTP11 | NLHRF_SSL | NLHRF_NODUMP | NLHRF_NODUMPHEADERS; - nlhr.szUrl = reqUrl; - nlhr.headers = (NETLIBHTTPHEADER*)&HEADER_URL_ENCODED; - nlhr.headersCount = 1; - nlhr.pData = reqParams; - nlhr.dataLength = (int)mir_strlen(reqParams); - - NLHR_PTR pResp(Netlib_HttpTransaction(hUser, &nlhr)); - return ((pResp && pResp->resultCode == HTTP_OK) ? mir_strdup(pResp->pData) : nullptr); -} - -LPSTR MakeRequest(HNETLIBUSER hUser, LPSTR reqUrl, LPSTR reqParamsFormat, LPSTR p1, LPSTR p2) -{ - ptrA encodedP1(mir_urlEncode(p1)), encodedP2(mir_urlEncode(p2)); - size_t size = mir_strlen(reqParamsFormat) + 1 + mir_strlen(encodedP1) + mir_strlen(encodedP2); - LPSTR reqParams = (LPSTR)alloca(size); - mir_snprintf(reqParams, size, reqParamsFormat, encodedP1, encodedP2); - return HttpPost(hUser, reqUrl, reqParams); -} - -LPSTR FindSid(LPSTR resp, LPSTR *LSID) -{ - LPSTR SID = strstr(resp, SID_KEY_NAME); - *LSID = strstr(resp, LSID_KEY_NAME); - if (!SID || !*LSID) return NULL; - - if (SID - 1 == *LSID) SID = strstr(SID + 1, SID_KEY_NAME); - if (!SID) return NULL; - - SID += mir_strlen(SID_KEY_NAME); - LPSTR term = strstr(SID, "\n"); - if (term) term[0] = 0; - - *LSID += mir_strlen(LSID_KEY_NAME); - term = strstr(*LSID, "\n"); - if (term) term[0] = 0; - - return SID; -} - -void DoOpenUrl(LPSTR tokenResp, LPSTR url) -{ - ptrA encodedUrl(mir_urlEncode(url)), encodedToken(mir_urlEncode(tokenResp)); - size_t size = mir_strlen(TOKEN_AUTH_URL) + 1 + mir_strlen(encodedToken) + mir_strlen(encodedUrl); - LPSTR composedUrl = (LPSTR)alloca(size); - mir_snprintf(composedUrl, size, TOKEN_AUTH_URL, encodedToken, encodedUrl); - Utils_OpenUrl(composedUrl); -} - -BOOL AuthAndOpen(HNETLIBUSER hUser, LPSTR url, LPSTR mailbox, LPSTR pwd) -{ - ptrA authResp(MakeRequest(hUser, AUTH_REQUEST_URL, AUTH_REQUEST_PARAMS, mailbox, pwd)); - if (!authResp) - return FALSE; - - LPSTR LSID; - LPSTR SID = FindSid(authResp, &LSID); - ptrA tokenResp(MakeRequest(hUser, ISSUE_TOKEN_REQUEST_URL, ISSUE_TOKEN_REQUEST_PARAMS, SID, LSID)); - if (!tokenResp) - return FALSE; - - DoOpenUrl(tokenResp, url); - return TRUE; -} - -struct OPEN_URL_HEADER { - LPSTR url; - LPSTR mailbox; - LPSTR pwd; - LPCSTR acc; -}; - -HNETLIBUSER FindNetUserHandle(LPCSTR acc) -{ - IJabberInterface *ji = getJabberApi(acc); - if (!ji) - return NULL; - - return ji->GetHandle(); -} - -void OpenUrlThread(void *param) -{ - OPEN_URL_HEADER* data = (OPEN_URL_HEADER*)param; - - HNETLIBUSER hUser = FindNetUserHandle(data->acc); - if (!hUser || !AuthAndOpen(hUser, data->url, data->mailbox, data->pwd)) - Utils_OpenUrl(data->url); - free(data); -} - -int GetMailboxPwd(LPCSTR acc, LPSTR *pwd, int buffSize) -{ - char buff[256]; - if (db_get_static(NULL, acc, LOGIN_PASS_SETTING_NAME, buff, sizeof(buff))) - return 0; - - int result = (int)mir_strlen(buff); - - if (pwd) { - if (buffSize < result + 1) - result = buffSize - 1; - memcpy(*pwd, &buff, result + 1); - } - - return result; -} - -BOOL OpenUrlWithAuth(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url) -{ - int pwdLen = GetMailboxPwd(acc, NULL, 0); - if (!pwdLen++) return FALSE; - - size_t urlLen = mir_wstrlen(url) + 1; - size_t mailboxLen = mir_wstrlen(mailbox) + 1; - - OPEN_URL_HEADER *data = (OPEN_URL_HEADER*)malloc(sizeof(OPEN_URL_HEADER) + urlLen + mailboxLen + pwdLen); - data->url = (LPSTR)data + sizeof(OPEN_URL_HEADER); - memcpy(data->url, _T2A(url), urlLen); - - data->mailbox = data->url + urlLen; - memcpy(data->mailbox, _T2A(mailbox), mailboxLen); - - data->pwd = data->mailbox + mailboxLen; - if (!GetMailboxPwd(acc, &data->pwd, pwdLen)) - return FALSE; - - data->acc = acc; - mir_forkthread(OpenUrlThread, data); - return TRUE; -} - -void OpenUrl(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url) -{ - extern DWORD itlsSettings; - if (!ReadCheckbox(0, IDC_AUTHONMAILBOX, (UINT_PTR)TlsGetValue(itlsSettings)) || !OpenUrlWithAuth(acc, mailbox, url)) - Utils_OpenUrlW(url); -} - -void OpenContactInbox(LPCSTR szModuleName) -{ - ptrW tszJid(db_get_wsa(0, szModuleName, "jid")); - if (tszJid == NULL) - return; - - LPTSTR host = wcschr(tszJid, '@'); - if (!host) - return; - *host++ = 0; - - wchar_t buf[1024]; - if (mir_wstrcmpi(host, COMMON_GMAIL_HOST1) && mir_wstrcmpi(host, COMMON_GMAIL_HOST2)) - mir_snwprintf(buf, INBOX_URL_FORMAT, L"a/", host); // hosted - else - mir_snwprintf(buf, INBOX_URL_FORMAT, L"", L"mail"); // common - OpenUrl(szModuleName, tszJid, buf); -} diff --git a/protocols/GTalkExt/src/inbox.h b/protocols/GTalkExt/src/inbox.h deleted file mode 100644 index 2ddf4709e6..0000000000 --- a/protocols/GTalkExt/src/inbox.h +++ /dev/null @@ -1,27 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#pragma once - -void OpenUrl(LPCSTR acc, LPCTSTR mailbox, LPCTSTR url); -void OpenContactInbox(LPCSTR); - -int InitMenus(WPARAM, LPARAM); \ No newline at end of file diff --git a/protocols/GTalkExt/src/menu.cpp b/protocols/GTalkExt/src/menu.cpp deleted file mode 100644 index 6fdb8f9b63..0000000000 --- a/protocols/GTalkExt/src/menu.cpp +++ /dev/null @@ -1,54 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#include "stdafx.h" -#include "db.h" -#include "resources.h" -#include "options.h" -#include "inbox.h" - -#define MS_GTALKEXT_OPENMAILBOX SHORT_PLUGIN_NAME "/OpenMailbox" - -INT_PTR OpenMailboxMenuHandler(WPARAM, LPARAM, LPARAM param) -{ - OpenContactInbox((LPCSTR)param); - return 0; -} - -int InitMenus(WPARAM wParam, LPARAM lParam) -{ - GoogleTalkAcc *pga = isGoogle(lParam); - if (pga != NULL) { - LPCSTR szModuleName = pga->m_japi->GetModuleName(); - char szServiceName[100]; - mir_snprintf(szServiceName, "%s/%s", szModuleName, MS_GTALKEXT_OPENMAILBOX); - CreateServiceFunctionParam(szServiceName, OpenMailboxMenuHandler, (LPARAM)szModuleName); - - CMenuItem mi; - mi.root = HGENMENU(wParam); - mi.hIcolibItem = iconList[0].hIcolib; - mi.position = 200101; - mi.name.a = LPGEN("Open mailbox"); - mi.pszService = szServiceName; - Menu_AddProtoMenuItem(&mi); - } - return 0; -} diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp deleted file mode 100644 index da71957b28..0000000000 --- a/protocols/GTalkExt/src/notifications.cpp +++ /dev/null @@ -1,340 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#include "StdAfx.h" -#include "notifications.h" -#include "db.h" -#include "options.h" -#include "inbox.h" - -#define PLUGIN_DATA_PROP_NAME L"{DB5CE833-C3AC-4851-831C-DDEBD9FA0508}" -#define EVT_DELETED_HOOK_PROP_NAME L"{87CBD2BC-8806-413C-8FD5-1D61ABCA4AF8}" - -#define EVENT_DELETED_MSG RegisterWindowMessage(L"{B9B00536-86A0-4BCE-B2FE-4ABD409C22AE}") -#define MESSAGE_CLOSEPOPUP RegisterWindowMessage(L"{7A60EA87-3E77-41DF-8A69-59B147F0C9C6}") - -#define CLIST_MODULE_NAME "CList" -#define CONTACT_DISPLAY_NAME_SETTING "MyHandle" -#define STATUS_MSG_SETTING "StatusMsg" -#define UNREAD_THREADS_SETTING "UnreadThreads" - -struct POPUP_DATA_HEADER -{ - BOOL MarkRead; - MEVENT hDbEvent; - MCONTACT hContact; - LPTSTR jid; - LPTSTR url; -}; - -extern DWORD itlsSettings; - -LPCSTR GetJidAcc(LPCTSTR jid) -{ - int count = 0; - PROTOACCOUNT **protos; - Proto_EnumAccounts(&count, &protos); - for (int i = 0; i < count; i++) { - if (getJabberApi(protos[i]->szModuleName)) { - ptrW tszJid(db_get_wsa(0, protos[i]->szModuleName, "jid")); - if (!mir_wstrcmpi(jid, tszJid)) - return protos[i]->szModuleName; - } - } - - return NULL; -} - -void MarkEventRead(MCONTACT hCnt, MEVENT hEvt) -{ - DWORD settings = (UINT_PTR)TlsGetValue(itlsSettings); - if (ReadCheckbox(0, IDC_POPUPSENABLED, settings) && - ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) && - ReadCheckbox(0, IDC_MARKEVENTREAD, settings) && - db_event_markRead(hCnt, hEvt) != -1) - pcli->pfnRemoveEvent(hCnt, hEvt); -} - -int OnEventDeleted(WPARAM hContact, LPARAM hDbEvent, LPARAM wnd) -{ - if (db_get_b((MCONTACT)hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) { - pcli->pfnRemoveEvent(hContact, hDbEvent); - PostMessage((HWND)wnd, EVENT_DELETED_MSG, hContact, hDbEvent); - } - - return 0; -} - -LRESULT CALLBACK PopupProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - POPUP_DATA_HEADER *ppdh = (POPUP_DATA_HEADER*)PUGetPluginData(wnd); - LPCSTR acc; - - if (EVENT_DELETED_MSG == msg) { - if ((MEVENT)lParam == ppdh->hDbEvent) - ppdh->hDbEvent = NULL; - return 0; - } - - if (MESSAGE_CLOSEPOPUP == msg) { - ppdh->MarkRead = TRUE; - PUDeletePopup(wnd); - } - - switch (msg) { - case UM_INITPOPUP: - SetProp(wnd, PLUGIN_DATA_PROP_NAME, (HANDLE)ppdh); - SetProp(wnd, EVT_DELETED_HOOK_PROP_NAME, - HookEventParam(ME_DB_EVENT_DELETED, OnEventDeleted, (LPARAM)wnd)); - return 0; - - case UM_FREEPLUGINDATA: - { - HANDLE hHook = GetProp(wnd, EVT_DELETED_HOOK_PROP_NAME); - RemoveProp(wnd, EVT_DELETED_HOOK_PROP_NAME); - UnhookEvent(hHook); - } - - if (ppdh->MarkRead && ppdh->hDbEvent && (acc = GetJidAcc(ppdh->jid))) { - ReadNotificationSettings(acc); - MarkEventRead(ppdh->hContact, ppdh->hDbEvent); - pcli->pfnRemoveEvent(ppdh->hContact, ppdh->hDbEvent); - } - RemoveProp(wnd, PLUGIN_DATA_PROP_NAME); - free(ppdh); - return 0; - - case WM_LBUTTONUP: - acc = NULL; - __try { - if (!(acc = GetJidAcc(ppdh->jid))) return 0; - - ReadNotificationSettings(acc); - OpenUrl(acc, ppdh->jid, ppdh->url); - } - __finally { - CloseNotifications(acc, ppdh->url, ppdh->jid, TRUE); - } - return 0; - - case WM_RBUTTONUP: - SendMessage(wnd, MESSAGE_CLOSEPOPUP, 0, 0); - return 0; - } - return DefWindowProc(wnd, msg, wParam, lParam); -} - -static bool DoAddPopup(POPUPDATAT *data) -{ - if (ReadCheckbox(0, IDC_POPUPSINFULLSCREEN, (UINT_PTR)TlsGetValue(itlsSettings)) && IsFullScreen()) { - HWND handle = CreateWindowEx(WS_EX_TOOLWINDOW, TEMP_WINDOW_CLASS_NAME, NULL, WS_OVERLAPPED | WS_VISIBLE, -100, -100, 10, 10, 0, 0, 0, 0); - if (handle) { - ShowWindow(handle, SW_MINIMIZE); - ShowWindow(handle, SW_RESTORE); - } - DestroyWindow(handle); - } - - return PUAddPopupT(data) == 0; -} - -void FormatPseudocontactDisplayName(LPTSTR buff, LPCTSTR jid, LPCTSTR unreadCount) -{ - if (mir_wstrcmp(unreadCount, L"0")) - wsprintf(buff, L"%s [%s]", jid, unreadCount); //!!!!!!!!!!! - else - wsprintf(buff, L"%s", jid); //!!!!!!!!!!! -} - -MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTSTR displayName) -{ - MCONTACT hContact = db_get_dw(NULL, acc, PSEUDOCONTACT_LINK, 0); - if (!hContact || !db_get_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) { - hContact = db_add_contact(); - db_set_dw(0, acc, PSEUDOCONTACT_LINK, hContact); - db_set_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 1); - Proto_AddToContact(hContact, acc); - } - - // SetAvatar(hContact); - - if (displayName == NULL) { - wchar_t *tszTemp = (wchar_t*)alloca((mir_wstrlen(jid) + mir_wstrlen(unreadCount) + 3 + 1) * sizeof(wchar_t)); - FormatPseudocontactDisplayName(tszTemp, jid, unreadCount); - db_set_ws(hContact, CLIST_MODULE_NAME, CONTACT_DISPLAY_NAME_SETTING, tszTemp); - } - else db_set_ws(hContact, CLIST_MODULE_NAME, CONTACT_DISPLAY_NAME_SETTING, displayName); - - db_set_ws(hContact, CLIST_MODULE_NAME, STATUS_MSG_SETTING, TranslateW(MAIL_NOTIFICATIONS)); - db_set_ws(hContact, SHORT_PLUGIN_NAME, UNREAD_THREADS_SETTING, unreadCount); - return hContact; -} - -static MEVENT AddCListNotification(MCONTACT hContact, LPCSTR acc, POPUPDATAT *data, LPCTSTR url) -{ - T2Utf szUrl(url), szText(data->lptzText); - - DBEVENTINFO dbei = {}; - dbei.szModule = (LPSTR)acc; - dbei.timestamp = time(NULL); - dbei.flags = DBEF_UTF; - dbei.eventType = EVENTTYPE_MESSAGE; - - char szEventText[4096]; - dbei.cbBlob = mir_snprintf(szEventText, "%s\r\n%s", szUrl, szText); - dbei.pBlob = (PBYTE)szEventText; - return db_event_add(hContact, &dbei); -} - -BOOL UsePopups() -{ - return ServiceExists(MS_POPUP_QUERY) && - CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) && - ReadCheckbox(0, IDC_POPUPSENABLED, (UINT_PTR)TlsGetValue(itlsSettings)); -} - -void ShowNotification(LPCSTR acc, POPUPDATAT *data, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount) -{ - MCONTACT hCnt = SetupPseudocontact(jid, unreadCount, acc, &data->lptzContactName[0]); - MEVENT hEvt = ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, (UINT_PTR)TlsGetValue(itlsSettings)) - ? AddCListNotification(hCnt, acc, data, url) : NULL; - - if (!UsePopups()) - return; - - data->lchIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib); - data->iSeconds = (int)db_get_dw(0, SHORT_PLUGIN_NAME, TIMEOUT_SETTING, 0); - data->colorBack = (COLORREF)db_get_dw(0, SHORT_PLUGIN_NAME, BACK_COLOR_SETTING, 0); - data->colorText = (COLORREF)db_get_dw(0, SHORT_PLUGIN_NAME, TEXT_COLOR_SETTING, 0); - if (data->colorBack == data->colorText) { - data->colorBack = 0; - data->colorText = 0; - } - - data->PluginWindowProc = PopupProc; - size_t lurl = (mir_wstrlen(url) + 1) * sizeof(wchar_t); - size_t ljid = (mir_wstrlen(jid) + 1) * sizeof(wchar_t); - - POPUP_DATA_HEADER *ppdh = (POPUP_DATA_HEADER*)malloc(sizeof(POPUP_DATA_HEADER) + lurl + ljid); - ppdh->MarkRead = FALSE; - ppdh->hContact = hCnt; - ppdh->hDbEvent = hEvt; - ppdh->jid = (LPTSTR)((PBYTE)ppdh + sizeof(*ppdh)); - memcpy(ppdh->jid, jid, ljid); - - ppdh->url = (LPTSTR)((PBYTE)ppdh->jid + ljid); - memcpy(ppdh->url, url, lurl); - data->PluginData = ppdh; - - if (!DoAddPopup(data)) - free(data->PluginData); -} - -void UnreadMailNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount) -{ - POPUPDATAT data = { 0 }; - - FormatPseudocontactDisplayName(&data.lptzContactName[0], jid, unreadCount); - mir_snwprintf(data.lptzText, TranslateT("You've received an e-mail\n%s unread threads"), unreadCount); - - ShowNotification(acc, &data, jid, url, unreadCount); -} - -void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount, const MAIL_THREAD_NOTIFICATION *mtn) -{ - POPUPDATAT data = { 0 }; - FormatPseudocontactDisplayName(&data.lptzContactName[0], jid, unreadCount); - - CMStringW tszSenders; - for (int i = 0; i < SENDER_COUNT; i++) { - const SENDER &p = mtn->senders[i]; - if (p.addr == NULL) - break; - - if (p.name) - tszSenders.AppendFormat(L" %s <%s>\n", p.name, p.addr); - else - tszSenders.AppendFormat(L" %s\n", p.addr); - } - - if (ReadCheckbox(0, IDC_ADDSNIP, (UINT_PTR)TlsGetValue(itlsSettings))) - mir_snwprintf(data.lptzText, TranslateW(FULL_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str(), mtn->snip); - else - mir_snwprintf(data.lptzText, TranslateW(SHORT_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str()); - - ShowNotification(acc, &data, jid, url, unreadCount); -} - -void ClearNotificationContactHistory(LPCSTR acc) -{ - MCONTACT hContact = db_get_dw(NULL, acc, PSEUDOCONTACT_LINK, 0); - if (!hContact || !db_get_b(hContact, SHORT_PLUGIN_NAME, PSEUDOCONTACT_FLAG, 0)) - return; - - for (MEVENT hEvent = db_event_first(hContact); hEvent;) { - MEVENT hEvent1 = db_event_next(hContact, hEvent); - db_event_delete(hContact, hEvent); - hEvent = hEvent1; - } -} - -DWORD ReadNotificationSettings(LPCSTR acc) -{ - DWORD result = ReadCheckboxes(0, acc); - TlsSetValue(itlsSettings, (PVOID)result); - return result; -} - -struct POPUP_IDENT_STRINGS -{ - LPCTSTR url; - LPCTSTR jid; -}; - -BOOL CALLBACK ClosePopupFunc(__in HWND hwnd, __in LPARAM lParam) -{ - DWORD pid = 0; - GetWindowThreadProcessId(hwnd, &pid); - if (pid != GetCurrentProcessId()) - return TRUE; - - POPUP_IDENT_STRINGS *ppis = (POPUP_IDENT_STRINGS*)lParam; - POPUP_DATA_HEADER *ppdh = (POPUP_DATA_HEADER*)GetProp(hwnd, PLUGIN_DATA_PROP_NAME); - if (!ppdh) - return TRUE; - - if (!mir_wstrcmpi(ppis->url, ppdh->url) && !mir_wstrcmpi(ppis->jid, ppdh->jid)) - SendMessage(hwnd, MESSAGE_CLOSEPOPUP, 0, 0); - - return TRUE; -} - -void CloseNotifications(LPCSTR acc, LPCTSTR url, LPCTSTR jid, BOOL PopupsOnly) -{ - DWORD settings = (UINT_PTR)TlsGetValue(itlsSettings); - if (acc && !PopupsOnly && - ReadCheckbox(0, IDC_PSEUDOCONTACTENABLED, settings) && - ReadCheckbox(0, IDC_CLEARPSEUDOCONTACTLOG, settings)) - ClearNotificationContactHistory(acc); - - POPUP_IDENT_STRINGS pis = { url, jid }; - EnumWindows(ClosePopupFunc, (LPARAM)&pis); -} diff --git a/protocols/GTalkExt/src/notifications.h b/protocols/GTalkExt/src/notifications.h deleted file mode 100644 index 1675f3285b..0000000000 --- a/protocols/GTalkExt/src/notifications.h +++ /dev/null @@ -1,44 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#pragma once - -#define TEMP_WINDOW_CLASS_NAME L"AntiShittyFullscreenDetectionWindowClass" - -#define SENDER_COUNT 10 - -struct SENDER { - LPCTSTR name; - LPCTSTR addr; -}; - -struct MAIL_THREAD_NOTIFICATION { - LPCTSTR subj; - LPCTSTR snip; - SENDER senders[SENDER_COUNT]; -}; - -void UnreadMailNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount); -void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unreadCount, const MAIL_THREAD_NOTIFICATION *mtn); -void CloseNotifications(LPCSTR acc, LPCTSTR url, LPCTSTR jid, BOOL PopupsOnly); -DWORD ReadNotificationSettings(LPCSTR acc); -MCONTACT SetupPseudocontact(LPCTSTR jid, LPCTSTR unreadCount, LPCSTR acc, LPCTSTR displayName = NULL); -LPCSTR GetJidAcc(LPCTSTR jid); \ No newline at end of file diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp deleted file mode 100644 index 5e2a8858f0..0000000000 --- a/protocols/GTalkExt/src/options.cpp +++ /dev/null @@ -1,252 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#include "stdafx.h" -#include "db.h" -#include "options.h" - -#define ACCOUNT_PROP_NAME L"{BF447EBA-27AE-4DB7-893C-FC42A3F74D75}" -#define DIALOG_INITIALIZED_PROP_NAME L"{5EE59FE5-679A-4A29-B0A1-03092E7AC20E}" - -#define POPUPS_OPTIONS_GROUP LPGENW("Popups") -#define NETWORK_OPTIONS_GROUP LPGENW("Network") - -#define NOTIFY_SETTINGS_FROM_MOD_NAME SHORT_PLUGIN_NAME ".NotifySettingsFromModName" - -#define TEST_LETTER_SUBJECT LPGENW("Why C sucks") -#define TEST_LETTER_INBOX L"brickstrace@gmail.com [1]" -#define TEST_LETTER_SENDER L" bems\n" -#define TEST_LETTER_SNIP LPGENW("* Primitive type system\n* No overloading\n* Limited possibility of data abstraction, polymorphism, subtyping and code reuse\n* No metaprogramming except preprocessor macros\n* No exceptions") - -void CheckControlsEnabled(HWND wnd) -{ - BOOL PopupsEnabled = (SendDlgItemMessage(wnd, IDC_POPUPSENABLED, BM_GETSTATE, 0, 0) & BST_CHECKED) == BST_CHECKED; - EnableWindow(GetDlgItem(wnd, IDC_POPUPSINFULLSCREEN), PopupsEnabled); - EnableWindow(GetDlgItem(wnd, IDC_POPUPSINFULLSCREENLABEL), PopupsEnabled); - - BOOL CListEnabled = (SendDlgItemMessage(wnd, IDC_PSEUDOCONTACTENABLED, BM_GETSTATE, 0, 0) & BST_CHECKED) == BST_CHECKED; - EnableWindow(GetDlgItem(wnd, IDC_CLEARPSEUDOCONTACTLOG), CListEnabled); - - EnableWindow(GetDlgItem(wnd, IDC_MARKEVENTREAD), PopupsEnabled && CListEnabled); - EnableWindow(GetDlgItem(wnd, IDC_ADDSNIP), PopupsEnabled || CListEnabled); - - EnableWindow(GetDlgItem(wnd, IDC_MAILBOXVIEWLABEL), PopupsEnabled || CListEnabled); - EnableWindow(GetDlgItem(wnd, IDC_UNKNOWNVIEW), PopupsEnabled || CListEnabled); - EnableWindow(GetDlgItem(wnd, IDC_STANDARDVIEW), PopupsEnabled || CListEnabled); - EnableWindow(GetDlgItem(wnd, IDC_HTMLVIEW), PopupsEnabled || CListEnabled); - - EnableWindow(GetDlgItem(wnd, IDC_MAILBOXVIEWLABEL), PopupsEnabled); - EnableWindow(GetDlgItem(wnd, IDC_UNKNOWNVIEW), PopupsEnabled); - EnableWindow(GetDlgItem(wnd, IDC_STANDARDVIEW), PopupsEnabled); - EnableWindow(GetDlgItem(wnd, IDC_HTMLVIEW), PopupsEnabled); -} - -BOOL ReadCheckbox(HWND wnd, int id, DWORD controls) -{ - BOOL result = ((controls >> (id - IDC_BASE)) & 1); - if (id != IDC_STANDARDVIEW && id != IDC_HTMLVIEW) result = !result; - if (wnd) Button_SetCheck(GetDlgItem(wnd, id), result); - return result; -} - -DWORD ReadCheckboxes(HWND wnd, LPCSTR mod) -{ - DWORD controls = db_get_dw(NULL, NOTIFY_SETTINGS_FROM_MOD_NAME, mod, 0); - ReadCheckbox(wnd, IDC_POPUPSENABLED, controls); - ReadCheckbox(wnd, IDC_PSEUDOCONTACTENABLED, controls); - ReadCheckbox(wnd, IDC_CLEARPSEUDOCONTACTLOG, controls); - ReadCheckbox(wnd, IDC_POPUPSINFULLSCREEN, controls); - ReadCheckbox(wnd, IDC_MARKEVENTREAD, controls); - ReadCheckbox(wnd, IDC_AUTHONMAILBOX, controls); - ReadCheckbox(wnd, IDC_ADDSNIP, controls); - ReadCheckbox(wnd, IDC_UNKNOWNVIEW, controls); - ReadCheckbox(wnd, IDC_STANDARDVIEW, controls); - ReadCheckbox(wnd, IDC_HTMLVIEW, controls); - return controls; -} - -DWORD GetCheckboxSaveValue(HWND wnd, int id) -{ - BOOL val = Button_GetCheck(GetDlgItem(wnd, id)); - if (id != IDC_STANDARDVIEW && id != IDC_HTMLVIEW) val = !val; - return val ? (1 << (id - IDC_BASE)) : 0; -} - -void SaveControls(HWND wnd, LPCSTR mod) -{ - DWORD controls = GetCheckboxSaveValue(wnd, IDC_CLEARPSEUDOCONTACTLOG) | - GetCheckboxSaveValue(wnd, IDC_POPUPSINFULLSCREEN) | - GetCheckboxSaveValue(wnd, IDC_POPUPSENABLED) | - GetCheckboxSaveValue(wnd, IDC_PSEUDOCONTACTENABLED) | - GetCheckboxSaveValue(wnd, IDC_MARKEVENTREAD) | - GetCheckboxSaveValue(wnd, IDC_AUTHONMAILBOX) | - GetCheckboxSaveValue(wnd, IDC_ADDSNIP) | - GetCheckboxSaveValue(wnd, IDC_UNKNOWNVIEW) | - GetCheckboxSaveValue(wnd, IDC_STANDARDVIEW) | - GetCheckboxSaveValue(wnd, IDC_HTMLVIEW); - - db_set_dw(NULL, NOTIFY_SETTINGS_FROM_MOD_NAME, mod, controls); -} - -///////////////////////////////////////////////////////////////////////////////////////// - -INT_PTR CALLBACK AccOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_INITDIALOG: - SetProp(wnd, ACCOUNT_PROP_NAME, (HANDLE)lParam); - TranslateDialogDefault(wnd); - ReadCheckboxes(wnd, (LPCSTR)lParam); - CheckControlsEnabled(wnd); - break; - - case WM_CTLCOLORSTATIC: - if (GetDlgItem(wnd, IDC_WARNBAR) == (HWND)lParam) - return (INT_PTR)CreateSolidBrush(0x55AAFF); // orange - break; - - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDC_POPUPSENABLED: - case IDC_PSEUDOCONTACTENABLED: - if (HIWORD(wParam) == BN_CLICKED) CheckControlsEnabled(wnd); - // no break - - case IDC_CLEARPSEUDOCONTACTLOG: - case IDC_POPUPSINFULLSCREEN: - case IDC_MARKEVENTREAD: - case IDC_AUTHONMAILBOX: - case IDC_ADDSNIP: - case IDC_UNKNOWNVIEW: - case IDC_STANDARDVIEW: - case IDC_HTMLVIEW: - if (HIWORD(wParam) == BN_CLICKED) PropSheet_Changed(GetParent(wnd), wnd); - } - break; - - case WM_NOTIFY: - if (!((LPNMHDR)lParam)->idFrom && ((LPNMHDR)lParam)->code == PSN_APPLY) - SaveControls(wnd, (LPCSTR)GetProp(wnd, ACCOUNT_PROP_NAME)); - break; - } - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// - -void ShowTestPopup(HWND wnd) -{ - POPUPDATAT data = { 0 }; - mir_snwprintf(data.lptzContactName, TranslateW(TEST_LETTER_INBOX)); - mir_snwprintf(data.lptzText, TranslateW(FULL_NOTIFICATION_FORMAT), TranslateW(TEST_LETTER_SUBJECT), TranslateW(TEST_LETTER_SENDER), TranslateW(TEST_LETTER_SNIP)); - - int len = SendDlgItemMessage(wnd, IDC_TIMEOUTEDIT, WM_GETTEXTLENGTH, 0, 0) + 1; - LPTSTR timeout = (LPTSTR)_alloca(len * sizeof(wchar_t)); - - GetDlgItemText(wnd, IDC_TIMEOUTEDIT, timeout, len); - data.iSeconds = _wtoi(timeout); - - data.lchIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib); - data.colorBack = (COLORREF)SendDlgItemMessage(wnd, IDC_BACKCOLORPICKER, CPM_GETCOLOUR, 0, 0); - data.colorText = (COLORREF)SendDlgItemMessage(wnd, IDC_TEXTCOLORPICKER, CPM_GETCOLOUR, 0, 0); - if (data.colorBack == data.colorText) { - data.colorBack = 0; - data.colorText = 0; - } - PUAddPopupT(&data); -} - -INT_PTR CALLBACK PopupsOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - wchar_t timeout[20]; - - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(wnd); - SendDlgItemMessage(wnd, IDC_BACKCOLORPICKER, CPM_SETCOLOUR, 0, (LPARAM)db_get_dw(0, SHORT_PLUGIN_NAME, BACK_COLOR_SETTING, 0)); - SendDlgItemMessage(wnd, IDC_TEXTCOLORPICKER, CPM_SETCOLOUR, 0, (LPARAM)db_get_dw(0, SHORT_PLUGIN_NAME, TEXT_COLOR_SETTING, 0)); - - _itow(db_get_dw(0, SHORT_PLUGIN_NAME, TIMEOUT_SETTING, 0), timeout, 10); - SetDlgItemText(wnd, IDC_TIMEOUTEDIT, timeout); - - SetProp(wnd, DIALOG_INITIALIZED_PROP_NAME, (HANDLE)TRUE); - break; - - case WM_COMMAND: - if (LOWORD(wParam) == IDC_TESTBUTTON && HIWORD(wParam) == BN_CLICKED) - ShowTestPopup(wnd); - - if (GetProp(wnd, DIALOG_INITIALIZED_PROP_NAME)) - switch (LOWORD(wParam)) { - case IDC_BACKCOLORPICKER: - case IDC_TEXTCOLORPICKER: - if (HIWORD(wParam) == CPN_COLOURCHANGED) PropSheet_Changed(GetParent(wnd), wnd); - break; - - case IDC_TIMEOUTEDIT: - if (HIWORD(wParam) == EN_CHANGE) PropSheet_Changed(GetParent(wnd), wnd); - } - break; - - case WM_NOTIFY: - if (!((LPNMHDR)lParam)->idFrom && ((LPNMHDR)lParam)->code == PSN_APPLY) - db_set_dw(0, SHORT_PLUGIN_NAME, BACK_COLOR_SETTING, (DWORD)SendDlgItemMessage(wnd, IDC_BACKCOLORPICKER, CPM_GETCOLOUR, 0, 0)); - db_set_dw(0, SHORT_PLUGIN_NAME, TEXT_COLOR_SETTING, (DWORD)SendDlgItemMessage(wnd, IDC_TEXTCOLORPICKER, CPM_GETCOLOUR, 0, 0)); - - GetDlgItemText(wnd, IDC_TIMEOUTEDIT, timeout, _countof(timeout)); - db_set_dw(0, SHORT_PLUGIN_NAME, TIMEOUT_SETTING, _wtoi(timeout)); - } - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// - -int OptionsInitialization(WPARAM wParam, LPARAM) -{ - if (ServiceExists(MS_POPUP_ADDPOPUPT)) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.szTitle.w = MAIL_NOTIFICATIONS; - odp.pfnDlgProc = PopupsOptionsDlgProc; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPSETTINGS); - odp.hInstance = g_hInst; - odp.szGroup.w = POPUPS_OPTIONS_GROUP; - odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB; - Options_AddPage(wParam, &odp); - } - - for (int i = 0; i < g_accs.getCount(); i++) { - LPCSTR szProto = g_accs[i]->m_pa->szModuleName; - PROTOACCOUNT *pa = Proto_GetAccount(szProto); - if (pa != NULL) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.szTitle.w = pa->tszAccountName; - odp.pfnDlgProc = AccOptionsDlgProc; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAILSETTINGS); - odp.hInstance = g_hInst; - odp.szGroup.w = NETWORK_OPTIONS_GROUP; - odp.flags = ODPF_UNICODE | ODPF_USERINFOTAB | ODPF_DONTTRANSLATE; - odp.szTab.w = MAIL_NOTIFICATIONS; - odp.dwInitParam = (LPARAM)szProto; - Options_AddPage(wParam, &odp); - } - } - return 0; -} diff --git a/protocols/GTalkExt/src/options.h b/protocols/GTalkExt/src/options.h deleted file mode 100644 index b9bb84ceea..0000000000 --- a/protocols/GTalkExt/src/options.h +++ /dev/null @@ -1,39 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#pragma once - -#include "resources.h" - -#define JABBER_FEAT_GTALK_PMUC L"http://www.google.com/xmpp/protocol/pmuc/v1" - -#define MAIL_NOTIFICATIONS LPGENW("GMail notifications") -#define FULL_NOTIFICATION_FORMAT LPGENW("subject\n %s\nfrom\n%s\n%s\n") -#define SHORT_NOTIFICATION_FORMAT LPGENW("subject\n %s\nfrom\n%s") - -#define PSEUDOCONTACT_LINK "GTalkExtNotifyContact" -#define PSEUDOCONTACT_FLAG "IsNotifyContact" -#define BACK_COLOR_SETTING "BackColor" -#define TEXT_COLOR_SETTING "TextColor" -#define TIMEOUT_SETTING "Timeout" - -DWORD ReadCheckboxes(HWND wnd, LPCSTR mod); -BOOL ReadCheckbox(HWND wnd, int id, DWORD controls); \ No newline at end of file diff --git a/protocols/GTalkExt/src/resources.h b/protocols/GTalkExt/src/resources.h deleted file mode 100644 index 1b63b3c9e4..0000000000 --- a/protocols/GTalkExt/src/resources.h +++ /dev/null @@ -1,59 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#pragma once - -#define SHORT_PLUGIN_NAME "GTalkExt" - -#define IDD_MAILSETTINGS 2001 - -#define IDC_BASE 1001 -#define IDC_POPUPSENABLED IDC_BASE + 0 -#define IDC_PSEUDOCONTACTENABLED IDC_BASE + 1 -#define IDC_CLEARPSEUDOCONTACTLOG IDC_BASE + 2 -#define IDC_POPUPSINFULLSCREEN IDC_BASE + 3 -#define IDC_MARKEVENTREAD IDC_BASE + 5 -#define IDC_AUTHONMAILBOX IDC_BASE + 6 -#define IDC_ADDSNIP IDC_BASE + 7 -#define IDC_UNKNOWNVIEW IDC_BASE + 8 -#define IDC_STANDARDVIEW IDC_BASE + 9 -#define IDC_HTMLVIEW IDC_BASE + 10 -#define IDC_POPUPSINFULLSCREENLABEL IDC_BASE + 32 -#define IDC_NOTE IDC_BASE + 33 -#define IDC_WARNBAR IDC_BASE + 34 -#define IDC_AUTHONMAILBOXLABEL IDC_BASE + 35 -#define IDC_MAILBOXVIEWLABEL IDC_BASE + 36 - -#define IDD_POPUPSETTINGS 2002 - -#define IDC_BACKCOLORLABEL 1001 -#define IDC_BACKCOLORPICKER 1002 -#define IDC_TEXTCOLORLABEL 1003 -#define IDC_TEXTCOLORPICKER 1004 -#define IDC_TIMEOUTLABEL 1005 -#define IDC_TIMEOUTEDIT 1006 -#define IDC_DEFCOLORSLABEL 1007 -#define IDC_DEFTIMEOUTLABEL 1008 -#define IDC_TESTBUTTON 1009 -#define IDC_GROUP 1010 - -#define IDI_POPUP 3001 -#define IDI_PSEUDOAVA 3002 diff --git a/protocols/GTalkExt/src/stdafx.cxx b/protocols/GTalkExt/src/stdafx.cxx deleted file mode 100644 index bdf32c5876..0000000000 --- a/protocols/GTalkExt/src/stdafx.cxx +++ /dev/null @@ -1,25 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/protocols/GTalkExt/src/stdafx.h b/protocols/GTalkExt/src/stdafx.h deleted file mode 100644 index abfc7fcb29..0000000000 --- a/protocols/GTalkExt/src/stdafx.h +++ /dev/null @@ -1,72 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#pragma once - -#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers - -#include -#include -#include -#include - -// Windows Header Files: -#include -#include -#include -#include - -#include -#pragma comment(lib, "psapi.lib") - -#include - -// Miranda&Plugins API -#include -#include - -#pragma warning(push) -#pragma warning(disable:4996) - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#pragma warning(pop) - -#include "googletalk.h" - -extern HINSTANCE g_hInst; -extern LIST g_accs; -extern IconItem iconList[]; - -void SetAvatar(MCONTACT hContact); -BOOL InitAvaUnit(BOOL init); diff --git a/protocols/GTalkExt/src/tipper_items.cpp b/protocols/GTalkExt/src/tipper_items.cpp deleted file mode 100644 index 5f7baa7f27..0000000000 --- a/protocols/GTalkExt/src/tipper_items.cpp +++ /dev/null @@ -1,137 +0,0 @@ -//*************************************************************************************** -// -// Google Extension plugin for the Miranda IM's Jabber protocol -// Copyright (c) 2011 bems@jabber.org, George Hazan (ghazan@jabber.ru) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// -//*************************************************************************************** - -#include "StdAfx.h" -#include "resources.h" - -#define VALUE_SETTING_PROP "DIValue%d" -#define LABEL_SETTING_PROP "DILabel%d" - -#define LAST_WRITTEN_LABEL_SETTING "LastWrittenTipperLabel" - -static LPSTR TipperItemProps[] = -{ - LABEL_SETTING_PROP, - "DILineAbove%d", - "DITipperVarsFirst%d", - "DIValNewline%d", - VALUE_SETTING_PROP, - "DIVisible%d" -}; - -#define TIPPER_ITEMS_MOD_NAME "Tipper_Items" -#define TIPPER_ITEM_COUNT_SETTING "DINumValues" -#define UNREAD_THREADS_RAW L"%raw:" _T(SHORT_PLUGIN_NAME) L"/UnreadThreads%" -#define UNREAD_THREADS_LABEL LPGENW("Unread threads:") - -void ShiftTipperSettings(LPSTR buff, int count, LPSTR format) -{ - for (int i = count; i > 0; i--) { - DBVARIANT dbv; - sprintf(buff, format, i - 1); //!!!!!!!!!!!!!!! - - if (db_get(0, TIPPER_ITEMS_MOD_NAME, buff, &dbv)) - break; - - __try { - if (DBVT_ASCIIZ == dbv.type) { - db_free(&dbv); - if (db_get_ws(0, TIPPER_ITEMS_MOD_NAME, buff, &dbv)) - break; - } - - if (db_get_s(0, TIPPER_ITEMS_MOD_NAME, buff, &dbv)) - break; - - sprintf(buff, format, i); //!!!!!!!!!!!!!!!! - db_set(NULL, TIPPER_ITEMS_MOD_NAME, buff, &dbv); - } - __finally { - db_free(&dbv); - } - } -} - -void SetLabelProp(int index, LPSTR setting) -{ - sprintf(setting, LABEL_SETTING_PROP, index); //!!!!!!!!!!!!!! - - ptrW tszProp(db_get_wsa(0, TIPPER_ITEMS_MOD_NAME, setting)); - if (tszProp == NULL) - return; - - ptrW tszLastWritten(db_get_wsa(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING)); - if (tszLastWritten == NULL) - return; - - if (!mir_wstrcmp(tszProp, tszLastWritten)) { - LPTSTR label = TranslateW(UNREAD_THREADS_LABEL); - db_set_ws(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING, label); - db_set_ws(0, TIPPER_ITEMS_MOD_NAME, setting, label); - } -} - -void AddTipperItem() -{ - WORD itemCount = db_get_w(0, TIPPER_ITEMS_MOD_NAME, TIPPER_ITEM_COUNT_SETTING, WORD(-1)); - if (itemCount == WORD(-1)) - return; - - int i, l = 0; - for (i = itemCount; i > 0; i /= 10) l++; // var setting path - l += 30; // const setting part - - LPSTR setting = (LPSTR)_alloca(l * sizeof(wchar_t)); - - for (i = 0; i < itemCount; i++) { - mir_snprintf(setting, l, VALUE_SETTING_PROP, i); - ptrW tszSetting(db_get_wsa(0, TIPPER_ITEMS_MOD_NAME, setting)); - if (tszSetting) { - if (!mir_wstrcmp(UNREAD_THREADS_RAW, tszSetting)) { - SetLabelProp(i, setting); - return; - } - } - } - - for (i = 0; i < _countof(TipperItemProps); i++) - ShiftTipperSettings(setting, itemCount, TipperItemProps[i]); - -#define WRITE_TIPPER_PROPS(index, value)\ - mir_snprintf(setting, l, TipperItemProps[##index##], 0);\ - db_set_ws(0, TIPPER_ITEMS_MOD_NAME, setting, ##value##) -#define WRITE_TIPPER_PROPB(index, value)\ - mir_snprintf(setting, l, TipperItemProps[##index##], 0);\ - db_set_b(0, TIPPER_ITEMS_MOD_NAME, setting, ##value##) - - LPTSTR label = TranslateW(UNREAD_THREADS_LABEL); - - db_set_ws(0, SHORT_PLUGIN_NAME, LAST_WRITTEN_LABEL_SETTING, label); - - WRITE_TIPPER_PROPS(0, label); - WRITE_TIPPER_PROPB(1, 0); - WRITE_TIPPER_PROPB(2, 0); - WRITE_TIPPER_PROPB(3, 0); - WRITE_TIPPER_PROPS(4, UNREAD_THREADS_RAW); - WRITE_TIPPER_PROPB(5, 1); - - db_set_w(0, TIPPER_ITEMS_MOD_NAME, TIPPER_ITEM_COUNT_SETTING, itemCount + 1); -} \ No newline at end of file diff --git a/protocols/GTalkExt/src/version.h b/protocols/GTalkExt/src/version.h deleted file mode 100644 index 5aed9a22b8..0000000000 --- a/protocols/GTalkExt/src/version.h +++ /dev/null @@ -1,14 +0,0 @@ -#define __MAJOR_VERSION 0 -#define __MINOR_VERSION 1 -#define __RELEASE_NUM 1 -#define __BUILD_NUM 0 - -#include - -#define __PLUGIN_NAME "GTalk Extension" -#define __FILENAME "GTalkExt.dll" -#define __DESCRIPTION "GTalk extensions for Jabber protocol" -#define __AUTHOR "bems" -#define __AUTHOREMAIL "" -#define __AUTHORWEB "https://miranda-ng.org/p/GTalkExt/" -#define __COPYRIGHT "© 2010-11 bems" diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 22bbfb6cb4..12786e4692 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -116,7 +116,8 @@ static const MUUID pluginBannedList[] = { 0xa5bb1b7a, 0xb7cd, 0x4cbb, { 0xa7, 0xdb, 0xce, 0xb4, 0xeb, 0x71, 0xda, 0x49 } }, // keepstatus { 0x4b733944, 0x5a70, 0x4b52, { 0xab, 0x2d, 0x68, 0xb1, 0xef, 0x38, 0xff, 0xe8 } }, // startupstatus { 0x9d6c3213, 0x02b4, 0x4fe1, { 0x92, 0xe6, 0x52, 0x6d, 0xe1, 0x4f, 0x8d, 0x65 } }, // stdchat - { 0x621f886b, 0xa7f6, 0x457f, { 0x9d, 0x62, 0x8e, 0xe8, 0x4c, 0x27, 0x59, 0x93 } } // modernopt + { 0x621f886b, 0xa7f6, 0x457f, { 0x9d, 0x62, 0x8e, 0xe8, 0x4c, 0x27, 0x59, 0x93 } }, // modernopt + { 0x08B86253, 0xEC6E, 0x4d09, { 0xB7, 0xA9, 0x64, 0xAC, 0xDF, 0x06, 0x27, 0xB8 } }, // gtalkext }; static bool isPluginBanned(const MUUID& u1) diff --git a/tools/build_scripts/bin10/full.sln b/tools/build_scripts/bin10/full.sln index ae49e4ffa7..8596658c79 100644 --- a/tools/build_scripts/bin10/full.sln +++ b/tools/build_scripts/bin10/full.sln @@ -124,8 +124,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WhenWasIt", "..\plugins\Whe EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MRA", "..\protocols\MRA\Mra.vcxproj", "{EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GTalkExt", "..\protocols\GTalkExt\GTalkExt.vcxproj", "{2A737817-2443-48FF-A2E8-CA8D69E450F3}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Facebook", "..\protocols\FacebookRM\facebook.vcxproj", "{DADE9455-DC28-465A-9604-2CA28052B9FB}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SpellChecker", "..\plugins\SpellChecker\spellchecker.vcxproj", "{5DB86086-10E9-42E7-AC90-503D2678C2A2}" @@ -998,14 +996,6 @@ Global {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|Win32.Build.0 = Release|Win32 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.ActiveCfg = Release|x64 {EE182018-5D3D-43F3-955F-7B5AB0BE2FCA}.Release|x64.Build.0 = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.ActiveCfg = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|Win32.Build.0 = Debug|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.ActiveCfg = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Debug|x64.Build.0 = Debug|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.ActiveCfg = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|Win32.Build.0 = Release|Win32 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.ActiveCfg = Release|x64 - {2A737817-2443-48FF-A2E8-CA8D69E450F3}.Release|x64.Build.0 = Release|x64 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.ActiveCfg = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|Win32.Build.0 = Debug|Win32 {DADE9455-DC28-465A-9604-2CA28052B9FB}.Debug|x64.ActiveCfg = Debug|x64 diff --git a/tools/build_scripts/z2_PackPluginUpater_x32.txt b/tools/build_scripts/z2_PackPluginUpater_x32.txt index 4b26911f2c..fa7b4789af 100644 --- a/tools/build_scripts/z2_PackPluginUpater_x32.txt +++ b/tools/build_scripts/z2_PackPluginUpater_x32.txt @@ -56,7 +56,6 @@ Plugins\folders.dll Plugins\ftpfile.dll Plugins\gg.dll Plugins\gmailnotifier.dll -Plugins\gtalkext.dll Plugins\historypp.dll Plugins\historystats.dll Plugins\historysweeperlight.dll diff --git a/tools/build_scripts/z2_PackPluginUpater_x64.txt b/tools/build_scripts/z2_PackPluginUpater_x64.txt index a557d404a2..d1e808e521 100644 --- a/tools/build_scripts/z2_PackPluginUpater_x64.txt +++ b/tools/build_scripts/z2_PackPluginUpater_x64.txt @@ -56,7 +56,6 @@ Plugins\folders.dll Plugins\ftpfile.dll Plugins\gg.dll Plugins\gmailnotifier.dll -Plugins\gtalkext.dll Plugins\historypp.dll Plugins\historystats.dll Plugins\historysweeperlight.dll -- cgit v1.2.3