diff options
Diffstat (limited to 'plugins')
145 files changed, 0 insertions, 29362 deletions
diff --git a/plugins/!NotAdopted/IMO2sProxy/Makefile b/plugins/!NotAdopted/IMO2sProxy/Makefile deleted file mode 100644 index e83db3ec76..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -.PHONY: all imo2sproxy clean - -all : imo2sproxy - -imo2sproxy: - cd src/imo2skype && make imo2sproxy - cd ../.. - mv src/imo2skype/imo2sproxy bin/ - -clean : - rm imo2sproxy diff --git a/plugins/!NotAdopted/IMO2sProxy/README.txt b/plugins/!NotAdopted/IMO2sProxy/README.txt deleted file mode 100644 index 0bd77dc7c2..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/README.txt +++ /dev/null @@ -1,240 +0,0 @@ -What is the SkypeProxy for imo.im ----------------------------------- -Back in 2005 when I developed the Skype plugin for Miranda IM, I also developed -a very simple protocol to tunnel the Skype API protocol via a socket. -The reason was, that some users wanted the possibility to run Skype on a -machine different to the machine they are using Miranda IM on. -So to tunnel the Skype API remotely over the network SkypeProxy was built and -was shipped with every Skype plugin build. - -The Skype API plugin for Miranda got more and more functions as the API evolved -and finally as I didn't have enough time to continue development, I handed over -development to user "tweety" who did the later versions. -The SkypeProxy-feature is still present in the current versions, as it is very -simple. It just wraps the communiction layer with the Skype API, therefore -this concept can also be adopted by other Skype-Plugins of other IMs. - -Ever since the first version of Skype plugin, people complained that they had to -install the Skype client on their machine in order to get it to work. -The Skype client was always bloated but it got even worse throughout the years. -I abandoned Skype some time ago, as this application is just consuming far too -many system ressources. However, there are some people that are only using Skype -and I need a way to communicate with them. I'm just interested in the chat -feature, so I only need to send and receive messages from other chat users. -So what can we do about it? - -There were some attempts to reverse-engineer the Skype protocol, but nobody -succeeded so far as the protocol relies heavily on cryptography, is proprietary -closed source and the Skype client itself is heaviely protected agains all -kinds of reverse-engineering (decrypts code on the fly, uses anti-debugging -tricks, etc.). - -However some users recently discovered, that there is a new Web 2.0 service that -makes it possible to do Instant messaging via the web browser using the Ajax -framework. The name of the service is imo.im -imo.im managed to provide basic connectivity to the Skype network via SkypeKit -and the nice thing about their service is, that you don't need to register, you -can just use it out of the box. -However most people are not so excited about IM in a web interface, there are -many features that an IM application provides and that are not so convenient in -a webinterface. But as their service is a webservice using jSON calls, -it is relatively easy to talk to their application server and so users of -Instant messengers that provide Skype protocol support can take advantage of -this for providing basic connectivity to the Skype network for instant messaging -without having to install the bloated Skype client application. -Only instant messaging is possible. In fact there is also alpha-Support for -Voicechat via the imo.im flash application, but this currently doesn't work -reliable due to some Macromedia Flash sandboxing issues. -But I think for most users like me that just want to stay in contact with -other Skype users via chat these functions will be enough. - -So as mentioned above the most generic approach to link imo.im services with an -Instant messanger would be to implement this as a wrapper between imo.im and -the Skype API. This way, we don't need to implement an extra plugin and it is -easily adaptable to Skype plugins of IMs, as you only need to use the -application in Skype API emulator mode. The Skype Plugin of the IM would need to do -proper error handling, but if the plugin is coded well (must be compatible with -Skype Protocol V3), this may even work out of the box. -The plugins mustn't assume that an API call always returns something useful on -every call. -The Skype API Emulation currently only works on Windows, other clients would -need to implement the very simple socket protocol for message exchange. -This application was originally developed to work with Miranda IM, so this IM -is officially supported. - -The application runs on Win32 as well as on Unix, so it's a cross-platform layer -that you can also install on your personal Server. By design, it would be even -able to manage multiple users at once, however this feature is currently not -implemented in the SkypeProxy protocol. Depeding on the user's needs, this -can be implemented, most of the code for this is already there. - -For usage with Miranda IM, a special plugin version was written, which -implementes the layer as a plugin so that it can be loaded into Miranda -and the user doesn't have to run the proxy application seperately. -The plugin version also has the advantage that it is able to communicate -with the Skype plugin directly. - -How does it work ----------------- - -Is described in the preamble, this is just a drop-in replacement for the -communication end point of the Skype API. -The classical communication model for Skype API is: - -[ Skype servers ] <--> [ Skype App ] <--> [ Plugin ] - -The SkypeProxy communication model is: - -[ Skype servers ] <--> [ Skype App ] <--> [ SkypeProxy ] <--> [ Plugin ] - -Now with this Drop-in replacement the communication model is: - -[ Skype servers ] <--> [ imo.im ] <--> [ SkypeProxy ] <--> [ Plugin ] - -The application communicates via a socket connection on Port 1402, like -SkypeProxy does. It uses the imo.im services to connect to the Skype network. - -You also have the possibility to emulate the Skype WIN32-API so that -any plugin can communicate with this application instead of Skype. - -As said, there are 3 connection points to communicate with the plugin: - - WIN32 Skype API via Windowmessages, emulates the real Skype API for - compatibility with any Skype plugin. (Windows) - - Socket communication layer via TCP/IP. (Windows/Unix) - - Internal plugin communcation layer used by the Miranda IM plugin to - communicate with Skype plugin versions starting with 0.0.0.46 - (Windows, Miranda IM plugin only) - -How to compile --------------- -On Unix type systems, just extract this package and type "make". -After compiling, you will find imo2sproxy in the bin/ directory - -On Windows systems, you will find Visual C 6 project files in the -msvc/ subdirectory. -You have Makefiles available for the appropriate modules: -imoskype.mak - Compiles the imo2sproxy standalone executable -imoproxy.mak - Compiles the Miranda IM Plugin - -There are 4 available Targets: -Win32 Release - 32bit Windows Release version -Win64 Release - 64bit Windows Release version -Win32 Debug - 32bit Windows Debug version -Win64 Debug - 64bit Windows Debug version - -i.e.: -nmake -f imoskype.mak CFG="Win32 Release" - -Requirements ------------- -On Linux, libcurl Libraries and the pthread library for threading -are needed in order to get this to work. -You can download CURL on http://curl.haxx.se/download.html -To install, just use libtool as usual. - -On Windows, WININET is required which should be shipped with -Internet Explorer. So on an average Windows System, you shouldn't -need to install any additional libraries. -Please note, that libcurl IS NO LONGER NEEDED on Windows. - -How to use the commandline version ----------------------------------- -Find the precompiled binaries in the bin/ subdirectory. - -imo2sproxy [-d] [-v [-l <Logfile>]] [-t] [-i] - [-m<s|a>] [-h <Bind to IP>] [-p <Port>] <Username> <Password> - --v - Verbose mode, log commands to console --l - Set logfile to redirect verbose log to. --d - Daemonize (detach from console) --i - Use interactive mode (starts imo.im flash app upon call) --t - Ignore server timestamp and use current time for messages --h - Bind to a specific IP, not to all interfaces (default) --p - Bind to another port (default: 1401) --m - Specify connection mode to use: - s Socket mode (SkypeProxy protocol) [default] - a Skype API Emulation via Window messages (real Skype API) - --ma is only available on Windows systems. - -As there is currently only a single-user implementation of this application, you - need to start imo2sproxy with your Skype username and password as parameters. - -Example for using the socket protocol: -imo2sproxy -d -h 127.0.0.1 myuser mypass - -As soon as the imo2sproxy is running, setup your Skype Plugin to use the -SkypeProxy at the machine you are running imo2sproxy on. -If you are running imo2sproxy locally, enter 127.0.0.1 as IP address. -After setting the SkypeProxy, you have to restart Miranda IM. - -If all works well, you should now be able to use Skype via imo.im. -If it doesn't work, you can use the -v parameter to see what's going on and -if the connection works. - -If it all works well, you can also install imo2sproxy on your machine -as a service using srvany. - -Example for using the Skype API Emulation (win32 only): -imo2sproxy.exe -d -ma myuser mypass - -As soon as the imo2sproxy is running, just try to use your Skype plugin and -see if it connects to the imo2sproxy locally. -Of course, if you have the Skype application installed, you mustn't run -it concurrently with the plugin with this configuration. - -How to use the Miranda plugin ------------------------------ -Copy the imoproxy.dll file to your Miranda Plugins-directory. -As the name starts with i and the the Skype plugin name starts with s, -the imoproxy.dll module is loaded prior to the Skype-Plugin DLL which -is important to work properly if you are using the socket method. - -For older versions of the Skype plugin (prior to 0.0.0.46, which is -currently still beta), you should use the socket communication method: -Configure the plugin DLL in the Options dialog Network/Skype Imoproxy. -Bind to address 127.0.0.1, Port 1401 -Make sure that the Skype Proxy settings in your Skype plugin are the -same. The Skypeproxy-Plugin tries to take care of that. -Enter your Username and Password, set the appropriate options and press -OK. The Skypeproxy-plugin restarts itself. Try to reconnect Skype plugin -and see if it works. -The plugin is still experimental and may contain some bugs or stability -problems, so use with care. It may be harder to hunt down bugs with this -Plugin as its running as Miranda plugin and the only logging facility is -a logfile. So if you want to hunt down bugs, you may be better off with -using the standalone version, however the plugin is a start to make the -use of imo2sproxy easier. Feel free to improve the plugin. - -For Skype plugin versions starting with 0.0.0.46, there is an internal -plugin link facility which makes it easier for the user to setup. -Bascially this should work out of the box, just enter your username and -password in the options dialog and ensute that the internal plugin -link service is active. -It will then automatically register to the Skype plugin. - -Module structure ----------------- - -For the structure of the code-modules, please refer to the -structure.txt document. - -SkypeProxy protocol -------------------- - -Plase download the sourcecode of skypeproxy.c of Miranda IM Skype plugin, it's -all well documented in the .c file. Basically the protocol just consists of: - -[UCHAR: number of bytes to send/receive][<char> Data] - -for every line sent or received. - -Contact -------- -Feel free to contact me regarding this project or if you wish to implement -SkypeProxy protocol in your own Skype-plugin implementation. - -leecher@dose.0wnz.at - - -Vienna, 10/07/2009 diff --git a/plugins/!NotAdopted/IMO2sProxy/bin/setupimo.bat b/plugins/!NotAdopted/IMO2sProxy/bin/setupimo.bat deleted file mode 100644 index 9c765c6479..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/bin/setupimo.bat +++ /dev/null @@ -1,24 +0,0 @@ -@echo off
-SET /P USER=Skype username:
-IF "%USER%"=="" (
- echo Username is mandatory, aborting.
- GOTO fini
-)
-SET /P PASS=Skype password:
-IF "%PASS%"=="" (
- echo Password is mandatory, aborting.
- GOTO fini
-)
-SET /P IP=Bind to IP [0.0.0.0]:
-SET /P PORT=Bind to Port [1401]:
-SET /P DAEM=Do you want to daemonize [N]:
-IF /I "%DAEM%" NEQ "Y" SET /P VERB=Do you want verbose command output [N]:
-IF /I "%DAEM%"=="Y" SET CMDLINE=%CMDLINE% -d
-IF /I "%VERB%"=="Y" SET CMDLINE=%CMDLINE% -v
-IF NOT "%IP%"=="" SET CMDLINE=%CMDLINE% -h %IP%
-IF NOT "%PORT%"=="" SET CMDLINE=%CMDLINE% -p %PORT%
-SET CMDLINE=%CMDLINE% %USER% %PASS%
-echo imo2sproxy %CMDLINE% >startimo.bat
-echo startimo.bat created.
-:fini
-pause
diff --git a/plugins/!NotAdopted/IMO2sProxy/msvc/imoproxy.dsp b/plugins/!NotAdopted/IMO2sProxy/msvc/imoproxy.dsp deleted file mode 100644 index d607233428..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/msvc/imoproxy.dsp +++ /dev/null @@ -1,248 +0,0 @@ -# Microsoft Developer Studio Project File - Name="imoproxy" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** NICHT BEARBEITEN **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=imoproxy - Win32 Debug
-!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
-!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
-!MESSAGE
-!MESSAGE NMAKE /f "imoproxy.mak".
-!MESSAGE
-!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
-!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
-!MESSAGE
-!MESSAGE NMAKE /f "imoproxy.mak" CFG="imoproxy - Win32 Debug"
-!MESSAGE
-!MESSAGE Für die Konfiguration stehen zur Auswahl:
-!MESSAGE
-!MESSAGE "imoproxy - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "imoproxy - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=xicl6.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "imoproxy - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "imoproxy_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\src\common" /I "..\src\imolib" /I "..\src\imo2skype" /I "F:\miranda09_src\miranda" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "imoproxy_EXPORTS" /FR /YX /FD /c
-# SUBTRACT CPP /X
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0xc07 /d "NDEBUG"
-# ADD RSC /l 0xc07 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-
-!ELSEIF "$(CFG)" == "imoproxy - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "imoproxy_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\src\common" /I "..\src\imolib" /I "..\src\imo2skype" /I "F:\miranda09_src\miranda" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "imoproxy_EXPORTS" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0xc07 /d "_DEBUG"
-# ADD RSC /l 0xc07 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"F:\miranda09_src\miranda\bin\debug\Plugins\imoproxy.dll" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "imoproxy - Win32 Release"
-# Name "imoproxy - Win32 Debug"
-# Begin Group "Quellcodedateien"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=..\src\imo2skype\avatarlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\buddylist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\callqueue.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\cJSON.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\fifo.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\imo2skypeapi.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\imo2sproxy.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\imo_request.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\imo_skype.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\miranda\imoproxy.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\miranda\io_layer_netlib.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\io_layer_win32.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\memlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\msgqueue.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\queue.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\miranda\skypepluginlink.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\socksproxy.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\w32browser.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\w32skypeemu.c
-# End Source File
-# End Group
-# Begin Group "Header-Dateien"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=..\src\imo2skype\buddylist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\callqueue.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\cJSON.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\fifo.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\imo2skypeapi.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\imo2sproxy.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\imo_request.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\imo_skype.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\io_layer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\memlist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\msgqueue.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\queue.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\miranda\skypepluginlink.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\socksproxy.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\w32browser.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\w32skypeemu.h
-# End Source File
-# End Group
-# Begin Group "Ressourcendateien"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=..\src\imo2skype\miranda\res.rc
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/plugins/!NotAdopted/IMO2sProxy/msvc/imoproxy.dsw b/plugins/!NotAdopted/IMO2sProxy/msvc/imoproxy.dsw deleted file mode 100644 index 2d4fb49ab6..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/msvc/imoproxy.dsw +++ /dev/null @@ -1,41 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN!
-
-###############################################################################
-
-Project: "imoproxy"=.\imoproxy.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "imoskype"=.\imoskype.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/msvc/imoproxy.mak b/plugins/!NotAdopted/IMO2sProxy/msvc/imoproxy.mak deleted file mode 100644 index 04b4371268..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/msvc/imoproxy.mak +++ /dev/null @@ -1,221 +0,0 @@ -!IF "$(CFG)" == ""
-CFG=Win32 Debug
-!MESSAGE Keine Konfiguration angegeben. Win32 Debug wird als Standard verwendet.
-!ENDIF
-
-!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug" && "$(CFG)" != "Win64 Release" && "$(CFG)" != "Win64 Debug"
-!MESSAGE Ungültige Konfiguration "$(CFG)" angegeben.
-!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
-!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
-!MESSAGE
-!MESSAGE NMAKE /f "imoproxy.mak" CFG="Win32 Debug"
-!MESSAGE
-!MESSAGE Für die Konfiguration stehen zur Auswahl:
-!MESSAGE
-!MESSAGE "Win32 Release"
-!MESSAGE "Win32 Debug"
-!MESSAGE "Win64 Release"
-!MESSAGE "Win64 Debug"
-!MESSAGE
-!ERROR Eine ungültige Konfiguration wurde angegeben.
-!ENDIF
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-LINK32=link.exe
-
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /dll /pdb:"$(INTDIR)\imoproxy.pdb" /out:"$(OUTDIR)\imoproxy.dll" /implib:"$(INTDIR)\imoproxy.lib"
-INCLUDES=/I "../src/common" /I "../src/imo2skype" /I "../src/imolib" /I "F:\miranda09_src\miranda"
-
-!IF "$(CFG)" == "Win64 Release"
-OUTDIR=..\bin64
-INTDIR=.\Release64
-CPP_PROJ=/nologo /MT /W3 /O2 $(INCLUDES) /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "imoproxy_EXPORTS" /Fp"$(INTDIR)\imoproxy.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:no
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\res.res" /d "NDEBUG"
-!ELSEIF "$(CFG)" == "Win32 Release"
-OUTDIR=..\bin
-INTDIR=.\Release
-CPP_PROJ=/nologo /MT /W3 /O2 $(INCLUDES) /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "imoproxy_EXPORTS" /Fp"$(INTDIR)\imoproxy.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:no
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\res.res" /d "NDEBUG"
-!ELSEIF "$(CFG)" == "Win64 Debug"
-OUTDIR=.\Debug64
-INTDIR=$(OUTDIR)
-CPP_PROJ=/nologo /MTd /W3 /Gm /ZI /Od $(INCLUDES) /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "imoproxy_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\imoproxy.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:yes /debug /pdbtype:sept
-MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\res.res" /d "_DEBUG"
-!ELSEIF "$(CFG)" == "Win32 Debug"
-OUTDIR=.\Debug
-INTDIR=$(OUTDIR)
-CPP_PROJ=/nologo /MTd /W3 /Gm /ZI /Od $(INCLUDES) /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "imoproxy_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\imoproxy.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:yes /debug /pdbtype:sept
-MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\res.res" /d "_DEBUG"
-!ENDIF
-
-LINK32_OBJS= \
- "$(INTDIR)\avatarlist.obj" \
- "$(INTDIR)\buddylist.obj" \
- "$(INTDIR)\callqueue.obj" \
- "$(INTDIR)\cJSON.obj" \
- "$(INTDIR)\fifo.obj" \
- "$(INTDIR)\imo2skypeapi.obj" \
- "$(INTDIR)\imo2sproxy.obj" \
- "$(INTDIR)\imo_request.obj" \
- "$(INTDIR)\imo_skype.obj" \
- "$(INTDIR)\imoproxy.obj" \
- "$(INTDIR)\io_layer_win32.obj" \
- "$(INTDIR)\io_layer_netlib.obj" \
- "$(INTDIR)\memlist.obj" \
- "$(INTDIR)\msgqueue.obj" \
- "$(INTDIR)\queue.obj" \
- "$(INTDIR)\socksproxy.obj" \
- "$(INTDIR)\w32browser.obj" \
- "$(INTDIR)\w32skypeemu.obj" \
- "$(INTDIR)\res.res" \
- "$(INTDIR)\skypepluginlink.obj"
-
-
-ALL : "$(OUTDIR)\imoproxy.dll"
-
-
-CLEAN :
- -@erase "$(INTDIR)\avatarlist.obj"
- -@erase "$(INTDIR)\buddylist.obj"
- -@erase "$(INTDIR)\callqueue.obj"
- -@erase "$(INTDIR)\cJSON.obj"
- -@erase "$(INTDIR)\fifo.obj"
- -@erase "$(INTDIR)\imo2skypeapi.obj"
- -@erase "$(INTDIR)\imo2sproxy.obj"
- -@erase "$(INTDIR)\imo_request.obj"
- -@erase "$(INTDIR)\imo_skype.obj"
- -@erase "$(INTDIR)\imoproxy.obj"
- -@erase "$(INTDIR)\io_layer_win32.obj"
- -@erase "$(INTDIR)\io_layer_netlib.obj"
- -@erase "$(INTDIR)\memlist.obj"
- -@erase "$(INTDIR)\msgqueue.obj"
- -@erase "$(INTDIR)\queue.obj"
- -@erase "$(INTDIR)\res.res"
- -@erase "$(INTDIR)\skypepluginlink.obj"
- -@erase "$(INTDIR)\socksproxy.obj"
- -@erase "$(INTDIR)\vc60.idb"
- -@erase "$(INTDIR)\w32browser.obj"
- -@erase "$(INTDIR)\w32skypeemu.obj"
- -@erase "$(OUTDIR)\imoproxy.dll"
- -@erase "$(OUTDIR)\imoproxy.exp"
- -@erase "$(OUTDIR)\imoproxy.lib"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-"$(OUTDIR)\imoproxy.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-.c{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-!IF "$(NO_EXTERNAL_DEPS)" != "1"
-!IF EXISTS("imoproxy.dep")
-!INCLUDE "imoproxy.dep"
-!ELSE
-!MESSAGE Warning: cannot find "imoproxy.dep"
-!ENDIF
-!ENDIF
-
-
-SOURCE=..\src\imo2skype\avatarlist.c
-"$(INTDIR)\avatarlist.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\buddylist.c
-"$(INTDIR)\buddylist.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\callqueue.c
-"$(INTDIR)\callqueue.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\common\cJSON.c
-"$(INTDIR)\cJSON.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\common\fifo.c
-"$(INTDIR)\fifo.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\imo2skypeapi.c
-"$(INTDIR)\imo2skypeapi.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\imo2sproxy.c
-"$(INTDIR)\imo2sproxy.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imolib\imo_request.c
-"$(INTDIR)\imo_request.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imolib\imo_skype.c
-"$(INTDIR)\imo_skype.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\miranda\imoproxy.c
-"$(INTDIR)\imoproxy.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imolib\io_layer_win32.c
-"$(INTDIR)\io_layer_win32.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\common\memlist.c
-"$(INTDIR)\memlist.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\msgqueue.c
-"$(INTDIR)\msgqueue.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\queue.c
-"$(INTDIR)\queue.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\miranda\skypepluginlink.c
-"$(INTDIR)\skypepluginlink.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\miranda\io_layer_netlib.c
-"$(INTDIR)\io_layer_netlib.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\socksproxy.c
-"$(INTDIR)\socksproxy.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\w32browser.c
-"$(INTDIR)\w32browser.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\w32skypeemu.c
-"$(INTDIR)\w32skypeemu.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
-SOURCE=..\src\imo2skype\miranda\res.rc
-"$(INTDIR)\res.res" : $(SOURCE) "$(INTDIR)"
- $(RSC) /l 0xc07 /fo"$(INTDIR)\res.res" /i "..\src\imo2skype\miranda" /d "NDEBUG" $(SOURCE)
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/msvc/imoskype.dsp b/plugins/!NotAdopted/IMO2sProxy/msvc/imoskype.dsp deleted file mode 100644 index 00d324b5b8..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/msvc/imoskype.dsp +++ /dev/null @@ -1,230 +0,0 @@ -# Microsoft Developer Studio Project File - Name="imoskype" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** NICHT BEARBEITEN **
-
-# TARGTYPE "Win32 (x86) Console Application" 0x0103
-
-CFG=imoskype - Win32 Debug
-!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
-!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
-!MESSAGE
-!MESSAGE NMAKE /f "imoskype.mak".
-!MESSAGE
-!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
-!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
-!MESSAGE
-!MESSAGE NMAKE /f "imoskype.mak" CFG="imoskype - Win32 Debug"
-!MESSAGE
-!MESSAGE Für die Konfiguration stehen zur Auswahl:
-!MESSAGE
-!MESSAGE "imoskype - Win32 Release" (basierend auf "Win32 (x86) Console Application")
-!MESSAGE "imoskype - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=xicl6.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "imoskype - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "../src/common" /I "../src/imo2skype" /I "../src/imolib" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
-# ADD BASE RSC /l 0xc07 /d "NDEBUG"
-# ADD RSC /l 0xc07 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"../bin/imo2sproxy.exe"
-
-!ELSEIF "$(CFG)" == "imoskype - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../src/common" /I "../src/imo2skype" /I "../src/imolib" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD BASE RSC /l 0xc07 /d "_DEBUG"
-# ADD RSC /l 0xc07 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/imo2sproxy.exe" /pdbtype:sept
-
-!ENDIF
-
-# Begin Target
-
-# Name "imoskype - Win32 Release"
-# Name "imoskype - Win32 Debug"
-# Begin Group "Quellcodedateien"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=\temp\debug\imo.im\src\imo2skype\avatarlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\buddylist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\callqueue.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\cJSON.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\fifo.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\imo2skypeapi.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\imo2sproxy.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\imo_request.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\imo_skype.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\io_layer_win32.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\main.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\memlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\msgqueue.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\queue.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\socksproxy.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\w32browser.c
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\w32skypeemu.c
-# End Source File
-# End Group
-# Begin Group "Header-Dateien"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=\temp\debug\imo.im\src\imo2skype\avatarlist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\buddylist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\callqueue.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\cJSON.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\fifo.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\imo2skypeapi.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\imo2sproxy.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\imo_request.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\imo_skype.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imolib\io_layer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\common\memlist.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\msgqueue.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\queue.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\socksproxy.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\w32browser.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\src\imo2skype\w32skypeemu.h
-# End Source File
-# End Group
-# Begin Group "Ressourcendateien"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/plugins/!NotAdopted/IMO2sProxy/msvc/imoskype.dsw b/plugins/!NotAdopted/IMO2sProxy/msvc/imoskype.dsw deleted file mode 100644 index a4c512f5e0..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/msvc/imoskype.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN!
-
-###############################################################################
-
-Project: "imoskype"=.\imoskype.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/msvc/imoskype.mak b/plugins/!NotAdopted/IMO2sProxy/msvc/imoskype.mak deleted file mode 100644 index be7b29f013..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/msvc/imoskype.mak +++ /dev/null @@ -1,193 +0,0 @@ -!IF "$(CFG)" == ""
-CFG=Win32 Debug
-!MESSAGE Keine Konfiguration angegeben. Win32 Debug wird als Standard verwendet.
-!ENDIF
-
-!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug" && "$(CFG)" != "Win64 Release" && "$(CFG)" != "Win64 Debug"
-!MESSAGE Ungltige Konfiguration "$(CFG)" angegeben.
-!MESSAGE Sie k”nnen beim Ausfhren von NMAKE eine Konfiguration angeben
-!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
-!MESSAGE
-!MESSAGE NMAKE /f "imoskype.mak" CFG="Win32 Debug"
-!MESSAGE
-!MESSAGE Fr die Konfiguration stehen zur Auswahl:
-!MESSAGE
-!MESSAGE "Win32 Release"
-!MESSAGE "Win32 Debug"
-!MESSAGE "Win64 Release"
-!MESSAGE "Win64 Debug"
-!MESSAGE
-!ERROR Eine ungltige Konfiguration wurde angegeben.
-!ENDIF
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-
-CPP=cl.exe
-RSC=rc.exe
-LINK32=link.exe
-
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib ws2_32.lib /nologo /subsystem:console /pdb:"$(INTDIR)\imo2sproxy.pdb" /out:"$(OUTDIR)/imo2sproxy.exe"
-INCLUDES=/I "../src/common" /I "../src/imo2skype" /I "../src/imolib"
-
-!IF "$(CFG)" == "Win64 Release"
-OUTDIR=..\bin64
-INTDIR=.\Release64
-CPP_PROJ=/nologo /MT /W3 /O2 $(INCLUDES) /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\imoskype.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:no
-!ELSEIF "$(CFG)" == "Win32 Release"
-OUTDIR=..\bin
-INTDIR=.\Release
-CPP_PROJ=/nologo /MT /W3 /O2 $(INCLUDES) /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\imoskype.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:no
-!ELSEIF "$(CFG)" == "Win64 Debug"
-OUTDIR=.\Debug64
-INTDIR=$(OUTDIR)
-CPP_PROJ=/nologo /MTd /W3 /Gm /ZI /Od $(INCLUDES) /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\imoskype.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:yes /debug /pdbtype:sept
-!ELSEIF "$(CFG)" == "Win32 Debug"
-OUTDIR=.\Debug
-INTDIR=$(OUTDIR)
-CPP_PROJ=/nologo /MTd /W3 /Gm /ZI /Od $(INCLUDES) /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\imoskype.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:yes /debug /pdbtype:sept
-!ENDIF
-
-LINK32_OBJS= \
- "$(INTDIR)\avatarlist.obj" \
- "$(INTDIR)\buddylist.obj" \
- "$(INTDIR)\callqueue.obj" \
- "$(INTDIR)\cJSON.obj" \
- "$(INTDIR)\fifo.obj" \
- "$(INTDIR)\imo2skypeapi.obj" \
- "$(INTDIR)\imo2sproxy.obj" \
- "$(INTDIR)\imo_request.obj" \
- "$(INTDIR)\imo_skype.obj" \
- "$(INTDIR)\io_layer_win32.obj" \
- "$(INTDIR)\main.obj" \
- "$(INTDIR)\memlist.obj" \
- "$(INTDIR)\msgqueue.obj" \
- "$(INTDIR)\queue.obj" \
- "$(INTDIR)\socksproxy.obj" \
- "$(INTDIR)\w32browser.obj" \
- "$(INTDIR)\w32skypeemu.obj"
-
-ALL : "$(OUTDIR)\imo2sproxy.exe"
-
-CLEAN :
- -@erase "$(INTDIR)\avatarlist.obj"
- -@erase "$(INTDIR)\buddylist.obj"
- -@erase "$(INTDIR)\callqueue.obj"
- -@erase "$(INTDIR)\cJSON.obj"
- -@erase "$(INTDIR)\fifo.obj"
- -@erase "$(INTDIR)\imo2skypeapi.obj"
- -@erase "$(INTDIR)\imo2sproxy.obj"
- -@erase "$(INTDIR)\imo_request.obj"
- -@erase "$(INTDIR)\imo_skype.obj"
- -@erase "$(INTDIR)\io_layer_win32.obj"
- -@erase "$(INTDIR)\main.obj"
- -@erase "$(INTDIR)\memlist.obj"
- -@erase "$(INTDIR)\msgqueue.obj"
- -@erase "$(INTDIR)\queue.obj"
- -@erase "$(INTDIR)\socksproxy.obj"
- -@erase "$(INTDIR)\vc60.idb"
- -@erase "$(INTDIR)\w32browser.obj"
- -@erase "$(INTDIR)\w32skypeemu.obj"
- -@erase "$(INTDIR)\imo2sproxy.ilk"
- -@erase "$(INTDIR)\imo2sproxy.pdb"
- -@erase "$(OUTDIR)\imo2sproxy.exe"
-
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-"$(OUTDIR)\imo2sproxy.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-.c{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-!IF "$(NO_EXTERNAL_DEPS)" != "1"
-!IF EXISTS("imoskype.dep")
-!INCLUDE "imoskype.dep"
-!ELSE
-!MESSAGE Warning: cannot find "imoskype.dep"
-!ENDIF
-!ENDIF
-
-
-SOURCE=..\src\imo2skype\avatarlist.c
-"$(INTDIR)\avatarlist.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\buddylist.c
-"$(INTDIR)\buddylist.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\callqueue.c
-"$(INTDIR)\callqueue.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\common\cJSON.c
-"$(INTDIR)\cJSON.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\common\fifo.c
-"$(INTDIR)\fifo.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\imo2skypeapi.c
-"$(INTDIR)\imo2skypeapi.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\imo2sproxy.c
-"$(INTDIR)\imo2sproxy.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imolib\imo_request.c
-"$(INTDIR)\imo_request.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imolib\imo_skype.c
-"$(INTDIR)\imo_skype.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imolib\io_layer_win32.c
-"$(INTDIR)\io_layer_win32.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\main.c
-"$(INTDIR)\main.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\common\memlist.c
-"$(INTDIR)\memlist.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\msgqueue.c
-"$(INTDIR)\msgqueue.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\queue.c
-"$(INTDIR)\queue.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\socksproxy.c
-"$(INTDIR)\socksproxy.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\w32browser.c
-"$(INTDIR)\w32browser.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-SOURCE=..\src\imo2skype\w32skypeemu.c
-"$(INTDIR)\w32skypeemu.obj" : $(SOURCE) "$(INTDIR)"
- $(CPP) $(CPP_PROJ) $(SOURCE)
-
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/msvc/make.bat b/plugins/!NotAdopted/IMO2sProxy/msvc/make.bat deleted file mode 100644 index a974f238ab..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/msvc/make.bat +++ /dev/null @@ -1,2 +0,0 @@ -cmd /c make_w32
-cmd /c make_w64
diff --git a/plugins/!NotAdopted/IMO2sProxy/msvc/make_w32.bat b/plugins/!NotAdopted/IMO2sProxy/msvc/make_w32.bat deleted file mode 100644 index e5f7eafd2f..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/msvc/make_w32.bat +++ /dev/null @@ -1,7 +0,0 @@ -call "F:\Programme\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
-nmake -f imoproxy.mak CFG="Win32 Release" clean
-nmake -f imoskype.mak CFG="Win32 Release" clean
-nmake -f imoproxy.mak CFG="Win32 Release"
-nmake -f imoskype.mak CFG="Win32 Release"
-nmake -f imoproxy.mak CFG="Win32 Debug"
-nmake -f imoskype.mak CFG="Win32 Debug"
diff --git a/plugins/!NotAdopted/IMO2sProxy/msvc/make_w64.bat b/plugins/!NotAdopted/IMO2sProxy/msvc/make_w64.bat deleted file mode 100644 index a97d4a2d7d..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/msvc/make_w64.bat +++ /dev/null @@ -1,5 +0,0 @@ -call f:\PlatformSDK\SetEnv /X64 /RETAIL
-nmake -f imoproxy.mak CFG="Win64 Release" clean
-nmake -f imoskype.mak CFG="Win64 Release" clean
-nmake -f imoproxy.mak CFG="Win64 Release"
-nmake -f imoskype.mak CFG="Win64 Release"
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/common/cJSON.c b/plugins/!NotAdopted/IMO2sProxy/src/common/cJSON.c deleted file mode 100644 index 72f35f6117..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/common/cJSON.c +++ /dev/null @@ -1,365 +0,0 @@ -/*
- Copyright (c) 2009 Dave Gamble
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-*/
-
-// cJSON
-// JSON parser in C.
-
-#include <string.h>
-#include <stdio.h>
-#include <math.h>
-#include <stdlib.h>
-#include <float.h>
-#include "cJSON.h"
-#ifdef WIN32
-#define strcasecmp stricmp
-#endif
-
-// Internal constructor.
-static cJSON *cJSON_New_Item() { return (cJSON*)calloc(sizeof(cJSON),1); }
-
-// Delete a cJSON structure.
-void cJSON_Delete(cJSON *c)
-{
- cJSON *next;
- while (c)
- {
- next=c->next;
- if (c->child) cJSON_Delete(c->child);
- if (c->valuestring) free(c->valuestring);
- if (c->string) free(c->string);
- free(c);
- c=next;
- }
-}
-
-// Parse the input text to generate a number, and populate the result into item.
-static const char *parse_number(cJSON *item,const char *num)
-{
- double n=0,sign=1,scale=0;int subscale=0,signsubscale=1;
-
- // Could use sscanf for this?
- if (*num=='-') sign=-1,num++; // Has sign?
- if (*num=='0') num++; // is zero
- if (*num>='1' && *num<='9') do n=(n*10.0)+(*num++ -'0'); while (*num>='0' && *num<='9'); // Number?
- if (*num=='.') {num++; do n=(n*10.0)+(*num++ -'0'),scale--; while (*num>='0' && *num<='9');} // Fractional part?
- if (*num=='e' || *num=='E') // Exponent?
- { num++;if (*num=='+') num++; else if (*num=='-') signsubscale=-1,num++; // With sign?
- while (*num>='0' && *num<='9') subscale=(subscale*10)+(*num++ - '0'); // Number?
- }
-
- n=sign*n*pow(10.0,(scale+subscale*signsubscale)); // number = +/- number.fraction * 10^+/- exponent
-
- item->valuedouble=n;
- item->valueint=(int)n;
- item->type=cJSON_Number;
- return num;
-}
-
-// Render the number nicely from the given item into a string.
-static char *print_number(cJSON *item)
-{
- char *str;
- double d=item->valuedouble;
- if (fabs(((double)item->valueint)-d)<=DBL_EPSILON)
- {
- str=malloc(21); // 2^64+1 can be represented in 21 chars.
- sprintf(str,"%d",item->valueint);
- }
- else
- {
- str=malloc(64); // This is a nice tradeoff.
- if (fabs(d)<1.0e-6 || fabs(d)>1.0e9) sprintf(str,"%e",d);
- else sprintf(str,"%f",d);
- }
- return str;
-}
-
-// Parse the input text into an unescaped cstring, and populate item.
-static const unsigned char firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
-static const char *parse_string(cJSON *item,const char *str)
-{
- const unsigned char *ptr=str+1;
- unsigned char *ptr2;
- char *out;int len=0;unsigned uc;
- if (*str!='\"') return 0; // not a string!
-
- while (*ptr!='\"' && *ptr>31 && ++len) if (*ptr++ == '\\') ptr++; // Skip escaped quotes.
-
- out=(char*)malloc(len+1); // This is how long we need for the string, roughly.
-
- ptr=str+1;ptr2=out;
- while (*ptr!='\"' && *ptr>31)
- {
- if (*ptr!='\\') *ptr2++=*ptr++;
- else
- {
- ptr++;
- switch (*ptr)
- {
- case 'b': *ptr2++='\b'; break;
- case 'f': *ptr2++='\f'; break;
- case 'n': *ptr2++='\n'; break;
- case 'r': *ptr2++='\r'; break;
- case 't': *ptr2++='\t'; break;
- case 'u': // transcode utf16 to utf8. DOES NOT SUPPORT SURROGATE PAIRS CORRECTLY.
- sscanf(ptr+1,"%4x",&uc); // get the unicode char.
- len=3;if (uc<0x80) len=1;else if (uc<0x800) len=2;ptr2+=len;
-
- switch (len) {
- case 3: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
- case 2: *--ptr2 =((uc | 0x80) & 0xBF); uc >>= 6;
- case 1: *--ptr2 =(uc | firstByteMark[len]);
- }
- ptr2+=len;ptr+=4;
- break;
- default: *ptr2++=*ptr; break;
- }
- ptr++;
- }
- }
- *ptr2=0;
- if (*ptr=='\"') ptr++;
- item->valuestring=out;
- item->type=cJSON_String;
- return ptr;
-}
-
-// Render the cstring provided to an escaped version that can be printed.
-static char *print_string_ptr(const char *str)
-{
- const unsigned char *ptr; unsigned char *ptr2,*out;int len=0;
-
- ptr=str;while (*ptr && ++len) {if (*ptr<32 || *ptr=='\"' || *ptr=='\\') len++;ptr++;}
-
- out=(char*)malloc(len+3);
- ptr2=out;ptr=str;
- *ptr2++='\"';
- while (*ptr)
- {
- if (*ptr>31 && *ptr!='\"' && *ptr!='\\') *ptr2++=*ptr++;
- else
- {
- *ptr2++='\\';
- switch (*ptr++)
- {
- case '\\': *ptr2++='\\'; break;
- case '\"': *ptr2++='\"'; break;
- case '\b': *ptr2++='b'; break;
- case '\f': *ptr2++='f'; break;
- case '\n': *ptr2++='n'; break;
- case '\r': *ptr2++='r'; break;
- case '\t': *ptr2++='t'; break;
- default: ptr2--; break; // eviscerate with prejudice.
- }
- }
- }
- *ptr2++='\"';*ptr2++=0;
- return out;
-}
-// Invote print_string_ptr (which is useful) on an item.
-static char *print_string(cJSON *item) {return print_string_ptr(item->valuestring);}
-
-// Predeclare these prototypes.
-static const char *parse_value(cJSON *item,const char *value);
-static char *print_value(cJSON *item,int depth);
-static const char *parse_array(cJSON *item,const char *value);
-static char *print_array(cJSON *item,int depth);
-static const char *parse_object(cJSON *item,const char *value);
-static char *print_object(cJSON *item,int depth);
-
-// Parse an object - create a new root, and populate.
-cJSON *cJSON_Parse(const char *value) {cJSON *c=cJSON_New_Item();parse_value(c,value);return c;}
-// Render a cJSON item/entity/structure to text.
-char *cJSON_Print(cJSON *item) {return print_value(item,0);}
-
-// Parser core - when encountering text, process appropriately.
-static const char *parse_value(cJSON *item,const char *value)
-{
- if (!value) return 0; // Fail on null.
- if (!strncmp(value,"null",4)) { item->type=cJSON_NULL; return value+4; }
- if (!strncmp(value,"false",5)) { item->type=cJSON_False; return value+5; }
- if (!strncmp(value,"true",4)) { item->type=cJSON_True; item->valueint=1; return value+4; }
- if (*value=='\"') { return parse_string(item,value); }
- if (*value=='-' || (*value>='0' && *value<='9')) { return parse_number(item,value); }
- if (*value=='[') { return parse_array(item,value); }
- if (*value=='{') { return parse_object(item,value); }
-
- return 0; // failure.
-}
-
-// Render a value to text.
-static char *print_value(cJSON *item,int depth)
-{
- char *out=0;
- switch (item->type)
- {
- case cJSON_NULL: out=strdup("null"); break;
- case cJSON_False: out=strdup("false");break;
- case cJSON_True: out=strdup("true"); break;
- case cJSON_Number: out=print_number(item);break;
- case cJSON_String: out=print_string(item);break;
- case cJSON_Array: out=print_array(item,depth);break;
- case cJSON_Object: out=print_object(item,depth);break;
- }
- return out;
-}
-
-// Utility to jump whitespace and cr/lf
-static const char *skip(const char *in) {while (in && *in<=32) in++; return in;}
-
-// Build an array from input text.
-static const char *parse_array(cJSON *item,const char *value)
-{
- cJSON *child;
- if (*value!='[') return 0; // not an array!
-
- item->type=cJSON_Array;
- value=skip(value+1);
- if (*value==']') return value+1; // empty array.
-
- item->child=child=cJSON_New_Item();
- value=skip(parse_value(child,skip(value))); // skip any spacing, get the value.
-
- while (*value==',')
- {
- cJSON *new_item;
- if (!(new_item=cJSON_New_Item())) return 0; // memory fail
- child->next=new_item;new_item->prev=child;child=new_item;
- value=skip(parse_value(child,skip(value+1)));
- }
-
- if (*value==']') return value+1; // end of array
- return 0; // malformed.
-}
-
-// Render an array to text
-static char *print_array(cJSON *item,int depth)
-{
- char *out,*ptr,*ret;int len=5;
- cJSON *child=item->child;
-
- out=malloc(len);*out='[';
- ptr=out+1;*ptr=0;
- while (child)
- {
- ret=print_value(child,depth+1);
- if (!ret) {free(out);return 0;} // Check for failure!
- len+=strlen(ret)+3;
- out=realloc(out,len);
- ptr=out+strlen(out);
- ptr+=sprintf(ptr,"%s",ret);
- if (child->next) {*ptr++=',';*ptr++=' ';*ptr=0;}
- child=child->next;
- free(ret);
- }
- *ptr++=']';*ptr++=0;
- return out;
-}
-
-// Build an object from the text.
-static const char *parse_object(cJSON *item,const char *value)
-{
- cJSON *child;
- if (*value!='{') return 0; // not an object!
-
- item->type=cJSON_Object;
- value=skip(value+1);
- if (*value=='}') return value+1; // empty array.
-
- item->child=child=cJSON_New_Item();
- value=skip(parse_string(child,skip(value)));
- child->string=child->valuestring;child->valuestring=0;
- if (*value!=':') return 0; // fail!
- value=skip(parse_value(child,skip(value+1))); // skip any spacing, get the value.
-
- while (*value==',')
- {
- cJSON *new_item;
- if (!(new_item=cJSON_New_Item())) return 0; // memory fail
- child->next=new_item;new_item->prev=child;child=new_item;
- value=skip(parse_string(child,skip(value+1)));
- child->string=child->valuestring;child->valuestring=0;
- if (*value!=':') return 0; // fail!
- value=skip(parse_value(child,skip(value+1))); // skip any spacing, get the value.
- }
-
- if (*value=='}') return value+1; // end of array
- return 0; // malformed.
-}
-
-// Render an object to text.
-static char *print_object(cJSON *item,int depth)
-{
- char *out,*ptr,*ret,*str;int len=7;//,i;
- cJSON *child=item->child;
-
- depth++;out=malloc(len+depth);*out='{';
- ptr=out+1;*ptr++=' ';*ptr=0;
- while (child)
- {
- str=print_string_ptr(child->string);
- if (!str) {free(out);return 0;}
- ret=print_value(child,depth);
- if (!ret) {free(out);return 0;} // Check for failure!
- len+=strlen(ret)+strlen(str)+4+depth;
- out=realloc(out,len);
- ptr=out+strlen(out);
-// for (i=0;i<depth;i++) *ptr++='\t';
- ptr+=sprintf(ptr,"%s",str);
- *ptr++=':';*ptr++=' ';
- ptr+=sprintf(ptr,"%s",ret);
- if (child->next) *ptr++=',';
- *ptr++=' ';*ptr=0;
- child=child->next;
- free(str);free(ret);
- }
-// for (i=0;i<depth-1;i++) *ptr++='\t';
- *ptr++='}';*ptr++=0;
- return out;
-}
-
-// Get Array size/item / object item.
-int cJSON_GetArraySize(cJSON *array) {cJSON *c=array->child;int i=0;while(c)i++,c=c->next;return i;}
-cJSON *cJSON_GetArrayItem(cJSON *array,int item) {cJSON *c=array->child; while (c && item) item--,c=c->next; return c;}
-cJSON *cJSON_GetObjectItem(cJSON *object,const char *string) {cJSON *c=object->child; while (c && strcasecmp(c->string,string)) c=c->next; return c;}
-
-// Utility for array list handling.
-static void suffix_object(cJSON *prev,cJSON *item) {prev->next=item;item->prev=prev;}
-
-// Add item to array/object.
-void cJSON_AddItemToArray(cJSON *array, cJSON *item) {cJSON *c=array->child;if (!c) {array->child=item;} else {while (c && c->next) c=c->next; suffix_object(c,item);}}
-void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item) {if (item->string) free(item->string);item->string=strdup(string);cJSON_AddItemToArray(object,item);}
-
-// Create basic types:
-cJSON *cJSON_CreateNull() {cJSON *item=cJSON_New_Item();item->type=cJSON_NULL;return item;}
-cJSON *cJSON_CreateTrue() {cJSON *item=cJSON_New_Item();item->type=cJSON_True;return item;}
-cJSON *cJSON_CreateFalse() {cJSON *item=cJSON_New_Item();item->type=cJSON_False;return item;}
-cJSON *cJSON_CreateNumber(double num) {cJSON *item=cJSON_New_Item();item->type=cJSON_Number;item->valuedouble=num;item->valueint=(int)num;return item;}
-cJSON *cJSON_CreateString(const char *string) {cJSON *item=cJSON_New_Item();item->type=cJSON_String;item->valuestring=strdup(string);return item;}
-cJSON *cJSON_CreateArray() {cJSON *item=cJSON_New_Item();item->type=cJSON_Array;return item;}
-cJSON *cJSON_CreateObject() {cJSON *item=cJSON_New_Item();item->type=cJSON_Object;return item;}
-
-// Create Arrays:
-cJSON *cJSON_CreateIntArray(int *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
-cJSON *cJSON_CreateFloatArray(float *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
-cJSON *cJSON_CreateDoubleArray(double *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
-cJSON *cJSON_CreateStringArray(const char **strings,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;i<count;i++){n=cJSON_CreateString(strings[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/common/cJSON.h b/plugins/!NotAdopted/IMO2sProxy/src/common/cJSON.h deleted file mode 100644 index debda45bc0..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/common/cJSON.h +++ /dev/null @@ -1,97 +0,0 @@ -/*
- Copyright (c) 2009 Dave Gamble
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-*/
-
-#ifndef cJSON__h
-#define cJSON__h
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-// cJSON Types:
-#define cJSON_False 0
-#define cJSON_True 1
-#define cJSON_NULL 2
-#define cJSON_Number 3
-#define cJSON_String 4
-#define cJSON_Array 5
-#define cJSON_Object 6
-
-// The cJSON structure:
-typedef struct cJSON {
- struct cJSON *next,*prev; // next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem
- struct cJSON *child; // An array or object item will have a child pointer pointing to a chain of the items in the array/object.
-
- int type; // The type of the item, as above.
-
- char *valuestring; // The item's string, if type==cJSON_String
- int valueint; // The item's number, if type==cJSON_Number
- double valuedouble; // The item's number, if type==cJSON_Number
-
- char *string; // The item's name string, if this item is the child of, or is in the list of subitems of an object.
-} cJSON;
-
-// Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished.
-extern cJSON *cJSON_Parse(const char *value);
-// Render a cJSON entity to text for transfer/storage. Free the char* when finished.
-extern char *cJSON_Print(cJSON *item);
-// Delete a cJSON entity and all subentities.
-extern void cJSON_Delete(cJSON *c);
-
-// Returns the number of items in an array (or object).
-extern int cJSON_GetArraySize(cJSON *array);
-// Retrieve item number "item" from array "array". Returns NULL if unsuccessful.
-extern cJSON *cJSON_GetArrayItem(cJSON *array,int item);
-// Get item "string" from object. Case insensitive.
-extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string);
-
-// These calls create a cJSON item of the appropriate type.
-extern cJSON *cJSON_CreateNull();
-extern cJSON *cJSON_CreateTrue();
-extern cJSON *cJSON_CreateFalse();
-extern cJSON *cJSON_CreateNumber(double num);
-extern cJSON *cJSON_CreateString(const char *string);
-extern cJSON *cJSON_CreateArray();
-extern cJSON *cJSON_CreateObject();
-
-// These utilities create an Array of count items.
-extern cJSON *cJSON_CreateIntArray(int *numbers,int count);
-extern cJSON *cJSON_CreateFloatArray(float *numbers,int count);
-extern cJSON *cJSON_CreateDoubleArray(double *numbers,int count);
-extern cJSON *cJSON_CreateStringArray(const char **strings,int count);
-
-// Append item to the specified array/object.
-extern void cJSON_AddItemToArray(cJSON *array, cJSON *item);
-extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
-
-#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
-#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
-#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
-#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
-#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/common/fifo.c b/plugins/!NotAdopted/IMO2sProxy/src/common/fifo.c deleted file mode 100644 index d703ac33d4..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/common/fifo.c +++ /dev/null @@ -1,144 +0,0 @@ -#include <stdlib.h>
-#include <string.h>
-#include "fifo.h"
-
-struct _tagFIFO
-{
- unsigned int uiCount;
- unsigned int uiCapacity;
- unsigned int uiActInd;
- char *acStorage;
-};
-
-
-TYP_FIFO *Fifo_Init(unsigned int uiCapacity)
-{
- TYP_FIFO *pstHandle;
-
- pstHandle = (TYP_FIFO *)malloc(sizeof(TYP_FIFO));
- if (!pstHandle) return NULL;
- pstHandle->uiCount = pstHandle->uiActInd = 0;
- pstHandle->uiCapacity = uiCapacity;
- if (uiCapacity == 0)
- pstHandle->acStorage = NULL;
- else
- {
- pstHandle->acStorage = (char *)malloc(uiCapacity);
- if (!pstHandle->acStorage)
- {
- free (pstHandle);
- return NULL;
- }
- }
- return pstHandle;
-}
-
-void Fifo_Exit(TYP_FIFO *pstHandle)
-{
- if (pstHandle->acStorage)
- free (pstHandle->acStorage);
- free (pstHandle);
-}
-
-char *Fifo_AllocBuffer(TYP_FIFO *pstHandle, unsigned int uiPCount)
-{
- unsigned int uiCount = pstHandle->uiCount;
-
- if (!Fifo_Add (pstHandle, NULL, uiPCount)) return NULL;
- return &pstHandle->acStorage[pstHandle->uiActInd+uiCount];
-
-}
-
-BOOL Fifo_Add(TYP_FIFO *pstHandle, char *acPBytes, unsigned int uiPCount)
-{
- unsigned int uiFree;
-
- if (uiPCount == 0) return TRUE;
- if (pstHandle->uiCapacity == 0)
- {
- if (!(pstHandle->acStorage = (char *)calloc(1, uiPCount)))
- return FALSE;
- if (acPBytes)
- memcpy(pstHandle->acStorage, acPBytes, uiPCount);
- else
- memset(pstHandle->acStorage, 0, uiPCount);
- pstHandle->uiCapacity = pstHandle->uiCount = uiPCount;
- pstHandle->uiActInd = 0;
- }
- else
- {
- uiFree = pstHandle->uiCapacity-(pstHandle->uiActInd+pstHandle->uiCount);
- if (uiFree < uiPCount)
- {
- if (pstHandle->uiActInd>=uiPCount && pstHandle->uiActInd*4>pstHandle->uiCount)
- {
- memmove(pstHandle->acStorage, pstHandle->acStorage+pstHandle->uiActInd, pstHandle->uiCount);
- pstHandle->uiActInd = 0;
- }
- else
- {
- char *acBuf;
- unsigned int uiNewLen;
-
- if (pstHandle->uiCapacity*2 <
- pstHandle->uiCount+pstHandle->uiActInd+uiPCount)
- uiNewLen = pstHandle->uiCount+pstHandle->uiActInd+uiPCount;
- else
- uiNewLen = pstHandle->uiCapacity*2;
- acBuf = realloc(pstHandle->acStorage, uiNewLen);
- if (acBuf == NULL) return FALSE;
- pstHandle->acStorage = acBuf;
- memset (acBuf+pstHandle->uiCapacity, 0, uiNewLen-pstHandle->uiCapacity);
- pstHandle->uiCapacity = uiNewLen;
- }
- }
- if (acPBytes)
- memcpy (&pstHandle->acStorage[pstHandle->uiActInd+pstHandle->uiCount], acPBytes, uiPCount);
- else
- memset (&pstHandle->acStorage[pstHandle->uiActInd+pstHandle->uiCount], 0, uiPCount);
-
- pstHandle->uiCount += uiPCount;
- }
-
- return TRUE;
-}
-
-BOOL Fifo_AddString(TYP_FIFO *pstHandle, char *pszString)
-{
- BOOL bRet;
-
- while (pstHandle->uiCount && pstHandle->acStorage[pstHandle->uiCount+pstHandle->uiActInd-1]==0)
- pstHandle->uiCount--;
- bRet = Fifo_Add (pstHandle, pszString, strlen(pszString)+1);
- return bRet;
-}
-
-char *Fifo_Get (TYP_FIFO *pstHandle, unsigned int *uiPCount)
-{
- unsigned int uiCount;
- char *pRet;
-
- if (!uiPCount) uiCount = pstHandle->uiCount;
- else
- {
- if (pstHandle->uiCount < *uiPCount)
- *uiPCount = pstHandle->uiCount;
- uiCount = *uiPCount;
- }
- if (!uiCount) return NULL;
-
- pRet = &pstHandle->acStorage[pstHandle->uiActInd];
- pstHandle->uiActInd += uiCount;
- pstHandle->uiCount -= uiCount;
- return pRet;
-}
-
-void Fifo_Reset (TYP_FIFO *pstHandle)
-{
- pstHandle->uiCount = pstHandle->uiActInd = 0;
-}
-
-unsigned int Fifo_Count (TYP_FIFO *pstHandle)
-{
- return pstHandle->uiCount;
-}
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/common/fifo.h b/plugins/!NotAdopted/IMO2sProxy/src/common/fifo.h deleted file mode 100644 index 0ab9f4f469..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/common/fifo.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef __FIFO_H__
-#define __FIFO_H__
-
-struct _tagFIFO;
-typedef struct _tagFIFO TYP_FIFO;
-
-#ifndef BOOL
-#define BOOL int
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-TYP_FIFO *Fifo_Init(unsigned int uiCapacity);
-void Fifo_Exit(TYP_FIFO *pstHandle);
-char *Fifo_AllocBuffer(TYP_FIFO *pstHandle, unsigned int uiPCount);
-BOOL Fifo_Add(TYP_FIFO *pstHandle, char *acPBytes, unsigned int uiPCount);
-BOOL Fifo_AddString(TYP_FIFO *pstHandle, char *pszString);
-char *Fifo_Get (TYP_FIFO *pstHandle, unsigned int *uiPCount);
-unsigned int Fifo_Count (TYP_FIFO *pstHandle);
-void Fifo_Reset (TYP_FIFO *hFifo);
-
-#endif
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/common/memlist.c b/plugins/!NotAdopted/IMO2sProxy/src/common/memlist.c deleted file mode 100644 index 137a03eeac..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/common/memlist.c +++ /dev/null @@ -1,158 +0,0 @@ -#include "memlist.h"
-#include <string.h>
-#include <stdlib.h>
-
-struct _tagLIST
-{
- unsigned int uiCount;
- unsigned int uiCapacity;
- void **apStorage;
-};
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-TYP_LIST *List_Init(unsigned int uiCapacity)
-{
- TYP_LIST *pstHandle;
-
- pstHandle = (TYP_LIST *)malloc(sizeof(TYP_LIST));
-
- if (!pstHandle) return NULL;
- pstHandle->uiCount = 0;
- pstHandle->uiCapacity = uiCapacity;
- if (uiCapacity == 0)
- pstHandle->apStorage = NULL;
- else
- {
- pstHandle->apStorage = (void **)malloc(sizeof(void *)*uiCapacity);
- if (!pstHandle->apStorage)
- {
- free(pstHandle);
- return NULL;
- }
- }
- return pstHandle;
-}
-
-// -----------------------------------------------------------------------------
-
-void List_Exit(TYP_LIST *pstHandle)
-{
- if (pstHandle->apStorage)
- free (pstHandle->apStorage);
- free (pstHandle);
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL List_Push(TYP_LIST *pstHandle, void *pItem)
-{
- return List_InsertElementAt(pstHandle, pItem,pstHandle->uiCount);
-}
-
-// -----------------------------------------------------------------------------
-
-void *List_Pop (TYP_LIST *pstHandle)
-{
- if (pstHandle->uiCount)
- return List_RemoveElementAt(pstHandle ,pstHandle->uiCount-1);
- else return NULL;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL List_ReplaceElementAt(TYP_LIST *pstHandle, void *pItem, unsigned int uiPos)
-{
- if (uiPos >= pstHandle->uiCount) return NULL;
- pstHandle->apStorage[uiPos]=pItem;
- return TRUE;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL List_InsertElementAt(TYP_LIST *pstHandle, void *pItem, unsigned int uiPos)
-{
- unsigned int uiStep;
- void **apNewStorage;
-
- if (uiPos > pstHandle->uiCount)
- uiPos = pstHandle->uiCount;
-
- if (pstHandle->uiCount >= pstHandle->uiCapacity)
- {
- uiStep = pstHandle->uiCount*2;
- if (uiStep < 8) uiStep = 8;
-
- if (!pstHandle->apStorage)
- apNewStorage = (void **)malloc(sizeof(void *)*uiStep);
- else
- apNewStorage = realloc (pstHandle->apStorage, sizeof(void *)*uiStep);
- if (!apNewStorage) return FALSE;
- pstHandle->apStorage = apNewStorage;
- pstHandle->uiCapacity = uiStep;
- }
-
- if (uiPos<pstHandle->uiCount)
- memmove(&pstHandle->apStorage[uiPos+1], &pstHandle->apStorage[uiPos], (pstHandle->uiCount-uiPos)*sizeof(void*));
- pstHandle->apStorage[uiPos] = pItem;
- pstHandle->uiCount++;
- return TRUE;
-}
-
-// -----------------------------------------------------------------------------
-
-void *List_RemoveElementAt(TYP_LIST *pstHandle, unsigned int uiPos)
-{
- void *pRet;
-
- pRet = pstHandle->apStorage[uiPos];
- if (uiPos<pstHandle->uiCount-1)
- memmove (&pstHandle->apStorage[uiPos], &pstHandle->apStorage[uiPos+1], (pstHandle->uiCount-uiPos-1)*sizeof(void*));
- pstHandle->uiCount--;
- return pRet;
-}
-
-// -----------------------------------------------------------------------------
-
-unsigned int List_Count(TYP_LIST *pstHandle)
-{
- return pstHandle->uiCount;
-}
-
-// -----------------------------------------------------------------------------
-
-void *List_ElementAt(TYP_LIST *pstHandle,unsigned int uiPos)
-{
- if (uiPos >= pstHandle->uiCount) return NULL;
- return pstHandle->apStorage[uiPos];
-}
-
-// -----------------------------------------------------------------------------
-
-void *List_Top(TYP_LIST *pstHandle)
-{
- if (pstHandle->uiCount)
- return List_ElementAt (pstHandle, pstHandle->uiCount-1);
- else return NULL;
-}
-
-// -----------------------------------------------------------------------------
-
-void List_Sort(TYP_LIST *pstHandle, int (*pFunc)(const void*,const void*))
-{
- qsort(pstHandle->apStorage,pstHandle->uiCount,sizeof(void *),pFunc);
-}
-
-// -----------------------------------------------------------------------------
-
-void List_FreeElements(TYP_LIST *pstHandle)
-{
- void *pEntry;
-
- while (pEntry = List_Pop(pstHandle))
- free (pEntry);
-}
-
-// -----------------------------------------------------------------------------
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/common/memlist.h b/plugins/!NotAdopted/IMO2sProxy/src/common/memlist.h deleted file mode 100644 index be37bbb723..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/common/memlist.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef __LIST_H__
-#define __LIST_H__
-
-#ifndef BOOL
-#define BOOL int
-#endif
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-struct _tagLIST;
-typedef struct _tagLIST TYP_LIST;
-
-TYP_LIST *List_Init(unsigned int uiCapacity);
-void List_Exit(TYP_LIST *pstHandle);
-BOOL List_Push(TYP_LIST *pstHandle, void *pItem);
-void *List_Pop (TYP_LIST *pstHandle);
-BOOL List_ReplaceElementAt(TYP_LIST *pstHandle, void *pItem, unsigned int uiPos);
-BOOL List_InsertElementAt(TYP_LIST *pstHandle, void *pItem, unsigned int uiPos);
-void *List_RemoveElementAt(TYP_LIST *pstHandle, unsigned int uiPos);
-unsigned int List_Count(TYP_LIST *pstHandle);
-void *List_ElementAt(TYP_LIST *pstHandle,unsigned int uiPos);
-void *List_Top(TYP_LIST *pstHandle);
-void List_FreeElements(TYP_LIST *pstHandle);
-void List_Sort(TYP_LIST *pstHandle, int (*pFunc)(const void*,const void*));
-
-#endif
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/Makefile b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/Makefile deleted file mode 100644 index 7e4420f87f..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -CFLAGS = -O0 -g -I../common/ -I../imolib/ -lcurl -lpthread -lm -CC = gcc -COMMON = ../common/fifo.c ../common/cJSON.c ../common/memlist.c -IMOLIB = ../imolib/imo_request.c ../imolib/imo_skype.c ../imolib/io_layer.c -IMO2S = buddylist.c queue.c msgqueue.c imo2skypeapi.c callqueue.c socksproxy.c avatarlist.c -.PHONY: all imo2stest imo2sproxy clean - -all : imo2stest imo2sproxy - -imo2stest: $(COMMON) $(IMO2S) $(IMOLIB) imo2stest.c - $(CC) -o imo2stest $(COMMON) $(IMO2S) $(IMOLIB) imo2stest.c $(CFLAGS) - strip imo2stest - -imo2sproxy: $(COMMON) $(IMO2S) $(IMOLIB) imo2sproxy.c main.c - $(CC) -o imo2sproxy $(COMMON) $(IMO2S) $(IMOLIB) imo2sproxy.c main.c $(CFLAGS) -# strip imo2sproxy - -clean : - rm imo2stest imo2sproxy diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/avatarlist.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/avatarlist.c deleted file mode 100644 index f1c78f0567..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/avatarlist.c +++ /dev/null @@ -1,110 +0,0 @@ -/* Module: avatarlist.c
- Purpose: Manages the avatars of your buddies
- Author: leecher
- Date: 18.08.2011
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include "memlist.h"
-#include "avatarlist.h"
-
-static void SetEntry(AVATARENTRY *pEntry, cJSON *pNick);
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-TYP_LIST *AvatarList_Init(void)
-{
- TYP_LIST *hList = List_Init(16);
-
- return hList;
-}
-
-// -----------------------------------------------------------------------------
-
-void AvatarList_Exit(TYP_LIST *hList)
-{
- AVATARENTRY *pEntry;
-
- while (pEntry=(AVATARENTRY*)List_Pop(hList))
- {
- AvatarList_FreeEntry(pEntry);
- free (pEntry);
- }
- List_Exit(hList);
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL AvatarList_Insert(TYP_LIST *hList, cJSON *pIcon)
-{
- AVATARENTRY *pEntry;
-
- if (pEntry=AvatarList_Find (hList, cJSON_GetObjectItem(pIcon, "buid")->valuestring))
- AvatarList_FreeEntry (pEntry);
- else
- {
- if (!(pEntry = calloc (1, sizeof(AVATARENTRY)))) return FALSE;
- if (!List_Push(hList, pEntry)) return FALSE;
- }
- SetEntry(pEntry, pIcon);
- return TRUE;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL AvatarList_Remove(TYP_LIST *hList, AVATARENTRY *pEntry)
-{
- AVATARENTRY *pListEntry;
- int i, nCount;
-
- for (i=0, nCount=List_Count(hList); i<nCount; i++)
- {
- pListEntry = List_ElementAt (hList, i);
- if (pListEntry == pEntry) break;
- }
- if (i<nCount)
- {
- AvatarList_FreeEntry (pEntry);
- List_RemoveElementAt(hList, i);
- free (pEntry);
- return TRUE;
- }
- return FALSE;
-}
-
-// -----------------------------------------------------------------------------
-
-AVATARENTRY *AvatarList_Find(TYP_LIST *hList, char *pszUser)
-{
- int i, nCount;
- AVATARENTRY *pEntry;
-
- for (i=0, nCount=List_Count(hList); i<nCount; i++)
- {
- pEntry = List_ElementAt (hList, i);
- if (strcmp(pEntry->pszUser, pszUser) == 0)
- return pEntry;
- }
- return NULL;
-}
-
-// -----------------------------------------------------------------------------
-
-void AvatarList_FreeEntry(AVATARENTRY *pEntry)
-{
- if (pEntry->pszUser) free (pEntry->pszUser);
- if (pEntry->pszIcon) free (pEntry->pszIcon);
-}
-
-// -----------------------------------------------------------------------------
-// Static
-// -----------------------------------------------------------------------------
-
-static void SetEntry(AVATARENTRY *pEntry, cJSON *pNick)
-{
- pEntry->pszUser = strdup(cJSON_GetObjectItem(pNick, "buid")->valuestring);
- pEntry->pszIcon = strdup(cJSON_GetObjectItem(pNick, "icon")->valuestring);
-}
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/avatarlist.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/avatarlist.h deleted file mode 100644 index 6a47ed2fa5..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/avatarlist.h +++ /dev/null @@ -1,16 +0,0 @@ -#include "cJSON.h"
-#include "memlist.h"
-
-typedef struct
-{
- char *pszUser;
- char *pszIcon;
-} AVATARENTRY;
-
-TYP_LIST *AvatarList_Init(void);
-void AvatarList_Exit(TYP_LIST *hList);
-
-BOOL AvatarList_Insert(TYP_LIST *hList, cJSON *pIcon);
-BOOL AvatarList_Remove(TYP_LIST *hList, AVATARENTRY *pEntry);
-AVATARENTRY *AvatarList_Find(TYP_LIST *hList, char *pszUser);
-void AvatarList_FreeEntry(AVATARENTRY *pEntry);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/buddylist.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/buddylist.c deleted file mode 100644 index 6d228ae4b9..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/buddylist.c +++ /dev/null @@ -1,204 +0,0 @@ -/* Module: buddylist.c
- Purpose: Manages your list of buddies in memory
- Author: leecher
- Date: 30.08.2009
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include "memlist.h"
-#include "buddylist.h"
-
-static void SetEntry(NICKENTRY *pEntry, cJSON *pNick);
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-TYP_LIST *BuddyList_Init(void)
-{
- TYP_LIST *hList = List_Init(16);
-
- return hList;
-}
-
-// -----------------------------------------------------------------------------
-
-void BuddyList_Exit(TYP_LIST *hList)
-{
- NICKENTRY *pEntry;
-
- while (pEntry=(NICKENTRY*)List_Pop(hList))
- {
- BuddyList_FreeEntry(pEntry, TRUE);
- free (pEntry);
- }
- List_Exit(hList);
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL BuddyList_Insert(TYP_LIST *hList, cJSON *pNick)
-{
- NICKENTRY *pEntry;
- cJSON *pElem;
-
- if (pEntry=BuddyList_Find (hList, cJSON_GetObjectItem(pNick, "buid")->valuestring))
- BuddyList_FreeEntry (pEntry, FALSE);
- else
- {
- if (!(pEntry = calloc (1, sizeof(NICKENTRY)))) return FALSE;
- if ((pElem=cJSON_GetObjectItem(pNick, "group")) && strcmp(pElem->valuestring, "Skype"))
- {
- char szBUID[256];
- NICKENTRY *pGroup;
-
- // Buddy Belongs to a chatgroup
- sprintf (szBUID, "%s;", pElem->valuestring);
- pGroup = BuddyList_Find (hList, szBUID);
-
- if (pGroup) // Group not yet created? Shouldn't be the case
- {
- if (!pGroup->hGCMembers) pGroup->hGCMembers=List_Init(1);
- hList = pGroup->hGCMembers;
- pEntry->pGroup = pGroup;
- }
- }
- if (!List_Push(hList, pEntry)) return FALSE;
- }
- SetEntry(pEntry, pNick);
- pEntry->iBuddyStatus = 3;
- return TRUE;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL BuddyList_AddTemporaryUser(TYP_LIST *hList, char *pszUser)
-{
- NICKENTRY *pEntry;
-
- if (BuddyList_Find (hList, pszUser)) return TRUE;
- if (!(pEntry = calloc (1, sizeof(NICKENTRY)))) return FALSE;
- pEntry->pszUser = strdup(pszUser);
- pEntry->pszAlias = strdup(pszUser);
- strcpy (pEntry->szStatus, "OFFLINE");
- pEntry->iBuddyStatus = 2;
- return List_Push(hList, pEntry);
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL BuddyList_Remove(TYP_LIST *hList, NICKENTRY *pEntry)
-{
- NICKENTRY *pListEntry;
- int i, nCount;
-
- if (pEntry->pGroup) hList=pEntry->pGroup->hGCMembers;
- for (i=0, nCount=List_Count(hList); i<nCount; i++)
- {
- pListEntry = List_ElementAt (hList, i);
- if (pListEntry == pEntry) break;
- }
- if (i<nCount)
- {
- BuddyList_FreeEntry (pEntry, TRUE);
- List_RemoveElementAt(hList, i);
- free (pEntry);
- return TRUE;
- }
- return FALSE;
-}
-
-// -----------------------------------------------------------------------------
-
-NICKENTRY *BuddyList_Find(TYP_LIST *hList, char *pszUser)
-{
- int i, nCount;
- NICKENTRY *pEntry;
-
- for (i=0, nCount=List_Count(hList); i<nCount; i++)
- {
- pEntry = List_ElementAt (hList, i);
- if (strcmp(pEntry->pszUser, pszUser) == 0)
- return pEntry;
- else if (pEntry->hGCMembers)
- {
- if (pEntry = BuddyList_Find(pEntry->hGCMembers, pszUser))
- return pEntry;
- }
- }
- return NULL;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL BuddyList_SetStatus(TYP_LIST *hList, cJSON *pNick)
-{
- NICKENTRY *pEntry;
-
- if ((pEntry = BuddyList_Find(hList, cJSON_GetObjectItem(pNick, "buid")->valuestring)))
- {
- BuddyList_FreeEntry(pEntry, FALSE);
- SetEntry(pEntry, pNick);
- return TRUE;
- }
- return FALSE;
-}
-
-// -----------------------------------------------------------------------------
-
-void BuddyList_FreeEntry(NICKENTRY *pEntry, BOOL bFreeGC)
-{
- if (pEntry->pszAlias)
- {
- free (pEntry->pszAlias);
- pEntry->pszAlias = NULL;
- }
- if (pEntry->pszUser)
- {
- free (pEntry->pszUser);
- pEntry->pszUser = NULL;
- }
- if (pEntry->pszStatusText)
- {
- free(pEntry->pszStatusText);
- pEntry->pszStatusText = NULL;
- }
- if (pEntry->pszDisplay)
- {
- free(pEntry->pszDisplay);
- pEntry->pszDisplay = NULL;
- }
- if (bFreeGC && pEntry->hGCMembers)
- {
- NICKENTRY *pNick;
-
- while (pNick=(NICKENTRY*)List_Pop(pEntry->hGCMembers))
- {
- BuddyList_FreeEntry(pNick, bFreeGC);
- free (pNick);
- }
- List_Exit (pEntry->hGCMembers);
- pEntry->hGCMembers = NULL;
- }
-}
-
-// -----------------------------------------------------------------------------
-// Static
-// -----------------------------------------------------------------------------
-
-static void SetEntry(NICKENTRY *pEntry, cJSON *pNick)
-{
- cJSON *obj;
-
- if ((obj=cJSON_GetObjectItem(pNick, "alias")) && obj->valuestring)
- pEntry->pszAlias = strdup(obj->valuestring);
- pEntry->pszUser = strdup(cJSON_GetObjectItem(pNick, "buid")->valuestring);
- if ((obj=cJSON_GetObjectItem(pNick, "status")) && obj->valuestring)
- pEntry->pszStatusText = strdup(obj->valuestring);
- if ((obj=cJSON_GetObjectItem(pNick, "primitive")) && obj->valuestring)
- strcpy (pEntry->szStatus, obj->valuestring);
- if ((obj=cJSON_GetObjectItem(pNick, "display")) && obj->valuestring)
- pEntry->pszDisplay = strdup(obj->valuestring);
-}
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/buddylist.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/buddylist.h deleted file mode 100644 index 3774ef3e5e..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/buddylist.h +++ /dev/null @@ -1,28 +0,0 @@ -#include "cJSON.h"
-#include "memlist.h"
-
-struct tag_nickentry;
-typedef struct tag_nickentry NICKENTRY;
-
-struct tag_nickentry
-{
- char *pszUser;
- char *pszStatusText;
- char szStatus[16];
- char *pszAlias;
- char *pszDisplay; // Display name, on Groupchat it is topic
- int iBuddyStatus;
- TYP_LIST *hGCMembers; // List of groupchat members, if this is a groupchat
- NICKENTRY *pGroup; // Uplink to Chatgroup, if Groupchat-Member
-};
-
-TYP_LIST *BuddyList_Init(void);
-void BuddyList_Exit(TYP_LIST *hList);
-
-BOOL BuddyList_Insert(TYP_LIST *hList, cJSON *pNick);
-BOOL BuddyList_AddTemporaryUser(TYP_LIST *hList, char *pszUser);
-BOOL BuddyList_Remove(TYP_LIST *hList, NICKENTRY *pEntry);
-NICKENTRY *BuddyList_Find(TYP_LIST *hList, char *pszUser);
-BOOL BuddyList_SetStatus(TYP_LIST *hList, cJSON *pNick);
-void BuddyList_FreeEntry(NICKENTRY *pEntry, BOOL bFreeGC);
-#define BuddyList_IsGroupchat(pEntry) (pEntry->hGCMembers!=NULL)
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/callqueue.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/callqueue.c deleted file mode 100644 index f579eb184e..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/callqueue.c +++ /dev/null @@ -1,95 +0,0 @@ -/* Module: callqueue.c
- Purpose: Queue for incoming calls
- Author: leecher
- Date: 02.09.2009
-
- Fixme: Sort on insert, do a binary search instead of iterating list.
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include "callqueue.h"
-
-static volatile unsigned int m_uMsgNr=0;
-static void FreeEntry(void *pPEntry);
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-TYP_LIST *CallQueue_Init(void)
-{
- TYP_LIST *hList = List_Init(16);
-
- return hList;
-}
-
-// -----------------------------------------------------------------------------
-
-void CallQueue_Exit(TYP_LIST *hList)
-{
- Queue_Exit (hList, FreeEntry);
-}
-
-// -----------------------------------------------------------------------------
-
-CALLENTRY *CallQueue_Insert(TYP_LIST *hList, cJSON *pNick, int iDirection)
-{
- CALLENTRY *pEntry;
- cJSON *pStream, *pVal, *pPipe;
-
- if (!(pEntry = Queue_InsertEntry(hList, sizeof(CALLENTRY), ++m_uMsgNr,
- FreeEntry))) return NULL;
- pEntry->pszUser = strdup(cJSON_GetObjectItem(pNick, "buid")->valuestring);
- time (&pEntry->timestamp);
- strcpy (pEntry->szStatus, "RINGING");
-
- if (pStream = cJSON_GetObjectItem(pNick, "send_stream"))
- {
- strcpy (pEntry->szSendStream, pStream->valuestring);
- if (pStream = cJSON_GetObjectItem(pNick, "recv_stream"))
- strcpy (pEntry->szRecvStream, pStream->valuestring);
- }
- else
- {
- // Copy pipe to Call object
- if (pPipe = cJSON_GetObjectItem(pNick, "pipe"))
- {
- if (pVal = cJSON_GetObjectItem(pPipe, "ip"))
- strncpy (pEntry->szIP, pVal->valuestring, sizeof(pEntry->szIP));
- if (pVal = cJSON_GetObjectItem(pPipe, "conv"))
- strncpy (pEntry->szConv, pVal->valuestring, sizeof(pEntry->szConv));
- if (pVal = cJSON_GetObjectItem(pPipe, "role"))
- pEntry->iRole = pVal->valueint;
- }
- }
- pEntry->iDirection = iDirection;
- return pEntry;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL CallQueue_Remove(TYP_LIST *hList, unsigned int uMsgNr)
-{
- return Queue_Remove (hList, uMsgNr, FreeEntry);
-}
-
-// -----------------------------------------------------------------------------
-
-CALLENTRY *CallQueue_Find(TYP_LIST *hList, unsigned int uMsgNr)
-{
- return (CALLENTRY*)Queue_Find(hList, uMsgNr);
-}
-
-// -----------------------------------------------------------------------------
-// Static
-// -----------------------------------------------------------------------------
-
-static void FreeEntry(void *pPEntry)
-{
- CALLENTRY *pEntry = (CALLENTRY*)pPEntry;
-
- free (pEntry->pszUser);
-}
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/callqueue.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/callqueue.h deleted file mode 100644 index 0c4fcfd2cf..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/callqueue.h +++ /dev/null @@ -1,32 +0,0 @@ -#include "cJSON.h"
-#include "queue.h"
-#include <time.h>
-
-#define CALL_INCOMING 0
-#define CALL_OUTGOING 1
-
-typedef struct
-{
- QUEUEHDR hdr;
- char *pszUser;
- char szStatus[16];
-
- char szSendStream[18];
- char szRecvStream[18];
-
- char szConv[18];
- char szIP[16];
- int iRole;
-
- char szCallFile[256];
- void *hCallWnd;
- int iDirection;
- time_t timestamp;
-} CALLENTRY;
-
-TYP_LIST *CallQueue_Init(void);
-void CallQueue_Exit(TYP_LIST *hList);
-
-CALLENTRY *CallQueue_Insert(TYP_LIST *hList, cJSON *pNick, int iDirection);
-BOOL CallQueue_Remove(TYP_LIST *hList, unsigned int uCallNr);
-CALLENTRY *CallQueue_Find(TYP_LIST *hList, unsigned int uCallNr);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/crash.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/crash.c deleted file mode 100644 index 91ad90032e..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/crash.c +++ /dev/null @@ -1,295 +0,0 @@ -#include <imagehlp.h>
-#include <malloc.h>
-#pragma comment (lib, "imagehlp.lib")
-
-#define MAXNAMELEN 1024
-#define HEXDUMP_BREAK 16
-
-void HexDump(char *pszOutput, PBYTE pData, int cbLength, BOOL bShow)
-{
- char *pszLastLine;
- int i;
-
- *pszOutput=0;
- pszLastLine = pszOutput;
- for (i=0; i<cbLength; i++)
- {
- if (i%HEXDUMP_BREAK == 0)
- {
- if (i>=HEXDUMP_BREAK)
- {
- int j;
-
- strcat (pszOutput, " ");
- for (j=i-HEXDUMP_BREAK; j<i; j++) sprintf (pszOutput+strlen(pszOutput), "%c", pData[j]);
- }
- sprintf (pszOutput+strlen(pszOutput), "\r\n");
- if (bShow) LOG (("\t%s", pszLastLine));
- if (i==0) *pszOutput=0;
- pszLastLine = pszOutput+strlen(pszOutput);
- }
- sprintf (pszOutput+strlen(pszOutput), "%02X ", pData[i]);
- if (i == cbLength-1)
- {
- int j;
-
- for (j=0; j<HEXDUMP_BREAK - i%HEXDUMP_BREAK - 1; j++) sprintf (pszOutput+strlen(pszOutput), " ");
- sprintf (pszOutput+strlen(pszOutput), " ");
- for (j=i-i%HEXDUMP_BREAK; j<i; j++) sprintf (pszOutput+strlen(pszOutput), "%c",
- (isprint(pData[j]) && pData[j]!=0x0D && pData[j]!=0x0A && pData[j]!=0x09)?pData[j]:'.');
- if (bShow) LOG (("\t%s", pszLastLine));
- }
- }
-}
-
-
-void CrashDumpMem (DWORD dwBase, char *pszName, DWORD dwDwords)
-{
- int cbLength = sizeof(DWORD) * dwDwords;
- PBYTE mem = (PBYTE)alloca (cbLength*2);
- SYSTEM_INFO sysInfo;
- SIZE_T read=0;
-
- dwBase &= ~3;
-
- dwBase-=cbLength; cbLength*=2;
- GetSystemInfo(&sysInfo);
- if (dwBase < (DWORD)sysInfo.lpMinimumApplicationAddress || dwBase > (DWORD)sysInfo.lpMaximumApplicationAddress)
- return;
-
- if (ReadProcessMemory (GetCurrentProcess(), (PVOID)dwBase, mem, cbLength, &read))
- {
- char *pszHexdump = (char *)alloca (((cbLength/HEXDUMP_BREAK)+1)*81);
-
- LOG (("Memory dump for %s:\n", pszName));
- HexDump (pszHexdump, mem, read, TRUE);
- LOG (("\n"));
- }
-}
-
-
-BOOL ShowThreadStack (HANDLE hThread, CONTEXT *c)
-{
- STACKFRAME stFrame={0};
- DWORD dwSymOptions, dwFrameNum=0, dwMachine, dwOffsetFromSym=0;
- IMAGEHLP_LINE Line={0};
- IMAGEHLP_MODULE Module={0};
- HANDLE hProcess = GetCurrentProcess();
- BYTE pbSym[sizeof(IMAGEHLP_SYMBOL) + MAXNAMELEN];
- IMAGEHLP_SYMBOL *pSym = (IMAGEHLP_SYMBOL *)&pbSym;
- char szUndecName[MAXNAMELEN], szUndecFullName[MAXNAMELEN];
-
- /*
- if ( ! GetThreadContext( hThread, &c ) )
- {
- SetError (NULL, NULL, 0);
- LOG (("Cannot get thread context%d\n", GetLastError()));
- return FALSE;
- }
- */
- LOG (("Please wait...\n"));
- if (!SymInitialize (hProcess, NULL, TRUE))
- {
- LOG (("Cannot initialize symbol engine (%08X)\n", GetLastError()));
- return FALSE;
- }
-
- dwSymOptions = SymGetOptions();
- dwSymOptions |= SYMOPT_LOAD_LINES;
- dwSymOptions &= ~SYMOPT_UNDNAME;
- SymSetOptions (dwSymOptions);
-
- stFrame.AddrPC.Mode = AddrModeFlat;
- dwMachine = IMAGE_FILE_MACHINE_I386;
- stFrame.AddrPC.Offset = c->Eip;
- stFrame.AddrStack.Offset = c->Esp;
- stFrame.AddrStack.Mode = AddrModeFlat;
- stFrame.AddrFrame.Offset = c->Ebp;
- stFrame.AddrFrame.Mode = AddrModeFlat;
-
- Module.SizeOfStruct = sizeof(Module);
- Line.SizeOfStruct = sizeof(Module);
-
- LOG (("\n--# FV EIP----- RetAddr- FramePtr StackPtr Symbol\n"));
- do
- {
- if (!StackWalk (dwMachine, hProcess, hThread, &stFrame, &c, NULL, &SymFunctionTableAccess, &SymGetModuleBase, NULL))
- break;
-
- LOG (( "\n%3d %c%c %08lx %08lx %08lx %08lx ",
- dwFrameNum, stFrame.Far? 'F': '.', stFrame.Virtual? 'V': '.',
- stFrame.AddrPC.Offset, stFrame.AddrReturn.Offset,
- stFrame.AddrFrame.Offset, stFrame.AddrStack.Offset ));
-
- if (stFrame.AddrPC.Offset == 0)
- {
- LOG (( "(-nosymbols-)\n" ));
- }
- else
- { // we seem to have a valid PC
- if (!SymGetSymFromAddr (hProcess, stFrame.AddrPC.Offset, &dwOffsetFromSym, pSym))
- {
- if (GetLastError() != 487)
- {
- LOG (("Unable to get symbol from addr (%08X)", GetLastError()));
- }
- }
- else
- {
- UnDecorateSymbolName (pSym->Name, szUndecName, MAXNAMELEN, UNDNAME_NAME_ONLY );
- UnDecorateSymbolName (pSym->Name, szUndecFullName, MAXNAMELEN, UNDNAME_COMPLETE );
- LOG (("%s", szUndecName));
- if (dwOffsetFromSym) LOG ((" %+ld bytes", (long)dwOffsetFromSym));
- LOG (("\n Sig: %s\n Decl: %s\n", pSym->Name, szUndecFullName));
- }
-
- if (!SymGetLineFromAddr (hProcess, stFrame.AddrPC.Offset, &dwOffsetFromSym, &Line))
- {
- if (GetLastError() != 487)
- {
- LOG (("Unable to get line from addr (%08X)", GetLastError()));
- }
- }
- else
- {
- LOG ((" Line: %s(%lu) %+ld bytes\n", Line.FileName, Line.LineNumber, dwOffsetFromSym ));
- }
-
- if (!SymGetModuleInfo (hProcess, stFrame.AddrPC.Offset, &Module))
- {
- if (GetLastError() != 487)
- {
- LOG (("Unable to get module info (%08X)", GetLastError()));
- }
- }
- else
- {
- char ty[80];
-
- switch ( Module.SymType )
- {
- case SymNone:
- strcpy( ty, "-nosymbols-" );
- break;
- case SymCoff:
- strcpy( ty, "COFF" );
- break;
- case SymCv:
- strcpy( ty, "CV" );
- break;
- case SymPdb:
- strcpy( ty, "PDB" );
- break;
- case SymExport:
- strcpy( ty, "-exported-" );
- break;
- case SymDeferred:
- strcpy( ty, "-deferred-" );
- break;
- case SymSym:
- strcpy( ty, "SYM" );
- break;
- default:
- _snprintf( ty, sizeof ty, "symtype=%ld", (long) Module.SymType );
- break;
-
- }
- LOG (( " Mod: %s[%s], base: %08lxh\n", Module.ModuleName, Module.ImageName, Module.BaseOfImage ));
- LOG (( " Sym: type: %s, file: %s\n", ty, Module.LoadedImageName));
- }
- }
- dwFrameNum++;
- } while (stFrame.AddrReturn.Offset);
- SymCleanup (hProcess);
- return TRUE;
-}
-
-
-LONG Win32FaultHandler(struct _EXCEPTION_POINTERS * ExInfo)
-{
- char *FaultTx;
- int wsFault = ExInfo->ExceptionRecord->ExceptionCode;
- PVOID CodeAdress = ExInfo->ExceptionRecord->ExceptionAddress;
-#ifndef USE_GUI
- char choice[10];
-#endif
-
- if (//IsDebuggerPresent() ||
- ExInfo->ExceptionRecord->ExceptionCode == EXCEPTION_BREAKPOINT)
- return EXCEPTION_CONTINUE_SEARCH;
-
- switch(ExInfo->ExceptionRecord->ExceptionCode)
- {
- case EXCEPTION_ACCESS_VIOLATION : FaultTx = "ACCESS VIOLATION"; break;
- case EXCEPTION_DATATYPE_MISALIGNMENT : FaultTx = "DATATYPE MISALIGNMENT"; break;
- case EXCEPTION_FLT_DIVIDE_BY_ZERO : FaultTx = "FLT DIVIDE BY ZERO"; break;
- case EXCEPTION_ARRAY_BOUNDS_EXCEEDED : FaultTx = "ARRAY BOUNDS EXCEEDED"; break;
- case EXCEPTION_FLT_DENORMAL_OPERAND : FaultTx = "FLT DENORMAL OPERAND"; break;
- case EXCEPTION_FLT_INEXACT_RESULT : FaultTx = "FLT INEXACT RESULT"; break;
- case EXCEPTION_FLT_INVALID_OPERATION : FaultTx = "FLT INVALID OPERATION"; break;
- case EXCEPTION_FLT_OVERFLOW : FaultTx = "FLT OVERFLOW"; break;
- case EXCEPTION_FLT_STACK_CHECK : FaultTx = "FLT STACK CHECK"; break;
- case EXCEPTION_FLT_UNDERFLOW : FaultTx = "FLT UNDERFLOW"; break;
- case EXCEPTION_ILLEGAL_INSTRUCTION : FaultTx = "ILLEGAL INSTRUCTION"; break;
- case EXCEPTION_IN_PAGE_ERROR : FaultTx = "IN PAGE ERROR"; break;
- case EXCEPTION_INT_DIVIDE_BY_ZERO : FaultTx = "INT DEVIDE BY ZERO"; break;
- case EXCEPTION_INT_OVERFLOW : FaultTx = "INT OVERFLOW"; break;
- case EXCEPTION_INVALID_DISPOSITION : FaultTx = "INVALID DISPOSITION"; break;
- case EXCEPTION_NONCONTINUABLE_EXCEPTION:FaultTx= "NONCONTINUABLE EXCEPTION"; break;
- case EXCEPTION_PRIV_INSTRUCTION : FaultTx = "PRIVILEGED INSTRUCTION";break;
- case EXCEPTION_SINGLE_STEP : FaultTx = "SINGLE STEP"; break;
- case EXCEPTION_STACK_OVERFLOW : FaultTx = "STACK OVERFLOW"; break;
- case DBG_CONTROL_C : return EXCEPTION_EXECUTE_HANDLER;
- default : FaultTx = "(unknown)"; break;
- }
-
- LOG (("****************************************************\n"));
- LOG (("*** A Program Fault occurred: ***\n"));
- LOG (("*** Error code %08X: %-24s***\n", wsFault, FaultTx));
- LOG (("****************************************************\n"));
- LOG (("*** Address: %08X Flags: %08X ***\n", (int)CodeAdress, ExInfo->ExceptionRecord->ExceptionFlags));
- LOG (("*** EAX=%08X EBX=%08X ECX=%08X ***\n", ExInfo->ContextRecord->Eax, ExInfo->ContextRecord->Ebx, ExInfo->ContextRecord->Ecx));
- LOG (("*** EDX=%08X EBP=%08X ESI=%08X ***\n", ExInfo->ContextRecord->Edx, ExInfo->ContextRecord->Ebp, ExInfo->ContextRecord->Esi));
- LOG (("*** EDI=%08X ESP=%08X EIP=%08X ***\n", ExInfo->ContextRecord->Edi, ExInfo->ContextRecord->Esp, ExInfo->ContextRecord->Eip));
- LOG (("****************************************************\n"));
- CrashDumpMem (ExInfo->ContextRecord->Eax, "EAX", 8);
- CrashDumpMem (ExInfo->ContextRecord->Ebx, "EBX", 8);
- CrashDumpMem (ExInfo->ContextRecord->Ecx, "ECX", 8);
- CrashDumpMem (ExInfo->ContextRecord->Edx, "EDX", 8);
- CrashDumpMem (ExInfo->ContextRecord->Esi, "ESI", 8);
- CrashDumpMem (ExInfo->ContextRecord->Edi, "EDI", 8);
- CrashDumpMem (ExInfo->ContextRecord->Esp, "ESP", 32);
- CrashDumpMem (ExInfo->ContextRecord->Ebp, "EBP", 32);
- {
- OSVERSIONINFO ov={0};
-
- ov.dwOSVersionInfoSize=sizeof(ov);
- GetVersionEx (&ov);
- LOG (("Target platform: Microsoft Windows NT %d.%d Build %d %s\n", ov.dwMajorVersion, ov.dwMinorVersion,
- ov.dwBuildNumber, ov.szCSDVersion));
- }
-
- //LogStackFrames(CodeAddress, (char *)ExInfo->ContextRecord->Ebp);
- ShowThreadStack (GetCurrentThread(), ExInfo->ContextRecord);
-
-#ifdef USE_GUI
- if (MessageBox(NULL, "A Program Fault occurred. Do you want to continue execution (not recommended)?", "CRASH!", MB_ICONERROR | MB_YESNO) == IDYES)
-#else
- printf ("Do you want to continue program execution (not recommended) [y/N]? ");
- fgets(choice, sizeof(choice) - 1, stdin);
-
- if (*choice=='y' || *choice=='Y')
-#endif
- {
- ExInfo->ContextRecord->Eip++;
- return EXCEPTION_CONTINUE_EXECUTION;
- }
- return EXCEPTION_EXECUTE_HANDLER;
-}
-
-void Crash_Init(void)
-{
-//#ifndef _DEBUG
- SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER) Win32FaultHandler);
-//#endif
-}
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/crash.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/crash.h deleted file mode 100644 index 7f2d790f6c..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/crash.h +++ /dev/null @@ -1 +0,0 @@ -void Crash_Init(void);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2skypeapi.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2skypeapi.c deleted file mode 100644 index de0a9b4028..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2skypeapi.c +++ /dev/null @@ -1,1959 +0,0 @@ -/* Module: imo2skypeapi.c
- Purpose: Simple wrapper for imo.im Webservice to SKYPE API to maintain compatibility with Skype-Plugins
- Author: leecher
- Date: 30.08.2009
-*/
-
-#define VOICECALL_VERSION 1221873445
-#define IVC_VERSION "98a29c15e305a7af04634b03d5e1425d6c67806e"
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <time.h>
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <process.h>
-#include <direct.h>
-#include "w32browser.h"
-#define strcasecmp stricmp
-#define strncasecmp strnicmp
-#define thread_t HANDLE
-#define vsnprintf _vsnprintf
-#define GWL_PINST 0
-#define GWL_ORIGWPRC 1*sizeof(PVOID)
-#else
-#define thread_t pthread_t
-#include <unistd.h>
-#include <pthread.h>
-#endif
-#include "imo_skype.h"
-#include "imo_request.h"
-#include "fifo.h"
-#include "memlist.h"
-#include "buddylist.h"
-#include "avatarlist.h"
-#include "msgqueue.h"
-#include "callqueue.h"
-#include "imo2skypeapi.h"
-
-typedef struct
-{
- char *pszImoStat;
- char *pszSkypeStat;
-} STATMAP;
-
-struct _tagIMOSAPI
-{
- IMOSKYPE *hInst;
- NICKENTRY myUser;
- char *pszPass;
- char *pszLogBuf;
- char *pszClientName;
- int cbBuf;
- TYP_LIST *hBuddyList;
- TYP_LIST *hAvatarList;
- TYP_LIST *hMsgQueue;
- TYP_LIST *hCallQueue;
- int iProtocol;
- int iLoginStat;
- IMO2SCB Callback;
- void *pUser;
- FILE *fpLog;
- thread_t hThread;
- int bFriendsPending;
- int iFlags;
- int iShuttingDown;
- volatile time_t tSetMoodText;
- char *pszCmdID;
- char *pszBuddiesToAdd;
-};
-
-static STATMAP m_stMap[] =
-{
- {"available", "ONLINE"},
- {"available", "SKYPEME"},
- {"offline", "OFFLINE"},
- {"away", "AWAY"},
- {"busy", "DND"},
- {"busy", "NA"},
- {"invisible", "INVISIBLE"}
-};
-
-static int StartCallSWF (IMOSAPI *pInst, CALLENTRY *pCall);
-static int StatusCallback (cJSON *pMsg, void *pUser);
-static void DispatcherThread(void *pUser);
-static int Dispatcher_Start(IMOSAPI *pInst);
-static int Dispatcher_Stop(IMOSAPI *pInst);
-static void Send(IMOSAPI *pInst, const char *pszMsg, ...);
-static void HandleMessage(IMOSAPI *pInst, char *pszMsg);
-
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-IMOSAPI *Imo2S_Init(IMO2SCB Callback, void *pUser, int iFlags)
-{
- IMOSAPI *pInst = calloc(1, sizeof(IMOSAPI));
-
- if (!pInst) return NULL;
- if (!(pInst->pszLogBuf = malloc(pInst->cbBuf=512)) ||
- !(pInst->hInst = ImoSkype_Init(StatusCallback, pInst)) ||
- !(pInst->hBuddyList = BuddyList_Init()) ||
- !(pInst->hAvatarList = AvatarList_Init()) ||
- !(pInst->hMsgQueue = MsgQueue_Init()) ||
-#ifdef WIN32
- ((iFlags & IMO2S_FLAG_ALLOWINTERACT) && W32Browser_Init(0)==-1) ||
-#endif
- !(pInst->hCallQueue = CallQueue_Init()))
- {
- Imo2S_Exit(pInst);
- return NULL;
- }
- pInst->Callback = Callback;
- pInst->pUser = pUser;
- pInst->iFlags = iFlags;
- pInst->myUser.iBuddyStatus = 3;
- strcpy (pInst->myUser.szStatus, "OFFLINE");
- pInst->iProtocol = 3;
- return pInst;
-}
-
-// -----------------------------------------------------------------------------
-
-void Imo2S_SetLog (IMOSAPI *pInst, FILE *fpLog)
-{
- pInst->fpLog = fpLog;
-}
-
-// -----------------------------------------------------------------------------
-
-void Imo2S_Exit (IMOSAPI *pInst)
-{
- if (!pInst) return;
- pInst->iShuttingDown = 1;
- if (pInst->fpLog) fprintf (pInst->fpLog, "Imo2S_Exit()\n");
- if (pInst->iLoginStat == 1) Imo2S_Logout(pInst);
- if (pInst->hInst) ImoSkype_Exit(pInst->hInst);
- if (pInst->hBuddyList) BuddyList_Exit(pInst->hBuddyList);
- if (pInst->hAvatarList) AvatarList_Exit(pInst->hAvatarList);
- if (pInst->hMsgQueue) MsgQueue_Exit(pInst->hMsgQueue);
- if (pInst->hCallQueue) CallQueue_Exit(pInst->hCallQueue);
- if (pInst->pszPass) free (pInst->pszPass);
- if (pInst->pszLogBuf) free(pInst->pszLogBuf);
- if (pInst->pszClientName) free(pInst->pszClientName);
-#ifdef WIN32
- if (pInst->iFlags & IMO2S_FLAG_ALLOWINTERACT) W32Browser_Exit();
-#endif
- BuddyList_FreeEntry(&pInst->myUser, TRUE);
- memset (pInst, 0, sizeof(IMOSAPI));
- free (pInst);
-}
-
-// -----------------------------------------------------------------------------
-
-int Imo2S_Login (IMOSAPI *pInst, char *pszUser, char *pszPass, char **ppszError)
-{
- // In case this module is passing in the original values...
- char *pszLocalUser, *pszLocalPass;
-
- if (pInst->fpLog) fprintf (pInst->fpLog, "Imo2S_Login(%s, ****)\n", pszUser);
- if (pInst->iLoginStat == 1) return pInst->iLoginStat;
- if (!pInst->hInst) pInst->hInst=ImoSkype_Init(StatusCallback, pInst);
- pszLocalUser = strdup(pszUser);
- if (pInst->myUser.pszUser) free (pInst->myUser.pszUser);
- pInst->myUser.pszUser = pszLocalUser;
- pszLocalPass = strdup(pszPass);
- if (pInst->pszPass) free (pInst->pszPass);
- pInst->pszPass = pszLocalPass;
- Send(pInst, "CONNSTATUS CONNECTING");
- pInst->iLoginStat = ImoSkype_Login(pInst->hInst, pszLocalUser, pszLocalPass);
- if (pInst->iLoginStat == 1)
- {
- ImoSkype_GetUnreadMsgs(pInst->hInst);
- if (IMO_API_VERSION > 0) ImoSkype_GetAlpha(pInst->hInst);
- Dispatcher_Start(pInst);
- }
- else
- if (ppszError) *ppszError = ImoSkype_GetLastError(pInst->hInst);
- return pInst->iLoginStat;
-}
-
-// -----------------------------------------------------------------------------
-
-void Imo2S_Logout(IMOSAPI *pInst)
-{
- if (pInst->fpLog) fprintf (pInst->fpLog, "Imo2S_Logout()\n");
- Dispatcher_Stop(pInst);
- if (ImoSkype_Logout(pInst->hInst) == 1)
- {
- pInst->iLoginStat = 0;
- strcpy (pInst->myUser.szStatus, "OFFLINE");
- }
-
-
- // If we relogin, user information won't be re-propagated if we
- // reuse the same connection. Therefore also dispose the connection
- // to imo.im service (wouldn't be necessary, but to ensure proper
- // repropagation of contacts on login, we have to do it, sorry)
- if (!pInst->iShuttingDown)
- {
- ImoSkype_Exit(pInst->hInst);
- pInst->hInst = NULL;
- }
-}
-
-// -----------------------------------------------------------------------------
-
-int Imo2S_Send (IMOSAPI *pInst, char *pszMsg)
-{
- char *pszDup = strdup(pszMsg);
- char *pszRealMsg = pszMsg;
-
- if (*pszRealMsg=='#')
- {
- char *p;
- if (p = strchr (pszRealMsg, ' ')) pszRealMsg=p+1;
- }
- if (pInst->fpLog) fprintf (pInst->fpLog, "Imo2S_Send(%s)\n", pszMsg);
- if (strlen(pszRealMsg)>15 && strncasecmp (pszRealMsg, "SET ", 4)== 0 &&
- (strncasecmp (pszRealMsg+4, "USERSTATUS", 10)==0 ||
- strncasecmp (pszRealMsg+4, "CONNSTATUS", 10)==0))
- {
-// if (pInst->fpLog) fprintf (pInst->fpLog, "Imo2S_Send: iLoginStat = %d\n",
-// pInst->iLoginStat);
- if (pInst->iLoginStat == 0)
- {
- if (pInst->myUser.pszUser && pInst->pszPass && strncasecmp (pszRealMsg+15, "OFFLINE", 7))
- {
- Imo2S_Login(pInst, pInst->myUser.pszUser, pInst->pszPass, NULL);
- }
- }
- else
- {
- HandleMessage (pInst, pszDup);
- if (strncasecmp (pszRealMsg+15, "OFFLINE", 7) == 0)
- Imo2S_Logout(pInst);
- free (pszDup);
- return 0;
- }
- }
- if (pInst->iLoginStat != 1) return -1;
- HandleMessage(pInst, pszDup);
- free (pszDup);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-// Static
-// -----------------------------------------------------------------------------
-
-
-static int StatusCallback (cJSON *pMsg, void *pUser)
-{
- char *pszName;
- BOOL bAdded;
- cJSON *pContent, *pProto;
- IMOSAPI *pInst = (IMOSAPI*)pUser;
- int m, iSize = cJSON_GetArraySize(pMsg);
-
- if (pInst->fpLog)
- {
- char *pszMsg = cJSON_Print(pMsg);
- fprintf (pInst->fpLog, "Imo2S::StatusCallback():%s\n", pszMsg);
- free(pszMsg);
- }
-
- for (m=0; m<iSize; m++)
- {
- pContent = cJSON_GetArrayItem(pMsg, m);
- if (!pContent) return 0;
- pszName = cJSON_GetObjectItem(pContent,"name")->valuestring;
-
- if ((pProto = cJSON_GetObjectItem(pContent,"proto")) && strcasecmp (pProto->valuestring, "prpl-skype"))
- continue;
-
- if (!strcmp(pszName, "recv_im"))
- {
- // I got a message!
- cJSON *pEdata = cJSON_GetObjectItem(pContent,"edata");
-
- if (pEdata)
- {
- MSGENTRY *pMsg;
-
- // imo.im sometimes seems to send information about messages you sent yourself.
- // We have to ignore them.
- if (strcmp(cJSON_GetObjectItem(pEdata, "buid")->valuestring, pInst->myUser.pszUser) &&
- (pMsg = MsgQueue_Insert(pInst->hMsgQueue, pEdata)))
- {
- if (pInst->iFlags & IMO2S_FLAG_CURRTIMESTAMP) time(&pMsg->timestamp);
- Send(pInst, "%sMESSAGE %d STATUS %s", pInst->iProtocol>=3?"CHAT":"",
- pMsg->hdr.uMsgNr, pMsg->szStatus);
- }
- }
- }
- else if (!strcmp(pszName, "signed_on"))
- {
- // I just signed on.
- cJSON *pEdata = cJSON_GetObjectItem(pContent,"edata");
- char *pszAlias;
-
- Send(pInst, "CONNSTATUS ONLINE");
- if (strcmp(pInst->myUser.szStatus, "OFFLINE")==0)
- strcpy (pInst->myUser.szStatus, "ONLINE");
- Send(pInst, "USERSTATUS %s", pInst->myUser.szStatus);
- if (pEdata && (pszAlias = cJSON_GetObjectItem(pEdata, "alias")->valuestring))
- {
- pInst->myUser.pszAlias = strdup(pszAlias);
- }
- Send(pInst, "CURRENTUSERHANDLE %s", cJSON_GetObjectItem(pContent, "uid")->valuestring);
- }
- else if (!strcmp(pszName, "buddy_icon"))
- {
- // Here are the Avatars for the buddies
- //We have to track them in a seperate list as the buddies may get populated lateron
- cJSON *pArray = cJSON_GetObjectItem(pContent,"edata"), *pItem;
- int i, iCount;
-
- if (pArray)
- {
- for (i=0, iCount = cJSON_GetArraySize(pArray); i<iCount; i++)
- {
- if (pItem = cJSON_GetArrayItem(pArray, i))
- AvatarList_Insert(pInst->hAvatarList, pItem);
- }
- }
- }
- else if (!strcmp(pszName, "disconnect"))
- {
- // I got disconnected (wrong user/pass?)
- cJSON *pEdata = cJSON_GetObjectItem(pContent,"edata");
- //char *pszMsg;
-
- Send(pInst, "CONNSTATUS OFFLINE");
- Send(pInst, "USERSTATUS OFFLINE");
- strcpy (pInst->myUser.szStatus, "OFFLINE");
- /*
- if (pEdata && (pszMsg = cJSON_GetObjectItem(pEdata, "msg")->valuestring))
- {
- if (strcmp(pszMsg, "uidpassword")==0)
- {
- fprintf (stderr, "Invalid username / password combination!\n");
- }
- }
- */
- }
- else if ((bAdded = !strcmp(pszName, "buddy_added")) || !strcmp(pszName, "buddy_status"))
- {
- // Here comes the contact list
- cJSON *pArray = cJSON_GetObjectItem(pContent,"edata"), *pItem;
- char *pszLastBUID = NULL, *pszLastGroup = NULL;
- int i, iCount;
-
- if (pArray)
- {
- TYP_LIST *hListMemToAdd = NULL;
-
- for (i=0, iCount = cJSON_GetArraySize(pArray); i<iCount; i++)
- {
- if (pItem = cJSON_GetArrayItem(pArray, i))
- {
- char szQuery[256];
- char *pszBUID = cJSON_GetObjectItem(pItem, "buid")->valuestring;
- cJSON *pGroup = cJSON_GetObjectItem(pItem, "group");
- cJSON *pDisplay = cJSON_GetObjectItem(pItem, "display");
-
- if (bAdded)
- {
- /*
- if (BuddyList_Find (pInst->hBuddyList, cJSON_GetObjectItem(pItem, "buid")->valuestring))
- bAdded=FALSE;
- else
- */
- BuddyList_Insert(pInst->hBuddyList, pItem);
- }
- else BuddyList_SetStatus(pInst->hBuddyList, pItem);
-
- if ((!pGroup || strcmp(pGroup->valuestring, "Skype")==0 ||
- strcmp(pGroup->valuestring, "Offline")==0) &&
- !pDisplay)
- {
- // Normal user, not groupchat, so output this
- sprintf (szQuery, "GET USER %s ONLINESTATUS", pszBUID);
- HandleMessage (pInst, szQuery);
- sprintf (szQuery, "GET USER %s MOOD_TEXT", pszBUID);
- HandleMessage (pInst, szQuery);
- }
- else
- {
- // Groupchat created/added
- MSGENTRY * pMsgEntry = NULL;
-
- if (bAdded && pInst->pszBuddiesToAdd)
- {
- // Process pending ADDs
- char *pTok, szQuery[256];
-
- for (pTok = strtok(pInst->pszBuddiesToAdd, ", "); pTok; pTok=strtok(NULL, ", "))
- ImoSkype_GroupInvite(pInst->hInst, pszBUID, pTok);
- free (pInst->pszBuddiesToAdd);
- pInst->pszBuddiesToAdd = NULL;
- sprintf (szQuery, "GET CHAT %s STATUS", pszBUID);
- HandleMessage (pInst, szQuery);
- }
- else
- {
- if (bAdded || !pDisplay)
- {
- char szQuery[256], szGroup[256]={0};
- NICKENTRY *pChat;
-
- if (pGroup) sprintf (szGroup, "%s;", pGroup->valuestring);
- if (pGroup && (pChat=BuddyList_Find(pInst->hBuddyList, szGroup)) &&
- pChat->hGCMembers)
- {
- sprintf (szQuery, "GET CHAT %s MEMBERS", szGroup);
- HandleMessage (pInst, szQuery);
- }
- else
- {
- if ((bAdded || !pChat) && (!pszLastBUID || strcmp(pszLastBUID, pszBUID)) &&
- (!pszLastGroup || (pGroup && strcmp(pszLastGroup, pGroup->valuestring))))
- {
- if (!hListMemToAdd) hListMemToAdd=List_Init(0);
- List_Push(hListMemToAdd, pItem);
- pszLastBUID = pszBUID;
- if (pGroup) pszLastGroup = pGroup->valuestring;
- }
- }
- }
- /*
- else
- {
- pMsgEntry = MsgQueue_AddEvent (pInst->hMsgQueue, pszBUID, "SETTOPIC");
- if (pDisplay->valuestring) pMsgEntry->pszMessage = strdup(pDisplay->valuestring);
- }
- */
- if (pMsgEntry)
- Send(pInst, "%sMESSAGE %d STATUS %s", pInst->iProtocol>=3?"CHAT":"",
- pMsgEntry->hdr.uMsgNr, pMsgEntry->szStatus);
-
- }
- }
- }
- }
- if (hListMemToAdd)
- {
- int nCount;
-
- for (i=0, nCount=List_Count(hListMemToAdd); i<nCount; i++)
- {
- cJSON *pItem = List_ElementAt(hListMemToAdd, i);
- cJSON *pInviter = cJSON_GetObjectItem(pItem, "inviter");
- MSGENTRY *pMsgEntry;
-
- if (pMsgEntry = MsgQueue_AddEvent (pInst->hMsgQueue, cJSON_GetObjectItem(pItem, "buid")->valuestring, "ADDEDMEMBERS")) // MULTI_SUBSCRIBED
- {
- if (pInviter) pMsgEntry->pszAuthor = strdup(pInviter->valuestring);
- Send(pInst, "%sMESSAGE %d STATUS %s", pInst->iProtocol>=3?"CHAT":"",
- pMsgEntry->hdr.uMsgNr, pMsgEntry->szStatus);
- }
- }
-
- List_Exit(hListMemToAdd);
- hListMemToAdd = NULL;
- }
- if (bAdded && pInst->bFriendsPending)
- {
- char szMsg[]="SEARCH FRIENDS";
- pInst->bFriendsPending = 0;
- HandleMessage (pInst, szMsg);
- }
- }
- }
- else if (!strcmp(pszName, "buddy_removed"))
- {
- // Here comes the contact list
- cJSON *pArray = cJSON_GetObjectItem(pContent,"edata"), *pItem;
- int i, iCount;
-
- if (pArray)
- {
- for (i=0, iCount = cJSON_GetArraySize(pArray); i<iCount; i++)
- {
- char *pszUser;
- cJSON *pBuid;
-
- if (iCount==1) pItem=pArray; else pItem = cJSON_GetArrayItem(pArray, i);
- if (pItem && (pBuid = cJSON_GetObjectItem(pItem, "buid")) &&
- (pszUser = pBuid->valuestring))
- {
- NICKENTRY *pNick = BuddyList_Find (pInst->hBuddyList, pszUser);
-
- if (pNick && pNick->pGroup)
- {
- MSGENTRY *pMsg = MsgQueue_AddEvent (pInst->hMsgQueue, pszUser, "KICKED");
- cJSON *pUid = cJSON_GetObjectItem(pContent,"uid");
- if (pUid) pMsg->pszAuthor = strdup(pUid->valuestring);
- Send(pInst, "%sMESSAGE %d STATUS %s", pInst->iProtocol>=3?"CHAT":"",
- pMsg->hdr.uMsgNr, pMsg->szStatus);
- }
- else
- Send (pInst, "USER %s BUDDYSTATUS 1", pszUser);
- if (pNick)
- BuddyList_Remove (pInst->hBuddyList, pNick);
- }
- }
- }
- }
- else
- if (/*!strcmp(pszName, "recv") || */!strcmp(pszName, "streams_info"))
- {
- cJSON *pEdata = cJSON_GetObjectItem(pContent,"edata"),
- *pType = cJSON_GetObjectItem(pContent,"type"), *pVal;
-
- if (pType && pEdata)
- {
- if (strcasecmp(pType->valuestring, "call")==0 || strcasecmp(pType->valuestring, "video")==0 ||
- strcasecmp(pType->valuestring, "av")==0)
- {
- // Rring, rrring...
- int iDirection = ((pVal = cJSON_GetObjectItem(pEdata, "is_initiator")) && pVal->type == cJSON_True)?CALL_OUTGOING:CALL_INCOMING;
- CALLENTRY *pCall = CallQueue_Insert (pInst->hCallQueue, pEdata, iDirection);
- if (pCall)
- {
- Send (pInst, "CALL %d STATUS %s", pCall->hdr.uMsgNr, pCall->szStatus);
- if ((pInst->iFlags & IMO2S_FLAG_ALLOWINTERACT) && iDirection == CALL_OUTGOING)
- StartCallSWF (pInst, pCall);
- }
- }
- }
- }
- else
- if (!strcmp(pszName, "ended"))
- {
- cJSON *pEdata = cJSON_GetObjectItem(pContent,"edata"),
- *pType = cJSON_GetObjectItem(pContent,"type");
-
- if (pType && pEdata)
- {
- if (strcasecmp(pType->valuestring, "call")==0 || strcasecmp(pType->valuestring, "video")==0)
- {
- // No call ID, so just hangup all calls to this user
- int i, nCount = List_Count(pInst->hCallQueue);
- char *pszUser = cJSON_GetObjectItem(pEdata, "buid")->valuestring;
-
- for (i=0; i<nCount; i++)
- {
- CALLENTRY *pCall = (CALLENTRY*)List_ElementAt(pInst->hCallQueue, i);
-
- if (!strcmp(pCall->pszUser, pszUser) && strcmp (pCall->szStatus, "FINISHED"))
- {
- char szQuery[256];
-
- sprintf (szQuery, "SET CALL %d STATUS FINISHED", pCall->hdr.uMsgNr);
- HandleMessage (pInst, szQuery);
- }
- }
- }
- }
- }
- else
- if (!strcmp(pszName, "reflect")) // Status reflections. We may want to support more of them in the future
- {
- cJSON *pEdata = cJSON_GetObjectItem(pContent,"edata"),
- *pType = cJSON_GetObjectItem(pContent,"type"), *pRname, *pValue;
-
- if (pEdata && pType && (pRname = cJSON_GetObjectItem(pEdata,"r_name")))
- {
- if (strcasecmp(pType->valuestring, "account") == 0)
- {
- if (strcasecmp (pRname->valuestring, "set_status") == 0 &&
- (pValue = cJSON_GetObjectItem(pEdata,"primitive")) )
- {
- unsigned int i;
-
- for (i=0; i<sizeof(m_stMap)/sizeof(m_stMap[0]); i++)
- {
- if (!strcasecmp(m_stMap[i].pszImoStat, pValue->valuestring))
- {
- strcpy (pInst->myUser.szStatus, m_stMap[i].pszSkypeStat);
- Send (pInst, "USERSTATUS %s", pInst->myUser.szStatus);
- break;
- }
- }
-
- // Just ensure that on autoaway we notify imo.im that we are still there
- if (!strcmp (pValue->valuestring, "away"))
- ImoSkype_KeepAlive(pInst->hInst);
-
- if (pValue = cJSON_GetObjectItem(pEdata,"status"))
- {
- if (pInst->myUser.pszStatusText) free (pInst->myUser.pszStatusText);
- pInst->myUser.pszStatusText = NULL;
- if (*pValue->valuestring)
- pInst->myUser.pszStatusText = strdup(pValue->valuestring);
- }
-
- }
- }
- else
- if (strcasecmp(pType->valuestring, "conv") == 0)
- {
- if (strcasecmp (pRname->valuestring, "send_im") == 0)
- {
- MSGENTRY *pMsg;
-
- if (pMsg = MsgQueue_AddReflect(pInst->hMsgQueue, pEdata, pInst->hBuddyList))
- {
- if (pInst->iFlags & IMO2S_FLAG_CURRTIMESTAMP) time(&pMsg->timestamp);
- Send(pInst, "%sMESSAGE %d STATUS %s", pInst->iProtocol>=3?"CHAT":"",
- pMsg->hdr.uMsgNr, pMsg->szStatus);
- }
- }
-
- }
- }
- }
- else
- if (!strcmp(pszName, "expired") && m>=iSize-1)
- {
- // Session expired, so we have to reconnect
- Send(pInst, "CONNSTATUS OFFLINE");
- Send(pInst, "USERSTATUS OFFLINE");
- strcpy (pInst->myUser.szStatus, "OFFLINE");
- pInst->iLoginStat = 0;
- Dispatcher_Stop(pInst);
- if (pInst->myUser.pszUser && pInst->pszPass)
- Imo2S_Login(pInst, pInst->myUser.pszUser, pInst->pszPass, NULL);
- }
- else
- if (!strcmp(pszName, "ack"))
- {
- MSGENTRY *pMsg;
- cJSON *pRqId = cJSON_GetObjectItem(pContent,"request_id");
-
- if (pRqId && (pMsg = MsgQueue_FindByRqId(pInst->hMsgQueue, pRqId->valueint)))
- {
- cJSON *pResp, *pTS;
-
- strcpy (pMsg->szStatus, "SENT");
- if ((pResp = cJSON_GetObjectItem(pContent,"response")) &&
- (pTS = cJSON_GetObjectItem(pResp,"timestamp")))
- pMsg->timestamp = pTS->valueint;
- Send (pInst, "MESSAGE %d STATUS %s", pMsg->hdr.uMsgNr, pMsg->szStatus);
- }
- }
- else
- {
- char *pszMsg = cJSON_Print(pMsg);
- fprintf (stderr, "%s\n\n", pszMsg);
- free (pszMsg);
- }
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-#ifdef WIN32
-// Set call status to finished when closing phone applet window just in case
-// there is no callback by imo.im upon closure
-static LRESULT CallWndFilter(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- switch (message)
- {
- case WM_DESTROY:
- {
- IMOSAPI *pInst = (IMOSAPI*)GetWindowLong (hWnd, GWL_PINST);
- int i, nCount;
-
- if (!pInst) break;
- for (i=0, nCount = List_Count(pInst->hCallQueue); i<nCount; i++)
- {
- CALLENTRY *pCall = (CALLENTRY*)List_ElementAt(pInst->hCallQueue, i);
-
- if (pCall->hCallWnd == hWnd)
- {
- char szQuery[256];
-
- sprintf (szQuery, "SET CALL %d STATUS FINISHED", pCall->hdr.uMsgNr);
- HandleMessage (pInst, szQuery);
- break;
- }
- }
- break;
- }
- }
- return CallWindowProc((WNDPROC)GetWindowLong (hWnd, GWL_ORIGWPRC), hWnd, message, wParam, lParam);
-}
-#endif
-
-
-// -----------------------------------------------------------------------------
-
-static int StartCallSWF (IMOSAPI *pInst, CALLENTRY *pCall)
-{
- char szSWF[256], szFlashVars[1024], szID[18];
- char szHTML[2048];
- static unsigned int id=100;
-
-
- /* The flash plugin basically opens rtmp://[host]/mchat in case of type=imo, otherwise rtmp://[host]/ivc
- Maybe this can also be used with a SIP-phone or Asterisk?
- */
-#ifndef WIN32
- FILE *fpTemp;
- int iFound;
-
- sprintf (pCall->szCallFile, "xdg-open %s.html", tmpnam(NULL));
- if (!(fpTemp=fopen(pCall->szCallFile, "w"))) return -1;
-#else
- // Windows:
- // Ensure that we are allowed to load the .swf from imo.im
-#ifndef CSIDL_APPDATA
-#define CSIDL_APPDATA 0x001a
-#endif
- static BOOL bInit = TRUE;
-
- if (bInit)
- {
- char szPath[MAX_PATH]={0};
- HMODULE hModule;
- typedef HMODULE (__stdcall *SHGETFOLDERPATH)(HWND, int, HANDLE, DWORD, LPTSTR);
-
- if (hModule = LoadLibrary("SHFOLDER.DLL"))
- {
- SHGETFOLDERPATH fnShGetFolderPath = (SHGETFOLDERPATH)GetProcAddress(hModule, "SHGetFolderPathA");
-
- if (fnShGetFolderPath && fnShGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, szPath)==S_OK)
- {
- strcat (szPath, "\\Macromedia\\Flash Player");
- if (GetFileAttributes (szPath) != 0xFFFFFFFF)
- {
- strcat (szPath, "\\#Security");
- _mkdir (szPath);
- strcat (szPath, "\\FlashPlayerTrust");
- _mkdir (szPath);
- strcat (szPath, "\\imo2sproxy.cfg");
- if (GetFileAttributes (szPath) == 0xFFFFFFFF)
- {
- FILE *fp = fopen (szPath, "w");
-
- if (fp)
- {
- fputs ("https://imo.im/images/nchat.swf\nabout:blank\n", fp);
- fclose (fp);
- }
- }
- }
- }
- FreeLibrary(hModule);
- }
- bInit = FALSE;
- }
-#endif
- sprintf (szSWF, "https://imo.im/images/nchat.swf?%s", IVC_VERSION);
- ImoRq_CreateID (szID, 16);
- //sprintf (szID, "imo%d", id++);
-
- if (*pCall->szSendStream)
- sprintf (szFlashVars,
- "type=skype&"
- "send_stream=%s&"
- "recv_stream=%s&"
- "id=skype#%s&"
- "host=video0.imo.im&"
- "debug=conv net&"
- "buddy_icon=https://imo.im/assets/main/icn_default.png&"
- "setCookie=setCookie&"
- "getCookie=getCookie&"
- "removeCookie=removeCookie&"
- "log=log&"
- "init_callback=init_callback&"
- "video_options_changed_cb=video_options_changed_cb&"
- "options_changed_cb=options_changed_cb&"
- "mic_changed_cb=mic_changed_cb&"
- "cam_changed_cb=cam_changed_cb&"
- "connection_status_cb=connection_status_cb",
- pCall->szSendStream, pCall->szRecvStream, pCall->szSendStream);
- else
- return -1;
- // sprintf (szFlashVars, "type=imo&conv=%s&role=%d&host=%s&id=%s", pCall->szConv, pCall->iRole, pCall->szIP, szID);
-
- strcat (szFlashVars, "&audio_only=true");
- // Currently not supported
- sprintf (szHTML, "<html>\n"
- "<head><script language='javascript'>\n"
- "function log(t, s) { document.all.log.innerHTML+=s+'<br>'; }\n"
- "function setCookie (N, L, M) { alert ('setcookie av_chat_'+L+' = '+M); }\n"
- "function getCookie (M, L) { alert ('getcookie av_chat_'+L); }\n"
- "function removeCookie (M, L) { alert ('removecookie av_chat_'+L); }\n"
- "function init_callback(L) { }\n"
- "function video_options_changed_cb(v, t, s) { }\n"
- "function options_changed_cb(v, t, s) { }\n"
- "function mic_changed_cb(u, s) { }\n"
- "function cam_changed_cb(u, t) { }\n"
- "function connection_status_cb (u, s) { }\n"
- "</script></head>"
- "<body>\n"
- "<object width=\"400\" height=\"208\" type=\"application/x-shockwave-flash\" data=\"%s\" id=\"flash_widget_%s\" "
- "style=\"visibility: visible; width: 400px; height: 208px;\">\n"
- "<param name=\"movie\" value=\"%s\">\n"
- "<param name=\"allowscriptaccess\" value=\"always\">\n"
- "<param name=\"bgcolor\" value=\"#ffffff\">"
- "<param name=\"flashvars\" value=\"%s\">\n"
- "</object><br><div id=\"log\"></div>\n"
- "</body></html>\n",
- szSWF, szID, szSWF, szFlashVars);
-
-#ifdef WIN32
- //OutputDebugString (szHTML);
- sprintf (szSWF, "Voicechat with %s", pCall->pszUser);
-
- /*
-
- {
- FILE *fpOut = fopen("C:\\TEMP\\CALL.HTML", "w");
-
- fputs (szHTML, fpOut);
- fclose (fpOut);
- system ("\"C:\\Programme\\Internet Explorer\\IEXPLORE.EXE\" C:\\TEMP\\CALL.HTML");
- }
- */
-
- if ((pCall->hCallWnd = W32Browser_ShowHTMLStr (szHTML,420, 280, szSWF))>0)
- {
- // Hook WndProc to handle WM_DESTROY so that we generate a CALL %d STATUS FINISHED on
- // closing the chat window
-#ifdef _WIN64
- SetWindowLongPtr ((HWND)pCall->hCallWnd, GWL_PINST, (LONG_PTR)pInst);
- SetWindowLongPtr ((HWND)pCall->hCallWnd, GWL_ORIGWPRC,
- GetWindowLongPtr ((HWND)pCall->hCallWnd, GWLP_WNDPROC));
- SetWindowLongPtr ((HWND)pCall->hCallWnd, GWLP_WNDPROC, (LONG_PTR)CallWndFilter);
-#else
- SetWindowLong ((HWND)pCall->hCallWnd, GWL_PINST, (LONG)pInst);
- SetWindowLong ((HWND)pCall->hCallWnd, GWL_ORIGWPRC, GetWindowLong ((HWND)pCall->hCallWnd, GWL_WNDPROC));
- SetWindowLong((HWND)pCall->hCallWnd, GWL_WNDPROC, (LONG)CallWndFilter);
-#endif
- return 0;
- }
- return -1;
-#else
- fprintf (fpTemp, "%s", szHTML);
- fclose (fpTemp);
- iFound = system(pCall->szCallFile);
- return (iFound == -1 || iFound == 127)?-1:0;
-#endif
-}
-
-// -----------------------------------------------------------------------------
-
-static void DispatcherThread(void *pUser)
-{
- IMOSAPI *pInst = (IMOSAPI*)pUser;
- time_t t = 0, tcur;
-
- if (pInst->fpLog) fprintf (pInst->fpLog, "Imo2S::DispatcherThread() start\n");
- while (!pInst->iShuttingDown)
- {
-#if defined(WIN32) && defined(WIN32)
- char szBuf[128];
-
- sprintf (szBuf, "DispatcherThread %d loops.\n", GetCurrentThreadId());
- OutputDebugString (szBuf);
-#endif
- if (time(&tcur)>=t+300)
- {
- t=tcur;
- //ImoSkype_Ping (pInst->hInst);
- ImoSkype_KeepAlive(pInst->hInst);
- }
-
- // Set status in case this is needed
- if (pInst->tSetMoodText && tcur>=pInst->tSetMoodText)
- {
- int i;
-
- pInst->tSetMoodText = 0;
- for (i=0; i<sizeof(m_stMap)/sizeof(m_stMap[0]); i++)
- {
- if (!strcasecmp(m_stMap[i].pszSkypeStat, pInst->myUser.szStatus))
- {
- ImoSkype_SetStatus(pInst->hInst, m_stMap[i].pszImoStat,
- pInst->myUser.pszStatusText?pInst->myUser.pszStatusText:"");
- break;
- }
- }
- }
- ImoSkype_Poll(pInst->hInst);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-#ifdef WIN32
-static int Dispatcher_Start(IMOSAPI *pInst)
-{
- DWORD ThreadID;
-
- if (pInst->fpLog) fprintf (pInst->fpLog, "Imo2S::Dispatcher_Start()\n");
- return (pInst->hThread=(thread_t)_beginthreadex(NULL, 0,
- (unsigned(__stdcall *)(void*))DispatcherThread, pInst, 0, &ThreadID))!=0;
-
-}
-
-static int Dispatcher_Stop(IMOSAPI *pInst)
-{
- int iRet, iOldShutdown;
-
- if (pInst->fpLog)
- {
- fprintf (pInst->fpLog, "Imo2S::Dispatcher_Stop()\n");
- fflush(pInst->fpLog);
- }
-
- // Shutdown polling socket and wait some time if thread terminates
- // gracefully, otherwise kill it
- iOldShutdown = pInst->iShuttingDown;
- pInst->iShuttingDown = 1;
- ImoSkype_CancelPolling (pInst->hInst);
- if (WaitForSingleObject (pInst->hThread, 2000) == WAIT_TIMEOUT)
- iRet = TerminateThread (pInst->hThread, 0);
- else iRet = 1;
- pInst->iShuttingDown = iOldShutdown;
-
- if (iRet)
- {
- CloseHandle (pInst->hThread);
- pInst->hThread = 0;
- }
-
- if (pInst->fpLog)
- {
- fprintf (pInst->fpLog, "Imo2S::Dispatcher_Stop() done.\n");
- pInst->fpLog = NULL;
- }
-
- return iRet;
-}
-
-#else
-static int Dispatcher_Start(IMOSAPI *pInst)
-{
- if (pInst->fpLog) fprintf (pInst->fpLog, "Imo2S::Dispatcher_Start()\n");
- return pthread_create(&pInst->hThread, NULL, DispatcherThread, pInst)==0;
-}
-
-static int Dispatcher_Stop(IMOSAPI *pInst)
-{
- if (pInst->fpLog) fprintf (pInst->fpLog, "Imo2S::Dispatcher_Stop()\n");
- if (pthread_cancel(pInst->hThread))
- {
- pInst->hThread=0;
- return 1;
- }
- return 0;
-}
-#endif
-
-// -----------------------------------------------------------------------------
-
-static void Send(IMOSAPI *pInst, const char *pszMsg, ...)
-{
- va_list ap;
- int iLen, iLenCmdID;
- char *pszLogBuf = pInst->pszLogBuf;
- int cbBuf = pInst->cbBuf;
-
- iLenCmdID = pInst->pszCmdID?strlen(pInst->pszCmdID)+1:0;
- do
- {
- cbBuf = pInst->cbBuf - iLenCmdID;
- pszLogBuf = pInst->pszLogBuf + iLenCmdID;
- va_start(ap, pszMsg);
- iLen = vsnprintf (pszLogBuf, cbBuf, pszMsg, ap);
- va_end(ap);
-#ifndef WIN32
- if (iLen>=cbBuf) iLen=-1;
-#endif
- if (iLen == -1)
- {
- char *pNewBuf;
-
- if (!(pNewBuf = realloc(pInst->pszLogBuf, pInst->cbBuf*2)))
- {
- break;
- }
- pInst->cbBuf*=2;
- pInst->pszLogBuf = pNewBuf;
- }
- } while (iLen == -1);
- if (pInst->pszCmdID && iLenCmdID>1)
- {
- memcpy (pInst->pszLogBuf, pInst->pszCmdID, iLenCmdID);
- pInst->pszLogBuf[iLenCmdID-1]=' ';
- }
-
-//printf ("%s\n", szBuf);
- pInst->Callback(pInst->pszLogBuf, pInst->pUser);
-}
-
-// -----------------------------------------------------------------------------
-
-static void HandleMessage(IMOSAPI *pInst, char *pszMsg)
-{
- char *pszCmd=strtok(pszMsg, " ");
-
- if (!pInst || !pszCmd || !pInst->hInst) return;
- if (*pszCmd=='#')
- {
- // This is a PROTOCOL 4 feature, but we will support it just in case...
- pInst->pszCmdID = pszCmd;
- if (!(pszCmd=strtok(NULL, " ")))
- {
- pInst->pszCmdID = NULL;
- return;
- }
- }
- else pInst->pszCmdID = NULL;
-
- if (strcasecmp(pszCmd, "PROTOCOL") == 0)
- {
- if (pszCmd = strtok(NULL, " "))
- {
- pInst->iProtocol = atoi(pszCmd);
- if (pInst->iProtocol>3) pInst->iProtocol=3;
- }
-
- Send (pInst, "PROTOCOL %d", pInst->iProtocol);
- return;
- }
- else
- if (strcasecmp(pszCmd, "PING") == 0)
- {
- Send (pInst, "PONG");
- return;
- }
- else
- if (strcasecmp(pszCmd, "SEARCH") == 0)
- {
- TYP_FIFO *hFifo;
-
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 2 Invalid command");
- return;
- }
-
- if (strcasecmp(pszCmd, "FRIENDS") == 0)
- {
- unsigned int nCount =List_Count(pInst->hBuddyList);
-
- if (!nCount)
- {
- pInst->bFriendsPending = 1;
- return;
- }
- if(hFifo=Fifo_Init(512))
- {
- unsigned int i;
- char *pszUsers;
-
- for (i=0; i<nCount; i++)
- {
- NICKENTRY *pEntry = List_ElementAt(pInst->hBuddyList, i);
- if (!pEntry->pGroup && !pEntry->hGCMembers)
- {
- if (i>0) Fifo_AddString (hFifo, ", ");
- Fifo_AddString (hFifo, pEntry->pszUser);
- }
- }
- if (pszUsers = Fifo_Get(hFifo, NULL))
- Send (pInst, "USERS %s", pszUsers);
- else
- pInst->bFriendsPending = 1;
- Fifo_Exit(hFifo);
- }
- }
- else if (strcasecmp(pszCmd, "MISSEDMESSAGES") == 0)
- {
- unsigned int nCount=List_Count(pInst->hMsgQueue);
-
- if(nCount && (hFifo=Fifo_Init(512)))
- {
- unsigned int i, j=0;
-
- for (i=0; i<nCount; i++)
- {
- MSGENTRY *pEntry = List_ElementAt(pInst->hMsgQueue, i);
- char szNr[32];
-
- if (!strcmp(pEntry->szStatus, "RECEIVED"))
- {
- if (j>0) Fifo_AddString (hFifo, ", ");
- sprintf (szNr, "%d", pEntry->hdr.uMsgNr);
- Fifo_AddString (hFifo, szNr);
- j++;
- }
- }
- Send (pInst, "MESSAGES %s", Fifo_Get(hFifo, NULL));
- Fifo_Exit(hFifo);
- }
- }
- else if (strcasecmp(pszCmd, "USERS") == 0)
- {
- // There is no possibility to search Skype users in imo.im
- // therefore just return that the user exists even if it doesn't :(
- Send (pInst, "USERS %s", pszCmd+6);
- // We add the user as a temporary contact to our list so that the
- // client can get the empty properties and set the buddystatus.
- BuddyList_AddTemporaryUser (pInst->hBuddyList, pszCmd+6);
- }
- else if (strcasecmp(pszCmd, "USERSWAITINGMYAUTHORIZATION") == 0)
- {
- Send (pInst, "USERS");
- }
- else if (strcasecmp(pszCmd, "ACTIVECALLS") == 0)
- {
- char szCalls[512];
- int i, nCount, iOffs=0;
-
- iOffs = sprintf (szCalls, "CALLS");
- for (i=0, nCount=List_Count(pInst->hCallQueue); i<nCount; i++)
- {
- if (i) iOffs+=sprintf(&szCalls[iOffs], ", ");
- iOffs+=sprintf(&szCalls[iOffs], "%d", ((CALLENTRY*)List_ElementAt (pInst->hCallQueue, i))->hdr.uMsgNr);
- if (iOffs+6>=sizeof(szCalls)) break;
- }
- Send (pInst, szCalls);
- }
- else if (strcasecmp(pszCmd, "RECENTCHATS") == 0)
- {
- char szChats[2056];
- int i, nCount, iOffs=0, j=0;
-
- iOffs = sprintf (szChats, "CHATS ");
- for (i=0, nCount=List_Count(pInst->hBuddyList); i<nCount; i++)
- {
- NICKENTRY *pChat = (NICKENTRY*)List_ElementAt (pInst->hBuddyList, i);
-
- if (BuddyList_IsGroupchat(pChat))
- {
- if (j) iOffs+=sprintf(&szChats[iOffs], ", ");
- iOffs+=sprintf(&szChats[iOffs], "%s", pChat->pszUser);
- if (iOffs+6>=sizeof(szChats)) break;
- j++;
- }
- }
- Send (pInst, szChats);
- }
- return;
- }
- else
- if (strcasecmp(pszCmd, "GET") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 7 Invalid property");
- return;
- }
-
- if (strcasecmp(pszCmd, "USER") == 0)
- {
- NICKENTRY *pUser = NULL;
-
- if (pszCmd = strtok(NULL, " "))
- {
- if (!strcasecmp (pszCmd, pInst->myUser.pszUser))
- pUser = &pInst->myUser;
- else
- pUser = BuddyList_Find(pInst->hBuddyList, pszCmd);
- }
-
- if (!pUser)
- {
- Send (pInst, "ERROR 26 Invalid user handle");
- return;
- }
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 10 Invalid property");
- return;
- }
-
- if (!strcasecmp (pszCmd, "HANDLE"))
- {
- if (pUser->pszAlias) Send (pInst, "USER %s HANDLE %s", pUser->pszUser, pUser->pszAlias);
- }
- else if (!strcasecmp (pszCmd, "FULLNAME")) /* Workaround */
- Send (pInst, "USER %s FULLNAME %s", pUser->pszUser, pUser->pszAlias);
- else if (!strcasecmp (pszCmd, "DISPLAYNAME"))
- Send (pInst, "USER %s DISPLAYNAME %s", pUser->pszUser, pUser->pszAlias);
- else if (!strcasecmp (pszCmd, "HASCALLEQUIPMENT"))
- Send (pInst, "USER %s HASCALLEQUIPMENT TRUE", pUser->pszUser);
- else if (!strcasecmp (pszCmd, "BUDDYSTATUS"))
- Send (pInst, "USER %s BUDDYSTATUS %d", pUser->pszUser, pUser->iBuddyStatus);
- else if (!strcasecmp (pszCmd, "ISAUTHORIZED"))
- Send (pInst, "USER %s ISAUTHORIZED TRUE", pUser->pszUser);
- else if (!strcasecmp (pszCmd, "MOOD_TEXT"))
- Send (pInst, "USER %s MOOD_TEXT %s", pUser->pszUser,
- pUser->pszStatusText?pUser->pszStatusText:"");
- else if (!strcasecmp (pszCmd, "SEX"))
- Send (pInst, "USER %s SEX UNKNOWN", pUser->pszUser);
- else if (!strcasecmp (pszCmd, "BIRTHDAY"))
- Send (pInst, "USER %s BIRTHDAY 0", pUser->pszUser);
- else if (!strcasecmp (pszCmd, "ONLINESTATUS"))
- {
- unsigned int i;
-
- for (i=0; i<sizeof(m_stMap)/sizeof(m_stMap[0]); i++)
- {
- if (!strcasecmp(m_stMap[i].pszImoStat, pUser->szStatus))
- {
- Send (pInst, "USER %s ONLINESTATUS %s", pUser->pszUser, m_stMap[i].pszSkypeStat);
- break;
- }
- }
- }
- else if (!strcasecmp (pszCmd, "AVATAR"))
- {
- char *pszFile, *pAvatarBuf;
- unsigned int dwLength;
- AVATARENTRY *pAvatar;
- FILE *fp;
-
- if (!(pszFile = strtok(NULL, " ")) || strcasecmp (pszFile, "1"))
- {
- Send (pInst, "ERROR 116 GET invalid ID");
- return;
- }
- if (!(pszFile = strtok(NULL, "\n")))
- {
- Send (pInst, "ERROR 7 GET: invalid WHAT");
- return;
- }
- if (fp=fopen(pszFile, "r"))
- {
- fseek (fp, 0, SEEK_END);
- if (ftell(fp))
- {
- fclose(fp);
- Send (pInst, "ERROR 124 GET Destination file is not empty");
- return;
- }
- fclose(fp);
- }
- if (!(pAvatar = AvatarList_Find(pInst->hAvatarList, pUser->pszUser)) ||
- !(pAvatarBuf = ImoSkype_GetAvatar (pInst->hInst, pAvatar->pszIcon, &dwLength)))
- {
- // FIXME: Normally we should return default avatar if pAvatar is NULL.
- // Default avatar from imo.im is PNG, but JPEG is expected, so we
- // return an error here
- Send (pInst, "ERROR 122 GET Unable to load avatar");
- return;
- }
- if (!(fp=fopen(pszFile,
-#ifdef WIN32
- "wb"
-#else
- "w"
-#endif
- )))
- {
- Send (pInst, "ERROR 121 GET File path doesn't exist");
- return;
- }
- fwrite (pAvatarBuf, dwLength, 1, fp);
- fclose (fp);
- Send (pInst, "USER %s AVATAR 1 %s", pUser->pszUser, pszFile);
- }
- else
- {
- Send(pInst, "ERROR 10 Invalid propery");
- }
- return;
- }
- else
- if (strcasecmp(pszCmd, "CURRENTUSERHANDLE") == 0)
- {
- if (pInst->myUser.pszUser)
- Send(pInst, "CURRENTUSERHANDLE %s", pInst->myUser.pszUser);
- }
- else
- if (strcasecmp(pszCmd, "USERSTATUS") == 0)
- {
- Send(pInst, "USERSTATUS %s", pInst->myUser.szStatus);
- }
- else
- if (strcasecmp(pszCmd, "MESSAGE") == 0 || strcasecmp(pszCmd, "CHATMESSAGE") == 0)
- {
- MSGENTRY *pEntry;
- char *pszMessage = pszCmd;
-
- if (!(pszCmd = strtok(NULL, " ")) || !(pEntry = MsgQueue_Find(pInst->hMsgQueue, atol(pszCmd))))
- {
- Send (pInst, "ERROR 14 Invalid message id");
- return;
- }
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 10 Invalid property");
- return;
- }
- if (!strcasecmp (pszCmd, "TIMESTAMP"))
- Send (pInst, "%s %d TIMESTAMP %ld", pszMessage, pEntry->hdr.uMsgNr, pEntry->timestamp);
- else if (!strcasecmp (pszCmd, "PARTNER_HANDLE") || !strcasecmp (pszCmd, "FROM_HANDLE"))
- {
- char *pszUser = strdup(pEntry->pszAuthor?pEntry->pszAuthor:pEntry->pszUser), *p, *pszRealUser=pszUser;
-
- if (p=strtok(pszUser, ";"))
- {
- if (!(pszRealUser=strtok(NULL, ";"))) pszRealUser=p;
- }
- Send (pInst, "%s %d %s %s", pszMessage, pEntry->hdr.uMsgNr, pszCmd, pszRealUser);
- free (pszUser);
- }
- else if (!strcasecmp (pszCmd, "PARTNER_DISPNAME"))
- Send (pInst, "%s %d PARTNER_DISPNAME %s", pszMessage, pEntry->hdr.uMsgNr, pEntry->pszAlias);
- else if (!strcasecmp (pszCmd, "TYPE"))
- Send (pInst, "%s %d TYPE %s", pszMessage, pEntry->hdr.uMsgNr, pEntry->szType);
- else if (!strcasecmp (pszCmd, "STATUS"))
- Send (pInst, "%s %d STATUS %s", pszMessage, pEntry->hdr.uMsgNr, pEntry->szStatus);
- else if (!strcasecmp (pszCmd, "FAILUREREASON"))
- Send (pInst, "%s %d FAILUREREASON %s", pszMessage, pEntry->hdr.uMsgNr, pEntry->szFailure);
- else if (!strcasecmp (pszCmd, "BODY"))
- Send (pInst, "%s %d BODY %s", pszMessage, pEntry->hdr.uMsgNr, pEntry->pszMessage);
- else if (!strcasecmp (pszCmd, "CHATNAME"))
- {
- if (pEntry->pszAuthor || !pEntry->pszMessage || strchr(pEntry->pszUser, ';')) // Groupchat
- {
- char *pszUser = strdup(pEntry->pszUser), *p;
-
- if (p=strchr(pszUser, ';')) p[1]=0;
- Send (pInst, "%s %d CHATNAME %s", pszMessage, pEntry->hdr.uMsgNr, pszUser);
- free (pszUser);
- }
- else
- Send (pInst, "%s %d CHATNAME #%s/$%s", pszMessage, pEntry->hdr.uMsgNr, pInst->myUser.pszUser, pEntry->pszUser);
- }
- else if (!strcasecmp (pszCmd, "USERS"))
- {
- // On KICK, this is the user who GOT kicked
- char *pszUser = strchr(pEntry->pszUser, ';');
- if (pszUser) pszUser++; else pszUser=pEntry->pszUser;
- Send (pInst, "%s %d USERS %s", pszMessage, pEntry->hdr.uMsgNr, pszUser);
- }
- else
- Send (pInst, "ERROR 10 Invalid property / not implemented");
- return;
- }
- else
- if (strcasecmp(pszCmd, "PRIVILEGE") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")) ||
- (strcasecmp (pszCmd, "SKYPEOUT") &&
- strcasecmp (pszCmd, "SKYPEIN") &&
- strcasecmp (pszCmd, "VOICEMAIL")))
- {
- Send (pInst, "ERROR 40 Unknown Privilege");
- return;
- }
- Send (pInst, "PRIVILEGE %s FALSE", pszCmd);
- return;
- }
- else
- if (strcasecmp(pszCmd, "CHAT") == 0)
- {
- char *pszChat;
- NICKENTRY *pChat=NULL;
-
- // A $ sign is in the name of a dialog, otherwise it's a groupchat ID
- if (!(pszChat = strtok(NULL, " ")) ||
- (!strchr(pszChat, '$') && !(pChat=BuddyList_Find(pInst->hBuddyList, pszChat))))
- {
- Send (pInst, "ERROR 14 Invalid message id");
- return;
- }
-
-
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 10 Invalid property");
- return;
- }
-
- if (strcasecmp(pszCmd, "NAME") == 0)
- Send (pInst, "CHAT %s NAME %s", pszChat, pszChat);
- else if (strcasecmp(pszCmd, "STATUS") == 0)
- // A $ sign is in the name of a dialog, otherwise it's a groupchat ID
- Send (pInst, "CHAT %s STATUS %s", pszChat, pChat?"MULTI_SUBSCRIBED":"LEGACY_DIALOG");
- else if (strcasecmp(pszCmd, "ADDER") == 0)
- Send (pInst, "CHAT %s ADDER %s", pszChat, pInst->myUser.pszUser);
- else if (strcasecmp(pszCmd, "TYPE") == 0)
- Send (pInst, "CHAT %s TYPE %s", pszChat, pChat?"MULTICHAT":"DIALOG");
- else if (strcasecmp(pszCmd, "MYROLE") == 0)
- Send (pInst, "CHAT %s MYROLE USER", pszChat);
- else if (strcasecmp(pszCmd, "MYSTATUS") == 0)
- Send (pInst, "CHAT %s MYSTATUS SUBSCRIBED", pszChat);
- else if ((strcasecmp(pszCmd, "TOPIC") == 0 || strcasecmp(pszCmd, "FRIENDLYNAME") == 0) && pChat)
- Send (pInst, "CHAT %s %s %s", pszChat, pszCmd, pChat->pszDisplay);
- else if ((strcasecmp(pszCmd, "ACTIVEMEMBERS") == 0 || strcasecmp(pszCmd, "MEMBERS") == 0) && pChat)
- {
- char szMembers[1024]={0};
- int i, nCount, iOffs=0;
-
- iOffs = sprintf (szMembers, "CHAT %s %s ", pszChat, pszCmd);
- for (i=0, nCount=List_Count(pChat->hGCMembers); i<nCount; i++)
- {
- NICKENTRY *pMemb = (NICKENTRY*)List_ElementAt (pChat->hGCMembers, i);
- char szUser[512], *pTok;
-
- if (i) iOffs+=sprintf(&szMembers[iOffs], " ");
- strcpy (szUser, pMemb->pszUser);
- pTok=strtok(szUser, ";");
- pTok=strtok(NULL, ";");
- iOffs+=sprintf(&szMembers[iOffs], "%s", pTok);
- if (iOffs+6>=sizeof(szMembers)) break;
- }
- Send (pInst, szMembers);
- }
- else
- Send(pInst, "ERROR 7 Invalid property / not implemented");
- return;
- }
- else
- if (strcasecmp(pszCmd, "CALL") == 0)
- {
- CALLENTRY *pEntry;
-
- if (!(pszCmd = strtok(NULL, " ")) || !(pEntry = CallQueue_Find(pInst->hCallQueue, atol(pszCmd))))
- {
- Send (pInst, "ERROR 11 Invalid call id");
- return;
- }
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 10 Invalid property");
- return;
- }
- if (!strcasecmp (pszCmd, "TIMESTAMP"))
- Send (pInst, "CALL %d TIMESTAMP %ld", pEntry->hdr.uMsgNr, pEntry->timestamp);
- else if (!strcasecmp (pszCmd, "PARTNER_HANDLE"))
- Send (pInst, "CALL %d PARTNER_HANDLE %s", pEntry->hdr.uMsgNr, pEntry->pszUser);
- else if (!strcasecmp (pszCmd, "PARTNER_DISPNAME"))
- {
- NICKENTRY *pNick = BuddyList_Find (pInst->hBuddyList, pEntry->pszUser);
-
- if (pNick)
- Send (pInst, "CALL %d PARTNER_DISPNAME %s", pEntry->hdr.uMsgNr, pNick->pszAlias);
- }
- else if (!strcasecmp (pszCmd, "CONF_ID"))
- Send (pInst, "CALL %d CONF_ID 0", pEntry->hdr.uMsgNr);
- else if (!strcasecmp (pszCmd, "TYPE"))
- Send (pInst, "CALL %d TYPE %s", pEntry->hdr.uMsgNr, pEntry->iDirection==CALL_INCOMING?"INCOMING_P2P":"OUTGOING_P2P");
- else if (!strcasecmp (pszCmd, "STATUS"))
- Send (pInst, "CALL %d STATUS %s", pEntry->hdr.uMsgNr, pEntry->szStatus);
- else if (!strcasecmp (pszCmd, "VIDEO_STATUS"))
- Send (pInst, "CALL %d VIDEO_STATUS VIDEO_NONE", pEntry->hdr.uMsgNr);
- else if (!strcasecmp (pszCmd, "VIDEO_SEND_STATUS") || !strcasecmp (pszCmd, "VIDEO_RECEIVE_STATUS"))
- Send (pInst, "CALL %d %s NOT_AVAILABLE", pEntry->hdr.uMsgNr, pszCmd);
- else if (!strcasecmp (pszCmd, "FAILUREREASON"))
- Send (pInst, "CALL %d FAILUREREASON UNKNOWN", pEntry->hdr.uMsgNr);
- else if (!strcasecmp (pszCmd, "DURATION"))
- Send (pInst, "CALL %d DURATION 0", pEntry->hdr.uMsgNr);
- else if (!strcasecmp (pszCmd, "CONF_PARTICIPANTS_COUNT"))
- Send (pInst, "CALL %d CONF_PARTICIPANTS_COUNT 0", pEntry->hdr.uMsgNr);
- else
- Send (pInst, "ERROR 10 Invalid property / not implemented");
- return;
- }
- else
- if (strcasecmp(pszCmd, "SKYPEVERSION") == 0)
- {
- Send (pInst, "SKYPEVERSION 3.8.0.188"); // Fake
- }
- else
- {
- Send(pInst, "ERROR 7 Invalid property / not implemented");
- }
- return;
- }
- else
- if (strcasecmp(pszCmd, "SET") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 7 Invalid property");
- return;
- }
-
- if (strcasecmp(pszCmd, "USER") == 0)
- {
- char *pszUser;
- NICKENTRY *pUser = NULL;
-
- if (!(pszUser = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 26 Invalid user handle");
- return;
- }
-
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 7 Invalid property");
- return;
- }
-
- pUser = BuddyList_Find(pInst->hBuddyList, pszUser);
-
- if (strcasecmp(pszCmd, "BUDDYSTATUS") == 0)
- {
- int iStatus = -1;
-
- if (pszCmd = strtok(NULL, " "))
- iStatus = atoi(pszCmd);
-
- if (!pUser && iStatus < 2)
- {
- Send (pInst, "ERROR 26 Invalid user handle");
- return;
- }
- if (iStatus == 2 || (iStatus > 2 && !pUser) || iStatus != pUser->iBuddyStatus)
- {
- switch (iStatus)
- {
- case 1:
- if (ImoSkype_DelBuddy (pInst->hInst, pUser->pszUser,
- strcmp(pUser->szStatus, "OFFLINE")?"Skype":"Offline") == 1)
- pUser->iBuddyStatus = iStatus;
- break;
- case 2:
- case 3:
- ImoSkype_AddBuddy (pInst->hInst, pszUser);
- return;
- default:
- Send (pInst, "ERROR 518 Invalid status given for BUDDYSTATUS");
- return;
- }
- }
- Send (pInst, "USER %s BUDDYSTATUS %d", pUser->pszUser, pUser->iBuddyStatus);
- return;
- }
- else if (!pUser)
- {
- Send (pInst, "ERROR 26 Invalid user handle");
- return;
- }
- else
- {
- // ISAUTHORIZED
- Send (pInst, "ERROR 7 Not implemented");
- }
- }
- else
- if (strcasecmp(pszCmd, "USERSTATUS") == 0)
- {
- unsigned int i;
-
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 28 Unknown userstatus");
- return;
- }
-
- if (strcasecmp(pInst->myUser.szStatus, pszCmd))
- {
- for (i=0; i<sizeof(m_stMap)/sizeof(m_stMap[0]); i++)
- {
- if (!strcasecmp(m_stMap[i].pszSkypeStat, pszCmd))
- {
- pInst->tSetMoodText = 0;
- if (ImoSkype_SetStatus(pInst->hInst, m_stMap[i].pszImoStat,
- pInst->myUser.pszStatusText?pInst->myUser.pszStatusText:"")>0)
- strcpy (pInst->myUser.szStatus, pszCmd);
- Send (pInst, "USERSTATUS %s", pInst->myUser.szStatus);
- break;
- }
- }
- if (i==sizeof(m_stMap)/sizeof(m_stMap[0]))
- Send (pInst, "ERROR 28 Unknown userstatus");
- } else Send (pInst, "USERSTATUS %s", pInst->myUser.szStatus);
- return;
- }
- else
- if (strcasecmp(pszCmd, "MESSAGE") == 0 || strcasecmp(pszCmd, "CHATMESSAGE") == 0)
- {
- MSGENTRY *pEntry;
- char *pszMessage = pszCmd;
-
- if (!(pszCmd = strtok(NULL, " ")) || !(pEntry = MsgQueue_Find(pInst->hMsgQueue, atol(pszCmd))))
- {
- Send (pInst, "ERROR 14 Invalid message id");
- return;
- }
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 10 Invalid property");
- return;
- }
- if (!strcasecmp (pszCmd, "SEEN"))
- {
- strcpy (pEntry->szStatus, "READ");
- Send (pInst, "%s %d STATUS %s", pszMessage, pEntry->hdr.uMsgNr, pEntry->szStatus);
- }
- else
- Send (pInst, "ERROR 10 Invalid property / not implemented");
- return;
- }
- else
- if (strcasecmp(pszCmd, "CALL") == 0)
- {
- CALLENTRY *pEntry;
-
- if (!(pszCmd = strtok(NULL, " ")) || !(pEntry = CallQueue_Find(pInst->hCallQueue, atol(pszCmd))))
- {
- Send (pInst, "ERROR 11 Invalid call id");
- return;
- }
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 10 Invalid property");
- return;
- }
- if (!strcasecmp (pszCmd, "STATUS"))
- {
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 21 Unknown/disallowed call prop");
- return;
- }
- strcpy (pEntry->szStatus, pszCmd);
- Send (pInst, "CALL %d STATUS %s", pEntry->hdr.uMsgNr, pEntry->szStatus);
-
- // {RINGING, INPROGRESS, ONHOLD, FINISHED}
- if (pInst->iFlags & IMO2S_FLAG_ALLOWINTERACT)
- {
- if (strcasecmp (pEntry->szStatus, "INPROGRESS") == 0 && pEntry->iDirection == CALL_INCOMING)
- {
- StartCallSWF (pInst, pEntry);
- }
- else
- if (strcasecmp (pEntry->szStatus, "FINISHED") == 0 && pEntry->hCallWnd)
- {
- if (*pEntry->szCallFile)
- {
- unlink(pEntry->szCallFile);
- *pEntry->szCallFile=0;
- }
-#ifdef WIN32
- if (pEntry->hCallWnd)
- {
- W32Browser_CloseWindow (pEntry->hCallWnd);
- pEntry->hCallWnd = NULL;
- }
-#endif
-
- // On incoming call, hang up
- }
- }
-
- // Currently we don't support calls, just hang up
- /* FIXME: Hangup! */
- return;
- }
- return;
- }
- else
- if (strcasecmp(pszCmd, "PROFILE") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 10 Invalid property");
- return;
- }
-
- if (!strcasecmp (pszCmd, "MOOD_TEXT"))
- {
- if (!pInst->myUser.pszStatusText ||
- strcasecmp(pInst->myUser.pszStatusText, pszCmd+10))
- {
- time_t t;
- // Delay setting of MOOD_TEXT, as next command in chain may change online status
- // and we want to prevent double calls
- // The polling-thread will take care of this event
- pInst->tSetMoodText = time(&t)+15;
- if (pInst->myUser.pszStatusText) free (pInst->myUser.pszStatusText);
- pInst->myUser.pszStatusText = strdup (pszCmd+10);
- }
- }
- else
- {
- Send (pInst, "ERROR 552 Invalid property");
- return;
- }
- }
- else
- {
- Send (pInst, "ERROR 7 Invalid property");
- return;
- }
- }
- else
- if (strcasecmp(pszCmd, "MESSAGE") == 0 || strcasecmp(pszCmd, "CHATMESSAGE") == 0)
- {
- NICKENTRY *pUser;
- unsigned int uMsgId;
- MSGENTRY *pMsg;
-
- if (!(pszCmd = strtok(NULL, " ")) || !(pUser = BuddyList_Find(pInst->hBuddyList, pszCmd)))
- {
- Send (pInst, "ERROR 26 Invalid user handle");
- return;
- }
- pszCmd+=strlen(pszCmd)+1;
- if (!*pszCmd)
- {
- Send (pInst, "ERROR 43 Cannot send empty message");
- return;
- }
- if (!(pMsg = MsgQueue_AddSent (pInst->hMsgQueue, pUser->pszUser, pUser->pszAlias, pszCmd, &uMsgId)))
- {
- Send (pInst, "ERROR 9901 Internal error");
- return;
- }
- if (IMO_API_VERSION == 0) Send (pInst, "MESSAGE %d STATUS SENDING", uMsgId);
- if (ImoSkype_SendMessage(pInst->hInst, pUser->pszUser, pszCmd, &pMsg->uRqId)>0)
- {
- if (IMO_API_VERSION == 0) strcpy (pMsg->szStatus, "SENT");
- }
- else
- {
- strcpy (pMsg->szStatus, "FAILED");
- strncpy (pMsg->szFailure, ImoSkype_GetLastError(pInst->hInst), sizeof(pMsg->szFailure));
- }
- Send (pInst, "MESSAGE %d STATUS %s", uMsgId, pMsg->szStatus);
- }
- else
- if (strcasecmp(pszCmd, "CHAT") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 536 CREATE: no object or type given");
- return;
- }
- if (strcasecmp(pszCmd, "CREATE") == 0)
- {
- char szName[128]; // No name given here, so make up a name
- time_t t;
-
- time(&t);
- sprintf (szName, "%d", t);
- if (ImoSkype_CreateSharedGroup(pInst->hInst, szName)<1) return;
-
- // Now buddy_added should be called which gives us the ID of the new groupchat
- // where we can then add members to. However this is not known here yet, so feed
- // list with users to add to instance and let it be processed by buddy_added handler
- if (pszCmd = strtok(NULL, "\n"))
- {
- if (pInst->pszBuddiesToAdd) free(pInst->pszBuddiesToAdd);
- pInst->pszBuddiesToAdd = strdup(pszCmd);
- }
- }
- else
- Send (pInst, "ERROR 503 CHAT: Invalid or unknown action");
- return;
- }
- else
- if (strcasecmp(pszCmd, "CALL") == 0)
- {
- NICKENTRY *pUser;
-
- if (!(pszCmd = strtok(NULL, " ")) || !(pUser = BuddyList_Find(pInst->hBuddyList, pszCmd)))
- {
- Send (pInst, "ERROR 26 Invalid user handle");
- return;
- }
-
- ImoSkype_StartVoiceCall (pInst->hInst, pUser->pszUser);
- return;
- }
- else
- if (strcasecmp(pszCmd, "OPEN") == 0)
- {
- return;
- }
- else
- if (strcasecmp(pszCmd, "CREATE") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 536 CREATE: no object or type given");
- return;
- }
- if (strcasecmp(pszCmd, "APPLICATION") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")) || strcasecmp(pszCmd, "libpurple_typing"))
- Send (pInst, "ERROR 540 CREATE APPLICATION: Missing or invalid name");
- else
- Send (pInst, "CREATE APPLICATION libpurple_typing");
- }
- else
- Send (pInst, "ERROR 537 CREATE: Unknown object type given");
- return;
- }
- else
- if (strcasecmp(pszCmd, "DELETE") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 538 DELETE: no object or type given");
- return;
- }
- if (strcasecmp(pszCmd, "APPLICATION") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")) || strcasecmp(pszCmd, "libpurple_typing"))
- Send (pInst, "ERROR 542 DELETE APPLICATION: Missing or invalid application name");
- else
- Send (pInst, "DELETE APPLICATION libpurple_typing");
- }
- else
- Send (pInst, "ERROR 539 DELETE: Unknown object type given");
- return;
- }
- else
- if (strcasecmp(pszCmd, "ALTER") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")))
- Send (pInst, "ERROR 526 ALTER: no object type given");
- else
- {
- if (strcasecmp(pszCmd, "APPLICATION") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")) || strcasecmp(pszCmd, "libpurple_typing") ||
- !(pszCmd = strtok(NULL, " ")))
- Send (pInst, "ERROR 545 ALTER: missing or invalid action");
- else
- {
- NICKENTRY *pUser;
-
- if (strcasecmp (pszCmd, "CONNECT") == 0)
- {
- if (!(pszCmd = strtok(NULL, " ")) || !(pUser = BuddyList_Find(pInst->hBuddyList, pszCmd)))
- Send (pInst, "ERROR 547 ALTER APPLICATION CONNECT: Invalid user handle");
- else
- {
- Send (pInst, "ALTER APPLICATION libpurple_typing CONNECT %s", pszCmd);
- Send (pInst, "APPLICATION CONNECTING %s", pszCmd);
- Send (pInst, "APPLICATION libpurple_typing STREAMS %s:1", pszCmd);
- // FIXME: Shouldn't we enumerate all STREAMS here? dunno...
- }
- } else
- if (strcasecmp (pszCmd, "DATAGRAM") == 0)
- {
- char *pSep;
-
- if (!(pszCmd = strtok(NULL, " ")) || !(pSep = strchr(pszCmd, ':')))
- Send (pInst, "ERROR 551 ALTER APPLICATION DATAGRAM: Missing or invalid stream identifier");
- else
- {
- *pSep=0;
- if (!(pUser = BuddyList_Find(pInst->hBuddyList, pszCmd)))
- Send (pInst, "ERROR 551 ALTER APPLICATION DATAGRAM: Missing or invalid stream identifier");
- else
- {
- *pSep=':';
- if (!(pszCmd = strtok(NULL, " ")))
- Send (pInst, "ERROR 541 APPLICATION: Operation failed");
- else
- {
- if (!strcmp (pszCmd, "PURPLE_TYPING"))
- ImoSkype_Typing (pInst->hInst, pUser->pszUser, "typing");
- else if (!strcmp (pszCmd, "PURPLE_TYPED"))
- ImoSkype_Typing (pInst->hInst, pUser->pszUser, "typed");
- else if (!strcmp (pszCmd, "PURPLE_NOT_TYPING"))
- ImoSkype_Typing (pInst->hInst, pUser->pszUser, "not_typing");
- }
- }
- }
- }
- }
-
- }
- else
- if (strcasecmp(pszCmd, "CHAT") == 0)
- {
- char *pszChat;
- NICKENTRY *pChat;
-
- if (!(pszChat = strtok(NULL, " ")) ||
- !(pChat=BuddyList_Find(pInst->hBuddyList, pszChat)))
- {
- Send (pInst, "ERROR 14 Invalid message id");
- return;
- }
-
-
- if (!(pszCmd = strtok(NULL, " ")))
- {
- Send (pInst, "ERROR 503 CHAT: Invalid or unknown action");
- return;
- }
-
- if (strcasecmp (pszCmd, "ADDMEMBERS") == 0)
- {
- while(pszCmd = strtok(NULL, ", "))
- {
- ImoSkype_GroupInvite (pInst->hInst, pChat->pszUser, pszCmd);
- }
- }
- else if (strcasecmp (pszCmd, "KICK") == 0)
- {
- while(pszCmd = strtok(NULL, ", "))
- {
- ImoSkype_GroupKick (pInst->hInst, pChat->pszUser, pszCmd);
- }
- }
- else if (strcasecmp (pszCmd, "SETTOPIC") == 0)
- {
- if(pszCmd = strtok(NULL, ""))
- {
- ImoSkype_GroupTopic (pInst->hInst, pChat->pszUser, pszCmd);
- }
- }
- else if (strcasecmp (pszCmd, "LEAVE") == 0)
- {
- if(pszCmd = strtok(NULL, ""))
- {
- ImoSkype_GroupLeave (pInst->hInst, pChat->pszUser);
- }
- }
- else Send (pInst, "ERROR 503 CHAT: Invalid or unknown action");
- } else
- Send (pInst, "ERROR 527 ALTER: unknown object type given");
- }
- return;
- }
- else
- if (strcasecmp(pszCmd, "NAME") == 0)
- {
- if (pszCmd = strtok(NULL, " "))
- {
- if (pInst->pszClientName) free(pInst->pszClientName);
- pInst->pszClientName = strdup(pszCmd);
- }
- Send (pInst, "OK");
- return;
- }
- else
- {
- Send (pInst, "ERROR 2 Not Implemented");
- }
-}
-
-// -----------------------------------------------------------------------------
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2skypeapi.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2skypeapi.h deleted file mode 100644 index fa68dd3899..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2skypeapi.h +++ /dev/null @@ -1,13 +0,0 @@ -typedef void(*IMO2SCB)(char *pszMsg, void *pUser);
-struct _tagIMOSAPI;
-typedef struct _tagIMOSAPI IMOSAPI;
-
-#define IMO2S_FLAG_CURRTIMESTAMP 1 // Use current timestamp on MSG receive
-#define IMO2S_FLAG_ALLOWINTERACT 2 // Allow GUI interaction (CALL)
-
-IMOSAPI *Imo2S_Init(IMO2SCB Callback, void *pUser, int iFlags);
-void Imo2S_Exit (IMOSAPI *pInst);
-void Imo2S_SetLog (IMOSAPI *pInst, FILE *fpLog);
-int Imo2S_Login (IMOSAPI *pInst, char *pszUser, char *pszPass, char **ppszError);
-void Imo2S_Logout(IMOSAPI *pInst);
-int Imo2S_Send (IMOSAPI *pInst, char *pszMsg);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2sproxy.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2sproxy.c deleted file mode 100644 index 1615d6ac46..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2sproxy.c +++ /dev/null @@ -1,78 +0,0 @@ -/* Module: imo2skypeproxy.c
- Purpose: Implementation of imo2skype API as Skype proxy (for Miranda Skype plugin)
- Author: leecher
- Date: 01.09.2009
-
- Changelog:
- 1.00 - 01.09.2009 - Initial release
- 1.01 - 02.09.2009 - Little bugfix for Onlinestatus, introduced mutex for send thread.
- 1.02 - 02.09.2009 - Added support for incoming call notifications and expired sessions.
- 1.03 - 03.09.2009 - As WIN32-port of libcurl is a total mess, Win32-version now uses WinINET.
- 1.04 - 04.09.2009 - Added support for searching, adding and removing buddies
- 1.05 - 06.09.2009 - * Mapped "busy" to DND, not NA, as forum user AL|EN proposed.
- * Mood text will now also be sent on status change of a contact
- (doesn't really have an effect though)
- * New Parameter -d (daemonize) to launch proxy in background
- * Fixed a bug with a crash when encoding umlauts on Win32
- 1.06 - 25.09.2009 - Added parameter -t for local timestamps.
- 1.07 - 07.10.2009 - Bugfix: Added parsing of multiple JSON messages
- Added support for writing to logfile while in daemon mode (-l)
- 1.08 - 18.10.2009 - Added support for voice calls via imo.im flash on WIN32 (-i)
- - Limited memory queues to 50 entries to reduce memory usage.
- 1.09 - 07.11.2009 - Split command line main module and proxy module to make proxy
- accessible by different layers (i.e. new Miranda Plugin layer)
- 1.10 - 14.12.2009 - Bug in the cJson library. The authors used the String as second
- sprintf-Parameter which contains the format string instead of
- ["%s", StringParam] causing problems sending Messages containt a %
- - Added some space in the dialog for translations and added Translate()
- function to some strings in the Wrapper-DLL
- - More verbose output if you enable logging
- - Fixes a Bug that caused the plugin to block after going offline
- and reconnecting back online
- - Hopefully fixed a severe threading problem: The Send-Mutex was not
- covering a full transaction, but only 1 send causing the receiver
- the receive garbled data causing "An existing connection was forcibly
- closed by the remote host." error.
- - Imo2S_Exit freed the temporary buffer too early resulting in a crash
- on exit.
- 1.12 - 19.04.2010 - POST interface changed from www.imo.im/amy to s.imo.im/amy
- 1.13 - 19.12.2010 - imo.im modified their interface, so tried to adapt the communication
- routines at low level to be compatible again. There still may be
- many bugs. Don't forget to turn off history logging in the options
- at https://imo.im
- There also seems to be a nice new feature called "reflection" so that
- you can login from multiple sessions and messages etc. entered there
- will be reflected to the current session. This may be addressed in one
- of the next builds...
- 1.14 - 02.03.2011 - Added a Skype WIN32-API Emulation Layer for better compatibility with
- other clients that don't want to implement the socks-protocol, so that
- we are compatible out-of-the-box.
- - Added a few features to be compatible with libpurple. i.e. we now support
- message numbering, even tough this is only supported in PROTOCOL 4.
- - Added Keepalive packet sending to circumvent imo.im AutoAway.
- 1.15 - 18.07.2012 - Avatar support
- - Support for new imo.im protocol, can now be compiled to use old or new
- protocol, in case there are troubles. New protocol enables participation
- in groupchats generated with native Skype client with at least 3
- participants (still a bit experimental)
- - WININET HTTPS communication layer now uses async calls to try to prevent
- lockups on connection loss.
-*/
-
-#include <memory.h>
-#include "imo2sproxy.h"
-
-// -----------------------------------------------------------------------------
-// PUBLIC
-// -----------------------------------------------------------------------------
-
-void Imo2sproxy_Defaults (IMO2SPROXY_CFG *pCfg)
-{
- memset (pCfg, 0, sizeof(IMO2SPROXY_CFG));
- pCfg->fpLog = stdout;
- pCfg->logerror = fprintf;
-}
-
-/* Real implementation is now in socksproxy.c for the socket communication method
- and in w32skypeemu.c for the Window messages Skype emulation
- */
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2sproxy.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2sproxy.h deleted file mode 100644 index dbdbbf1cf7..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2sproxy.h +++ /dev/null @@ -1,28 +0,0 @@ -#include <stdio.h>
-#include "imo2skypeapi.h"
-#ifndef WIN32
-#define __cdecl
-#endif
-
-typedef struct
-{
- int bVerbose;
- FILE *fpLog;
- int iFlags;
- int (__cdecl *logerror)( FILE *stream, const char *format, ...);
-// FIXME: user+pass from cmdline, until there is a possibility for
-// a client to authenticate
- char *pszUser;
- char *pszPass;
-} IMO2SPROXY_CFG;
-
-typedef struct tag_imo2sproxy IMO2SPROXY;
-
-struct tag_imo2sproxy
-{
- int (*Open)(IMO2SPROXY*);
- void (*Loop)(IMO2SPROXY*);
- void (*Exit)(IMO2SPROXY*);
-};
-
-void Imo2sproxy_Defaults (IMO2SPROXY_CFG *pCfg);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2stest.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2stest.c deleted file mode 100644 index 3007e3ce06..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/imo2stest.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Module: imo2stest.c
- Purpose: Simple test application for imo2skypeapi
- Author: leecher
- Date: 31.08.2009
-*/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include "imo2skypeapi.h"
-
-// -----------------------------------------------------------------------------
-// Static
-// -----------------------------------------------------------------------------
-static void Recv(char *pszMsg, void *pUser)
-{
- printf ("< %s\n", pszMsg);
-}
-
-// -----------------------------------------------------------------------------
-// EIP
-// -----------------------------------------------------------------------------
-int main(int argc, char **argv)
-{
- int iRet = -1;
- IMOSAPI *pInst;
- char *pszError = NULL;
-
- if (argc<3)
- {
- printf ("Usage: %s [username] [password]\n", argv[0]);
- return -1;
- }
-
- if (!(pInst = Imo2S_Init(Recv, NULL,0)))
- {
- fprintf (stderr, "Failed initialization.\n");
- return -1;
- }
-
- /* Logon */
- if (Imo2S_Login(pInst, argv[1], argv[2], &pszError) == 1)
- {
- /* Dispatch loop */
- char szLine[4096]={0};
-
- while (gets(szLine))
- {
- Imo2S_Send (pInst, szLine);
- memset (szLine, 0, sizeof(szLine));
- }
- }
- else
- {
- fprintf (stderr, "Login failed: %s\n", pszError);
- return -1;
- }
-
- Imo2S_Exit (pInst);
- return iRet;
-}
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/main.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/main.c deleted file mode 100644 index 872509616d..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/main.c +++ /dev/null @@ -1,197 +0,0 @@ -/* Module: main.c
- Purpose: Main commandline dispatcher for imo.im Skypeproxy
- Author: leecher
- Date: 07.11.2009
-*/
-#include <stdlib.h>
-#include <stdio.h>
-#include "imo2sproxy.h"
-#include "socksproxy.h"
-#ifdef WIN32
-#include "w32skypeemu.h"
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winsock2.h>
-#define Daemonize FreeConsole()
-#ifdef _DEBUG
-#define LOG(_args_) printf _args_
-#ifndef _WIN64
-#include "crash.c"
-#endif
-#endif
-#else
-#define Daemonize daemon(0, 0)
-#endif
-
-// -----------------------------------------------------------------------------
-// EIP
-// -----------------------------------------------------------------------------
-int main(int argc, char **argv)
-{
- int i, j=0, bDaemon = 0;
- char cMode='s';
- IMO2SPROXY_CFG stCfg;
- SOCKSPROXY_CFG stSocksCfg;
-#ifdef WIN32
- W32SKYPEEMU_CFG stSypeEmuCfg;
-#endif
- IMO2SPROXY *pProxy;
-
-#ifdef _DEBUG
- Crash_Init();
-#endif
-
- Imo2sproxy_Defaults (&stCfg);
- SocksProxy_Defaults (&stSocksCfg);
-#ifdef WIN32
- W32SkypeEmu_Defaults(&stSypeEmuCfg);
-#endif
- if (argc<3)
- {
- printf ("imo.im Skypeproxy V1.15 - (c) by leecher 2009-2012\n\n"
- "%s [-d] [-v [-l <Logfile>]] [-t] [-i]\n"
- "[-m<s|a>] [-h <Bind to IP>] [-p <Port>] <Username> <Password>\n\n"
- "-d\t- Daemonize (detach from console)\n"
- "-v\t- Verbose mode, log commands to console\n"
- "-l\t- Set logfile to redirect verbose log to.\n"
- "-t\t- Ignore server timestamp and use current time for messages\n"
- "-i\t- Use interactive mode (starts imo.im flash app upon call)\n"
- "-m\t- Specify connection mode to use:\n"
- "\t\ts\tSocket mode (SkypeProxy protocol) [default]\n"
-#ifdef WIN32
- "\t\ta\tSkype API Emulation via Window messages (real Skype API)\n"
-#endif
- "\tParameters for socket mode:\n"
- "-h\t- Bind to a specific IP, not to all interfaces (default)\n"
- "-p\t- Bind to another port (default: 1401)\n"
- "Default: Bind to any interface, Use Port %d\n", argv[0], stSocksCfg.sPort);
- return EXIT_FAILURE;
- }
-
- for (i=1; i<argc; i++)
- {
- if (argv[i][0] == '-')
- {
- switch (argv[i][1])
- {
- case 'v':
- stCfg.bVerbose = 1;
- break;
- case 'l':
- if (argc<=i+1)
- {
- fprintf (stderr, "Please specify logfile for -l\n");
- return EXIT_FAILURE;
- }
- if (!(stCfg.fpLog = fopen(argv[++i], "a")))
- {
- fprintf (stderr, "Cannot open logfile %s\n", argv[i]);
- return EXIT_FAILURE;
- }
- break;
- case 'd':
- bDaemon = 1;
- break;
- case 'h':
- if (argc<=i+1)
- {
- fprintf (stderr, "Please specify bind IP for -h\n");
- return EXIT_FAILURE;
- }
- stSocksCfg.lAddr = inet_addr(argv[++i]);
- break;
- case 'p':
- if (argc<=i+1)
- {
- fprintf (stderr, "Please specify port for -p\n");
- return EXIT_FAILURE;
- }
- stSocksCfg.sPort = atoi(argv[++i]);
- break;
- case 't':
- stCfg.iFlags |= IMO2S_FLAG_CURRTIMESTAMP;
- break;
- case 'i':
- stCfg.iFlags |= IMO2S_FLAG_ALLOWINTERACT;
- break;
- case 'm':
- switch (argv[i][2])
- {
- case 'a':
-#ifndef WIN32
- fprintf (stderr, "This mode is not available on your platform!\n");
- return EXIT_FAILURE;
-#endif
- case 's':
- cMode=argv[i][2];
- break;
- default:
- fprintf (stderr, "Unknown mode: %c\n", argv[i][2]);
- return EXIT_FAILURE;
- }
- break;
- default:
- printf ("Unknown parameter: %s\n", argv[i]);
- break;
- }
- }
- else
- {
- switch (j)
- {
- case 0: stCfg.pszUser = argv[i]; break;
- case 1: stCfg.pszPass = argv[i]; break;
- default: printf ("Unknown extra arg: %s\n", argv[i]); break;
- }
- j++;
- }
- }
-
- if (!stCfg.pszUser)
- {
- fprintf (stderr, "Please specify Username\n");
- return EXIT_FAILURE;
- }
- if (!stCfg.pszPass)
- {
- fprintf (stderr, "Please specify Password\n");
- return EXIT_FAILURE;
- }
- if (bDaemon && stCfg.bVerbose && stCfg.fpLog == stdout)
- {
- printf ("Parameters Verbose mode and daemonize cannot be used together, if you don't\n"
- "specify a logfile, not daemonizing.\n");
- bDaemon = 0;
- }
- if (bDaemon) Daemonize;
-
- switch (cMode)
- {
- case 's':
- if (!(pProxy = SocksProxy_Init (&stCfg, &stSocksCfg)))
- return EXIT_FAILURE;
- break;
- case 'a':
-#ifdef WIN32
- if (!(pProxy = W32SkypeEmu_Init (&stCfg, &stSypeEmuCfg)))
- return EXIT_FAILURE;
-#else
- fprintf (stderr, "Skype API EMulator is only available in WIN32\n");
- return EXIT_FAILURE;
-#endif
- break;
- }
-
- if (pProxy->Open(pProxy) == 0)
- pProxy->Loop(pProxy);
- pProxy->Exit(pProxy);
-
- if (stCfg.fpLog && stCfg.fpLog != stdout && stCfg.fpLog != stderr)
- {
- fclose(stCfg.fpLog);
- stCfg.fpLog = NULL;
- }
-
- return EXIT_SUCCESS;
-}
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/imoproxy.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/imoproxy.c deleted file mode 100644 index 195f479ea6..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/imoproxy.c +++ /dev/null @@ -1,882 +0,0 @@ -/* Module: imoproxy.c
- Purpose: Proxy-DLL for Miranda IM to load imo2sproxy as plugin
- Author: leecher
- Date: 26.10.2009
-*/
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winsock2.h>
-#include <prsht.h>
-#include <commdlg.h>
-#include <stdlib.h>
-#include <io.h>
-#include <fcntl.h>
-#include <process.h>
-#pragma comment (lib, "Ws2_32.lib")
-#include <stdio.h>
-#include "io_layer.h"
-#include "imo2sproxy.h"
-#include "imo_request.h"
-#include "socksproxy.h"
-#include "w32skypeemu.h"
-#include "skypepluginlink.h"
-#include "include/newpluginapi.h"
-#include "include/m_langpack.h"
-#include "include/m_options.h"
-#include "include/m_database.h"
-#include "include/m_system.h"
-#include "sdk/m_updater.h"
-#include "resource.h"
-
-// Crash dumper
-#ifdef _DEBUG
-void CrashLog (const char *pszFormat, ...)
-{
- static FILE *fpLog = NULL;
- char szLine[1024];
- va_list ap;
-
- if (!fpLog) fpLog=fopen("imoproxy.log", "a");
- va_start(ap, pszFormat);
- _vsnprintf(szLine, sizeof(szLine), pszFormat, ap);
- va_end(ap);
-
- if (fpLog)
- {
- fprintf (fpLog, "%s", szLine);
- fflush (fpLog);
- }
-}
-#define LOG(_args_) CrashLog _args_
-#ifndef _WIN64
-#include "crash.c"
-#endif
-#endif
-
-
-PLUGINLINK *pluginLink;
-HINSTANCE m_hInst;
-static HANDLE m_hOptHook=NULL, m_hPreShutdownHook=NULL, m_hHookModulesLoaded=NULL;
-
-#define PROXY_SOCKS 0
-#define PROXY_W32SKYPEEMU 1
-#define PROXY_SKYPEPLUGIN 2
-#define PROXY_MAX 3
-
-static IMO2SPROXY_CFG m_stCfg;
-static SOCKSPROXY_CFG m_stSocksCfg;
-static W32SKYPEEMU_CFG m_stSypeEmuCfg;
-static SKYPEPLUGINLINK_CFG m_stSkypePluginCfg;
-
-static IMO2SPROXY *m_apProxy[PROXY_MAX] = {0};
-static HANDLE m_hThread[PROXY_MAX]={0}, m_hEvent = INVALID_HANDLE_VALUE;
-static BOOL m_bConsole = FALSE;
-
-#define ANY_SIZE 1
-
-typedef struct _MIB_IPADDRROW {
- DWORD dwAddr;
- DWORD dwIndex;
- DWORD dwMask;
- DWORD dwBCastAddr;
- DWORD dwReasmSize;
- unsigned short unused1;
- unsigned short wType;
-}MIB_IPADDRROW, *PMIB_IPADDRROW;
-
-typedef struct _MIB_IPADDRTABLE {
- DWORD dwNumEntries;
- MIB_IPADDRROW table[ANY_SIZE];
-}MIB_IPADDRTABLE, *PMIB_IPADDRTABLE;
-
-
-// Plugin Info
-#define PINFO \
- "imo2sproxy-Plugin", \
- PLUGIN_MAKE_VERSION(1,0,0,15), \
- "Tunnelling Skype traffic via imo.im Web service", \
- "leecher", \
- "leecher@dose.0wnz.at", \
- "© 2010-2012 leecher", \
- "http://dose.0wnz.at", \
- 0, \
- 0 //doesn't replace anything built-in
-
-
-PLUGININFO pluginInfo = {
- sizeof(PLUGININFO),
- PINFO
-};
-
-// New plugininfo
-PLUGININFOEX pluginInfoEx = {
- sizeof (pluginInfoEx),
- PINFO,
- { 0x3005c2b1, 0x4278, 0x470c, { 0x94, 0x98, 0x5, 0x95, 0x3d, 0xfa, 0x4d, 0x88 } } // // {3005C2B1-4278-470c-9498-05953DFA4D88}
-};
-
-// Whatever this is...
-// {95061E8D-B18C-4c1c-8E14-686DE967D851}
-#define MIID_IMOPROXY { 0x95061e8d, 0xb18c, 0x4c1c, { 0x8e, 0x14, 0x68, 0x6d, 0xe9, 0x67, 0xd8, 0x51 } }
-static const MUUID interfaces[] = { MIID_IMOPROXY, MIID_LAST };
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-int ShowError( FILE *stream, const char *format, ...)
-{
- char szBuf[1024];
- va_list ap;
- int iRet;
-
- va_start(ap, format);
- iRet = _vsnprintf (szBuf, sizeof(szBuf), format, ap);
- va_end(ap);
-
- MessageBox (NULL, szBuf, Translate("IMOPROXY Error"), MB_ICONSTOP | MB_OK);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-static void LoadSettings(void)
-{
- DBVARIANT dbv;
-
- // General config
- if (!m_bConsole)
- {
- if (DBGetContactSetting(NULL, "IMOPROXY", "Logfile", &dbv)==0)
- {
- if ((m_stCfg.bVerbose = DBGetContactSettingByte(NULL, "IMOPROXY", "Verbose", 0)) &&
- *dbv.pszVal)
- {
- if (m_stCfg.fpLog) fclose (m_stCfg.fpLog);
- if (!(m_stCfg.fpLog = fopen(dbv.pszVal, "a")))
- {
- char szMsg[MAX_PATH+64];
-
- sprintf (szMsg, Translate("Cannot open Logfile %s for writing."), dbv.pszVal);
- MessageBox(NULL,szMsg,"IMOPROXY", MB_OK | MB_ICONWARNING);
- m_stCfg.bVerbose = FALSE;
- }
- }
- DBFreeVariant(&dbv);
- }
- }
- m_stCfg.iFlags = DBGetContactSettingDword(NULL, "IMOPROXY", "Flags", 0);
- if (DBGetContactSetting(NULL, "IMOPROXY", "User", &dbv)==0)
- {
- if (m_stCfg.pszUser) free(m_stCfg.pszUser);
- m_stCfg.pszUser = strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- if (DBGetContactSetting(NULL, "IMOPROXY", "Password", &dbv)==0)
- {
- if (m_stCfg.pszPass) free(m_stCfg.pszPass);
- m_stCfg.pszPass = strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
- }
-
- // Socks Proxy config
- m_stSocksCfg.sPort = DBGetContactSettingWord(NULL, "IMOPROXY", "Port", 1401);
- if (DBGetContactSetting(NULL, "IMOPROXY", "Host", &dbv)==0)
- {
- m_stSocksCfg.lAddr = inet_addr(dbv.pszVal);
- DBFreeVariant(&dbv);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-static BOOL CheckSettings(int iMask)
-{
- DBVARIANT dbv;
-
- if (iMask & PROXY_SOCKS)
- {
- if (DBGetContactSetting(NULL, SKYPE_PROTONAME, "Host", &dbv)==0)
- {
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseSkype2Socket", 0) &&
- (lstrcmp (dbv.pszVal, "127.0.0.1")==0 ||
- lstrcmp (dbv.pszVal, "localhost")==0) &&
- DBGetContactSettingWord(NULL, SKYPE_PROTONAME, "Port", 0) ==
- DBGetContactSettingWord(NULL, "IMOPROXY", "Port", 1401))
- {
- DBFreeVariant(&dbv);
- return TRUE;
- }
- DBFreeVariant(&dbv);
- }
- }
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "FirstRun", 9) == 9)
- {
- MessageBox (NULL, Translate("SKYPE plugin may not be installed, this plugin only works together with "
- "the SKYPE-plugin. Please check if you installed and enabled it."), "IMOPROXY",
- MB_OK | MB_ICONWARNING);
- }
- else
- {
-
- if ((iMask & PROXY_SOCKS) && !ServiceExists(SKYPE_PROTONAME PSS_SKYPEAPIMSG) )
- {
- if (MessageBox (NULL, Translate("Your Skype plugin currently doesn't seem to be setup to use imo2proxy, "
- "do you want me to change its settings so that it uses this plugins?"), "IMOPROXY",
- MB_YESNO | MB_ICONQUESTION) == IDYES)
- {
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "UseSkype2Socket", 1);
- DBWriteContactSettingWord (NULL, SKYPE_PROTONAME, "Port", m_stSocksCfg.sPort);
- DBWriteContactSettingString (NULL, SKYPE_PROTONAME, "Host", "127.0.0.1");
- return TRUE;
- }
- }
- }
- return FALSE;
-}
-
-// -----------------------------------------------------------------------------
-
-static BOOL EnumNetInterfaces (HWND hwndControl)
-{
- HINSTANCE hLib;
- BOOL bRet = FALSE;
-
- if (hLib = LoadLibrary("Iphlpapi.dll"))
- {
- PMIB_IPADDRTABLE pTable;
- ULONG uSize=1;
- DWORD i;
- FARPROC GetIpAddrTable;
-
- if (GetIpAddrTable = (FARPROC)GetProcAddress (hLib, "GetIpAddrTable"))
- {
- if ((GetIpAddrTable (&pTable, &uSize, TRUE) == ERROR_INSUFFICIENT_BUFFER) &&
- (pTable = HeapAlloc (GetProcessHeap(), 0, uSize)))
- {
- if (GetIpAddrTable (pTable, &uSize, TRUE) == NO_ERROR)
- {
- struct in_addr addr;
-
- for (i=0; i<pTable->dwNumEntries; i++)
- {
- addr.S_un.S_addr = pTable->table[i].dwAddr;
- SendMessage (hwndControl, CB_ADDSTRING, 0, (LPARAM)inet_ntoa(addr));
- }
- bRet = pTable->dwNumEntries > 0;
- }
- HeapFree (GetProcessHeap(), 0, pTable);
- }
- }
- FreeLibrary (hLib);
- }
- return bRet;
-}
-
-// -----------------------------------------------------------------------------
-
-static DWORD WINAPI ProxyThread(IMO2SPROXY *pProxy)
-{
- if (pProxy->Open(pProxy)<0) return -1;
- SetEvent (m_hEvent);
- pProxy->Loop(pProxy);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-static BYTE GetProxies(void)
-{
- return DBGetContactSettingByte(NULL, "IMOPROXY", "Proxies",
- (ServiceExists(SKYPE_PROTONAME PSS_SKYPEAPIMSG)?(1<<PROXY_SKYPEPLUGIN):(1<<PROXY_SOCKS)));
-}
-
-// -----------------------------------------------------------------------------
-
-static BOOL StartProxy (int i)
-{
- DWORD dwThreadId;
- BOOL bCreateThread = FALSE, bRet = TRUE;
- BYTE cEnabled = GetProxies();
- HANDLE ahEvents[2];
-
- // Username and Password must me available
- if (!m_stCfg.pszUser || !*m_stCfg.pszUser ||
- !m_stCfg.pszPass || !*m_stCfg.pszPass || !(cEnabled&(1<<i)) ) return FALSE;
-
- // Start the proxy, if enabled
- switch (i)
- {
- case PROXY_SOCKS:
- if (!(m_apProxy[i]))
- m_apProxy[i] = SocksProxy_Init (&m_stCfg, &m_stSocksCfg);
- break;
- case PROXY_W32SKYPEEMU:
- if (!(m_apProxy[i]))
- m_apProxy[i] = W32SkypeEmu_Init (&m_stCfg, &m_stSypeEmuCfg);
- break;
- case PROXY_SKYPEPLUGIN:
- if (!(m_apProxy[i]))
- m_apProxy[i] = SkypePluginLink_Init (&m_stCfg, &m_stSkypePluginCfg);
- if (m_apProxy[i]->Open(m_apProxy[i])<0)
- {
- m_apProxy[i]->Exit(m_apProxy[i]);
- return FALSE;
- }
- return TRUE;
- default:
- return FALSE;
- }
- if (!m_apProxy[i]) return FALSE;
-
- // As for example W32SKYPEEMU runs its own messagepump and the Window is
- // Registered in the Open-Function (as it can fail), we have to start
- // our Mainloop-Thread and wait for the Open() part to finish.
- // If it worked ok, the loop will start to run, otherwise we return
- // an error. So we need a Mutex for synchronisation.
- m_hEvent = ahEvents[1] = CreateEvent (NULL, FALSE, FALSE, NULL);
-
- if (!(m_hThread[i] = ahEvents[0] = (HANDLE)_beginthreadex (NULL, 0, ProxyThread, m_apProxy[i], 0, &dwThreadId)))
- {
- MessageBox (NULL, Translate("IMOPROXY Cannot start dispatch thread"), "IMOPROXY", MB_OK | MB_ICONSTOP);
- CloseHandle (m_hEvent);
- m_apProxy[i]->Exit(m_apProxy[i]);
- return FALSE;
- }
-
- bRet = WaitForMultipleObjects (2, ahEvents, FALSE, INFINITE)==WAIT_OBJECT_0+1;
- CloseHandle (m_hEvent);
- return bRet;
-}
-
-// -----------------------------------------------------------------------------
-
-static void StopProxy (int i)
-{
- if (m_apProxy[i])
- {
- m_apProxy[i]->Exit(m_apProxy[i]);
- m_apProxy[i] = NULL;
- }
-
- if (m_hThread[i])
- {
- if (WaitForSingleObject (m_hThread[i], 3000) != WAIT_OBJECT_0)
- TerminateThread (m_hThread[i], -1);
- m_hThread[i] = NULL;
- }
-}
-
-// -----------------------------------------------------------------------------
-
-static BOOL StartProxies(int iMask)
-{
- int i;
- BOOL bRet=TRUE;
-
- for (i=0; i<PROXY_MAX; i++)
- if (iMask&(1<<i))
- bRet &= StartProxy(i);
- return bRet;
-}
-
-// -----------------------------------------------------------------------------
-
-static void StopProxies(int iMask)
-{
- int i;
-
- for (i=0; i<PROXY_MAX; i++)
- if (iMask&(1<<i))
- StopProxy(i);
-}
-
-// -----------------------------------------------------------------------------
-
-static void UpdateProxyStatus (HWND hWnd, int iID)
-{
- struct {
- UINT uStatus;
- UINT uStart;
- UINT uStop;
- } astStatus[] = {
- {IDC_STATUSSOCKS, IDC_STARTSOCKS, IDC_STOPSOCKS},
- {IDC_STATUSCOMM, IDC_STARTCOMM, IDC_STOPCOMM},
- {IDC_STATUSSKYPEPL, IDC_STARTSKYPEPL, IDC_STOPSKYPEPL}
- };
-
- if (m_apProxy[iID])
- {
- SetDlgItemText (hWnd, astStatus[iID].uStatus, Translate("Running"));
- EnableWindow ((HWND)GetDlgItem (hWnd, astStatus[iID].uStart), FALSE);
- EnableWindow ((HWND)GetDlgItem (hWnd, astStatus[iID].uStop), TRUE);
- }
- else
- {
- BYTE cEnabled = GetProxies();
-
- SetDlgItemText (hWnd, astStatus[iID].uStatus, Translate("Stopped"));
- EnableWindow ((HWND)GetDlgItem (hWnd, astStatus[iID].uStart),
- ((cEnabled&(1<<iID)) && m_stCfg.pszUser && *m_stCfg.pszUser &&
- m_stCfg.pszPass && *m_stCfg.pszPass)?TRUE:FALSE);
- EnableWindow ((HWND)GetDlgItem (hWnd, astStatus[iID].uStop), FALSE);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-static int CALLBACK OptionsDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
- static char szOldHost[64]={0}, szOldLog[MAX_PATH]={0}, szOldUser[64], szOldPass[64];
- static short sOldPort=0;
- static BOOL bOldVerbose=FALSE;
- static int iOldFlags = 0, iOldProxies;
-
- switch (uMsg)
- {
- case WM_INITDIALOG:
- {
- DBVARIANT dbv;
-
- TranslateDialogDefault(hWnd);
- EnumNetInterfaces (GetDlgItem (hWnd, IDC_BINDIP));
- if (DBGetContactSetting(NULL, "IMOPROXY", "Host", &dbv)==0)
- {
- lstrcpyn (szOldHost, dbv.pszVal, sizeof(szOldHost));
- DBFreeVariant(&dbv);
- } else lstrcpy (szOldHost, "127.0.0.1");
- SetDlgItemText (hWnd, IDC_BINDIP,szOldHost);
- SetDlgItemInt (hWnd, IDC_BINDPORT, sOldPort = DBGetContactSettingWord(NULL, "IMOPROXY", "Port", 1401), FALSE);
- iOldFlags = DBGetContactSettingDword(NULL, "IMOPROXY", "Flags", 0);
- if (iOldFlags & IMO2S_FLAG_ALLOWINTERACT) CheckDlgButton (hWnd, IDC_INTERACT, BST_CHECKED);
- if (iOldFlags & IMO2S_FLAG_CURRTIMESTAMP) CheckDlgButton (hWnd, IDC_CURRTIMESTAMP, BST_CHECKED);
- if (DBGetContactSetting(NULL, "IMOPROXY", "Logfile", &dbv)==0)
- {
- lstrcpyn (szOldLog, dbv.pszVal, sizeof(szOldLog));
- DBFreeVariant(&dbv);
- }
- if (CallService (MS_SYSTEM_GETVERSION, 0, 0) >= 0x080000)
- {
- EnableWindow (GetDlgItem (hWnd, IDC_USENETLIB), TRUE);
- if (DBGetContactSettingByte (NULL, "IMOPROXY", "UseNetlib", 0))
- CheckDlgButton (hWnd, IDC_USENETLIB, BST_CHECKED);
- }
- SetDlgItemText (hWnd, IDC_LOGFILE, szOldLog);
- if (bOldVerbose = DBGetContactSettingByte(NULL, "IMOPROXY", "Verbose", 0))
- CheckDlgButton (hWnd, IDC_LOG, BST_CHECKED);
- else
- {
- EnableWindow (GetDlgItem (hWnd, IDC_LOGFILE), FALSE);
- EnableWindow (GetDlgItem (hWnd, IDC_OPEN), FALSE);
- }
- if (DBGetContactSetting(NULL, "IMOPROXY", "User", &dbv)==0)
- {
- lstrcpyn (szOldUser, dbv.pszVal, sizeof(szOldUser));
- DBFreeVariant(&dbv);
- }
- SetDlgItemText (hWnd, IDC_USERNAME, szOldUser);
- if (DBGetContactSetting(NULL, "IMOPROXY", "Password", &dbv)==0)
- {
- lstrcpyn (szOldPass, dbv.pszVal, sizeof(szOldPass));
- DBFreeVariant(&dbv);
- }
- iOldProxies= GetProxies();
- CheckDlgButton (hWnd, IDC_USESOCKS, (iOldProxies&(1<<PROXY_SOCKS))?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton (hWnd, IDC_USECOMM, (iOldProxies&(1<<PROXY_W32SKYPEEMU))?BST_CHECKED:BST_UNCHECKED);
- if (ServiceExists(SKYPE_PROTONAME PSS_SKYPEAPIMSG))
- {
- CheckDlgButton (hWnd, IDC_USESKYPEPL, (iOldProxies&(1<<PROXY_SKYPEPLUGIN))?BST_CHECKED:BST_UNCHECKED);
- UpdateProxyStatus (hWnd, PROXY_SKYPEPLUGIN);
- }
- else
- {
- EnableWindow (GetDlgItem (hWnd, IDC_USESKYPEPL), FALSE);
- EnableWindow (GetDlgItem (hWnd, IDC_STARTSKYPEPL), FALSE);
- }
- SetDlgItemText (hWnd, IDC_PASSWORD, szOldPass);
- UpdateProxyStatus (hWnd, PROXY_SOCKS);
- UpdateProxyStatus (hWnd, PROXY_W32SKYPEEMU);
-#ifdef _DEBUG
- EnableWindow (GetDlgItem(hWnd, IDC_CONSOLE), TRUE);
-#endif
- return TRUE;
- }
- case WM_NOTIFY:
- {
- NMHDR* nmhdr = (NMHDR*)lParam;
-
- switch (nmhdr->code)
- {
- case PSN_APPLY:
- case PSN_KILLACTIVE:
- {
- int iFlags=0, iProxies=0;
- short sPort;
- char szHost[64], szLog[MAX_PATH], szUser[64], szPass[64];
- BOOL bVerbose;
-
- GetDlgItemText (hWnd, IDC_BINDIP, szHost, sizeof(szHost));
- DBWriteContactSettingString (NULL, "IMOPROXY", "Host", szHost);
- DBWriteContactSettingWord (NULL, "IMOPROXY", "Port",
- (sPort = GetDlgItemInt (hWnd, IDC_BINDPORT, NULL, FALSE)));
- if (IsDlgButtonChecked (hWnd, IDC_INTERACT)==BST_CHECKED)
- iFlags|=IMO2S_FLAG_ALLOWINTERACT;
- if (IsDlgButtonChecked (hWnd, IDC_CURRTIMESTAMP)==BST_CHECKED)
- iFlags|=IMO2S_FLAG_CURRTIMESTAMP;
- GetDlgItemText (hWnd, IDC_USERNAME, szUser, sizeof(szUser));
- DBWriteContactSettingString (NULL, "IMOPROXY", "User", szUser);
- GetDlgItemText (hWnd, IDC_PASSWORD, szPass, sizeof(szPass));
- DBWriteContactSettingString (NULL, "IMOPROXY", "Password", szPass);
- DBWriteContactSettingDword (NULL, "IMOPROXY", "Flags", iFlags);
- DBWriteContactSettingByte(NULL, "IMOPROXY", "Verbose",
- (char)(bVerbose = (IsDlgButtonChecked (hWnd, IDC_LOG)==BST_CHECKED)));
- GetDlgItemText (hWnd, IDC_LOGFILE, szLog, sizeof(szLog));
- DBWriteContactSettingString (NULL, "IMOPROXY", "Logfile", szLog);
- if (IsDlgButtonChecked (hWnd, IDC_USESOCKS)==BST_CHECKED)
- iProxies|=(1<<PROXY_SOCKS);
- if (IsDlgButtonChecked (hWnd, IDC_USECOMM)==BST_CHECKED)
- iProxies|=(1<<PROXY_W32SKYPEEMU);
- if (IsDlgButtonChecked (hWnd, IDC_USESKYPEPL)==BST_CHECKED)
- iProxies|=(1<<PROXY_SKYPEPLUGIN);
- DBWriteContactSettingByte(NULL, "IMOPROXY", "UseNetlib",
- (char)(IsDlgButtonChecked (hWnd, IDC_USENETLIB)==BST_CHECKED));
- DBWriteContactSettingByte(NULL, "IMOPROXY", "Proxies", (char)iProxies);
- iProxies^=iOldProxies;
- if (sPort != sOldPort || lstrcmp (szOldHost, szHost))
- iProxies|=(1<<PROXY_SOCKS);
-
- if (lstrcmp (szOldLog, szLog) || bOldVerbose != bVerbose ||
- lstrcmp (szOldUser, szUser) || lstrcmp(szOldPass, szPass) ||
- iFlags != iOldFlags)
- iProxies=(1<<PROXY_MAX)-1;
-
- /*
- StopProxies(iProxies);
- LoadSettings();
- CheckSettings(iProxies);
- StartProxies(iProxies);
- */
- UpdateProxyStatus (hWnd, PROXY_SOCKS);
- UpdateProxyStatus (hWnd, PROXY_W32SKYPEEMU);
- if (ServiceExists(SKYPE_PROTONAME PSS_SKYPEAPIMSG))
- UpdateProxyStatus (hWnd, PROXY_SKYPEPLUGIN);
- return TRUE;
- }
- }
- break;
- }
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDC_LOG:
- {
- BOOL bEnable = (SendMessage ((HWND)lParam, BM_GETCHECK, 0, 0)==BST_CHECKED);
-
- EnableWindow (GetDlgItem (hWnd, IDC_LOGFILE), bEnable);
- EnableWindow (GetDlgItem (hWnd, IDC_OPEN), bEnable);
- break;
- }
- case IDC_OPEN:
- {
- char szFilename[MAX_PATH];
- OPENFILENAME ofn={0};
-
- GetDlgItemText (hWnd, IDC_LOGFILE, szFilename, sizeof(szFilename));
- ofn.lStructSize=sizeof(OPENFILENAME);
- ofn.hwndOwner=hWnd;
- ofn.Flags=OFN_HIDEREADONLY;
- ofn.lpstrTitle=Translate("Select where log file will be created");
- ofn.lpstrFilter=Translate("All files (*.*)\0*.*\0");
- ofn.lpstrFile=szFilename;
- ofn.nMaxFile=sizeof(szFilename)-2;
- ofn.nMaxFileTitle=sizeof(szFilename);
- if(GetSaveFileName(&ofn))
- SetDlgItemText(hWnd, IDC_LOGFILE, szFilename);
- break;
- }
- case IDC_STARTSOCKS:
- case IDC_STARTCOMM:
- case IDC_STARTSKYPEPL:
- {
- int iID;
-
- switch (LOWORD(wParam))
- {
- case IDC_STARTSOCKS:
- iID = PROXY_SOCKS;
- break;
- case IDC_STARTCOMM:
- iID = PROXY_W32SKYPEEMU;
- break;
- case IDC_STARTSKYPEPL:
- iID = PROXY_SKYPEPLUGIN;
- break;
- }
- EnableWindow ((HWND)lParam, FALSE);
- LoadSettings();
- CheckSettings (1<<iID);
- StartProxy (iID);
- UpdateProxyStatus (hWnd, iID);
- break;
- }
- case IDC_STOPSOCKS:
- case IDC_STOPCOMM:
- case IDC_STOPSKYPEPL:
- {
- int iID;
-
- switch (LOWORD(wParam))
- {
- case IDC_STOPSOCKS:
- iID = PROXY_SOCKS;
- break;
- case IDC_STOPCOMM:
- iID = PROXY_W32SKYPEEMU;
- break;
- case IDC_STOPSKYPEPL:
- iID = PROXY_SKYPEPLUGIN;
- break;
- }
- EnableWindow ((HWND)lParam, FALSE);
- StopProxy (iID);
- UpdateProxyStatus (hWnd, iID);
- break;
- }
- case IDC_CONSOLE:
- {
- CONSOLE_SCREEN_BUFFER_INFO coninfo;
- HANDLE hStdHandle;
- int hConHandle;
- HMENU hMenu;
- FILE *fp;
- HMODULE hKernel32;
- HWND (WINAPI *_GetConsoleWindow)(void), hWndCon;
-
- /* Some dirty hack for a simple console. I know this isn't really
- proper and that I should use my own console, but it's enough for
- debugging purposes ;-)
- */
- if (HIWORD(wParam)!=BN_CLICKED) break;
- switch (SendMessage ((HWND)lParam, BM_GETCHECK, 0, 0))
- {
- case BST_UNCHECKED:
- if (m_stCfg.fpLog) fclose(m_stCfg.fpLog);
- m_stCfg.fpLog = NULL;
- LoadSettings ();
- FreeConsole();
- m_stCfg.bVerbose = bOldVerbose;
- m_bConsole = FALSE;
- break;
- case BST_CHECKED:
- m_bConsole = AllocConsole();
- hStdHandle = GetStdHandle(STD_OUTPUT_HANDLE);
- GetConsoleScreenBufferInfo(hStdHandle, &coninfo);
- coninfo.dwSize.Y = 500;
- SetConsoleScreenBufferSize(hStdHandle, coninfo.dwSize);
- hConHandle = _open_osfhandle((long)hStdHandle, _O_TEXT);
- fp = _fdopen(hConHandle, "w");
- if (!fp)
- {
- FreeConsole();
- break;
- }
- // Only available in Win2k or above
- // Protect Console form closing, otherwise closing the console
- // would Shutdown Miranda
- if ((hKernel32 = GetModuleHandle ("kernel32.dll")) &&
- (*(FARPROC *)&_GetConsoleWindow =
- GetProcAddress(hKernel32, "GetConsoleWindow")) &&
- (hWndCon = _GetConsoleWindow()))
- {
- hMenu = GetSystemMenu (hWndCon, FALSE);
- DeleteMenu (hMenu, SC_CLOSE, MF_BYCOMMAND);
- }
- else
- {
- fprintf (fp, Translate("WARNING: Only close this console by pushing the Console button "
- "in the settings dialog, otherwise you sould shutdown Miranda by closing "
- "the Window!\n"));
- }
- setvbuf(fp, NULL, _IONBF, 0 );
- if (m_stCfg.fpLog && m_stCfg.fpLog != stdout && m_stCfg.fpLog != stderr) fclose(m_stCfg.fpLog);
- bOldVerbose = m_stCfg.bVerbose;
- m_stCfg.bVerbose = 1;
- m_stCfg.fpLog = fp;
- break;
- }
- break;
- }
- }
- SendMessage (GetParent(hWnd), PSM_CHANGED, 0, 0);
- break;
- }
- return FALSE;
-}
-
-// -----------------------------------------------------------------------------
-
-static int RegisterOptions(WPARAM wParam, LPARAM lParam)
-{
- OPTIONSDIALOGPAGE odp={0};
-
- odp.cbSize = sizeof(odp);
- odp.hInstance = m_hInst;
- odp.pszTemplate = MAKEINTRESOURCE(IDD_OPTIONS);
- odp.pszGroup = Translate("Network");
- odp.pszTitle = "Skype Imoproxy";
- odp.pfnDlgProc = OptionsDlgProc;
- odp.flags = ODPF_BOLDGROUPS;
- CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-void RegisterToUpdate(void)
-{
- //Use for the Updater plugin
- if(ServiceExists(MS_UPDATE_REGISTER))
- {
- Update update = {0};
- char szVersion[16];
-
- update.szComponentName = pluginInfo.shortName;
- update.pbVersion = (BYTE *)CreateVersionStringPlugin((PLUGININFO *)&pluginInfo, szVersion);
- update.cpbVersion = strlen((char *)update.pbVersion);
-
-#ifdef _WIN64
- update.szUpdateURL = "http://dose.0wnz.at/miranda/Skype/imo2sproxy_x64_binonly.zip"; // FIXME!!
- update.szVersionURL = "http://dose.0wnz.at/miranda/Skype/"; // FIXME
- update.pbVersionPrefix = (BYTE *)"imo2sproxy version "; //FIXME
- update.szBetaUpdateURL = "http://dose.0wnz.at/miranda/Skype/imo2sproxy_x64_binonly.zip";
- update.szBetaVersionURL = "http://dose.0wnz.at/miranda/Skype/";
- update.pbBetaVersionPrefix = (BYTE *)"imo2sproxy version ";
-#else
- update.szUpdateURL = "http://addons.miranda-im.org/feed.php?dlfile=4146";
- update.szVersionURL = "http://addons.miranda-im.org/details.php?action=viewfile&id=4146";
- update.pbVersionPrefix = (BYTE *)"<span class=\"fileNameHeader\">Skype to imo.im Gateway ";
- update.szBetaUpdateURL = "http://dose.0wnz.at/miranda/Skype/imo2sproxy_w32_binonly.zip";
- update.szBetaVersionURL = "http://dose.0wnz.at/miranda/Skype/";
- update.pbBetaVersionPrefix = (BYTE *)"imo2sproxy version ";
-#endif
-
- update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix);
- update.cpbBetaVersionPrefix = strlen((char *)update.pbBetaVersionPrefix);
-
- CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
-
- }
-}
-
-// -----------------------------------------------------------------------------
-
-int PreShutdown(WPARAM wParam, LPARAM lParam)
-{
- OutputDebugString ("IMOPROXY: PreShutdown");
- StopProxies (-1);
- if (m_stCfg.fpLog && m_stCfg.fpLog != stdout && m_stCfg.fpLog != stderr)
- {
- fclose(m_stCfg.fpLog);
- m_stCfg.fpLog = NULL;
- }
- if (m_stCfg.pszUser)
- {
- free(m_stCfg.pszUser);
- m_stCfg.pszUser = NULL;
- }
- if (m_stCfg.pszPass)
- {
- free(m_stCfg.pszPass);
- m_stCfg.pszPass = NULL;
- }
-
- FreeConsole();
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
-{
- BYTE CheckSkype = DBGetContactSettingByte (NULL, "IMOPROXY", "CheckSkype", 2);
- if (CheckSkype) CheckSettings(-1);
- if (CheckSkype == 2) DBWriteContactSettingByte (NULL, "IMOPROXY", "CheckSkype", 0);
- RegisterToUpdate();
-
- // On Miranda 0.0.0.8+ NETLIB suppotrs HTTPS, therefore we can use
- // Netlib there
- if (CallService (MS_SYSTEM_GETVERSION, 0, 0) >= 0x080000 &&
- DBGetContactSettingByte (NULL, "IMOPROXY", "UseNetlib", 0))
- ImoRq_SetIOLayer (IoLayerNETLIB_Init);
- StartProxies(-1);
-
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
-{
- m_hInst=hinstDLL;
- return TRUE;
-}
-
-// -----------------------------------------------------------------------------
-// -----------------------------------------------------------------------------
-
-__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
-{
- return &pluginInfo;
-}
-
-// -----------------------------------------------------------------------------
-
-// New plugin API
-__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
-{
- return &pluginInfoEx;
-}
-
-// -----------------------------------------------------------------------------
-
-__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
-
-// -----------------------------------------------------------------------------
-
-int __declspec(dllexport) Load(PLUGINLINK *link)
-{
-
-#ifdef _DEBUG
- Crash_Init();
-#endif
- pluginLink = link;
-
- // Init IMO2S config structures
- Imo2sproxy_Defaults (&m_stCfg);
- SocksProxy_Defaults (&m_stSocksCfg);
- W32SkypeEmu_Defaults(&m_stSypeEmuCfg);
- SkypePluginLink_Defaults(&m_stSkypePluginCfg);
- m_stCfg.logerror = ShowError;
- LoadSettings();
-
- m_hOptHook = HookEvent(ME_OPT_INITIALISE, RegisterOptions);
- m_hPreShutdownHook = HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
- m_hHookModulesLoaded = HookEvent( ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
-
- OutputDebugString ("IMOPROXY: Loaded");
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-int __declspec(dllexport) Unload(void)
-{
- OutputDebugString ("IMOPROXY: Unload");
- UnhookEvent(m_hOptHook);
- UnhookEvent(m_hPreShutdownHook);
- UnhookEvent(m_hHookModulesLoaded);
- return 0;
-}
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/io_layer_netlib.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/io_layer_netlib.c deleted file mode 100644 index 378f72e65f..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/io_layer_netlib.c +++ /dev/null @@ -1,340 +0,0 @@ -/* Module: io_layer_netlib.c
- Purpose: IO Layer for Internet communication using Miranda NETLIB
- Author: leecher
- Date: 20.04.2011 :=)
-*/
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winsock2.h>
-#include <stdlib.h>
-#include "include/newpluginapi.h"
-#include "include/m_netlib.h"
-#include "fifo.h"
-#include "memlist.h"
-#include "io_layer.h"
-
-#define USER_AGENT "Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"
-
-typedef struct
-{
- IOLAYER vtbl;
- int iRecursion;
- NETLIBHTTPREQUEST *nlhrReply;
- LPVOID lpErrorBuf;
- HANDLE nlc;
-} IOLAYER_INST;
-
-typedef struct
-{
- HANDLE hNetlib;
- TYP_LIST *hCookies;
- TYP_FIFO *hCookieStr;
- char *pszCookies;
- LONG lRefCount;
- CRITICAL_SECTION cs;
-} IOLAYER_SINGLETON;
-
-static IOLAYER_SINGLETON *m_hNL = NULL;
-
-static void IoLayer_Exit (IOLAYER *hPIO);
-static char *IoLayer_Post(IOLAYER *hPIO, char *pszURL, char *pszPostFields, unsigned int cbPostFields, unsigned int *pdwLength);
-static char *IoLayer_Get(IOLAYER *hIO, char *pszURL, unsigned int *pdwLength);
-static void IoLayer_Cancel(IOLAYER *hIO);
-static char *IoLayer_GetLastError(IOLAYER *hIO);
-static char *IoLayer_EscapeString(IOLAYER *hPIO, char *pszData);
-static void IoLayer_FreeEscapeString(char *pszData);
-static void FetchLastError (IOLAYER_INST *hIO);
-static void add_cookies(char *pszCookies);
-static void refresh_cookies();
-static HANDLE *OpenConnection(NETLIBHTTPREQUEST *nlhr);
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-IOLAYER *IoLayerNETLIB_Init(void)
-{
- IOLAYER_INST *hIO;
-
- if (CallService (MS_SYSTEM_GETVERSION, 0, 0) < 0x080000 || // Miranda HTTPS support starting with 0.8.0.0
- !(hIO = calloc(1, sizeof(IOLAYER_INST))))
- return NULL;
-
- // NETLIB only works as singleton
- if (!m_hNL)
- {
- NETLIBUSER nlu={0};
-
- if (!(m_hNL = calloc (1, sizeof(IOLAYER_SINGLETON))))
- {
- free (hIO);
- return NULL;
- }
- m_hNL->lRefCount++;
-
- // Init Netlib
- nlu.cbSize = sizeof(nlu);
- nlu.flags = NUF_OUTGOING;
- nlu.szDescriptiveName = "imo2sproxy connection";
- nlu.szSettingsModule = "IMOPROXY";
- nlu.szHttpGatewayUserAgent = USER_AGENT;
- if (!(m_hNL->hNetlib = (HANDLE)CallService (MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu)) ||
- !(m_hNL->hCookies = List_Init(0)) ||
- !(m_hNL->hCookieStr = Fifo_Init(0)))
- {
- IoLayer_Exit((IOLAYER*)hIO);
- return NULL;
- }
- m_hNL->pszCookies = "";
- InitializeCriticalSection (&m_hNL->cs);
- } else m_hNL->lRefCount++;
-
- // Init Vtbl
- hIO->vtbl.Exit = IoLayer_Exit;
- hIO->vtbl.Post = IoLayer_Post;
- hIO->vtbl.Get = IoLayer_Get;
- hIO->vtbl.Cancel = IoLayer_Cancel;
- hIO->vtbl.GetLastError = IoLayer_GetLastError;
- hIO->vtbl.EscapeString = IoLayer_EscapeString;
- hIO->vtbl.FreeEscapeString = IoLayer_FreeEscapeString;
-
- return (IOLAYER*)hIO;
-}
-// -----------------------------------------------------------------------------
-
-static void IoLayer_Exit (IOLAYER *hPIO)
-{
- IOLAYER_INST *hIO = (IOLAYER_INST*)hPIO;
-
- if (hIO->nlhrReply) CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT,0,(LPARAM)hIO->nlhrReply);
- if (hIO->lpErrorBuf) LocalFree(hIO->lpErrorBuf);
- if (InterlockedDecrement(&m_hNL->lRefCount) <= 0)
- {
- if (m_hNL->hNetlib) Netlib_CloseHandle (m_hNL->hNetlib);
- if (m_hNL->hCookies) {
- List_FreeElements(m_hNL->hCookies);
- List_Exit (m_hNL->hCookies);
- }
- if (m_hNL->hCookieStr) Fifo_Exit(m_hNL->hCookieStr);
- DeleteCriticalSection (&m_hNL->cs);
- free (m_hNL);
- m_hNL = NULL;
- }
- free (hIO);
-}
-
-// -----------------------------------------------------------------------------
-
-static char *IoLayer_Post(IOLAYER *hPIO, char *pszURL, char *pszPostFields, unsigned int cbPostFields, unsigned int *pdwLength)
-{
- IOLAYER_INST *hIO = (IOLAYER_INST*)hPIO;
- NETLIBHTTPREQUEST nlhr={0};
- NETLIBHTTPHEADER headers[5];
- int i;
- char *pszCookies = NULL;
-
-
- /*
- char szDbg[256];
- sprintf (szDbg, "Thread %d with hIO %08X requests %s\n", GetCurrentThreadId(), hIO, pszURL);
- OutputDebugString(szDbg);
- */
-
- // Build basic request
- nlhr.cbSize = sizeof(nlhr);
- nlhr.flags = NLHRF_GENERATEHOST | NLHRF_SMARTREMOVEHOST | NLHRF_REDIRECT;
- if (!pdwLength) nlhr.flags |= NLHRF_DUMPASTEXT; // pdwLength needed -> Binary data
- nlhr.requestType = pszPostFields?REQUEST_POST:REQUEST_GET;
- nlhr.szUrl = pszURL;
- nlhr.pData = pszPostFields;
- nlhr.dataLength = cbPostFields;
- nlhr.headers = headers;
-
- // Add headers
- EnterCriticalSection (&m_hNL->cs);
- if (m_hNL->pszCookies && *m_hNL->pszCookies)
- {
- headers[nlhr.headersCount].szName = "Cookie";
- headers[nlhr.headersCount++].szValue = pszCookies = strdup(m_hNL->pszCookies);
- }
- headers[nlhr.headersCount].szName = "User-Agent";
- headers[nlhr.headersCount++].szValue = USER_AGENT;
- headers[nlhr.headersCount].szName = "Accept-Encoding";
- headers[nlhr.headersCount++].szValue = "deflate, gzip";
- headers[nlhr.headersCount].szName = "Content-Type";
- headers[nlhr.headersCount++].szValue = "application/x-www-form-urlencoded; charset=UTF-8";
- headers[nlhr.headersCount].szName = "X-Requested-With";
- headers[nlhr.headersCount++].szValue = "XMLHttpRequest";
- LeaveCriticalSection (&m_hNL->cs);
-
- // Do the transaction
- nlhr.nlc = hIO->nlc = OpenConnection (&nlhr);
- if (hIO->nlhrReply) CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT,0,(LPARAM)hIO->nlhrReply);
- hIO->nlhrReply = (NETLIBHTTPREQUEST*)CallService (MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNL->hNetlib, (LPARAM)&nlhr);
- hIO->nlc = NULL;
-
- if (pszCookies) free (pszCookies);
- if (!hIO->nlhrReply)
- {
- FetchLastError (hIO);
- return NULL;
- }
-
- if (!hIO->nlhrReply || !hIO->nlhrReply->dataLength || !hIO->nlhrReply->pData)
- {
- if (hIO->lpErrorBuf) LocalFree(hIO->lpErrorBuf);
- if (hIO->lpErrorBuf = LocalAlloc (LPTR, 64))
- strcpy (hIO->lpErrorBuf, "Reply contained no data");
- return NULL;
- }
-
- // Error handling
- if (hIO->nlhrReply->resultCode < 200 || hIO->nlhrReply->resultCode >= 300)
- {
- if (hIO->lpErrorBuf) LocalFree(hIO->lpErrorBuf);
- if (hIO->lpErrorBuf = LocalAlloc (LPTR, 64))
- sprintf (hIO->lpErrorBuf, "HTTP transaction returned status %d", hIO->nlhrReply->resultCode);
- return NULL;
- }
-
- // Process headers to collect cookies
- EnterCriticalSection (&m_hNL->cs);
- for (i=0; i<hIO->nlhrReply->headersCount; i++)
- {
- if (!strnicmp(hIO->nlhrReply->headers[i].szName, "Set-Cookie", 10))
- add_cookies(hIO->nlhrReply->headers[i].szValue);
- }
- LeaveCriticalSection (&m_hNL->cs);
-
- // Return reply
- if (pdwLength) *pdwLength = hIO->nlhrReply->dataLength;
- return hIO->nlhrReply->pData;
-}
-
-// -----------------------------------------------------------------------------
-
-static char *IoLayer_Get(IOLAYER *hIO, char *pszURL, unsigned int *pdwLength)
-{
- return IoLayer_Post (hIO, pszURL, NULL, 0, pdwLength);
-}
-
-// -----------------------------------------------------------------------------
-
-static void IoLayer_Cancel(IOLAYER *hPIO)
-{
- IOLAYER_INST *hIO = (IOLAYER_INST*)hPIO;
-
- if (hIO->nlc && Netlib_CloseHandle(hIO->nlc))
- hIO->nlc = NULL;
-}
-
-// -----------------------------------------------------------------------------
-
-static char *IoLayer_GetLastError(IOLAYER *hIO)
-{
- return (char*)((IOLAYER_INST*)hIO)->lpErrorBuf;
-}
-
-// -----------------------------------------------------------------------------
-
-static char *IoLayer_EscapeString(IOLAYER *hPIO, char *pszData)
-{
- return (char*)CallService (MS_NETLIB_URLENCODE, 0, (LPARAM)pszData);
-}
-
-// -----------------------------------------------------------------------------
-
-static void IoLayer_FreeEscapeString(char *pszData)
-{
- HeapFree(GetProcessHeap(), 0, pszData);
-}
-
-// -----------------------------------------------------------------------------
-// Static
-// -----------------------------------------------------------------------------
-
-static void FetchLastError (IOLAYER_INST *hIO)
-{
- if (hIO->lpErrorBuf) LocalFree(hIO->lpErrorBuf);
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
- GetLastError(), MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT),
- (LPTSTR)&hIO->lpErrorBuf, 0, NULL);
-}
-
-// -----------------------------------------------------------------------------
-
-static void add_cookies(char *pszCookies)
-{
- int i, nCount, iLenCmp, iLenCookie;
- char *p, *pszCookie = NULL;
-
- if (!(p = strchr(pszCookies, '='))) return;
- iLenCmp=p-pszCookies+1;
- if ((p=strchr (p, ';')) || (p=strchr (p, ';'))) iLenCookie = p-pszCookies;
- else iLenCookie=strlen(pszCookies);
-
- for (i=0, nCount=List_Count(m_hNL->hCookies); i<nCount; i++)
- {
- pszCookie = (char*)List_ElementAt (m_hNL->hCookies, i);
- if (!strncmp(pszCookie, pszCookies, iLenCmp))
- break;
- }
-
- if (i==nCount) pszCookie = NULL;
- if (pszCookie = realloc (pszCookie, iLenCookie+1))
- {
- strncpy (pszCookie, pszCookies, iLenCookie);
- pszCookie[iLenCookie]=0;
- if (i<nCount)
- List_ReplaceElementAt (m_hNL->hCookies, pszCookie, i);
- else
- List_Push (m_hNL->hCookies, pszCookie);
- }
- refresh_cookies ();
-}
-
-// -----------------------------------------------------------------------------
-
-static void refresh_cookies()
-{
- int i, nCount;
-
- Fifo_Reset (m_hNL->hCookieStr);
- for (i=0, nCount=List_Count(m_hNL->hCookies); i<nCount; i++)
- {
- char *pszCookie = (char*)List_ElementAt (m_hNL->hCookies, i);
- Fifo_Add (m_hNL->hCookieStr, pszCookie, strlen(pszCookie));
- Fifo_Add (m_hNL->hCookieStr, "; ", 2);
- }
- Fifo_Add (m_hNL->hCookieStr, "", 1);
- m_hNL->pszCookies = Fifo_Get (m_hNL->hCookieStr, NULL);
-}
-
-// -----------------------------------------------------------------------------
-
-static HANDLE *OpenConnection(NETLIBHTTPREQUEST *nlhr)
-{
- NETLIBOPENCONNECTION nloc={0};
- BOOL secur = (nlhr->flags & NLHRF_SSL) || _strnicmp(nlhr->szUrl, "https", 5) == 0;
- char* phost = strstr(nlhr->szUrl, "://");
- char *ppath, *pcolon;
-
- // Poor man's InternetCrackUrl
- nloc.cbSize = sizeof(NETLIBOPENCONNECTION);
- if (phost) phost+=3; else phost=nlhr->szUrl;
- nloc.szHost = _alloca (strlen(phost)+1);
- strcpy ((char*)nloc.szHost, phost);
- if (ppath = strchr(nloc.szHost, '/')) *ppath = '\0';
- if (pcolon = strrchr(nloc.szHost, ':'))
- {
- *pcolon = '\0';
- nloc.wPort = (WORD)strtol(pcolon+1, NULL, 10);
- }
- else nloc.wPort = secur ? 443 : 80;
- nloc.flags = (secur ? NLOCF_SSL : 0) | NLOCF_HTTP;
- if (secur) nlhr->flags |= NLHRF_SSL; else nlhr->flags &= ~NLHRF_SSL;
-
- // Open connection
- return (HANDLE)CallService (MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNL->hNetlib, (LPARAM)&nloc);
-}
\ No newline at end of file diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/res.aps b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/res.aps Binary files differdeleted file mode 100644 index 280086f42b..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/res.aps +++ /dev/null diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/res.rc b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/res.rc deleted file mode 100644 index 487426fbfe..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/res.rc +++ /dev/null @@ -1,145 +0,0 @@ -//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Deutsch (Österreich) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEA)
-#ifdef _WIN32
-LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_AUSTRIAN
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_OPTIONS DIALOGEX 0, 0, 287, 224
-STYLE WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Sans Serif"
-BEGIN
- GROUPBOX "Account information",IDC_STATIC,7,7,273,31
- LTEXT "Username:",IDC_STATIC,17,20,53,9
- EDITTEXT IDC_USERNAME,74,18,56,12,ES_AUTOHSCROLL
- LTEXT "Password:",IDC_STATIC,135,20,47,9
- EDITTEXT IDC_PASSWORD,185,18,56,12,ES_PASSWORD | ES_AUTOHSCROLL
- CONTROL "Support for Voicecalls via imo.im Flash in Internet Explorer",
- IDC_INTERACT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,42,
- 273,9
- CONTROL "Ignore server timestamp and use current time for messages",
- IDC_CURRTIMESTAMP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
- 7,60,273,10
- CONTROL "Log traffic to file:",IDC_LOG,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,7,71,110,10
- EDITTEXT IDC_LOGFILE,119,71,128,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_OPEN,248,71,14,12
- LTEXT "Status:",IDC_STATIC,126,140,29,10
- LTEXT "Stopped",IDC_STATUSSOCKS,157,140,54,9,SS_SUNKEN
- GROUPBOX "Socket Proxy",IDC_STATIC,7,129,273,45
- LTEXT "Bind to address:",IDC_STATIC,17,157,73,9
- COMBOBOX IDC_BINDIP,95,155,75,12,CBS_DROPDOWN | CBS_SORT |
- WS_VSCROLL | WS_TABSTOP
- LTEXT "Port:",IDC_STATIC,179,157,31,9
- EDITTEXT IDC_BINDPORT,211,155,31,12,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "Use Socket Proxy",IDC_USESOCKS,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,18,140,81,9
- PUSHBUTTON "Start",IDC_STARTSOCKS,216,137,30,12
- PUSHBUTTON "Stop",IDC_STOPSOCKS,246,137,30,12,WS_DISABLED
- GROUPBOX "Skype compatible communication API",IDC_STATIC,7,177,
- 273,40
- LTEXT "Caution: Don't use this if you have the Skype application running!",
- IDC_STATIC,13,188,260,8
- LTEXT "Status:",IDC_STATIC,126,201,29,10
- LTEXT "Stopped",IDC_STATUSCOMM,158,201,54,9,SS_SUNKEN
- CONTROL "Use compatible comm API",IDC_USECOMM,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,18,201,105,9
- PUSHBUTTON "Start",IDC_STARTCOMM,216,198,30,12
- PUSHBUTTON "Stop",IDC_STOPCOMM,246,198,30,12,WS_DISABLED
- CONTROL "Console",IDC_CONSOLE,"Button",BS_AUTOCHECKBOX |
- BS_PUSHLIKE | WS_TABSTOP,216,87,45,11
- GROUPBOX "Skype Plugin 0.0.0.46+ internal communication link",
- IDC_STATIC,7,102,273,25
- LTEXT "Status:",IDC_STATIC,126,113,29,10
- LTEXT "Stopped",IDC_STATUSSKYPEPL,158,113,54,9,SS_SUNKEN
- CONTROL "Use plugin link",IDC_USESKYPEPL,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,18,113,105,9
- PUSHBUTTON "Start",IDC_STARTSKYPEPL,216,110,30,12
- PUSHBUTTON "Stop",IDC_STOPSKYPEPL,246,110,30,12,WS_DISABLED
- CONTROL "Use Netlib instead of WinInet (Experimental)",
- IDC_USENETLIB,"Button",BS_AUTOCHECKBOX | WS_DISABLED |
- WS_TABSTOP,7,51,273,9
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_OPTIONS, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 280
- TOPMARGIN, 7
- BOTTOMMARGIN, 217
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // Deutsch (Österreich) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/resource.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/resource.h deleted file mode 100644 index e0da6bef1d..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/resource.h +++ /dev/null @@ -1,39 +0,0 @@ -//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by res.rc
-//
-#define IDD_OPTIONS 101
-#define IDC_BINDPORT 1001
-#define IDC_BINDIP 1002
-#define IDC_INTERACT 1003
-#define IDC_CURRTIMESTAMP 1004
-#define IDC_LOG 1005
-#define IDC_LOGFILE 1006
-#define IDC_OPEN 1007
-#define IDC_USERNAME 1008
-#define IDC_PASSWORD 1009
-#define IDC_STATUSSOCKS 1010
-#define IDC_STATUSCOMM 1011
-#define IDC_STATUSSKYPEPL 1012
-#define IDC_USESOCKS 1013
-#define IDC_STARTSOCKS 1014
-#define IDC_STOPSOCKS 1015
-#define IDC_USECOMM 1016
-#define IDC_STARTCOMM 1017
-#define IDC_STOPCOMM 1018
-#define IDC_CONSOLE 1019
-#define IDC_USESKYPEPL 1020
-#define IDC_STARTSKYPEPL 1021
-#define IDC_STOPSKYPEPL 1022
-#define IDC_USENETLIB 1023
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 102
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1020
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/sdk/m_updater.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/sdk/m_updater.h deleted file mode 100644 index 371b7437a0..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/sdk/m_updater.h +++ /dev/null @@ -1,146 +0,0 @@ -#ifndef _M_UPDATER_H
-#define _M_UPDATER_H
-
-// NOTES:
-// - For langpack updates, include a string of the following format in the langpack text file:
-// ";FLID: <file listing name> <version>"
-// version must be four numbers seperated by '.', in the range 0-255 inclusive
-// - Updater will disable plugins that are downloaded but were not active prior to the update (this is so that, if an archive contains e.g. ansi and
-// unicode versions, the correct plugin will be the only one active after the new version is installed)...so if you add a support plugin, you may need
-// to install an ini file to make the plugin activate when miranda restarts after the update
-// - Updater will replace all dlls that have the same internal shortName as a downloaded update dll (this is so that msn1.dll and msn2.dll, for example,
-// will both be updated) - so if you have a unicode and a non-unicode version of a plugin in your archive, you should make the internal names different (which will break automatic
-// updates from the file listing if there is only one file listing entry for both versions, unless you use the 'MS_UPDATE_REGISTER' service below)
-// - Updater will install all files in the root of the archive into the plugins folder, except for langpack files that contain the FLID string which go into the root folder (same
-// folder as miranda32.exe)...all folders in the archive will also be copied to miranda's root folder, and their contents transferred into the new folders. The only exception is a
-// special folder called 'root_files' - if there is a folder by that name in the archive, it's contents will also be copied into miranda's root folder - this is intended to be used
-// to install additional dlls etc that a plugin may require)
-
-// if you set Update.szUpdateURL to the following value when registering, as well as setting your beta site and version data,
-// Updater will ignore szVersionURL and pbVersionPrefix, and attempt to find the file listing URL's from the backend XML data.
-// for this to work, the plugin name in pluginInfo.shortName must match the file listing exactly (except for case)
-#define UPDATER_AUTOREGISTER "UpdaterAUTOREGISTER"
-// Updater will also use the backend xml data if you provide URL's that reference the miranda file listing for updates (so you can use that method
-// if e.g. your plugin shortName does not match the file listing) - it will grab the file listing id from the end of these URLs
-
-typedef struct Update_tag {
- int cbSize;
- char *szComponentName; // component name as it will appear in the UI (will be translated before displaying)
-
- char *szVersionURL; // URL where the current version can be found (NULL to disable)
- BYTE *pbVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
- // (note that this URL could point at a binary file - dunno why, but it could :)
- int cpbVersionPrefix; // number of bytes pointed to by pbVersionPrefix
- char *szUpdateURL; // URL where dll/zip is located
- // set to UPDATER_AUTOREGISTER if you want Updater to find the file listing URLs (ensure plugin shortName matches file listing!)
-
- char *szBetaVersionURL; // URL where the beta version can be found (NULL to disable betas)
- BYTE *pbBetaVersionPrefix; // bytes occuring in VersionURL before the version, used to locate the version information within the URL data
- int cpbBetaVersionPrefix; // number of bytes pointed to by pbVersionPrefix
- char *szBetaUpdateURL; // URL where dll/zip is located
-
- BYTE *pbVersion; // bytes of current version, used for comparison with those in VersionURL
- int cpbVersion; // number of bytes pointed to by pbVersion
-
- char *szBetaChangelogURL; // url for displaying changelog for beta versions
-} Update;
-
-// register a comonent with Updater
-//
-// wparam = 0
-// lparam = (LPARAM)&Update
-#define MS_UPDATE_REGISTER "Update/Register"
-
-// utility functions to create a version string from a DWORD or from pluginInfo
-// point buf at a buffer at least 16 chars wide - but note the version string returned may be shorter
-//
-__inline static char *CreateVersionString(DWORD version, char *buf) {
- mir_snprintf(buf, 16, "%d.%d.%d.%d", (version >> 24) & 0xFF, (version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);
- return buf;
-}
-
-__inline static char *CreateVersionStringPlugin(PLUGININFO *pluginInfo, char *buf) {
- return CreateVersionString(pluginInfo->version, buf);
-}
-
-
-// register the 'easy' way - use this method if you have no beta URL and the plugin is on the miranda file listing
-// NOTE: the plugin version string on the file listing must be the string version of the version in pluginInfo (i.e. 0.0.0.1,
-// four numbers between 0 and 255 inclusivem, so no letters, brackets, etc.)
-//
-// wParam = (int)fileID - this is the file ID from the file listing (i.e. the number at the end of the download link)
-// lParam = (PLUGININFO*)&pluginInfo
-#define MS_UPDATE_REGISTERFL "Update/RegisterFL"
-
-// this function can be used to 'unregister' components - useful for plugins that register non-plugin/langpack components and
-// may need to change those components on the fly
-// lParam = (char *)szComponentName
-#define MS_UPDATE_UNREGISTER "Update/Unregister"
-
-// this event is fired when the startup process is complete, but NOT if a restart is imminent
-// it is designed for status managment plugins to use as a trigger for beggining their own startup process
-// wParam = lParam = 0 (unused)
-// (added in version 0.1.6.0)
-#define ME_UPDATE_STARTUPDONE "Update/StartupDone"
-
-// this service can be used to enable/disable Updater's global status control
-// it can be called from the StartupDone event handler
-// wParam = (BOOL)enable
-// lParam = 0
-// (added in version 0.1.6.0)
-#define MS_UPDATE_ENABLESTATUSCONTROL "Update/EnableStatusControl"
-
-// An description of usage of the above service and event:
-// Say you are a status control plugin that normally sets protocol or global statuses in your ModulesLoaded event handler.
-// In order to make yourself 'Updater compatible', you would move the status control code from ModulesLoaded to another function,
-// say DoStartup. Then, in ModulesLoaded you would check for the existence of the MS_UPDATE_ENABLESTATUSCONTROL service.
-// If it does not exist, call DoStartup. If it does exist, hook the ME_UPDATE_STARTUPDONE event and call DoStartup from there. You may
-// also wish to call MS_UPDATE_ENABLESTATUSCONTROL with wParam == FALSE at this time, to disable Updater's own status control feature.
-
-// this service can be used to determine whether updates are possible for a component with the given name
-// wParam = 0
-// lParam = (char *)szComponentName
-// returns TRUE if updates are supported, FALSE otherwise
-#define MS_UPDATE_ISUPDATESUPPORTED "Update/IsUpdateSupported"
-
-#endif
-
-
-/////////////// Usage Example ///////////////
-
-#ifdef EXAMPLE_CODE
-
-// you need to #include "m_updater.h" and HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded) in your Load function...
-
-int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
-
- Update update = {0}; // for c you'd use memset or ZeroMemory...
- char szVersion[16];
-
- update.cbSize = sizeof(Update);
-
- update.szComponentName = pluginInfo.shortName;
- update.pbVersion = (BYTE *)CreateVersionString(&pluginInfo, szVersion);
- update.cpbVersion = strlen((char *)update.pbVersion);
-
- // these are the three lines that matter - the archive, the page containing the version string, and the text (or data)
- // before the version that we use to locate it on the page
- // (note that if the update URL and the version URL point to standard file listing entries, the backend xml
- // data will be used to check for updates rather than the actual web page - this is not true for beta urls)
- update.szUpdateURL = "http://scottellis.com.au:81/test/updater.zip";
- update.szVersionURL = "http://scottellis.com.au:81/test/updater_test.html";
- update.pbVersionPrefix = (BYTE *)"Updater version ";
-
- update.cpbVersionPrefix = strlen((char *)update.pbVersionPrefix);
-
- // do the same for the beta versions of the above struct members if you wish to allow beta updates from another URL
-
- CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
-
- // Alternatively, to register a plugin with e.g. file ID 2254 on the file listing...
- // CallService(MS_UPDATE_REGISTERFL, (WPARAM)2254, (LPARAM)&pluginInfo);
-
- return 0;
-}
-
-#endif
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/skypepluginlink.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/skypepluginlink.c deleted file mode 100644 index 0109bd6ede..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/skypepluginlink.c +++ /dev/null @@ -1,233 +0,0 @@ -#include "imo2sproxy.h"
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <stdlib.h>
-#include "skypepluginlink.h"
-#include "include/newpluginapi.h"
-#include "include/m_system.h"
-
-#define LockMutex(x) EnterCriticalSection (&x)
-#define UnlockMutex(x) LeaveCriticalSection(&x)
-#define InitMutex(x) InitializeCriticalSection(&x)
-#define ExitMutex(x) DeleteCriticalSection(&x)
-#define mutex_t CRITICAL_SECTION
-
-
-// -----------------------------------------------------------------------------
-
-struct tag_proxyInst;
-typedef struct tag_proxyInst IMO2SPROXY_INST;
-
-typedef struct
-{
- IMOSAPI *hInst;
- IMO2SPROXY_INST *hProxy;
- mutex_t sendmutex;
- mutex_t rcvmutex;
- int iConnectionStat;
-} CONNINST;
-
-struct tag_proxyInst
-{
- IMO2SPROXY vtbl; // Must be first!
- IMO2SPROXY_CFG *pCfg;
- SKYPEPLUGINLINK_CFG *pMyCfg;
- HANDLE hService;
- CONNINST stClient; // Currently only 1 connection
-};
-
-
-static CONNINST *m_pConn = NULL;
-
-// -----------------------------------------------------------------------------
-
-static void EventHandler(char *pszMsg, void *pUser);
-static int InitProxy(IMO2SPROXY_INST *hProxy);
-
-static int Imo2sproxy_Open(IMO2SPROXY *hInst);
-static void Imo2sproxy_Loop(IMO2SPROXY *hInst);
-static void Imo2sproxy_Exit(IMO2SPROXY *hInst);
-
-// -----------------------------------------------------------------------------
-static void EventHandler(char *pszMsg, void *pUser)
-{
- CONNINST *pInst = (CONNINST*)pUser;
- COPYDATASTRUCT cds;
- DWORD dwRes = 0;
-
- //LockMutex (pInst->sendmutex);
- if (pInst->hProxy->pCfg->bVerbose && pInst->hProxy->pCfg->fpLog)
- {
- fprintf (pInst->hProxy->pCfg->fpLog, "> %s\n", pszMsg);
- fflush (pInst->hProxy->pCfg->fpLog);
- }
- cds.dwData = 0;
- cds.cbData = strlen(pszMsg)+1;
- cds.lpData = pszMsg;
- CallService (SKYPE_PROTONAME PSS_SKYPEAPIMSG, 0, (LPARAM)&cds);
- //UnlockMutex (pInst->sendmutex);
-}
-
-// -----------------------------------------------------------------------------
-
-INT_PTR CallIn(WPARAM wParam,LPARAM lParam)
-{
- CONNINST *pInst = (CONNINST*)m_pConn;
- PCOPYDATASTRUCT pCopyData = (PCOPYDATASTRUCT)lParam;
-
- if (!pInst) return -1;
-
- if (pInst->hProxy->pMyCfg->bDelayLogin && pInst->iConnectionStat < 1)
- {
- LockMutex (pInst->rcvmutex);
- if (InitProxy(pInst->hProxy)<0)
- {
- UnlockMutex(pInst->rcvmutex);
- return -1;
- }
- UnlockMutex(pInst->rcvmutex);
- }
-
- if (pInst->hProxy->pCfg->bVerbose && pInst->hProxy->pCfg->fpLog)
- {
- fprintf (pInst->hProxy->pCfg->fpLog, "< [%s]\n", pCopyData->lpData);
- fflush (pInst->hProxy->pCfg->fpLog);
- }
- Imo2S_Send (pInst->hInst, pCopyData->lpData);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-static void FreeConnection (CONNINST *pInst)
-{
- if (!pInst || !pInst->hProxy) return;
- if (pInst->hProxy->pCfg->bVerbose && pInst->hProxy->pCfg->fpLog)
- {
- fprintf (pInst->hProxy->pCfg->fpLog, "SkypePluginLink: Closed connection\n");
- fflush (pInst->hProxy->pCfg->fpLog);
- }
-
- if (pInst->hProxy->hService)
- {
- DestroyServiceFunction(pInst->hProxy->hService);
- pInst->hProxy->hService = NULL;
- CallService (SKYPE_PROTONAME SKYPE_REGPROXY, 0, 0);
- }
- ExitMutex(pInst->sendmutex);
- ExitMutex(pInst->rcvmutex);
- if (pInst->hInst)
- {
- IMOSAPI *hInst = pInst->hInst;
- pInst->hInst = NULL;
- Imo2S_Exit(hInst);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-static int InitProxy(IMO2SPROXY_INST *hProxy)
-{
- char *pszError;
-
- if (!hProxy->stClient.hInst)
- {
- if (!(hProxy->stClient.hInst = Imo2S_Init(EventHandler, &hProxy->stClient, hProxy->pCfg->iFlags)))
- {
- hProxy->pCfg->logerror (stderr, "SkypePluginLink: Cannot start Imo2Skype instance.\n");
- return -1;
- }
- }
-
- // FIXME: We should enable logging dependent on a loglevel rather than just enabling it
- Imo2S_SetLog (hProxy->stClient.hInst, hProxy->pCfg->fpLog);
-
- if (hProxy->stClient.iConnectionStat == 0 ||
- (hProxy->stClient.iConnectionStat = Imo2S_Login (hProxy->stClient.hInst,
- hProxy->pCfg->pszUser, hProxy->pCfg->pszPass, &pszError)) != 1)
- {
- hProxy->pCfg->logerror (stderr, "SkypePluginLink: Cannot login with (%s/****): %s\n",
- hProxy->pCfg->pszUser, pszError);
- return -1;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-// PUBLIC
-// -----------------------------------------------------------------------------
-
-void SkypePluginLink_Defaults (SKYPEPLUGINLINK_CFG *pMyCfg)
-{
- memset (pMyCfg, 0, sizeof(SKYPEPLUGINLINK_CFG));
- pMyCfg->bDelayLogin = TRUE;
-}
-
-// -----------------------------------------------------------------------------
-
-IMO2SPROXY *SkypePluginLink_Init (IMO2SPROXY_CFG *pCfg, SKYPEPLUGINLINK_CFG *pMyCfg)
-{
- IMO2SPROXY_INST *pstInst = calloc(sizeof(IMO2SPROXY_INST), 1);
-
- pstInst->vtbl.Open = Imo2sproxy_Open;
- pstInst->vtbl.Loop = Imo2sproxy_Loop;
- pstInst->vtbl.Exit = Imo2sproxy_Exit;
- pstInst->pCfg = pCfg;
- pstInst->pMyCfg = pMyCfg;
- return (IMO2SPROXY*)pstInst;
-}
-
-// -----------------------------------------------------------------------------
-// IMPLEMENTATION
-// -----------------------------------------------------------------------------
-static int Imo2sproxy_Open(IMO2SPROXY *hInst)
-{
- IMO2SPROXY_INST *hProxy = (IMO2SPROXY_INST*)hInst;
- WNDCLASS WndClass ={0};
-
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "SkypePluginLink:Open(Start)\n");
-
- // Only 1 connection instance, so we can init it right here
- InitMutex(hProxy->stClient.sendmutex);
- InitMutex(hProxy->stClient.rcvmutex);
- hProxy->stClient.hProxy = hProxy;
- m_pConn = &hProxy->stClient;
-
- // Register with Skype Plugin
- hProxy->hService = CreateServiceFunction("IMO2SPROXY" PSS_SKYPEAPIMSG, CallIn);
- CallService (SKYPE_PROTONAME SKYPE_REGPROXY, 0, (LPARAM)"IMO2SPROXY" PSS_SKYPEAPIMSG);
- hProxy->stClient.iConnectionStat = -1;
-
- if (!hProxy->pMyCfg->bDelayLogin)
- {
- if (InitProxy(hProxy)<0)
- {
- FreeConnection(&hProxy->stClient);
- return -1;
- }
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-static void Imo2sproxy_Loop(IMO2SPROXY *hInst)
-{
- // No loop needed for call-in
-}
-
-
-// -----------------------------------------------------------------------------
-
-static void Imo2sproxy_Exit(IMO2SPROXY *hInst)
-{
- IMO2SPROXY_INST *hProxy = (IMO2SPROXY_INST*)hInst;
-
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "SkypePluginLink:Exit()\n");
-
- FreeConnection (&hProxy->stClient);
- free (hProxy);
-}
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/skypepluginlink.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/skypepluginlink.h deleted file mode 100644 index ecc520ff1e..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/miranda/skypepluginlink.h +++ /dev/null @@ -1,10 +0,0 @@ -typedef struct {
- int bDelayLogin;
-} SKYPEPLUGINLINK_CFG;
-
-#define SKYPE_PROTONAME "SKYPE"
-#define PSS_SKYPEAPIMSG "/SendSkypeAPIMsg"
-#define SKYPE_REGPROXY "/RegisterProxySvc"
-
-void SkypePluginLink_Defaults (SKYPEPLUGINLINK_CFG *pMyCfg);
-IMO2SPROXY *SkypePluginLink_Init (IMO2SPROXY_CFG *pCfg, SKYPEPLUGINLINK_CFG *pMyCfg);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.c deleted file mode 100644 index 7f1db504e9..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.c +++ /dev/null @@ -1,158 +0,0 @@ -/* Module: msgqueue.c
- Purpose: Message queue for incoming messages
- Author: leecher
- Date: 30.08.2009
-
- Fixme: Sort on insert, do a binary search instead of iterating list.
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include "msgqueue.h"
-#include "buddylist.h"
-
-static volatile unsigned int m_uMsgNr=0;
-static void FreeEntry(void *pEntry);
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-TYP_LIST *MsgQueue_Init(void)
-{
- TYP_LIST *hList = List_Init(16);
-
- return hList;
-}
-
-// -----------------------------------------------------------------------------
-
-void MsgQueue_Exit(TYP_LIST *hList)
-{
- Queue_Exit(hList, FreeEntry);
-}
-
-// -----------------------------------------------------------------------------
-
-MSGENTRY *MsgQueue_Insert(TYP_LIST *hList, cJSON *pNick)
-{
- MSGENTRY *pEntry;
- cJSON *pVal;
-
- if (!(pEntry = Queue_InsertEntry(hList, sizeof(MSGENTRY), ++m_uMsgNr,
- FreeEntry))) return NULL;
- pEntry->pszUser = strdup(cJSON_GetObjectItem(pNick, "buid")->valuestring);
- pEntry->pszAlias = strdup(cJSON_GetObjectItem(pNick, "alias")->valuestring);
- pEntry->pszMessage = strdup(cJSON_GetObjectItem(pNick, "msg")->valuestring);
- pEntry->timestamp = cJSON_GetObjectItem(pNick, "timestamp")->valueint;
- if (pVal = cJSON_GetObjectItem(pNick, "author")) pEntry->pszAuthor=strdup(pVal->valuestring);
- strcpy (pEntry->szStatus, "RECEIVED");
- strcpy (pEntry->szType, "TEXT");
- // imo.im somehow sets group topic via recv_im??
- if (strcmp(pEntry->pszAlias, pEntry->pszMessage) == 0) strcpy (pEntry->szType, "SETTOPIC");
- return pEntry;
-}
-
-// -----------------------------------------------------------------------------
-
-MSGENTRY *MsgQueue_AddReflect(TYP_LIST *hList, cJSON *pNick, TYP_LIST *hBuddyList)
-{
- MSGENTRY *pEntry;
- cJSON *pVal;
-
- if (!(pEntry = Queue_InsertEntry(hList, sizeof(MSGENTRY), ++m_uMsgNr,
- FreeEntry))) return NULL;
- pEntry->pszUser = strdup(cJSON_GetObjectItem(pNick, "buid")->valuestring);
-
- // Usually no alias in Reflection, so query buddy list, if available
- if (pVal = cJSON_GetObjectItem(pNick, "alias"))
- pEntry->pszAlias = strdup(pVal->valuestring);
- else
- {
- NICKENTRY *pBuddy = hBuddyList?BuddyList_Find (hBuddyList, pEntry->pszUser):NULL;
- pEntry->pszAlias = strdup (pBuddy?pBuddy->pszAlias:pEntry->pszUser);
- }
-
- pEntry->pszMessage = strdup(cJSON_GetObjectItem(pNick, "msg")->valuestring);
- pEntry->timestamp = cJSON_GetObjectItem(pNick, "timestamp")->valueint;
- strcpy (pEntry->szStatus, "SENT");
- return pEntry;
-}
-
-// -----------------------------------------------------------------------------
-
-MSGENTRY *MsgQueue_AddSent(TYP_LIST *hList, char *pszUser, char *pszAlias, char *pszMessage, unsigned int *puMsgId)
-{
- MSGENTRY *pEntry;
-
- if (!(pEntry = Queue_InsertEntry(hList, sizeof(MSGENTRY), ++m_uMsgNr,
- FreeEntry))) return NULL;
- pEntry->pszUser = strdup(pszUser);
- pEntry->pszAlias = strdup(pszAlias);
- pEntry->pszMessage = strdup(pszMessage);
- time (&pEntry->timestamp);
- strcpy (pEntry->szStatus, "SENDING");
- if (puMsgId) *puMsgId = pEntry->hdr.uMsgNr;
- return pEntry;
-}
-
-// -----------------------------------------------------------------------------
-
-MSGENTRY *MsgQueue_AddEvent(TYP_LIST *hList, char *pszUser, char *pszType)
-{
- MSGENTRY *pEntry;
-
- if (!(pEntry = Queue_InsertEntry(hList, sizeof(MSGENTRY), ++m_uMsgNr,
- FreeEntry))) return NULL;
- pEntry->pszUser = strdup(pszUser);
- time (&pEntry->timestamp);
- strcpy (pEntry->szStatus, "RECEIVED");
- strcpy (pEntry->szType, pszType);
- return pEntry;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL MsgQueue_Remove(TYP_LIST *hList, unsigned int uMsgNr)
-{
- return Queue_Remove(hList, uMsgNr, FreeEntry);
-}
-
-// -----------------------------------------------------------------------------
-
-MSGENTRY *MsgQueue_Find(TYP_LIST *hList, unsigned int uMsgNr)
-{
- return (MSGENTRY*)Queue_Find(hList, uMsgNr);
-}
-
-// -----------------------------------------------------------------------------
-
-MSGENTRY *MsgQueue_FindByRqId(TYP_LIST *hList, unsigned int uRqId)
-{
- unsigned int i;
- MSGENTRY *pEntry;
-
- for (i=List_Count(hList)-1; (int)i!=-1; i--)
- {
- pEntry = (MSGENTRY*)List_ElementAt (hList, i);
- if (pEntry->uRqId == uRqId)
- return pEntry;
- }
- return NULL;
-}
-
-// -----------------------------------------------------------------------------
-// Static
-// -----------------------------------------------------------------------------
-
-static void FreeEntry(void *pPEntry)
-{
- MSGENTRY *pEntry = (MSGENTRY*)pPEntry;
-
- if (pEntry->pszAlias) free (pEntry->pszAlias);
- free (pEntry->pszUser);
- if (pEntry->pszMessage) free (pEntry->pszMessage);
- if (pEntry->pszAuthor) free (pEntry->pszAuthor);
-}
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.h deleted file mode 100644 index ac8ce1cf8d..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/msgqueue.h +++ /dev/null @@ -1,28 +0,0 @@ -#include "cJSON.h"
-#include "queue.h"
-#include <time.h>
-
-typedef struct
-{
- QUEUEHDR hdr;
- char *pszUser;
- char *pszAuthor; // In case of groupchat, pszUser is the Groupchat ID and pszAuthor is the user sending it, if not a GC message, pszAuthor is NULL
- char *pszAlias;
- char *pszMessage;
- time_t timestamp;
- char szStatus[16];
- char szFailure[256];
- char szType[20]; // TEXT, SETTOPIC, ADDEDMEMBERS, CREATEDCHATWITH, LEFT, KICKED, ...
- unsigned int uRqId;
-} MSGENTRY;
-
-TYP_LIST *MsgQueue_Init(void);
-void MsgQueue_Exit(TYP_LIST *hList);
-
-MSGENTRY *MsgQueue_Insert(TYP_LIST *hList, cJSON *pNick);
-MSGENTRY *MsgQueue_AddReflect(TYP_LIST *hList, cJSON *pNick, TYP_LIST *hBuddyList);
-MSGENTRY *MsgQueue_AddSent(TYP_LIST *hList, char *pszUser, char *pszAlias, char *pszMessage, unsigned int *puMsgId);
-MSGENTRY *MsgQueue_AddEvent(TYP_LIST *hList, char *pszUser, char *pszType);
-BOOL MsgQueue_Remove(TYP_LIST *hList, unsigned int uMsgNr);
-MSGENTRY *MsgQueue_Find(TYP_LIST *hList, unsigned int uMsgNr);
-MSGENTRY *MsgQueue_FindByRqId(TYP_LIST *hList, unsigned int uRqId);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/queue.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/queue.c deleted file mode 100644 index a163314c8e..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/queue.c +++ /dev/null @@ -1,94 +0,0 @@ -/* Module: queue.c
- Purpose: Queue management
- Author: leecher
- Date: 02.09.2009
-*/
-
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include "memlist.h"
-#include "queue.h"
-
-// Maximum threshold for queues (So that we don't leak memory)
-#define THRESHOLD 50
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-void Queue_Exit(TYP_LIST *hList, void (*fpFree)(void *pEntry))
-{
- void *pEntry;
-
- while (pEntry=List_Pop(hList))
- {
- if (fpFree) fpFree(pEntry);
- free (pEntry);
- }
- List_Exit(hList);
-}
-
-// -----------------------------------------------------------------------------
-
-void* Queue_InsertEntry (TYP_LIST *hList, unsigned int cbSize, unsigned int uMsgNr,
- void (*fpFree)(void *pEntry))
-{
- void *pEntry;
-
- if (!(pEntry = calloc (1, cbSize))) return NULL;
- if (!List_Push(hList, pEntry))
- {
- free (pEntry);
- return NULL;
- } else ((QUEUEHDR*)pEntry)->uMsgNr = uMsgNr;
-#ifdef THRESHOLD
- if (List_Count(hList)>THRESHOLD)
- {
- void *pEntry = List_RemoveElementAt(hList, 0);
-
- if (pEntry) fpFree (pEntry);
- free (pEntry);
- }
-#endif
- return pEntry;
-}
-
-// -----------------------------------------------------------------------------
-
-BOOL Queue_Remove(TYP_LIST *hList, unsigned int uMsgNr, void (*fpFree)(void *pEntry))
-{
- QUEUEHDR *pListEntry;
- unsigned int i;
-
- for (i=List_Count(hList)-1; (int)i!=-1; i--)
- {
- pListEntry = List_ElementAt (hList, i);
- if (pListEntry->uMsgNr == uMsgNr)
- {
- if (fpFree) fpFree (pListEntry);
- List_RemoveElementAt(hList, i);
- free (pListEntry);
- return TRUE;
- }
- }
- return FALSE;
-}
-
-// -----------------------------------------------------------------------------
-
-void *Queue_Find(TYP_LIST *hList, unsigned int uMsgNr)
-{
- unsigned int i;
- QUEUEHDR *pEntry;
-
- for (i=List_Count(hList)-1; (int)i!=-1; i--)
- {
- pEntry = (QUEUEHDR*)List_ElementAt (hList, i);
- if (pEntry->uMsgNr == uMsgNr)
- return pEntry;
- }
- return NULL;
-}
-
-// -----------------------------------------------------------------------------
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/queue.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/queue.h deleted file mode 100644 index 4f42a3b42f..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/queue.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef __QUEUE_H__
-#define __QUEUE_H__
-
-#include "memlist.h"
-
-typedef struct
-{
- unsigned int uMsgNr;
-} QUEUEHDR;
-
-void Queue_Exit(TYP_LIST *hList, void (*fpFree)(void *pEntry));
-void* Queue_InsertEntry (TYP_LIST *hList, unsigned int cbSize, unsigned int uMsgNr,
- void (*fpFree)(void *pEntry));
-BOOL Queue_Remove(TYP_LIST *hList, unsigned int uMsgNr, void (*fpFree)(void *pEntry));
-void *Queue_Find(TYP_LIST *hList, unsigned int uMsgNr);
-
-#endif
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/socksproxy.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/socksproxy.c deleted file mode 100644 index 20c56a7a66..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/socksproxy.c +++ /dev/null @@ -1,565 +0,0 @@ -/* Module: imo2skypeproxy.c
- Purpose: Implementation of imo2skype API as Skype proxy (for Miranda Skype plugin)
- Author: leecher
- Date: 01.09.2009
-
- Changelog:
- 1.00 - 01.09.2009 - Initial release
- 1.01 - 02.09.2009 - Little bugfix for Onlinestatus, introduced mutex for send thread.
- 1.02 - 02.09.2009 - Added support for incoming call notifications and expired sessions.
- 1.03 - 03.09.2009 - As WIN32-port of libcurl is a total mess, Win32-version now uses WinINET.
- 1.04 - 04.09.2009 - Added support for searching, adding and removing buddies
- 1.05 - 06.09.2009 - * Mapped "busy" to DND, not NA, as forum user AL|EN proposed.
- * Mood text will now also be sent on status change of a contact
- (doesn't really have an effect though)
- * New Parameter -d (daemonize) to launch proxy in background
- * Fixed a bug with a crash when encoding umlauts on Win32
- 1.06 - 25.09.2009 - Added parameter -t for local timestamps.
- 1.07 - 07.10.2009 - Bugfix: Added parsing of multiple JSON messages
- Added support for writing to logfile while in daemon mode (-l)
- 1.08 - 18.10.2009 - Added support for voice calls via imo.im flash on WIN32 (-i)
- - Limited memory queues to 50 entries to reduce memory usage.
- 1.09 - 07.11.2009 - Split command line main module and proxy module to make proxy
- accessible by different layers (i.e. new Miranda Plugin layer)
- 1.10 - 14.12.2009 - Bug in the cJson library. The authors used the String as second
- sprintf-Parameter which contains the format string instead of
- ["%s", StringParam] causing problems sending Messages containt a %
- - Added some space in the dialog for translations and added Translate()
- function to some strings in the Wrapper-DLL
- - More verbose output if you enable logging
- - Fixes a Bug that caused the plugin to block after going offline
- and reconnecting back online
- - Hopefully fixed a severe threading problem: The Send-Mutex was not
- covering a full transaction, but only 1 send causing the receiver
- the receive garbled data causing "An existing connection was forcibly
- closed by the remote host." error.
- - Imo2S_Exit freed the temporary buffer too early resulting in a crash
- on exit.
- 1.12 - 19.04.2010 - POST interface changed from www.imo.im/amy to s.imo.im/amy
- 1.13 - 19.12.2010 - imo.im modified their interface, so tried to adapt the communication
- routines at low level to be compatible again. There still may be
- many bugs. Don't forget to turn off history logging in the options
- at https://imo.im
- There also seems to be a nice new feature called "reflection" so that
- you can login from multiple sessions and messages etc. entered there
- will be reflected to the current session. This may be addressed in one
- of the next builds...
-*/
-
-#include <stdio.h>
-#include "imo2sproxy.h"
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winsock2.h>
-#include <process.h>
-#define thread_t HANDLE
-#define LockMutex(x) EnterCriticalSection (&x)
-#define UnlockMutex(x) LeaveCriticalSection(&x)
-#define InitMutex(x) InitializeCriticalSection(&x)
-#define ExitMutex(x) DeleteCriticalSection(&x)
-#define strcasecmp stricmp
-#define strncasecmp stricmpn
-#define mutex_t CRITICAL_SECTION
-#define SHUT_RD SD_RECEIVE
-#define SHUT_WR SD_SEND
-#define SHUT_RDWR SD_BOTH
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/select.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <pthread.h>
-#include <errno.h>
-#include <unistd.h>
-#include <pthread.h>
-#define SOCKET int
-#define thread_t pthread_t
-#define mutex_t pthread_mutex_t
-#define INVALID_SOCKET -1
-#define SOCKET_ERROR INVALID_SOCKET
-#define closesocket close
-#define LockMutex(x) pthread_mutex_lock(&x)
-#define UnlockMutex(x) pthread_mutex_unlock(&x)
-#define InitMutex(x) pthread_mutex_init(&x, NULL);
-#define ExitMutex(x)
-#endif
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include "memlist.h"
-#include "socksproxy.h"
-
-// -----------------------------------------------------------------------------
-
-#define AUTHENTICATE 0x01
-#define CAPABILITIES 0x02
-#define USE_AUTHENTICATION 0x01
-
-typedef struct
-{
- IMO2SPROXY vtbl; // Must be first!
- IMO2SPROXY_CFG *pCfg;
- SOCKSPROXY_CFG *pMyCfg;
-
- SOCKET listen_fd;
- volatile int iRunning;
- mutex_t loopmutex;
-} IMO2SPROXY_INST;
-
-typedef struct
-{
- SOCKET hSock;
- thread_t hThread;
- IMOSAPI *hInst;
- int iConnectionStat;
- mutex_t connected;
- mutex_t sendmutex;
- IMO2SPROXY_INST *hProxy;
-} CONNINST;
-
-
-// -----------------------------------------------------------------------------
-
-static void EventHandler(char *pszMsg, void *pUser);
-static void DispatcherThread(void *pUser);
-static int Dispatcher_Start(CONNINST *pInst);
-static int Dispatcher_Stop(CONNINST *pInst);
-static char *GetError(void);
-static int RcvPacket (CONNINST *pInst, void *buf, int len);
-static int SendPacket (CONNINST *pInst, void *buf, int len);
-static void FreeConnection (CONNINST *pInst);
-static void CleanConnections (TYP_LIST *hList);
-static SOCKET Init(unsigned long int lHost, short sPort, int iMaxConn);
-static void Loop(SOCKET listen_fd);
-static void Exit(SOCKET listen_fd);
-
-static int Imo2sproxy_Open(IMO2SPROXY *hInst);
-static void Imo2sproxy_Loop(IMO2SPROXY *hInst);
-static void Imo2sproxy_Exit(IMO2SPROXY *hInst);
-
-// -----------------------------------------------------------------------------
-static void EventHandler(char *pszMsg, void *pUser)
-{
- CONNINST *pInst = (CONNINST*)pUser;
- unsigned int uiLen = strlen (pszMsg);
- static BOOL bFirstLogin = TRUE;
-
- if (pInst->hProxy->pCfg->bVerbose && pInst->hProxy->pCfg->fpLog)
- {
- fprintf (pInst->hProxy->pCfg->fpLog, "%03d> %s\n", pInst->hSock, pszMsg);
- fflush (pInst->hProxy->pCfg->fpLog);
- }
- if (bFirstLogin && strncmp (pszMsg, "CONNSTATUS", 10) == 0 &&
- strcmp(pszMsg+11, "CONNECTING"))
- {
- pInst->iConnectionStat = (strcmp(pszMsg+11, "ONLINE")==0);
- UnlockMutex (pInst->connected);
- bFirstLogin = FALSE;
- }
- LockMutex(pInst->sendmutex);
- if (!(SendPacket (pInst, &uiLen, sizeof(uiLen)) && SendPacket (pInst, pszMsg, uiLen)))
- {
- //Dispatcher_Stop(pInst);
- //FreeConnection (pInst);
- }
- UnlockMutex(pInst->sendmutex);
-}
-
-// -----------------------------------------------------------------------------
-
-static void DispatcherThread(void *pUser)
-{
- CONNINST *pInst = (CONNINST*)pUser;
- char *pszUser, *pszPass, *pszError, *pszMsgBuf=NULL;
- unsigned int uiLength, cbMsgBuf=0, bAuthenticated = 0, iConnected=0, iLogin=1;
- char command=0, reply=0;
-
- if (pInst->hProxy->pCfg->bVerbose && pInst->hProxy->pCfg->fpLog)
- fprintf (pInst->hProxy->pCfg->fpLog, "Imo2sproxy::DispatcherThread()\n");
-
- if (!(pInst->hInst = Imo2S_Init(EventHandler, pInst, pInst->hProxy->pCfg->iFlags)))
- {
- pInst->hProxy->pCfg->logerror (stderr, "Connection %d: Cannot start Imo2Skype instance.\n", pInst->hSock);
- FreeConnection (pInst);
- return;
- }
-
- // FIXME: Static user+pass from cmdline, until there is a possibility for
- // a client to authenticate
- pszUser = pInst->hProxy->pCfg->pszUser;
- pszPass = pInst->hProxy->pCfg->pszPass;
-
- // FIXME: We should enable logging dependent on a loglevel rather than just enabling it
- if (pInst->hProxy->pCfg->bVerbose)
- Imo2S_SetLog (pInst->hInst, pInst->hProxy->pCfg->fpLog);
-
-
- while (pInst->hProxy->iRunning)
- {
- if (RcvPacket(pInst, &uiLength, sizeof(uiLength))<=0) break;
- LockMutex(pInst->sendmutex);
-
- if (uiLength == 0)
- {
- if (RcvPacket(pInst, &command, 1)<=0)
- {
- UnlockMutex(pInst->sendmutex);
- break;
- }
- switch (command)
- {
- case AUTHENTICATE:
- if (pInst->hProxy->pMyCfg->pszAuthPass) reply=1;
- break;
- case CAPABILITIES:
- if (pInst->hProxy->pMyCfg->pszAuthPass) reply=USE_AUTHENTICATION;
- break;
- }
- if (SendPacket (pInst, &reply, 1)<=0)
- {
- UnlockMutex(pInst->sendmutex);
- break;
- }
- UnlockMutex(pInst->sendmutex);
- continue;
- }
-
- if (uiLength >= cbMsgBuf)
- {
- pszMsgBuf = realloc (pszMsgBuf, uiLength+1);
- if (!pszMsgBuf)
- {
- UnlockMutex(pInst->sendmutex);
- break;
- }
- cbMsgBuf=uiLength+1;
- }
-
- if (RcvPacket(pInst, pszMsgBuf, uiLength)<=0)
- {
- UnlockMutex(pInst->sendmutex);
- break;
- }
-
- if (command)
- {
- if (command == AUTHENTICATE)
- {
- bAuthenticated = pInst->hProxy->pMyCfg->pszAuthPass && strcmp(pInst->hProxy->pMyCfg->pszAuthPass, pszMsgBuf) == 0;
- if (SendPacket (pInst, &bAuthenticated, 1)<=0)
- {
- UnlockMutex(pInst->sendmutex);
- break;
- }
- }
- command = 0;
- }
- UnlockMutex(pInst->sendmutex);
-
- if (iLogin) - { - if (Imo2S_Login (pInst->hInst, pszUser, pszPass, &pszError) != 1)
- {
- pInst->hProxy->pCfg->logerror (stderr, "Connection %d: Cannot login with (%s/****): %s\n",
- pInst->hSock, pszUser, pszError);
- FreeConnection (pInst);
- return;
- }
- iLogin = 0; - } - - if (pInst->hProxy->pMyCfg->pszAuthPass && !bAuthenticated)continue;
- pszMsgBuf[uiLength]=0;
- if (pInst->hProxy->pCfg->bVerbose && pInst->hProxy->pCfg->fpLog)
- {
- fprintf (pInst->hProxy->pCfg->fpLog, "%03d< [%s]\n", pInst->hSock, pszMsgBuf);
- fflush (pInst->hProxy->pCfg->fpLog);
- }
- if (!iConnected)
- {
- LockMutex (pInst->connected);
- iConnected = pInst->iConnectionStat;
- if (!iConnected)
- {
- pInst->hProxy->pCfg->logerror(stderr, "Invalid username / password");
- }
- }
- Imo2S_Send (pInst->hInst, pszMsgBuf);
- }
-
- FreeConnection (pInst);
- if (pszMsgBuf) free (pszMsgBuf);
- return;
-}
-
-// -----------------------------------------------------------------------------
-
-#ifdef WIN32
-static int Dispatcher_Start(CONNINST *pInst)
-{
- DWORD ThreadID;
-
- return (pInst->hThread=(thread_t)_beginthreadex(NULL, 0,
- (unsigned(__stdcall *)(void*))DispatcherThread, pInst, 0, &ThreadID))!=0;
-
-}
-
-static int Dispatcher_Stop(CONNINST *pInst)
-{
- return pInst->hThread?TerminateThread (pInst->hThread, 0):1;
-}
-
-static char *GetError(void)
-{
- static char szMessage[1024];
- DWORD dwErr = WSAGetLastError();
-
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, 0, szMessage, sizeof(szMessage), NULL);
- return szMessage;
-}
-
-#else
-static int Dispatcher_Start(CONNINST *pInst)
-{
- return pthread_create(&pInst->hThread, NULL, DispatcherThread, pInst)==0;
-}
-
-static int Dispatcher_Stop(CONNINST *pInst)
-{
- if (!pInst->hThread || pthread_cancel(pInst->hThread))
- {
- pInst->hThread=0;
- return 1;
- }
- return 0;
-}
-
-static char *GetError(void)
-{
- return strerror (errno);
-}
-
-#endif
-
-// -----------------------------------------------------------------------------
-
-static int RcvPacket (CONNINST *pInst, void *buf, int len)
-{
- int iReceived = recv (pInst->hSock, buf, len, 0);
- if (iReceived <= 0)
- pInst->hProxy->pCfg->logerror(stderr, "Connection %d (Receive): %s", pInst->hSock, GetError());
- return iReceived;
-}
-
-// -----------------------------------------------------------------------------
-
-static int SendPacket (CONNINST *pInst, void *buf, int len)
-{
- int iSent;
-
- iSent = send (pInst->hSock, buf, len, 0);
- if (iSent <= 0)
- pInst->hProxy->pCfg->logerror (stderr, "Connection %d (Send): %s", pInst->hSock, GetError());
- return iSent;
-}
-// -----------------------------------------------------------------------------
-
-static void FreeConnection (CONNINST *pInst)
-{
- if (pInst->hProxy->pCfg->bVerbose && pInst->hProxy->pCfg->fpLog)
- {
- fprintf (pInst->hProxy->pCfg->fpLog, "Closed connection %d\n", pInst->hSock);
- fflush (pInst->hProxy->pCfg->fpLog);
- }
- if (pInst->hSock != INVALID_SOCKET)
- closesocket(pInst->hSock);
- pInst->hSock = INVALID_SOCKET;
- pInst->hThread = 0;
- ExitMutex (pInst->connected);
- ExitMutex (pInst->sendmutex);
- if (pInst->hInst)
- {
- IMOSAPI *hInst = pInst->hInst;
- pInst->hInst = NULL;
- Imo2S_Exit(hInst);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-static void CleanConnections (TYP_LIST *hList)
-{
- unsigned int i;
- CONNINST *hInst;
-
- for (i=0; i<List_Count(hList); i++)
- {
- hInst = List_ElementAt (hList, i);
- if (hInst->hThread == 0)
- {
- free (List_RemoveElementAt(hList, i));
- i--;
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-// PUBLIC
-// -----------------------------------------------------------------------------
-
-void SocksProxy_Defaults (SOCKSPROXY_CFG *pMyCfg)
-{
- memset (pMyCfg, 0, sizeof(SOCKSPROXY_CFG));
- pMyCfg->lAddr = htonl(INADDR_ANY);
- pMyCfg->sPort = 1401;
- pMyCfg->iMaxConn = SOMAXCONN;
-}
-
-// -----------------------------------------------------------------------------
-
-IMO2SPROXY *SocksProxy_Init (IMO2SPROXY_CFG *pCfg, SOCKSPROXY_CFG *pMyCfg)
-{
- IMO2SPROXY_INST *pstInst = calloc(sizeof(IMO2SPROXY_INST), 1);
-
- pstInst->vtbl.Open = Imo2sproxy_Open;
- pstInst->vtbl.Loop = Imo2sproxy_Loop;
- pstInst->vtbl.Exit = Imo2sproxy_Exit;
- pstInst->pCfg = pCfg;
- pstInst->pMyCfg = pMyCfg;
- InitMutex(pstInst->loopmutex);
- return (IMO2SPROXY*)pstInst;
-}
-
-// -----------------------------------------------------------------------------
-// IMPLEMENTATION
-// -----------------------------------------------------------------------------
-static int Imo2sproxy_Open(IMO2SPROXY *hInst)
-{
- struct sockaddr_in sock={0};
- int yes = 1;
- IMO2SPROXY_INST *hProxy = (IMO2SPROXY_INST*)hInst;
-
-#ifdef WIN32
- WSADATA wsaData;
-
- if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
- {
- hProxy->pCfg->logerror (stderr, "WSAStartup failed");
- return INVALID_SOCKET;
- }
-#endif
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "Socksproxy:Loop(Start)\n");
- hProxy->listen_fd = socket(PF_INET, SOCK_STREAM, 0);
- if(hProxy->listen_fd == INVALID_SOCKET) return -1;
- if (setsockopt(hProxy->listen_fd, SOL_SOCKET, SO_REUSEADDR, (char*)&yes, sizeof(int))<0)
- {
- hProxy->pCfg->logerror (stderr, "Cannot set socket options to SO_REUSEADDR");
- closesocket(hProxy->listen_fd);
- return -1;
- }
- sock.sin_family = AF_INET;
- sock.sin_addr.s_addr = hProxy->pMyCfg->lAddr;
- sock.sin_port = htons(hProxy->pMyCfg->sPort);
-
- if (bind(hProxy->listen_fd, (struct sockaddr *) &sock, sizeof(sock)) != 0)
- {
- hProxy->pCfg->logerror (stderr, "Cannot bind socket");
- closesocket(hProxy->listen_fd);
- return -1;
- }
-
- if (listen(hProxy->listen_fd, hProxy->pMyCfg->iMaxConn) < 0)
- {
- hProxy->pCfg->logerror (stderr, "Cannot listen on socket");
- closesocket(hProxy->listen_fd);
- return -1;
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-static void Imo2sproxy_Loop(IMO2SPROXY *hInst)
-{
- struct sockaddr_in sock;
- int socklen;
- SOCKET new_fd;
- TYP_LIST *hConns = List_Init(32);
- CONNINST *pInst;
- IMO2SPROXY_INST *hProxy = (IMO2SPROXY_INST*)hInst;
- fd_set fdListen;
-
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "Socksproxy:Loop(Start)\n");
- hProxy->iRunning = 1;
- LockMutex(hProxy->loopmutex);
- while (hProxy->iRunning)
- {
- FD_ZERO(&fdListen);
- FD_SET(hProxy->listen_fd, &fdListen);
- socklen = sizeof(sock);
- if (select (0, &fdListen, NULL, NULL, NULL) != SOCKET_ERROR && FD_ISSET(hProxy->listen_fd, &fdListen))
- {
- new_fd = accept(hProxy->listen_fd, (struct sockaddr *) &sock, &socklen);
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- {
- fprintf (hProxy->pCfg->fpLog, "Connection from %s:%d -> Connection: %d\n", inet_ntoa(sock.sin_addr),
- ntohs(sock.sin_port), new_fd);
- fflush (hProxy->pCfg->fpLog);
- }
- if (new_fd != INVALID_SOCKET && (pInst = calloc (1, sizeof(CONNINST))))
- {
- CleanConnections (hConns);
- List_Push(hConns, pInst);
- pInst->hSock = new_fd;
- pInst->hProxy = hProxy;
- InitMutex(pInst->connected);
- LockMutex(pInst->connected);
- InitMutex(pInst->sendmutex);
- Dispatcher_Start(pInst);
- }
- }
- }
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "Socksproxy:Loop(End)\n");
-
- CleanConnections (hConns);
- while (pInst=List_Pop(hConns))
- {
- Dispatcher_Stop(pInst);
- FreeConnection(pInst);
- free (pInst);
- }
- List_Exit(hConns);
- UnlockMutex(hProxy->loopmutex);
-}
-
-
-// -----------------------------------------------------------------------------
-
-static void Imo2sproxy_Exit(IMO2SPROXY *hInst)
-{
- IMO2SPROXY_INST *hProxy = (IMO2SPROXY_INST*)hInst;
-
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "Socksproxy:Exit()\n");
-
- hProxy->iRunning = 0;
- shutdown (hProxy->listen_fd, SHUT_RDWR);
- closesocket (hProxy->listen_fd);
- LockMutex(hProxy->loopmutex);
-
-/*
-#ifdef WIN32
- WSACleanup();
-#endif
-*/
- UnlockMutex(hProxy->loopmutex);
- ExitMutex(hProxy->loopmutex);
- free (hProxy);
-}
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/socksproxy.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/socksproxy.h deleted file mode 100644 index 6010e749f1..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/socksproxy.h +++ /dev/null @@ -1,11 +0,0 @@ -typedef struct
-{
- char *pszAuthPass;
- unsigned long int lAddr;
- short sPort;
- int iMaxConn;
-} SOCKSPROXY_CFG;
-
-
-void SocksProxy_Defaults (SOCKSPROXY_CFG *pMyCfg);
-IMO2SPROXY *SocksProxy_Init (IMO2SPROXY_CFG *pCfg, SOCKSPROXY_CFG *pMyCfg);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32browser.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32browser.c deleted file mode 100644 index 8053a3c16d..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32browser.c +++ /dev/null @@ -1,1143 +0,0 @@ -/* Module: win32_browsewnd.c
- Purpose: Displays a window with an embedded browser in order to display the Voicechat
- flash from imo.im
- This example is bsaed on the work of Jeff Glatt (http://www.codeproject.com/KB/COM/cwebpage.aspx?msg=2852721)
- Author: leecher, credits go to Jeff Glatt for his excellent work.
- Date: 18.10.2009
-*/
-
-#include <windows.h>
-#include <exdisp.h>
-#include <mshtml.h>
-#include <mshtmhst.h>
-#include <process.h>
-#include "memlist.h"
-#include "w32browser.h"
-
-#ifndef _WIN64
-#if WINVER<0x0500
-#define SetWindowLongPtr SetWindowLong
-#define GetWindowLongPtr GetWindowLong
-#endif
-#ifndef LONG_PTR
-#define LONG_PTR LONG
-#endif
-#ifndef GWLP_USERDATA
-#define GWLP_USERDATA GWL_USERDATA
-#endif
-#endif
-
-static const SAFEARRAYBOUND ArrayBound = {1, 0};
-static TYP_LIST *m_hWindows = NULL;
-static DWORD m_dwThread = 0;
-static HANDLE m_hThread = NULL, m_hEvent = NULL;
-
-
-HRESULT STDMETHODCALLTYPE Frame_QueryInterface(IOleInPlaceFrame FAR* This, REFIID riid, LPVOID FAR* ppvObj);
-HRESULT STDMETHODCALLTYPE Frame_AddRef(IOleInPlaceFrame FAR* This);
-HRESULT STDMETHODCALLTYPE Frame_Release(IOleInPlaceFrame FAR* This);
-HRESULT STDMETHODCALLTYPE Frame_GetWindow(IOleInPlaceFrame FAR* This, HWND FAR* lphwnd);
-HRESULT STDMETHODCALLTYPE Frame_ContextSensitiveHelp(IOleInPlaceFrame FAR* This, BOOL fEnterMode);
-HRESULT STDMETHODCALLTYPE Frame_GetBorder(IOleInPlaceFrame FAR* This, LPRECT lprectBorder);
-HRESULT STDMETHODCALLTYPE Frame_RequestBorderSpace(IOleInPlaceFrame FAR* This, LPCBORDERWIDTHS pborderwidths);
-HRESULT STDMETHODCALLTYPE Frame_SetBorderSpace(IOleInPlaceFrame FAR* This, LPCBORDERWIDTHS pborderwidths);
-HRESULT STDMETHODCALLTYPE Frame_SetActiveObject(IOleInPlaceFrame FAR* This, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName);
-HRESULT STDMETHODCALLTYPE Frame_InsertMenus(IOleInPlaceFrame FAR* This, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths);
-HRESULT STDMETHODCALLTYPE Frame_SetMenu(IOleInPlaceFrame FAR* This, HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject);
-HRESULT STDMETHODCALLTYPE Frame_RemoveMenus(IOleInPlaceFrame FAR* This, HMENU hmenuShared);
-HRESULT STDMETHODCALLTYPE Frame_SetStatusText(IOleInPlaceFrame FAR* This, LPCOLESTR pszStatusText);
-HRESULT STDMETHODCALLTYPE Frame_EnableModeless(IOleInPlaceFrame FAR* This, BOOL fEnable);
-HRESULT STDMETHODCALLTYPE Frame_TranslateAccelerator(IOleInPlaceFrame FAR* This, LPMSG lpmsg, WORD wID);
-
-IOleInPlaceFrameVtbl MyIOleInPlaceFrameTable = {Frame_QueryInterface,
-Frame_AddRef,
-Frame_Release,
-Frame_GetWindow,
-Frame_ContextSensitiveHelp,
-Frame_GetBorder,
-Frame_RequestBorderSpace,
-Frame_SetBorderSpace,
-Frame_SetActiveObject,
-Frame_InsertMenus,
-Frame_SetMenu,
-Frame_RemoveMenus,
-Frame_SetStatusText,
-Frame_EnableModeless,
-Frame_TranslateAccelerator};
-
-typedef struct {
- IOleInPlaceFrame frame;
- HWND window;
-} _IOleInPlaceFrameEx;
-
-HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite FAR* This, REFIID riid, void ** ppvObject);
-HRESULT STDMETHODCALLTYPE Site_AddRef(IOleClientSite FAR* This);
-HRESULT STDMETHODCALLTYPE Site_Release(IOleClientSite FAR* This);
-HRESULT STDMETHODCALLTYPE Site_SaveObject(IOleClientSite FAR* This);
-HRESULT STDMETHODCALLTYPE Site_GetMoniker(IOleClientSite FAR* This, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker ** ppmk);
-HRESULT STDMETHODCALLTYPE Site_GetContainer(IOleClientSite FAR* This, LPOLECONTAINER FAR* ppContainer);
-HRESULT STDMETHODCALLTYPE Site_ShowObject(IOleClientSite FAR* This);
-HRESULT STDMETHODCALLTYPE Site_OnShowWindow(IOleClientSite FAR* This, BOOL fShow);
-HRESULT STDMETHODCALLTYPE Site_RequestNewObjectLayout(IOleClientSite FAR* This);
-
-IOleClientSiteVtbl MyIOleClientSiteTable = {Site_QueryInterface,
-Site_AddRef,
-Site_Release,
-Site_SaveObject,
-Site_GetMoniker,
-Site_GetContainer,
-Site_ShowObject,
-Site_OnShowWindow,
-Site_RequestNewObjectLayout};
-
-HRESULT STDMETHODCALLTYPE UI_QueryInterface(IDocHostUIHandler FAR* This, REFIID riid, void ** ppvObject);
-HRESULT STDMETHODCALLTYPE UI_AddRef(IDocHostUIHandler FAR* This);
-HRESULT STDMETHODCALLTYPE UI_Release(IDocHostUIHandler FAR* This);
-HRESULT STDMETHODCALLTYPE UI_ShowContextMenu(IDocHostUIHandler FAR* This, DWORD dwID, POINT __RPC_FAR *ppt, IUnknown __RPC_FAR *pcmdtReserved, IDispatch __RPC_FAR *pdispReserved);
-HRESULT STDMETHODCALLTYPE UI_GetHostInfo(IDocHostUIHandler FAR* This, DOCHOSTUIINFO __RPC_FAR *pInfo);
-HRESULT STDMETHODCALLTYPE UI_ShowUI(IDocHostUIHandler FAR* This, DWORD dwID, IOleInPlaceActiveObject __RPC_FAR *pActiveObject, IOleCommandTarget __RPC_FAR *pCommandTarget, IOleInPlaceFrame __RPC_FAR *pFrame, IOleInPlaceUIWindow __RPC_FAR *pDoc);
-HRESULT STDMETHODCALLTYPE UI_HideUI(IDocHostUIHandler FAR* This);
-HRESULT STDMETHODCALLTYPE UI_UpdateUI(IDocHostUIHandler FAR* This);
-HRESULT STDMETHODCALLTYPE UI_EnableModeless(IDocHostUIHandler FAR* This, BOOL fEnable);
-HRESULT STDMETHODCALLTYPE UI_OnDocWindowActivate(IDocHostUIHandler FAR* This, BOOL fActivate);
-HRESULT STDMETHODCALLTYPE UI_OnFrameWindowActivate(IDocHostUIHandler FAR* This, BOOL fActivate);
-HRESULT STDMETHODCALLTYPE UI_ResizeBorder(IDocHostUIHandler FAR* This, LPCRECT prcBorder, IOleInPlaceUIWindow __RPC_FAR *pUIWindow, BOOL fRameWindow);
-HRESULT STDMETHODCALLTYPE UI_TranslateAccelerator(IDocHostUIHandler FAR* This, LPMSG lpMsg, const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID);
-HRESULT STDMETHODCALLTYPE UI_GetOptionKeyPath(IDocHostUIHandler FAR* This, LPOLESTR __RPC_FAR *pchKey, DWORD dw);
-HRESULT STDMETHODCALLTYPE UI_GetDropTarget(IDocHostUIHandler FAR* This, IDropTarget __RPC_FAR *pDropTarget, IDropTarget __RPC_FAR *__RPC_FAR *ppDropTarget);
-HRESULT STDMETHODCALLTYPE UI_GetExternal(IDocHostUIHandler FAR* This, IDispatch __RPC_FAR *__RPC_FAR *ppDispatch);
-HRESULT STDMETHODCALLTYPE UI_TranslateUrl(IDocHostUIHandler FAR* This, DWORD dwTranslate, OLECHAR __RPC_FAR *pchURLIn, OLECHAR __RPC_FAR *__RPC_FAR *ppchURLOut);
-HRESULT STDMETHODCALLTYPE UI_FilterDataObject(IDocHostUIHandler FAR* This, IDataObject __RPC_FAR *pDO, IDataObject __RPC_FAR *__RPC_FAR *ppDORet);
-
-IDocHostUIHandlerVtbl MyIDocHostUIHandlerTable = {UI_QueryInterface,
-UI_AddRef,
-UI_Release,
-UI_ShowContextMenu,
-UI_GetHostInfo,
-UI_ShowUI,
-UI_HideUI,
-UI_UpdateUI,
-UI_EnableModeless,
-UI_OnDocWindowActivate,
-UI_OnFrameWindowActivate,
-UI_ResizeBorder,
-UI_TranslateAccelerator,
-UI_GetOptionKeyPath,
-UI_GetDropTarget,
-UI_GetExternal,
-UI_TranslateUrl,
-UI_FilterDataObject};
-
-HRESULT STDMETHODCALLTYPE InPlace_QueryInterface(IOleInPlaceSite FAR* This, REFIID riid, void ** ppvObject);
-HRESULT STDMETHODCALLTYPE InPlace_AddRef(IOleInPlaceSite FAR* This);
-HRESULT STDMETHODCALLTYPE InPlace_Release(IOleInPlaceSite FAR* This);
-HRESULT STDMETHODCALLTYPE InPlace_GetWindow(IOleInPlaceSite FAR* This, HWND FAR* lphwnd);
-HRESULT STDMETHODCALLTYPE InPlace_ContextSensitiveHelp(IOleInPlaceSite FAR* This, BOOL fEnterMode);
-HRESULT STDMETHODCALLTYPE InPlace_CanInPlaceActivate(IOleInPlaceSite FAR* This);
-HRESULT STDMETHODCALLTYPE InPlace_OnInPlaceActivate(IOleInPlaceSite FAR* This);
-HRESULT STDMETHODCALLTYPE InPlace_OnUIActivate(IOleInPlaceSite FAR* This);
-HRESULT STDMETHODCALLTYPE InPlace_GetWindowContext(IOleInPlaceSite FAR* This, LPOLEINPLACEFRAME FAR* lplpFrame,LPOLEINPLACEUIWINDOW FAR* lplpDoc,LPRECT lprcPosRect,LPRECT lprcClipRect,LPOLEINPLACEFRAMEINFO lpFrameInfo);
-HRESULT STDMETHODCALLTYPE InPlace_Scroll(IOleInPlaceSite FAR* This, SIZE scrollExtent);
-HRESULT STDMETHODCALLTYPE InPlace_OnUIDeactivate(IOleInPlaceSite FAR* This, BOOL fUndoable);
-HRESULT STDMETHODCALLTYPE InPlace_OnInPlaceDeactivate(IOleInPlaceSite FAR* This);
-HRESULT STDMETHODCALLTYPE InPlace_DiscardUndoState(IOleInPlaceSite FAR* This);
-HRESULT STDMETHODCALLTYPE InPlace_DeactivateAndUndo(IOleInPlaceSite FAR* This);
-HRESULT STDMETHODCALLTYPE InPlace_OnPosRectChange(IOleInPlaceSite FAR* This, LPCRECT lprcPosRect);
-
-IOleInPlaceSiteVtbl MyIOleInPlaceSiteTable = {InPlace_QueryInterface,
-InPlace_AddRef,
-InPlace_Release,
-InPlace_GetWindow,
-InPlace_ContextSensitiveHelp,
-InPlace_CanInPlaceActivate,
-InPlace_OnInPlaceActivate,
-InPlace_OnUIActivate,
-InPlace_GetWindowContext,
-InPlace_Scroll,
-InPlace_OnUIDeactivate,
-InPlace_OnInPlaceDeactivate,
-InPlace_DiscardUndoState,
-InPlace_DeactivateAndUndo,
-InPlace_OnPosRectChange};
-
-typedef struct {
- IOleInPlaceSite inplace;
- _IOleInPlaceFrameEx frame;
-} _IOleInPlaceSiteEx;
-
-typedef struct {
- IDocHostUIHandler ui;
-} _IDocHostUIHandlerEx;
-
-typedef struct {
- IOleClientSite client;
- _IOleInPlaceSiteEx inplace;
- _IDocHostUIHandlerEx ui;
-} _IOleClientSiteEx;
-
-#define NOTIMPLEMENTED return(E_NOTIMPL)
-
-typedef struct
-{
- char *pszHTML;
- char *pszTitle;
- int width;
- int height;
- HWND hWnd; // out
-} ShowIEWndParam;
-
-
-//////////////////////////////////// My IDocHostUIHandler functions //////////////////////////////////////
-//
-HRESULT STDMETHODCALLTYPE UI_QueryInterface(IDocHostUIHandler FAR* This, REFIID riid, LPVOID FAR* ppvObj)
-{
- return(Site_QueryInterface((IOleClientSite *)((char *)This - sizeof(IOleClientSite) - sizeof(_IOleInPlaceSiteEx)), riid, ppvObj));
-}
-
-HRESULT STDMETHODCALLTYPE UI_AddRef(IDocHostUIHandler FAR* This)
-{
- return(1);
-}
-
-HRESULT STDMETHODCALLTYPE UI_Release(IDocHostUIHandler FAR* This)
-{
- return(1);
-}
-
-HRESULT STDMETHODCALLTYPE UI_ShowContextMenu(IDocHostUIHandler FAR* This, DWORD dwID, POINT __RPC_FAR *ppt, IUnknown __RPC_FAR *pcmdtReserved, IDispatch __RPC_FAR *pdispReserved)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE UI_GetHostInfo(IDocHostUIHandler FAR* This, DOCHOSTUIINFO __RPC_FAR *pInfo)
-{
- pInfo->cbSize = sizeof(DOCHOSTUIINFO);
- pInfo->dwFlags = DOCHOSTUIFLAG_NO3DBORDER;
- pInfo->dwDoubleClick = DOCHOSTUIDBLCLK_DEFAULT;
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE UI_ShowUI(IDocHostUIHandler FAR* This, DWORD dwID, IOleInPlaceActiveObject __RPC_FAR *pActiveObject, IOleCommandTarget __RPC_FAR *pCommandTarget, IOleInPlaceFrame __RPC_FAR *pFrame, IOleInPlaceUIWindow __RPC_FAR *pDoc)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE UI_HideUI(IDocHostUIHandler FAR* This)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE UI_UpdateUI(IDocHostUIHandler FAR* This)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE UI_EnableModeless(IDocHostUIHandler FAR* This, BOOL fEnable)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE UI_OnDocWindowActivate(IDocHostUIHandler FAR* This, BOOL fActivate)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE UI_OnFrameWindowActivate(IDocHostUIHandler FAR* This, BOOL fActivate)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE UI_ResizeBorder(IDocHostUIHandler FAR* This, LPCRECT prcBorder, IOleInPlaceUIWindow __RPC_FAR *pUIWindow, BOOL fRameWindow)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE UI_TranslateAccelerator(IDocHostUIHandler FAR* This, LPMSG lpMsg, const GUID __RPC_FAR *pguidCmdGroup, DWORD nCmdID)
-{
- return(S_FALSE);
-}
-
-HRESULT STDMETHODCALLTYPE UI_GetOptionKeyPath(IDocHostUIHandler FAR* This, LPOLESTR __RPC_FAR *pchKey, DWORD dw)
-{
- return(S_FALSE);
-}
-
-HRESULT STDMETHODCALLTYPE UI_GetDropTarget(IDocHostUIHandler FAR* This, IDropTarget __RPC_FAR *pDropTarget, IDropTarget __RPC_FAR *__RPC_FAR *ppDropTarget)
-{
- return(S_FALSE);
-}
-
-HRESULT STDMETHODCALLTYPE UI_GetExternal(IDocHostUIHandler FAR* This, IDispatch __RPC_FAR *__RPC_FAR *ppDispatch)
-{
- *ppDispatch = 0;
- return(S_FALSE);
-}
-
-HRESULT STDMETHODCALLTYPE UI_TranslateUrl(IDocHostUIHandler FAR* This, DWORD dwTranslate, OLECHAR __RPC_FAR *pchURLIn, OLECHAR __RPC_FAR *__RPC_FAR *ppchURLOut)
-{
- *ppchURLOut = 0;
- return(S_FALSE);
-}
-
-HRESULT STDMETHODCALLTYPE UI_FilterDataObject(IDocHostUIHandler FAR* This, IDataObject __RPC_FAR *pDO, IDataObject __RPC_FAR *__RPC_FAR *ppDORet)
-{
- *ppDORet = 0;
- return(S_FALSE);
-}
-
-////////////////////////////////////// My IOleClientSite functions /////////////////////////////////////
-//
-
-HRESULT STDMETHODCALLTYPE Site_QueryInterface(IOleClientSite FAR* This, REFIID riid, void ** ppvObject)
-{
- if (!memcmp(riid, &IID_IUnknown, sizeof(GUID)) || !memcmp(riid, &IID_IOleClientSite, sizeof(GUID)))
- *ppvObject = &((_IOleClientSiteEx *)This)->client;
- else if (!memcmp(riid, &IID_IOleInPlaceSite, sizeof(GUID)))
- *ppvObject = &((_IOleClientSiteEx *)This)->inplace;
- else if (!memcmp(riid, &IID_IDocHostUIHandler, sizeof(GUID)))
- *ppvObject = &((_IOleClientSiteEx *)This)->ui;
- else
- {
- *ppvObject = 0;
- return(E_NOINTERFACE);
- }
-
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE Site_AddRef(IOleClientSite FAR* This)
-{
- return(1);
-}
-
-HRESULT STDMETHODCALLTYPE Site_Release(IOleClientSite FAR* This)
-{
- return(1);
-}
-
-HRESULT STDMETHODCALLTYPE Site_SaveObject(IOleClientSite FAR* This)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE Site_GetMoniker(IOleClientSite FAR* This, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker ** ppmk)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE Site_GetContainer(IOleClientSite FAR* This, LPOLECONTAINER FAR* ppContainer)
-{
- *ppContainer = 0;
-
- return(E_NOINTERFACE);
-}
-
-HRESULT STDMETHODCALLTYPE Site_ShowObject(IOleClientSite FAR* This)
-{
- return(NOERROR);
-}
-
-HRESULT STDMETHODCALLTYPE Site_OnShowWindow(IOleClientSite FAR* This, BOOL fShow)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE Site_RequestNewObjectLayout(IOleClientSite FAR* This)
-{
- NOTIMPLEMENTED;
-}
-
-
-////////////////////////////////////// My IOleInPlaceSite functions /////////////////////////////////////
-//
-HRESULT STDMETHODCALLTYPE InPlace_QueryInterface(IOleInPlaceSite FAR* This, REFIID riid, LPVOID FAR* ppvObj)
-{
- return(Site_QueryInterface((IOleClientSite *)((char *)This - sizeof(IOleClientSite)), riid, ppvObj));
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_AddRef(IOleInPlaceSite FAR* This)
-{
- return(1);
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_Release(IOleInPlaceSite FAR* This)
-{
- return(1);
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_GetWindow(IOleInPlaceSite FAR* This, HWND FAR* lphwnd)
-{
- *lphwnd = ((_IOleInPlaceSiteEx FAR*)This)->frame.window;
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_ContextSensitiveHelp(IOleInPlaceSite FAR* This, BOOL fEnterMode)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_CanInPlaceActivate(IOleInPlaceSite FAR* This)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_OnInPlaceActivate(IOleInPlaceSite FAR* This)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_OnUIActivate(IOleInPlaceSite FAR* This)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_GetWindowContext(IOleInPlaceSite FAR* This, LPOLEINPLACEFRAME FAR* lplpFrame, LPOLEINPLACEUIWINDOW FAR* lplpDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
-{
- *lplpFrame = (LPOLEINPLACEFRAME)&((_IOleInPlaceSiteEx *)This)->frame;
- *lplpDoc = 0;
-
- lpFrameInfo->fMDIApp = FALSE;
- lpFrameInfo->hwndFrame = ((_IOleInPlaceFrameEx *)*lplpFrame)->window;
- lpFrameInfo->haccel = 0;
- lpFrameInfo->cAccelEntries = 0;
-
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_Scroll(IOleInPlaceSite FAR* This, SIZE scrollExtent)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_OnUIDeactivate(IOleInPlaceSite FAR* This, BOOL fUndoable)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_OnInPlaceDeactivate(IOleInPlaceSite FAR* This)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_DiscardUndoState(IOleInPlaceSite FAR* This)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_DeactivateAndUndo(IOleInPlaceSite FAR* This)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE InPlace_OnPosRectChange(IOleInPlaceSite FAR* This, LPCRECT lprcPosRect)
-{
- IOleObject *browserObject;
- IOleInPlaceObject *inplace;
-
- browserObject = *((IOleObject **)((char *)This - sizeof(IOleObject *) - sizeof(IOleClientSite)));
- if (!browserObject->lpVtbl->QueryInterface(browserObject, &IID_IOleInPlaceObject, (void**)&inplace))
- {
- inplace->lpVtbl->SetObjectRects(inplace, lprcPosRect, lprcPosRect);
- inplace->lpVtbl->Release(inplace);
- }
-
- return(S_OK);
-}
-
-
-
-////////////////////////////////////// My IOleInPlaceFrame functions /////////////////////////////////////////
-//
-HRESULT STDMETHODCALLTYPE Frame_QueryInterface(IOleInPlaceFrame FAR* This, REFIID riid, LPVOID FAR* ppvObj)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE Frame_AddRef(IOleInPlaceFrame FAR* This)
-{
- return(1);
-}
-
-HRESULT STDMETHODCALLTYPE Frame_Release(IOleInPlaceFrame FAR* This)
-{
- return(1);
-}
-
-HRESULT STDMETHODCALLTYPE Frame_GetWindow(IOleInPlaceFrame FAR* This, HWND FAR* lphwnd)
-{
- *lphwnd = ((_IOleInPlaceFrameEx *)This)->window;
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE Frame_ContextSensitiveHelp(IOleInPlaceFrame FAR* This, BOOL fEnterMode)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE Frame_GetBorder(IOleInPlaceFrame FAR* This, LPRECT lprectBorder)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE Frame_RequestBorderSpace(IOleInPlaceFrame FAR* This, LPCBORDERWIDTHS pborderwidths)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE Frame_SetBorderSpace(IOleInPlaceFrame FAR* This, LPCBORDERWIDTHS pborderwidths)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE Frame_SetActiveObject(IOleInPlaceFrame FAR* This, IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE Frame_InsertMenus(IOleInPlaceFrame FAR* This, HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE Frame_SetMenu(IOleInPlaceFrame FAR* This, HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE Frame_RemoveMenus(IOleInPlaceFrame FAR* This, HMENU hmenuShared)
-{
- NOTIMPLEMENTED;
-}
-
-HRESULT STDMETHODCALLTYPE Frame_SetStatusText(IOleInPlaceFrame FAR* This, LPCOLESTR pszStatusText)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE Frame_EnableModeless(IOleInPlaceFrame FAR* This, BOOL fEnable)
-{
- return(S_OK);
-}
-
-HRESULT STDMETHODCALLTYPE Frame_TranslateAccelerator(IOleInPlaceFrame FAR* This, LPMSG lpmsg, WORD wID)
-{
- NOTIMPLEMENTED;
-}
-
-
-
-
-/*************************** UnEmbedBrowserObject() ************************
- * Called to detach the browser object from our host window, and free its
- * resources, right before we destroy our window.
- *
- * hwnd = Handle to the window hosting the browser object.
- *
- * NOTE: The pointer to the browser object must have been stored in the
- * window's USERDATA field. In other words, don't call UnEmbedBrowserObject().
- * with a HWND that wasn't successfully passed to EmbedBrowserObject().
- */
-
-void UnEmbedBrowserObject(HWND hwnd)
-{
- IOleObject **browserHandle;
- IOleObject *browserObject;
-
- // Retrieve the browser object's pointer we stored in our window's GWL_USERDATA when
- // we initially attached the browser object to this window.
- if ((browserHandle = (IOleObject **)GetWindowLongPtr(hwnd, GWLP_USERDATA)))
- {
- // Unembed the browser object, and release its resources.
- browserObject = *browserHandle;
- browserObject->lpVtbl->Close(browserObject, OLECLOSE_NOSAVE);
- browserObject->lpVtbl->Release(browserObject);
-
- GlobalFree(browserHandle);
-
- return;
- }
-}
-
-
-/******************************* DisplayHTMLStr() ****************************
- * Takes a string containing some HTML BODY, and displays it in the specified
- * window. For example, perhaps you want to display the HTML text of...
- *
- * <P>This is a picture.<P><IMG src="mypic.jpg">
- *
- * hwnd = Handle to the window hosting the browser object.
- * string = Pointer to nul-terminated string containing the HTML BODY.
- * (NOTE: No <BODY></BODY> tags are required in the string).
- *
- * RETURNS: 0 if success, or non-zero if an error.
- *
- * NOTE: EmbedBrowserObject() must have been successfully called once with the
- * specified window, prior to calling this function. You need call
- * EmbedBrowserObject() once only, and then you can make multiple calls to
- * this function to display numerous pages in the specified window.
- */
-
-long DisplayHTMLStr(HWND hwnd, LPCTSTR string)
-{
- IWebBrowser2 *webBrowser2;
- LPDISPATCH lpDispatch;
- IHTMLDocument2 *htmlDoc2;
- IOleObject *browserObject;
- SAFEARRAY *sfArray;
- VARIANT myURL;
- VARIANT *pVar;
- BSTR bstr;
-
- // Retrieve the browser object's pointer we stored in our window's GWL_USERDATA when
- // we initially attached the browser object to this window.
- browserObject = *((IOleObject **)GetWindowLongPtr(hwnd, GWLP_USERDATA));
-
- // Assume an error.
- bstr = 0;
-
- // We want to get the base address (ie, a pointer) to the IWebBrowser2 object embedded within the browser
- // object, so we can call some of the functions in the former's table.
- if (!browserObject->lpVtbl->QueryInterface(browserObject, &IID_IWebBrowser2, (void**)&webBrowser2))
- {
- // Ok, now the pointer to our IWebBrowser2 object is in 'webBrowser2', and so its VTable is
- // webBrowser2->lpVtbl.
-
- // Before we can get_Document(), we actually need to have some HTML page loaded in the browser. So,
- // let's load an empty HTML page. Then, once we have that empty page, we can get_Document() and
- // write() to stuff our HTML string into it.
- VariantInit(&myURL);
- myURL.vt = VT_BSTR;
- myURL.bstrVal = SysAllocString(L"about:blank");
-
- // Call the Navigate2() function to actually display the page.
- webBrowser2->lpVtbl->Navigate2(webBrowser2, &myURL, 0, 0, 0, 0);
-
- // Free any resources (including the BSTR).
- VariantClear(&myURL);
-
- // Call the IWebBrowser2 object's get_Document so we can get its DISPATCH object. I don't know why you
- // don't get the DISPATCH object via the browser object's QueryInterface(), but you don't.
- if (!webBrowser2->lpVtbl->get_Document(webBrowser2, &lpDispatch))
- {
- // We want to get a pointer to the IHTMLDocument2 object embedded within the DISPATCH
- // object, so we can call some of the functions in the former's table.
- if (!lpDispatch->lpVtbl->QueryInterface(lpDispatch, &IID_IHTMLDocument2, (void**)&htmlDoc2))
- {
- // Ok, now the pointer to our IHTMLDocument2 object is in 'htmlDoc2', and so its VTable is
- // htmlDoc2->lpVtbl.
-
- // Our HTML must be in the form of a BSTR. And it must be passed to write() in an
- // array of "VARIENT" structs. So let's create all that.
- if ((sfArray = SafeArrayCreate(VT_VARIANT, 1, (SAFEARRAYBOUND *)&ArrayBound)))
- {
- if (!SafeArrayAccessData(sfArray, (void**)&pVar))
- {
- pVar->vt = VT_BSTR;
-#ifndef UNICODE
- {
- wchar_t *buffer;
- DWORD size;
-
- size = MultiByteToWideChar(CP_ACP, 0, string, -1, 0, 0);
- if (!(buffer = (wchar_t *)GlobalAlloc(GMEM_FIXED, sizeof(wchar_t) * size))) goto bad;
- MultiByteToWideChar(CP_ACP, 0, string, -1, buffer, size);
- bstr = SysAllocString(buffer);
- GlobalFree(buffer);
- }
-#else
- bstr = SysAllocString(string);
-#endif
- // Store our BSTR pointer in the VARIENT.
- if ((pVar->bstrVal = bstr))
- {
- htmlDoc2->lpVtbl->clear(htmlDoc2);
- // Pass the VARIENT with its BSTR to write() in order to shove our desired HTML string
- // into the body of that empty page we created above.
- htmlDoc2->lpVtbl->write(htmlDoc2, sfArray);
-
- // Close the document. If we don't do this, subsequent calls to DisplayHTMLStr
- // would append to the current contents of the page
- htmlDoc2->lpVtbl->close(htmlDoc2);
-
- // Normally, we'd need to free our BSTR, but SafeArrayDestroy() does it for us
-// SysFreeString(bstr);
- }
- }
-
- // Free the array. This also frees the VARIENT that SafeArrayAccessData created for us,
- // and even frees the BSTR we allocated with SysAllocString
- SafeArrayDestroy(sfArray);
- }
-
- // Release the IHTMLDocument2 object.
-bad: htmlDoc2->lpVtbl->Release(htmlDoc2);
- }
-
- // Release the DISPATCH object.
- lpDispatch->lpVtbl->Release(lpDispatch);
- }
-
- // Release the IWebBrowser2 object.
- webBrowser2->lpVtbl->Release(webBrowser2);
- }
-
- // No error?
- if (bstr) return(0);
-
- // An error
- return(-1);
-}
-
-
-
-/******************************* ResizeBrowser() ****************************
- * Resizes the browser object for the specified window to the specified
- * width and height.
- *
- * hwnd = Handle to the window hosting the browser object.
- * width = Width.
- * height = Height.
- *
- * NOTE: EmbedBrowserObject() must have been successfully called once with the
- * specified window, prior to calling this function. You need call
- * EmbedBrowserObject() once only, and then you can make multiple calls to
- * this function to resize the browser object.
- */
-
-void ResizeBrowser(HWND hwnd, DWORD width, DWORD height)
-{
- IWebBrowser2 *webBrowser2;
- IOleObject *browserObject;
-
- // Retrieve the browser object's pointer we stored in our window's GWL_USERDATA when
- // we initially attached the browser object to this window.
- browserObject = *((IOleObject **)GetWindowLongPtr(hwnd, GWLP_USERDATA));
-
- // We want to get the base address (ie, a pointer) to the IWebBrowser2 object embedded within the browser
- // object, so we can call some of the functions in the former's table.
- if (!browserObject->lpVtbl->QueryInterface(browserObject, &IID_IWebBrowser2, (void**)&webBrowser2))
- {
- // Ok, now the pointer to our IWebBrowser2 object is in 'webBrowser2', and so its VTable is
- // webBrowser2->lpVtbl.
-
- // Call are put_Width() and put_Height() to set the new width/height.
- webBrowser2->lpVtbl->put_Width(webBrowser2, width);
- webBrowser2->lpVtbl->put_Height(webBrowser2, height);
-
- // We no longer need the IWebBrowser2 object (ie, we don't plan to call any more functions in it,
- // so we can release our hold on it). Note that we'll still maintain our hold on the browser
- // object.
- webBrowser2->lpVtbl->Release(webBrowser2);
- }
-}
-
-
-
-
-
-/***************************** EmbedBrowserObject() **************************
- * Puts the browser object inside our host window, and save a pointer to this
- * window's browser object in the window's GWL_USERDATA field.
- *
- * hwnd = Handle of our window into which we embed the browser object.
- *
- * RETURNS: 0 if success, or non-zero if an error.
- *
- * NOTE: We tell the browser object to occupy the entire client area of the
- * window.
- *
- * NOTE: No HTML page will be displayed here. We can do that with a subsequent
- * call to either DisplayHTMLPage() or DisplayHTMLStr(). This is merely once-only
- * initialization for using the browser object. In a nutshell, what we do
- * here is get a pointer to the browser object in our window's GWL_USERDATA
- * so we can access that object's functions whenever we want, and we also pass
- * the browser a pointer to our IOleClientSite struct so that the browser can
- * call our functions in our struct's VTable.
- */
-
-long EmbedBrowserObject(HWND hwnd)
-{
- LPCLASSFACTORY pClassFactory;
- IOleObject *browserObject;
- IWebBrowser2 *webBrowser2;
- RECT rect;
- char *ptr;
- _IOleClientSiteEx *_iOleClientSiteEx;
-
- // Our IOleClientSite, IOleInPlaceSite, and IOleInPlaceFrame functions need to get our window handle. We
- // could store that in some global. But then, that would mean that our functions would work with only that
- // one window. If we want to create multiple windows, each hosting its own browser object (to display its
- // own web page), then we need to create unique IOleClientSite, IOleInPlaceSite, and IOleInPlaceFrame
- // structs for each window. And we'll put an extra field at the end of those structs to store our extra
- // data such as a window handle. So, our functions won't have to touch global data, and can therefore be
- // re-entrant and work with multiple objects/windows.
- //
- // Remember that a pointer to our IOleClientSite we create here will be passed as the first arg to every
- // one of our IOleClientSite functions. Ditto with the IOleInPlaceFrame object we create here, and the
- // IOleInPlaceFrame functions. So, our functions are able to retrieve the window handle we'll store here,
- // and then, they'll work with all such windows containing a browser control.
- //
- // Furthermore, since the browser will be calling our IOleClientSite's QueryInterface to get a pointer to
- // our IOleInPlaceSite and IDocHostUIHandler objects, that means that our IOleClientSite QueryInterface
- // must have an easy way to grab those pointers. Probably the easiest thing to do is just embed our
- // IOleInPlaceSite and IDocHostUIHandler objects inside of an extended IOleClientSite which we'll call
- // a _IOleClientSiteEx. As long as they come after the pointer to the IOleClientSite VTable, then we're
- // ok.
- //
- // Of course, we need to GlobalAlloc the above structs now. We'll just get all 4 with a single call to
- // GlobalAlloc, especially since 3 of them are all contained inside of our _IOleClientSiteEx anyway.
- //
- // So, we're not actually allocating separate IOleClientSite, IOleInPlaceSite, IOleInPlaceFrame and
- // IDocHostUIHandler structs.
- //
- // One final thing. We're going to allocate extra room to store the pointer to the browser object.
- if (!(ptr = (char *)GlobalAlloc(GMEM_FIXED, sizeof(_IOleClientSiteEx) + sizeof(IOleObject *))))
- return(-1);
-
- // Initialize our IOleClientSite object with a pointer to our IOleClientSite VTable.
- _iOleClientSiteEx = (_IOleClientSiteEx *)(ptr + sizeof(IOleObject *));
- _iOleClientSiteEx->client.lpVtbl = &MyIOleClientSiteTable;
-
- // Initialize our IOleInPlaceSite object with a pointer to our IOleInPlaceSite VTable.
- _iOleClientSiteEx->inplace.inplace.lpVtbl = &MyIOleInPlaceSiteTable;
-
- // Initialize our IOleInPlaceFrame object with a pointer to our IOleInPlaceFrame VTable.
- _iOleClientSiteEx->inplace.frame.frame.lpVtbl = &MyIOleInPlaceFrameTable;
-
- // Save our HWND (in the IOleInPlaceFrame object) so our IOleInPlaceFrame functions can retrieve it.
- _iOleClientSiteEx->inplace.frame.window = hwnd;
-
- // Initialize our IDocHostUIHandler object with a pointer to our IDocHostUIHandler VTable.
- _iOleClientSiteEx->ui.ui.lpVtbl = &MyIDocHostUIHandlerTable;
-
- // Get a pointer to the browser object and lock it down (so it doesn't "disappear" while we're using
- // it in this program). We do this by calling the OS function CoGetClassObject().
- //
- // NOTE: We need this pointer to interact with and control the browser. With normal WIN32 controls such as a
- // Static, Edit, Combobox, etc, you obtain an HWND and send messages to it with SendMessage(). Not so with
- // the browser object. You need to get a pointer to its "base structure" (as returned by CoGetClassObject()). This
- // structure contains an array of pointers to functions you can call within the browser object. Actually, the
- // base structure contains a 'lpVtbl' field that is a pointer to that array. We'll call the array a 'VTable'.
- //
- // For example, the browser object happens to have a SetHostNames() function we want to call. So, after we
- // retrieve the pointer to the browser object (in a local we'll name 'browserObject'), then we can call that
- // function, and pass it args, as so:
- //
- // browserObject->lpVtbl->SetHostNames(browserObject, SomeString, SomeString);
- //
- // There's our pointer to the browser object in 'browserObject'. And there's the pointer to the browser object's
- // VTable in 'browserObject->lpVtbl'. And the pointer to the SetHostNames function happens to be stored in an
- // field named 'SetHostNames' within the VTable. So we are actually indirectly calling SetHostNames by using
- // a pointer to it. That's how you use a VTable.
- //
- // NOTE: We pass our _IOleClientSiteEx struct and lie -- saying that it's a IOleClientSite. It's ok. A
- // _IOleClientSiteEx struct starts with an embedded IOleClientSite. So the browser won't care, and we want
- // this extended struct passed to our IOleClientSite functions.
-
- // Get a pointer to the browser object's IClassFactory object via CoGetClassObject()
- pClassFactory = 0;
- if (!CoGetClassObject(&CLSID_WebBrowser, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, NULL, &IID_IClassFactory, (void **)&pClassFactory) && pClassFactory)
- {
- // Call the IClassFactory's CreateInstance() to create a browser object
- if (!pClassFactory->lpVtbl->CreateInstance(pClassFactory, 0, &IID_IOleObject, &browserObject))
- {
- // Free the IClassFactory. We need it only to create a browser object instance
- pClassFactory->lpVtbl->Release(pClassFactory);
-
- // Ok, we now have the pointer to the browser object in 'browserObject'. Let's save this in the
- // memory block we allocated above, and then save the pointer to that whole thing in our window's
- // USERDATA field. That way, if we need multiple windows each hosting its own browser object, we can
- // call EmbedBrowserObject() for each one, and easily associate the appropriate browser object with
- // its matching window and its own objects containing per-window data.
- *((IOleObject **)ptr) = browserObject;
- SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)ptr);
-
- // Give the browser a pointer to my IOleClientSite object
- if (!browserObject->lpVtbl->SetClientSite(browserObject, (IOleClientSite *)_iOleClientSiteEx))
- {
- // We can now call the browser object's SetHostNames function. SetHostNames lets the browser object know our
- // application's name and the name of the document in which we're embedding the browser. (Since we have no
- // document name, we'll pass a 0 for the latter). When the browser object is opened for editing, it displays
- // these names in its titlebar.
- //
- // We are passing 3 args to SetHostNames. You'll note that the first arg to SetHostNames is the base
- // address of our browser control. This is something that you always have to remember when working in C
- // (as opposed to C++). When calling a VTable function, the first arg to that function must always be the
- // structure which contains the VTable. (In this case, that's the browser control itself). Why? That's
- // because that function is always assumed to be written in C++. And the first argument to any C++ function
- // must be its 'this' pointer (ie, the base address of its class, which in this case is our browser object
- // pointer). In C++, you don't have to pass this first arg, because the C++ compiler is smart enough to
- // produce an executable that always adds this first arg. In fact, the C++ compiler is smart enough to
- // know to fetch the function pointer from the VTable, so you don't even need to reference that. In other
- // words, the C++ equivalent code would be:
- //
- // browserObject->SetHostNames(L"My Host Name", 0);
- //
- // So, when you're trying to convert C++ code to C, always remember to add this first arg whenever you're
- // dealing with a VTable (ie, the field is usually named 'lpVtbl') in the standard objects, and also add
- // the reference to the VTable itself.
- //
- // Oh yeah, the L is because we need UNICODE strings. And BTW, the host and document names can be anything
- // you want.
- browserObject->lpVtbl->SetHostNames(browserObject, L"My Host Name", 0);
-
- GetClientRect(hwnd, &rect);
-
- // Let browser object know that it is embedded in an OLE container.
- if (!OleSetContainedObject((struct IUnknown *)browserObject, TRUE) &&
-
- // Set the display area of our browser control the same as our window's size
- // and actually put the browser object into our window.
- !browserObject->lpVtbl->DoVerb(browserObject, OLEIVERB_SHOW, NULL, (IOleClientSite *)_iOleClientSiteEx, -1, hwnd, &rect) &&
-
- // Ok, now things may seem to get even trickier, One of those function pointers in the browser's VTable is
- // to the QueryInterface() function. What does this function do? It lets us grab the base address of any
- // other object that may be embedded within the browser object. And this other object has its own VTable
- // containing pointers to more functions we can call for that object.
- //
- // We want to get the base address (ie, a pointer) to the IWebBrowser2 object embedded within the browser
- // object, so we can call some of the functions in the former's table. For example, one IWebBrowser2 function
- // we intend to call below will be Navigate2(). So we call the browser object's QueryInterface to get our
- // pointer to the IWebBrowser2 object.
- !browserObject->lpVtbl->QueryInterface(browserObject, &IID_IWebBrowser2, (void**)&webBrowser2))
- {
- // Ok, now the pointer to our IWebBrowser2 object is in 'webBrowser2', and so its VTable is
- // webBrowser2->lpVtbl.
-
- // Let's call several functions in the IWebBrowser2 object to position the browser display area
- // in our window. The functions we call are put_Left(), put_Top(), put_Width(), and put_Height().
- // Note that we reference the IWebBrowser2 object's VTable to get pointers to those functions. And
- // also note that the first arg we pass to each is the pointer to the IWebBrowser2 object.
- webBrowser2->lpVtbl->put_Left(webBrowser2, 0);
- webBrowser2->lpVtbl->put_Top(webBrowser2, 0);
- webBrowser2->lpVtbl->put_Width(webBrowser2, rect.right);
- webBrowser2->lpVtbl->put_Height(webBrowser2, rect.bottom);
-
- // We no longer need the IWebBrowser2 object (ie, we don't plan to call any more functions in it
- // right now, so we can release our hold on it). Note that we'll still maintain our hold on the
- // browser object until we're done with that object.
- webBrowser2->lpVtbl->Release(webBrowser2);
-
- // Success
- return(0);
- }
- }
-
- // Something went wrong setting up the browser!
- UnEmbedBrowserObject(hwnd);
- return(-4);
- }
-
- pClassFactory->lpVtbl->Release(pClassFactory);
- GlobalFree(ptr);
-
- // Can't create an instance of the browser!
- return(-3);
- }
-
- GlobalFree(ptr);
-
- // Can't get the web browser's IClassFactory!
- return(-2);
-}
-
-
-
-
-
-/****************************** WindowProc() ***************************
- * Our message handler for our window to host the browser.
- */
-
-LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
- switch (uMsg)
- {
- case WM_SIZE:
- {
- // Resize the browser object to fit the window
- ResizeBrowser(hwnd, LOWORD(lParam), HIWORD(lParam));
- return(0);
- }
-
- case WM_CREATE:
- {
- // Embed the browser object into our host window. We need do this only
- // once. Note that the browser object will start calling some of our
- // IOleInPlaceFrame and IOleClientSite functions as soon as we start
- // calling browser object functions in EmbedBrowserObject().
- if (EmbedBrowserObject(hwnd)) return(-1);
-
- // Success
- return(0);
- }
-
- case WM_DESTROY:
- {
- int i, nCount;
-
- // Detach the browser object from this window, and free resources.
- UnEmbedBrowserObject(hwnd);
-
- // If all the windows are now closed, quit this app
- if (m_hWindows)
- {
- for (i=0, nCount=List_Count(m_hWindows); i<nCount; i++)
- {
- if (List_ElementAt (m_hWindows, i)==hwnd)
- {
- List_RemoveElementAt (m_hWindows, i);
- break;
- }
- }
- }
-
- return(TRUE);
- }
-
-
- }
-
- return(DefWindowProc(hwnd, uMsg, wParam, lParam));
-}
-
-// -----------------------------------------------------------------------------
-
-
-static DWORD WINAPI ShowIEWndFunc(PVOID pLoadWnd)
-{
- MSG msg;
- WNDCLASSEX wc={0};
- HWND hWndCache = NULL;
- static const TCHAR ClassName[] = "imo.im Voicechat wnd";
-
- if (CoInitialize(NULL) != S_OK) return -1;
-
- wc.cbSize = sizeof(WNDCLASSEX);
- wc.cbWndExtra = 2*sizeof(PVOID); // Extra to be used by caller, as we already make use of GWL_USERDATA
- wc.hInstance = (HINSTANCE)GetModuleHandle(NULL);
- wc.lpfnWndProc = WindowProc;
- wc.lpszClassName = &ClassName[0];
- RegisterClassEx(&wc);
-
- m_hWindows = List_Init(0);
-
- if (pLoadWnd)
- {
- // Create an invisible window with IE Control so that the appropriate libraries get loaded
- // and a new window can be shown more quickly
- hWndCache = CreateWindowEx(0, wc.lpszClassName, "dummy", WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, CW_USEDEFAULT, 0, 0,
- HWND_DESKTOP, NULL, wc.hInstance, 0);
- List_Push (m_hWindows, hWndCache);
- DisplayHTMLStr(hWndCache, "");
- }
-
- while (GetMessage(&msg, 0, 0, 0) == 1)
- {
- switch (msg.message)
- {
- case WM_USER:
- {
- ShowIEWndParam *Param = (ShowIEWndParam *)msg.lParam;
- if ((Param->hWnd = CreateWindowEx(0, wc.lpszClassName, Param->pszTitle, WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT, CW_USEDEFAULT, Param->width, Param->height,
- HWND_DESKTOP, NULL, wc.hInstance, 0)))
- {
- List_Push (m_hWindows, Param->hWnd);
- DisplayHTMLStr(Param->hWnd, Param->pszHTML);
- ShowWindow(Param->hWnd, SW_SHOWNORMAL);
- SetForegroundWindow (Param->hWnd);
- UpdateWindow(Param->hWnd);
- }
- SetEvent (m_hEvent);
- break;
- }
- case WM_USER+1:
- {
- DestroyWindow ((HWND)msg.lParam);
- break;
- }
- }
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
-
- UnregisterClass (wc.lpszClassName, wc.hInstance);
- CoUninitialize();
- if (m_hWindows) List_Exit (m_hWindows);
- ExitThread (0);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-// bInitBrowser - Tries to initialize a dummy window on start so that subsequent
-// calls are faster as all libraries are already present in
-// memory. Drawback: Higher memory consumption
-int W32Browser_Init(BOOL bInitBrowser)
-{
- if (m_hThread) W32Browser_Exit();
- m_hThread = (HANDLE)_beginthreadex(NULL, 0, ShowIEWndFunc, (LPVOID)bInitBrowser, 0, &m_dwThread);
- if (!m_hThread) return -1;
- if (!(m_hEvent = CreateEvent (NULL, FALSE, FALSE, NULL)))
- {
- TerminateThread (m_hThread, -1);
- CloseHandle (m_hThread);
- return -1;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-void W32Browser_Exit(void)
-{
- if (m_hWindows)
- {
- HWND hWnd;
-
- while (hWnd = List_Pop(m_hWindows))
- W32Browser_CloseWindow (hWnd);
- m_hWindows = NULL;
- }
- if (m_hThread)
- {
- PostThreadMessage (m_dwThread, WM_QUIT, 0, 0);
- if (WaitForSingleObject (m_hThread, 2000) == WAIT_TIMEOUT)
- TerminateThread (m_hThread, -1);
- CloseHandle (m_hThread);
- m_hThread = NULL;
- }
- if (m_hEvent)
- {
- CloseHandle (m_hEvent);
- m_hEvent = NULL;
- }
-}
-
-// -----------------------------------------------------------------------------
-
-void *W32Browser_ShowHTMLStr(char *pszHTMLStr, int width, int height, char *pszTitle)
-{
- // Window gets its own thread to not block the Mainthread
- static ShowIEWndParam Param;
-
- Param.width = width;
- Param.height = height;
- Param.pszHTML = pszHTMLStr;
- Param.pszTitle = pszTitle;
- Param.hWnd = 0;
- PostThreadMessage (m_dwThread, WM_USER, 0, (LPARAM)&Param);
- WaitForSingleObject (m_hEvent, INFINITE);
- return (void*)Param.hWnd;
-}
-
-// -----------------------------------------------------------------------------
-
-void W32Browser_CloseWindow (void *pWnd)
-{
- PostThreadMessage (m_dwThread, WM_USER+1, 0, (LPARAM)pWnd);
-}
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32browser.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32browser.h deleted file mode 100644 index effc86998d..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32browser.h +++ /dev/null @@ -1,5 +0,0 @@ -int W32Browser_Init(int bInitBrowser);
-void W32Browser_Exit(void);
-
-void *W32Browser_ShowHTMLStr(char *pszHTMLStr, int width, int height, char *pszTitle);
-void W32Browser_CloseWindow (void *pWnd);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32skypeemu.c b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32skypeemu.c deleted file mode 100644 index f9cc734cd1..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32skypeemu.c +++ /dev/null @@ -1,387 +0,0 @@ -#include <stdio.h>
-#include "imo2sproxy.h"
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#define LockMutex(x) EnterCriticalSection (&x)
-#define UnlockMutex(x) LeaveCriticalSection(&x)
-#define InitMutex(x) InitializeCriticalSection(&x)
-#define ExitMutex(x) DeleteCriticalSection(&x)
-#define strcasecmp stricmp
-#define strncasecmp stricmpn
-#define mutex_t CRITICAL_SECTION
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
-#include "memlist.h"
-#include "w32skypeemu.h"
-
-#ifndef _WIN64
-#if WINVER<0x0500
-#define SetWindowLongPtr SetWindowLong
-#define GetWindowLongPtr GetWindowLong
-#endif
-#ifndef LONG_PTR
-#define LONG_PTR LONG
-#endif
-#ifndef GWLP_USERDATA
-#define GWLP_USERDATA GWL_USERDATA
-#endif
-#endif
-
-// Skype API defines
-#define SKYPECONTROLAPI_ATTACH_SUCCESS 0
-#define SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION 1
-#define SKYPECONTROLAPI_ATTACH_REFUSED 2
-#define SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE 3
-#define SKYPECONTROLAPI_ATTACH_API_AVAILABLE 0x8001
-
-// -----------------------------------------------------------------------------
-
-typedef struct
-{
- IMO2SPROXY vtbl; // Must be first!
- IMO2SPROXY_CFG *pCfg;
- W32SKYPEEMU_CFG *pMyCfg;
- HWND hWndDispatch;
- TYP_LIST *hClients;
- mutex_t loopmutex;
- DWORD dwThreadID;
-} IMO2SPROXY_INST;
-
-typedef struct
-{
- HWND hWnd;
- IMOSAPI *hInst;
- IMO2SPROXY_INST *hProxy;
- mutex_t sendmutex;
- int iConnectionStat;
-} CONNINST;
-
-static UINT m_ControlAPIAttach = 0;
-static UINT m_ControlAPIDiscover = 0;
-
-// -----------------------------------------------------------------------------
-
-static void EventHandler(char *pszMsg, void *pUser);
-static CONNINST *FindClient(IMO2SPROXY_INST *hProxy, HWND hWnd);
-static void CleanConnections (TYP_LIST *hList);
-static void FreeConnection (CONNINST *pInst);
-static LONG APIENTRY WndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam);
-
-static int Imo2sproxy_Open(IMO2SPROXY *hInst);
-static void Imo2sproxy_Loop(IMO2SPROXY *hInst);
-static void Imo2sproxy_Exit(IMO2SPROXY *hInst);
-
-// -----------------------------------------------------------------------------
-static void EventHandler(char *pszMsg, void *pUser)
-{
- CONNINST *pInst = (CONNINST*)pUser;
- COPYDATASTRUCT cds;
- DWORD dwRes = 0;
-
- LockMutex(pInst->sendmutex);
- if (pInst->hProxy->pCfg->bVerbose && pInst->hProxy->pCfg->fpLog)
- {
- fprintf (pInst->hProxy->pCfg->fpLog, "%08X> %s\n", pInst->hWnd, pszMsg);
- fflush (pInst->hProxy->pCfg->fpLog);
- }
- cds.dwData = 0;
- cds.cbData = strlen(pszMsg)+1;
- cds.lpData = pszMsg;
- SendMessageTimeout (pInst->hWnd, WM_COPYDATA, (WPARAM)pInst->hProxy->hWndDispatch, (LPARAM)&cds, SMTO_NORMAL, 1000, &dwRes);
- UnlockMutex(pInst->sendmutex);
-}
-
-// -----------------------------------------------------------------------------
-
-static CONNINST *FindClient(IMO2SPROXY_INST *hProxy, HWND hWnd)
-{
- int i, nCount;
- CONNINST *pConn;
-
- for (i=0, nCount=List_Count(hProxy->hClients); i<nCount; i++)
- {
- if ((pConn=(CONNINST*)List_ElementAt (hProxy->hClients, i))->hWnd == hWnd)
- return pConn;
- }
- return NULL;
-}
-
-// -----------------------------------------------------------------------------
-
-static void CleanConnections (TYP_LIST *hList)
-{
- unsigned int i;
- CONNINST *pInst;
-
- for (i=0; i<List_Count(hList); i++)
- {
- pInst = List_ElementAt (hList, i);
- if (!IsWindow (pInst->hWnd))
- {
- if (pInst->hInst) FreeConnection(pInst);
- free (List_RemoveElementAt(hList, i));
- i--;
- }
- }
-}
-
-// -----------------------------------------------------------------------------
-
-static void FreeConnection (CONNINST *pInst)
-{
- if (pInst->hProxy->pCfg->bVerbose && pInst->hProxy->pCfg->fpLog)
- {
- fprintf (pInst->hProxy->pCfg->fpLog, "Closed connection %08X\n", pInst->hWnd);
- fflush (pInst->hProxy->pCfg->fpLog);
- }
- ExitMutex (pInst->sendmutex);
- if (pInst->hInst)
- {
- IMOSAPI *hInst = pInst->hInst;
- pInst->hInst = NULL;
- Imo2S_Exit(hInst);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-static LONG APIENTRY WndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam)
-{
- switch (message)
- {
- case WM_CREATE:
- {
- LPCREATESTRUCT lpCr = (LPCREATESTRUCT)lParam;
-
- SetWindowLongPtr (hWnd, GWLP_USERDATA, (LONG_PTR)lpCr->lpCreateParams);
- SetTimer (hWnd, 0, 60000, NULL);
- break;
- }
- case WM_COPYDATA:
- {
- PCOPYDATASTRUCT pCopyData = (PCOPYDATASTRUCT)lParam;
- CONNINST *pInst;
- IMO2SPROXY_INST *hProxy = (IMO2SPROXY_INST*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
-
- if (pInst = FindClient (hProxy, (HWND)wParam))
- {
- if (pInst->hProxy->pMyCfg->bDelayLogin && pInst->iConnectionStat < 1)
- {
- char *pszError;
-
- if ((pInst->iConnectionStat = Imo2S_Login (pInst->hInst, hProxy->pCfg->pszUser, hProxy->pCfg->pszPass, &pszError)) != 1)
- {
- pInst->hProxy->pCfg->logerror (stderr, "Connection %08X: Cannot login with (%s/****): %s\n",
- pInst->hWnd, hProxy->pCfg->pszUser, pszError);
- FreeConnection(pInst);
- free (List_Pop(hProxy->hClients));
- PostMessage ((HWND)wParam, m_ControlAPIAttach, (WPARAM)hWnd, SKYPECONTROLAPI_ATTACH_REFUSED);
- return 0;
- }
- }
- LockMutex(pInst->sendmutex);
- if (pInst->hProxy->pCfg->bVerbose && pInst->hProxy->pCfg->fpLog)
- {
- fprintf (pInst->hProxy->pCfg->fpLog, "%08X< [%s]\n", pInst->hWnd, pCopyData->lpData);
- fflush (pInst->hProxy->pCfg->fpLog);
- }
- Imo2S_Send (pInst->hInst, pCopyData->lpData);
- UnlockMutex(pInst->sendmutex);
- }
- return 1;
- }
- case WM_TIMER:
- // Housekeeping timer
- CleanConnections (((IMO2SPROXY_INST*)GetWindowLongPtr(hWnd, GWLP_USERDATA))->hClients);
- break;
- case WM_DESTROY:
- KillTimer (hWnd, 0);
- break;
- default:
- if (message == m_ControlAPIDiscover)
- {
- CONNINST *pInst;
- IMO2SPROXY_INST *hProxy = (IMO2SPROXY_INST*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
- char *pszError;
-
- if (!(pInst = FindClient (hProxy, (HWND)wParam)))
- {
- pInst = (CONNINST*)calloc (1, sizeof(CONNINST));
- if (!pInst) break;
- List_Push(hProxy->hClients, pInst);
- pInst->hProxy = hProxy;
- pInst->hWnd = (HWND)wParam;
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "Imo2sproxy::SkypeControlAPIDiscover\n");
-
- if (!(pInst->hInst = Imo2S_Init(EventHandler, pInst, hProxy->pCfg->iFlags)))
- {
- hProxy->pCfg->logerror (stderr, "Connection %08X: Cannot start Imo2Skype instance.\n", pInst->hWnd);
- free (List_Pop(hProxy->hClients));
- PostMessage ((HWND)wParam, m_ControlAPIAttach, (WPARAM)hWnd, SKYPECONTROLAPI_ATTACH_REFUSED);
- return 0;
- }
-
- // FIXME: We should enable logging dependent on a loglevel rather than just enabling it
- if (hProxy->pCfg->bVerbose)
- Imo2S_SetLog (pInst->hInst, hProxy->pCfg->fpLog);
-
- InitMutex(pInst->sendmutex);
-
- if (!pInst->hProxy->pMyCfg->bDelayLogin)
- {
- PostMessage ((HWND)wParam, m_ControlAPIAttach, (WPARAM)hWnd, SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE);
- if ((pInst->iConnectionStat = Imo2S_Login (pInst->hInst, hProxy->pCfg->pszUser, hProxy->pCfg->pszPass, &pszError)) != 1)
- {
- pInst->hProxy->pCfg->logerror (stderr, "Connection %08X: Cannot login with (%s/****): %s\n",
- pInst->hWnd, hProxy->pCfg->pszUser, pszError);
- FreeConnection(pInst);
- free (List_Pop(hProxy->hClients));
- PostMessage ((HWND)wParam, m_ControlAPIAttach, (WPARAM)hWnd, SKYPECONTROLAPI_ATTACH_REFUSED);
- return 0;
- }
- PostMessage ((HWND)wParam, m_ControlAPIAttach, (WPARAM)hWnd, SKYPECONTROLAPI_ATTACH_API_AVAILABLE);
- }
- else
- {
- SendMessage ((HWND)wParam, m_ControlAPIAttach, (WPARAM)hWnd, SKYPECONTROLAPI_ATTACH_SUCCESS);
- }
- return 0;
- }
- else
- SendMessage ((HWND)wParam, m_ControlAPIAttach, (WPARAM)hWnd, SKYPECONTROLAPI_ATTACH_SUCCESS);
- return 0;
- }
- break;
- }
- return (DefWindowProc(hWnd, message, wParam, lParam));
-}
-
-
-
-// -----------------------------------------------------------------------------
-// PUBLIC
-// -----------------------------------------------------------------------------
-
-void W32SkypeEmu_Defaults (W32SKYPEEMU_CFG *pMyCfg)
-{
- memset (pMyCfg, 0, sizeof(W32SKYPEEMU_CFG));
- // Login on first command from Client, immediately send SKYPECONTROLAPI_ATTACH_SUCCESS
- // This is necessary for some broken plugins, i.e. current SVN build of Miranda
- // Skype plugin, which doesn't correctly poll again if SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE
- // is sent.
- pMyCfg->bDelayLogin = TRUE;
-}
-
-// -----------------------------------------------------------------------------
-
-IMO2SPROXY *W32SkypeEmu_Init (IMO2SPROXY_CFG *pCfg, W32SKYPEEMU_CFG *pMyCfg)
-{
- IMO2SPROXY_INST *pstInst = calloc(sizeof(IMO2SPROXY_INST), 1);
-
- pstInst->vtbl.Open = Imo2sproxy_Open;
- pstInst->vtbl.Loop = Imo2sproxy_Loop;
- pstInst->vtbl.Exit = Imo2sproxy_Exit;
- pstInst->pCfg = pCfg;
- pstInst->pMyCfg = pMyCfg;
- InitMutex(pstInst->loopmutex);
- return (IMO2SPROXY*)pstInst;
-}
-
-// -----------------------------------------------------------------------------
-// IMPLEMENTATION
-// -----------------------------------------------------------------------------
-static int Imo2sproxy_Open(IMO2SPROXY *hInst)
-{
- IMO2SPROXY_INST *hProxy = (IMO2SPROXY_INST*)hInst;
- WNDCLASS WndClass ={0};
-
- // Start Skype connection
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "W32SkypeEmu:Open(Start)\n");
- if ((!m_ControlAPIAttach && !(m_ControlAPIAttach=RegisterWindowMessage("SkypeControlAPIAttach"))) ||
- (!m_ControlAPIDiscover && !(m_ControlAPIDiscover=RegisterWindowMessage("SkypeControlAPIDiscover"))))
- {
- hProxy->pCfg->logerror (stderr, "Cannot register Window messages!");
- return -1;
- }
-
- // Create window class
- WndClass.style = CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS;
- WndClass.lpfnWndProc = (WNDPROC)WndProc;
- WndClass.hInstance = GetModuleHandle(NULL);
- WndClass.lpszClassName = "Imo2SProxyDispatchWindow";
- RegisterClass(&WndClass);
-
- if (!(hProxy->hWndDispatch=CreateWindowEx( WS_EX_APPWINDOW|WS_EX_WINDOWEDGE,
- WndClass.lpszClassName, "", WS_BORDER|WS_SYSMENU|WS_MINIMIZEBOX,
- CW_USEDEFAULT, CW_USEDEFAULT, 128, 128, NULL, 0, (HINSTANCE)WndClass.hInstance, (LPVOID)hProxy)))
- {
- hProxy->pCfg->logerror (stderr, "Unable to create dispatch window!");
- UnregisterClass (WndClass.lpszClassName, WndClass.hInstance);
- return -1;
- }
-
- hProxy->hClients = List_Init(32);
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-static void Imo2sproxy_Loop(IMO2SPROXY *hInst)
-{
- IMO2SPROXY_INST *hProxy = (IMO2SPROXY_INST*)hInst;
- MSG Message;
-
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "W32SkypeEmu:Loop(Start)\n");
-
- // Pump da messages
- hProxy->dwThreadID = GetCurrentThreadId();
- LockMutex(hProxy->loopmutex);
- while (GetMessage(&Message, NULL, 0, 0))
- {
- TranslateMessage(&Message);
- DispatchMessage(&Message);
- }
-
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "W32SkypeEmu:Loop(End)\n");
- UnlockMutex(hProxy->loopmutex);
-}
-
-
-// -----------------------------------------------------------------------------
-
-static void Imo2sproxy_Exit(IMO2SPROXY *hInst)
-{
- IMO2SPROXY_INST *hProxy = (IMO2SPROXY_INST*)hInst;
- CONNINST *pInst;
-
- if (hProxy->pCfg->bVerbose && hProxy->pCfg->fpLog)
- fprintf (hProxy->pCfg->fpLog, "W32SkypeEmu:Exit()\n");
-
- if (hProxy->hWndDispatch) DestroyWindow (hProxy->hWndDispatch);
- if (hProxy->dwThreadID) PostThreadMessage (hProxy->dwThreadID, WM_QUIT, 0, 0);
- LockMutex(hProxy->loopmutex);
-
- // Kill 'em all!
- if (hProxy->hClients)
- {
- while (pInst=List_Pop(hProxy->hClients))
- {
- FreeConnection(pInst);
- free (pInst);
- }
- List_Exit (hProxy->hClients);
- }
-
- UnregisterClass ("Imo2SProxyDispatchWindow", GetModuleHandle(NULL));
-
- UnlockMutex(hProxy->loopmutex);
- ExitMutex(hProxy->loopmutex);
-
- free (hProxy);
-}
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32skypeemu.h b/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32skypeemu.h deleted file mode 100644 index a8291f3357..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imo2skype/w32skypeemu.h +++ /dev/null @@ -1,6 +0,0 @@ -typedef struct {
- int bDelayLogin;
-} W32SKYPEEMU_CFG;
-
-void W32SkypeEmu_Defaults (W32SKYPEEMU_CFG *pMyCfg);
-IMO2SPROXY *W32SkypeEmu_Init (IMO2SPROXY_CFG *pCfg, W32SKYPEEMU_CFG *pMyCfg);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imolib/Makefile b/plugins/!NotAdopted/IMO2sProxy/src/imolib/Makefile deleted file mode 100644 index 30775becec..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imolib/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -CFLAGS = -I../common/ -lcurl -lpthread -lm -O0 -g -CC = gcc -COMMON = ../common/fifo.c ../common/cJSON.c -OBJS = imo_request.c imo_skype.c skypetst.c io_layer.c - -.PHONY: all skypetst clean - -all : skypetst - -skypetst: $(COMMON) $(OBJS) - $(CC) -o skypetst $(COMMON) $(OBJS) $(CFLAGS) - -clean : - rm skypetst diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_request.c b/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_request.c deleted file mode 100644 index 732a7e3e48..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_request.c +++ /dev/null @@ -1,388 +0,0 @@ -/* Module: imo_request.c
- Purpose: Posts XMLHHTP-Requests to imo.im server
- Author: leecher
- Date: 30.08.2009
-*/
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#define LockMutex(x) EnterCriticalSection (&x)
-#define UnlockMutex(x) LeaveCriticalSection(&x)
-#define InitMutex(x) InitializeCriticalSection(&x)
-#define ExitMutex(x) DeleteCriticalSection(&x)
-#define mutex_t CRITICAL_SECTION
-#else
-#include <pthread.h>
-#define LockMutex(x) pthread_mutex_lock(&x)
-#define UnlockMutex(x) pthread_mutex_unlock(&x)
-#define InitMutex(x) pthread_mutex_init(&x, NULL);
-#define ExitMutex(x)
-#define mutex_t pthread_mutex_t
-#endif
-#include <time.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "fifo.h"
-#include "imo_request.h"
-#include "io_layer.h"
-
-#define SSID_LENGTH 16
-
-struct _tagIMORQ
-{
- IOLAYER *hIO;
- char szSessId[SSID_LENGTH+2];
- unsigned long send_ack; // Some Sending ACK number - unsigned long send_seq; // Within one ACK there seems to be a SEQ-Number?
- unsigned long *psend_ack; // Pointer to send_ack to use
- unsigned long *psend_seq; // Pointer to send_seq to use
- mutex_t mutex; // Mutex for securing psend_ack and psend_seq read/write
- BOOL bIsClone; // Indicates that the current handle is a clone
- char *pszHost; // Login host
- char szReqURL[32]; // Request-URL -};
-
-static IOLAYER *(*IoLayer_Init)(void) =
-#ifdef WIN32
-IoLayerW32_Init;
-#else
-IoLayerCURL_Init;
-#endif
-
-// Forward declaration of private functions
-static size_t add_data(char *data, size_t size, size_t nmemb, void *ctx);
-static IMORQ *Init(void); -
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-void ImoRq_SetIOLayer(IOLAYER *(*fp_Init)(void))
-{
- IoLayer_Init = fp_Init;
-}
-
-// -----------------------------------------------------------------------------
-
-IMORQ *ImoRq_Init(void)
-{
-
- IMORQ *hRq; -
- if (hRq = Init())
- { - /* Create session ID */
- ImoRq_CreateID (hRq->szSessId, SSID_LENGTH+1);
-
- hRq->psend_seq = &hRq->send_seq;
- hRq->psend_ack = &hRq->send_ack;
- InitMutex(hRq->mutex);
-
- /* Disptch version of imo.im protocol */
- switch (IMO_API_VERSION)
- {
- case 0:
- hRq->pszHost = "https://o.imo.im/";
- break;
- case 1:
- hRq->pszHost = "https://imo.im/";
- break;
- }
- sprintf (hRq->szReqURL, "%simo", hRq->pszHost);
-
- /* Fetch start page to get cookies */
- if (hRq->hIO->Get (hRq->hIO, hRq->pszHost, NULL))
-
- /* Get new session ID from system */ - { - char *pszRPC = ImoRq_ResetRPC (hRq), *pszRPCRes;
- if (pszRPC)
- { - if ((pszRPCRes = strstr(pszRPC, "ssid\":\"")) || (pszRPCRes = strstr(pszRPC, "ssid\": \"")))
- strcpy (hRq->szSessId, strtok (pszRPCRes+7, "\""));
- } - } else {
- ImoRq_Exit(hRq);
- hRq = NULL;
- }
- } -
- return hRq;
-}
-
-// -----------------------------------------------------------------------------
-
-IMORQ *ImoRq_Clone (IMORQ *hRq)
-{
- IMORQ *hDup;
-
- if (!(hDup = Init())) return NULL;
- strcpy (hDup->szSessId, hRq->szSessId);
- hDup->psend_seq = hRq->psend_seq;
- hDup->psend_ack = hRq->psend_ack;
- hDup->mutex = hRq->mutex;
- hDup->bIsClone = TRUE;
- hDup->pszHost = hRq->pszHost;
- strcpy (hDup->szReqURL, hRq->szReqURL);
- return hDup;
-}
-
-// -----------------------------------------------------------------------------
-
-void ImoRq_Exit (IMORQ *hRq)
-{
- if (hRq->hIO) hRq->hIO->Exit(hRq->hIO);
- if (!hRq->bIsClone) ExitMutex (hRq->mutex);
- free (hRq);
-}
-// -----------------------------------------------------------------------------
-
-void ImoRq_Cancel (IMORQ *hRq)
-{
- if (hRq->hIO) hRq->hIO->Cancel(hRq->hIO);
-}
-
-// -----------------------------------------------------------------------------
-
-char *ImoRq_PostImo(IMORQ *hRq, char *pszMethod, cJSON *data)
-{
- TYP_FIFO *hPostString;
- char *pszData, *pszEscData;
- unsigned int uiCount = -1;
-
- if (!(pszData = cJSON_Print(data))) return NULL;
-printf ("-> %s\n", pszData);
-#ifdef _WIN32
-OutputDebugString (pszData);
-OutputDebugString ("\n");
-#endif - pszEscData = hRq->hIO->EscapeString(hRq->hIO, pszData);
- free (pszData);
- if (!pszEscData || !(hPostString = Fifo_Init(strlen(pszEscData)+32)))
- {
- if (pszEscData) hRq->hIO->FreeEscapeString (pszEscData);
- return NULL;
- }
- Fifo_AddString (hPostString, "method=");
- Fifo_AddString (hPostString, pszMethod);
- Fifo_AddString (hPostString, "&data=");
- Fifo_AddString (hPostString, pszEscData);
- hRq->hIO->FreeEscapeString (pszEscData);
- pszEscData = Fifo_Get(hPostString, &uiCount);
- pszData = hRq->hIO->Post (hRq->hIO, hRq->szReqURL, pszEscData,
- uiCount-1, NULL);
- Fifo_Exit(hPostString);
-printf ("<- %s\n", pszData); - return pszData;
-}
-
-// -----------------------------------------------------------------------------
-
-char *ImoRq_PostSystem(IMORQ *hRq, char *pszMethod, char *pszSysTo, char *pszSysFrom, cJSON *data, int bFreeData) -{ - cJSON *root, *msgs, *msg, *to, *from; - char *pszRet; - - if (!(root=cJSON_CreateObject())) return NULL;
- LockMutex (hRq->mutex); - cJSON_AddNumberToObject (root, "ack", *hRq->psend_ack);
- if (*hRq->szSessId) cJSON_AddStringToObject (root, "ssid", hRq->szSessId); - else cJSON_AddNumberToObject (root, "ssid", 0); - cJSON_AddItemToObject (root, "messages", (msgs = cJSON_CreateArray())); - if (data) - { - msg=cJSON_CreateObject(); - cJSON_AddItemToObject(msg, "data", data); - to = cJSON_CreateObject(); - cJSON_AddStringToObject (to, "system", pszSysTo); - cJSON_AddItemToObject(msg, "to", to); - from = cJSON_CreateObject(); - cJSON_AddStringToObject (from, "system", pszSysFrom); - if (*hRq->szSessId) cJSON_AddStringToObject (from, "ssid", hRq->szSessId); - else cJSON_AddNumberToObject (from, "ssid", 0); - cJSON_AddItemToObject(msg, "from", from);
- cJSON_AddNumberToObject (msg, "seq", (*hRq->psend_seq)++); - cJSON_AddItemToArray (msgs, msg); - }
- UnlockMutex (hRq->mutex); - pszRet = ImoRq_PostImo (hRq, pszMethod, root); - if (data && !bFreeData) - { - msg->child = data->next; - data->next = NULL; - } - cJSON_Delete (root); - return pszRet; -} - -// -----------------------------------------------------------------------------
-
-char *ImoRq_ResetRPC(IMORQ *hRq) -{ - cJSON *root, *ssid; - char *pszRet; - - if (!(root=cJSON_CreateObject())) return NULL; - cJSON_AddStringToObject (root, "method", (IMO_API_VERSION==0?"get_ssid":"get_cookie_and_ssid")); - ssid=cJSON_CreateObject(); - cJSON_AddStringToObject (ssid, "ssid", hRq->szSessId);
- if (IMO_API_VERSION > 0)
- {
- cJSON_AddStringToObject (ssid, "kind", "reui");
- cJSON_AddStringToObject (ssid, "version", "1336611734.48");
- } - cJSON_AddItemToObject(root, "data", ssid); - if (IMO_API_VERSION == 0) *hRq->szSessId = 0; - pszRet = ImoRq_PostSystem (hRq, "rest_rpc", (IMO_API_VERSION==0?"ssid":"session"), "client", root, 1);
- LockMutex (hRq->mutex);
- *hRq->psend_seq=0;
- UnlockMutex (hRq->mutex); - return pszRet; -} - -// -----------------------------------------------------------------------------
- -char *ImoRq_UserActivity(IMORQ *hRq) -{ - cJSON *ssid; - - ssid=cJSON_CreateObject(); - cJSON_AddStringToObject (ssid, "ssid", hRq->szSessId); - return ImoRq_PostToSys (hRq, "observed_user_activity", "session", ssid, 1, NULL);
-} - -// -----------------------------------------------------------------------------
-
-char *ImoRq_Echo(IMORQ *hRq)
-{
- cJSON *data;
- time_t t;
- char szTime[16], *pszRet;
-
- if (!(data=cJSON_CreateObject())) return NULL;
- sprintf (szTime, "%ld", time(&t)*1000);
- cJSON_AddStringToObject (data, "t", szTime);
- pszRet = ImoRq_PostImo (hRq, "echo", data);
- cJSON_Delete (data);
- return pszRet;
-}
-
-// -----------------------------------------------------------------------------
-
-char *ImoRq_Reui_Session(IMORQ *hRq)
-{
- cJSON *ssid;
-
- ssid=cJSON_CreateObject();
- cJSON_AddStringToObject (ssid, "ssid", hRq->szSessId);
- return ImoRq_PostToSys (hRq, "reui_session", "session", ssid, 1, NULL);
-}
-
-// -----------------------------------------------------------------------------
- -char *ImoRq_PostToSys(IMORQ *hRq, char *pszMethod, char *pszSysTo, cJSON *data, int bFreeData, int *pireqid) -{ - cJSON *root; - char *pszRet; - - if (!(root=cJSON_CreateObject())) return NULL; - cJSON_AddStringToObject (root, "method", pszMethod);
- if (pireqid) cJSON_AddNumberToObject(root, "request_id", *pireqid); - cJSON_AddItemToObject(root, "data", data); - pszRet = ImoRq_PostSystem (hRq, "forward_to_server", pszSysTo, "client", root, bFreeData); - if (!bFreeData) - { - data->prev->next = data->next; - if (data->next) data->next->prev = data->prev; - data->prev = data->next = NULL; - cJSON_Delete (root); - } - return pszRet; -}
-// -----------------------------------------------------------------------------
- -char *ImoRq_PostAmy(IMORQ *hRq, char *pszMethod, cJSON *data)
-{
- return ImoRq_PostToSys (hRq, pszMethod, "im", data, FALSE, NULL); -}
-
-// -----------------------------------------------------------------------------
-
-char *ImoRq_SessId(IMORQ *hRq)
-{
- return hRq->szSessId;
-}
-
-// -----------------------------------------------------------------------------
-
-char *ImoRq_GetLastError(IMORQ *hRq)
-{
- return hRq->hIO->GetLastError (hRq->hIO);
-}
-
-// -----------------------------------------------------------------------------
-char *ImoRq_GetHost(IMORQ *hRq)
-{
- return hRq->pszHost;
-}
-
-// -----------------------------------------------------------------------------
-void ImoRq_UpdateAck(IMORQ *hRq, unsigned long lAck) -{
- LockMutex (hRq->mutex); - *hRq->psend_ack = lAck;
- UnlockMutex (hRq->mutex); -}
-// -----------------------------------------------------------------------------
-unsigned long ImoRq_GetSeq(IMORQ *hRq)
-{
- unsigned long lRet;
-
- LockMutex (hRq->mutex);
- lRet = *hRq->psend_seq;
- UnlockMutex (hRq->mutex);
- return lRet;
-}
-// -----------------------------------------------------------------------------
-
-void ImoRq_CreateID(char *pszID, int cbID)
-{
- int i, r;
- time_t curtime;
-
- srand(time(&curtime));
- for (i=0; i<cbID; i++)
- {
- r = rand()%62;
- if (r<26) pszID[i]='A'+r; else
- if (r<52) pszID[i]='a'+(r-26); else
- pszID[i]='0'+(r-52);
- }
- pszID[i]=0;
- return;
-}
- -// -----------------------------------------------------------------------------
-
-char *ImoRq_HTTPGet(IMORQ *hRq, char *pszURL, unsigned int *pdwLength)
-{
- return hRq->hIO->Get (hRq->hIO, pszURL, pdwLength);
-}
-
-// -----------------------------------------------------------------------------
- -static IMORQ *Init(void) -{ - IMORQ *hRq = calloc(1, sizeof(IMORQ));
-
- /* Setup CURL */
- if (!hRq) return NULL;
- if (!(hRq->hIO = IoLayer_Init()))
- {
- ImoRq_Exit(hRq);
- return NULL;
- }
- return hRq; -} - diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_request.h b/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_request.h deleted file mode 100644 index 42da000bc2..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_request.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _IMO_REQUEST_H_
-#define _IMO_REQUEST_H_
-
-#include "cJSON.h"
-
-// 1 - New imo.im api
-// 0 - o.imo.im api
-#define IMO_API_VERSION 1
-
-struct _tagIMORQ;
-typedef struct _tagIMORQ IMORQ;
-
-#ifdef _IOLAYER_H_
-void ImoRq_SetIOLayer(IOLAYER *(*fp_Init)(void));
-#endif
-
-IMORQ *ImoRq_Init(void);
-IMORQ *ImoRq_Clone (IMORQ *hRq);
-void ImoRq_Cancel (IMORQ *hRq);
-void ImoRq_Exit (IMORQ *hRq);
-
-char *ImoRq_SessId(IMORQ *hRq);
-char *ImoRq_GetLastError(IMORQ *hRq);
-char *ImoRq_GetHost(IMORQ *hRq);
-char *ImoRq_PostAmy(IMORQ *hRq, char *pszMethod, cJSON *data);
-void ImoRq_CreateID(char *pszID, int cbID);
-char *ImoRq_PostSystem(IMORQ *hRq, char *pszMethod, char *pszSysTo, char *pszSysFrom, cJSON *data, int bFreeData); -char *ImoRq_PostToSys(IMORQ *hRq, char *pszMethod, char *pszSysTo, cJSON *data, int bFreeData, int *pireqid); -void ImoRq_UpdateAck(IMORQ *hRq, unsigned long lAck);
-unsigned long ImoRq_GetSeq(IMORQ *hRq); -char *ImoRq_UserActivity(IMORQ *hRq); -char *ImoRq_ResetRPC(IMORQ *hRq); -char *ImoRq_Reui_Session(IMORQ *hRq);
-char *ImoRq_Echo(IMORQ *hRq);
-char *ImoRq_HTTPGet(IMORQ *hRq, char *pszURL, unsigned int *pdwLength);
-#endif
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_skype.c b/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_skype.c deleted file mode 100644 index f2bca4d7b8..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_skype.c +++ /dev/null @@ -1,707 +0,0 @@ -/* Module: imo_skype.c
- Purpose: Communication layer for imo.im Skype
- Author: leecher
- Date: 30.08.2009
-*/
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "imo_request.h"
-#include "imo_skype.h"
-
-#ifdef _WIN64
-#pragma comment (lib, "bufferoverflowU.lib")
-#endif
-
-#define PROTO "prpl-skype"
-
-struct _tagIMOSKYPE
-{
- IMORQ *hRq;
- IMORQ *hPoll;
- char *pszUser;
- IMOSTATCB StatusCb;
- char *pszLastRes;
- void *pUser;
- int request_id;
-};
-
-static int CheckReturn (IMOSKYPE *hSkype, char *pszMsg, char *pszExpected);
-static int ManageBuddy(IMOSKYPE *hSkype, char *pszAction, char *pszBuddy, char *pszGroup);
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-IMOSKYPE *ImoSkype_Init(IMOSTATCB StatusCb, void *pUser)
-{
- IMOSKYPE *hSkype = calloc(1, sizeof(IMOSKYPE));
-
- if (!hSkype) return NULL;
- if (!(hSkype->hRq = ImoRq_Init()) || !(hSkype->hPoll = ImoRq_Clone(hSkype->hRq)))
- {
- ImoSkype_Exit(hSkype);
- return NULL;
- }
- hSkype->StatusCb = StatusCb;
- hSkype->pUser = pUser;
- return hSkype;
-}
-
-// -----------------------------------------------------------------------------
-
-void ImoSkype_Exit(IMOSKYPE *hSkype)
-{
- if (!hSkype) return;
- if (hSkype->hRq) ImoRq_Exit(hSkype->hRq);
- if (hSkype->hPoll) ImoRq_Exit(hSkype->hPoll);
- if (hSkype->pszUser) free(hSkype->pszUser);
- free (hSkype);
-}
-
-// -----------------------------------------------------------------------------
-
-void ImoSkype_CancelPolling(IMOSKYPE *hSkype)
-{
- if (hSkype->hPoll)
- ImoRq_Cancel(hSkype->hPoll);
-}
-
-// -----------------------------------------------------------------------------
-
-char *ImoSkype_GetLastError(IMOSKYPE *hSkype)
-{
- char *pszRet = ImoRq_GetLastError(hSkype->hRq);
-
- if (!pszRet || !*pszRet) return hSkype->pszLastRes;
- return pszRet;
-}
-
-// -----------------------------------------------------------------------------
-
-char *ImoSkype_GetUserHandle(IMOSKYPE *hSkype)
-{
- return hSkype->pszUser;
-}
-
-// -----------------------------------------------------------------------------
-
-// -1 - Error
-// 0 - Login failed
-// 1 - Login successful
-int ImoSkype_Login(IMOSKYPE *hSkype, char *pszUser, char *pszPass)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- if (!hSkype) return 0;
- if (IMO_API_VERSION == 0)
- {
- if (!(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- if (pszRet = ImoRq_PostToSys(hSkype->hRq, "cookie_login", "session", root, 1, NULL)) - iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- }
-
- if (!(root=cJSON_CreateObject())) return 0;
- if (hSkype->pszUser) free (hSkype->pszUser);
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser = strdup(pszUser));
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "passwd", pszPass);
- cJSON_AddNullToObject(root, "captcha"); // Uh-oh, thay may get annoying in the future! :(
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, "account_login", root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- cJSON_Delete(root);
- - return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-// -1 - Error
-// 0 - Logout failed
-// 1 - Logout successful
-int ImoSkype_Logout(IMOSKYPE *hSkype)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- if (!hSkype || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- if (pszRet = ImoRq_PostToSys(hSkype->hRq, "signoff_all", "session", root, 1, NULL))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-// -1 - Error
-// 0 - Received unknown answer
-// 1 - Got back information, called notification callback
-// 2 - Received PING [deprecated]
-int ImoSkype_Poll(IMOSKYPE *hSkype)
-{
- char *pszRet;
-
- if (!hSkype || !hSkype->hPoll) return 0;
- pszRet = ImoRq_PostSystem(hSkype->hPoll, "forward_to_server", NULL, NULL, NULL, 1); - if (!pszRet) return -1;
- return CheckReturn (hSkype, pszRet, "ping");
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_KeepAlive(IMOSKYPE *hSkype)
-{
- char *pszRet;
-
- /* In case we want to receive Promo-Infos...
- {
- cJSON *edata = cJSON_CreateObject(), *root;
-
- root=cJSON_CreateObject();
- cJSON_AddStringToObject(edata, "kind", "web");
- cJSON_AddNumberToObject(edata, "quantity", 1);
- cJSON_AddItemToObject(root, "edata", edata);
- if (pszRet = ImoRq_PostToSys(hSkype->hRq, "get_promos", "promo", root, 1))
- CheckReturn(hSkype, pszRet, "ok");
- }
- */
-
- if (!hSkype) return 0;
- pszRet = ImoRq_UserActivity(hSkype->hPoll);
- if (!pszRet) return -1;
- return CheckReturn (hSkype, pszRet, "ok");
-}
-
-// -----------------------------------------------------------------------------
-
-// pszStatus:
-// Valid states:
-// typing
-// typed
-// not_typing
-//
-// -1 - Error
-// 0 - Typing notification failed
-// 1 - Typing notification successful
-int ImoSkype_Typing(IMOSKYPE *hSkype, char *pszBuddy, char *pszStatus)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- if (!hSkype || !hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "buid", pszBuddy);
- cJSON_AddStringToObject(root, "typing_state", pszStatus);
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, "im_typing", root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- cJSON_Delete(root);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-// -1 - Error
-// 0 - Sending failed
-// 1 - Send pending
-int ImoSkype_SendMessage(IMOSKYPE *hSkype, char *pszBuddy, char *pszMessage, int *prequest_id)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- if (!hSkype || !hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "buid", pszBuddy);
- cJSON_AddStringToObject(root, "msg", pszMessage);
- if (pszRet = (IMO_API_VERSION==0?ImoRq_PostAmy(hSkype->hRq, "send_im", root):ImoRq_PostToSys (hSkype->hRq, "send_im", "im", root, 0, &hSkype->request_id)))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- if (prequest_id) *prequest_id = hSkype->request_id;
- hSkype->request_id++;
- cJSON_Delete(root);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-// pszStatus:
-// Valid states:
-// available
-// away
-// busy
-// invisible
-//
-// -1 - Error
-// 0 - Failed
-// 1 - OK
-int ImoSkype_SetStatus(IMOSKYPE *hSkype, char *pszStatus, char *pszStatusMsg)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- /*
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "ad", "");
- cJSON_AddStringToObject(root, "primitive", pszStatus);
- cJSON_AddStringToObject(root, "status", pszStatusMsg);
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, "set_status", root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- */
-
- if (!hSkype || !hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "ad", "");
- cJSON_AddStringToObject(root, "primitive", pszStatus);
- cJSON_AddStringToObject(root, "status", pszStatusMsg);
- cJSON_AddFalseToObject (root, "auto_away");
- if (pszRet = ImoRq_PostToSys(hSkype->hRq, "set_status", "session", root, 0, NULL))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
-
- cJSON_Delete(root);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-// -1 - Error
-// 0 - Failed
-// 1 - OK
-int ImoSkype_AddBuddy(IMOSKYPE *hSkype, char *pszBuddy)
-{
- return ManageBuddy (hSkype, "add_buddy", pszBuddy, "Offline");
-}
-
-// -----------------------------------------------------------------------------
-
-// pszGroup = "Offline" if the user if offline, otherwise "Skype" or "Buddies"
-// -1 - Error
-// 0 - Failed
-// 1 - OK
-int ImoSkype_DelBuddy(IMOSKYPE *hSkype, char *pszBuddy, char *pszGroup)
-{
- int iRet = ManageBuddy (hSkype, "del_buddy", pszBuddy, pszGroup);
-
- if (iRet<1 && strcmp(pszGroup, "Skype")==0)
- return ManageBuddy (hSkype, "del_buddy", pszBuddy, "Buddies");
- return iRet;
-}
-// -----------------------------------------------------------------------------
-
-int ImoSkype_BlockBuddy(IMOSKYPE *hSkype, char *pszBuddy)
-{
- return ManageBuddy (hSkype, "block_buddy", pszBuddy, NULL);
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_UnblockBuddy(IMOSKYPE *hSkype, char *pszBuddy)
-{
- return ManageBuddy (hSkype, "unblock_buddy", pszBuddy, NULL);
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_ChangeAlias(IMOSKYPE *hSkype, char *pszBuddy, char *pszNewAlias)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "buid", pszBuddy);
- cJSON_AddStringToObject(root, "alias", pszNewAlias);
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, "change_buddy_alias", root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- cJSON_Delete(root);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_StartVoiceCall(IMOSKYPE *hSkype, char *pszBuddy)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "buid", pszBuddy);
- if (pszRet = ImoRq_PostToSys (hSkype->hRq, "start_audio_chat", "av", root, 1, NULL))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_Ping(IMOSKYPE *hSkype)
-{
- char *pszRet;
- int iRet = -1;
-
- if (pszRet = ImoRq_Echo(hSkype->hRq))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-char *ImoSkype_GetAvatar(IMOSKYPE *hSkype, char *pszID, unsigned int *pdwLength)
-{
- char szURL[256];
-
- sprintf (szURL, "%sb/%s", ImoRq_GetHost(hSkype->hRq), pszID);
- return ImoRq_HTTPGet (hSkype->hRq, szURL, pdwLength);
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_GetUnreadMsgs(IMOSKYPE *hSkype)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, "get_unread_msgs", root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- cJSON_Delete(root);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_GetAlpha(IMOSKYPE *hSkype)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- if (pszRet = ImoRq_PostToSys (hSkype->hRq, "get_alpha_for_user", "alpha", root, 1, NULL))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-
-int ImoSkype_CreateSharedGroup(IMOSKYPE *hSkype, char *pszName)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddFalseToObject(root, "is_native"); // TRUE would be great, but not yet supported?
- cJSON_AddStringToObject(root, "name", pszName);
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, "create_shared_group", root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- cJSON_Delete(root);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_GroupInvite(IMOSKYPE *hSkype, char *pszGroup, char *pszUser)
-{
- cJSON *root;
- char *pszRet, *p, *pszGroupDup = strdup(pszGroup);
- int iRet = -1;
-
- if (p=strrchr(pszGroupDup, ';')) *p=0;
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "gid", pszGroupDup);
- cJSON_AddStringToObject(root, "iproto", PROTO);
- cJSON_AddStringToObject(root, "iuid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "ibuid", pszUser);
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, "invite_to_group", root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- free (pszGroupDup);
- cJSON_Delete(root);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_GroupKick(IMOSKYPE *hSkype, char *pszGroup, char *pszUser)
-{
- cJSON *root;
- char *pszRet, *p, *pszGroupDup = strdup(pszGroup), szBUID[256];
- int iRet = -1;
-
- if (p=strrchr(pszGroupDup, ';')) *p=0;
- sprintf (szBUID, "%s;%s;"PROTO, pszGroupDup, pszUser);
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "buid", szBUID);
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, "kick_member", root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- free (pszGroupDup);
- cJSON_Delete(root);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_GroupTopic(IMOSKYPE *hSkype, char *pszGroup, char *pszTopic)
-{
- cJSON *root;
- char *pszRet, *p, *pszGroupDup = strdup(pszGroup);
- int iRet = -1;
-
- if (p=strrchr(pszGroupDup, ';')) *p=0;
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "gid", pszGroupDup);
- cJSON_AddStringToObject(root, "topic", pszTopic);
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, "set_group_topic", root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- free (pszGroupDup);
- cJSON_Delete(root);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-
-int ImoSkype_GroupLeave(IMOSKYPE *hSkype, char *pszGroup)
-{
- cJSON *root;
- char *pszRet, *p, *pszGroupDup = strdup(pszGroup);
- int iRet = -1;
-
- if (p=strrchr(pszGroupDup, ';')) *p=0;
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "gid", pszGroupDup);
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, "leave_group", root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- free (pszGroupDup);
- cJSON_Delete(root);
- return iRet;
-}
-
-// -----------------------------------------------------------------------------
-// Static
-// -----------------------------------------------------------------------------
-static void PostDisconnect(IMOSKYPE *hSkype)
-{
- cJSON *arr, *root;
-
- if (arr = cJSON_CreateArray())
- {
- if (!(root=cJSON_CreateObject())) return;
- cJSON_AddStringToObject(root, "name", "disconnect");
- cJSON_AddItemToArray (arr, root);
- hSkype->StatusCb(arr, hSkype->pUser);
- cJSON_Delete(arr);
- }
-}
-
-// 0 - Unexpected answer
-// 1 - Got back JSON data, notified callback
-// 2 - Received expected message pszExpected [deprecated]
-static int CheckReturn (IMOSKYPE *hSkype, char *pszMsg, char *pszExpected)
-{
- cJSON *root, *data, *msgs, *msg, *sys, *arr, *prefs, *pref;
- char *pszMethod, *pszSys; -
- hSkype->pszLastRes = pszMsg;
- if (root = cJSON_Parse(pszMsg))
- {
- // Now let's see if this one is interesting for our system - if ((data = cJSON_GetObjectItem(root,"method")) &&
- (pszMethod = data->valuestring) && - strcmp(pszMethod, "forward_to_client") == 0 && - (data = cJSON_GetObjectItem(root,"data")) && - (msgs = cJSON_GetObjectItem(data,"messages"))) - { - int i, iCount = cJSON_GetArraySize(msgs); - - if (!iCount && pszExpected && strcmp(pszExpected, "ok") == 0)
- {
- if ((sys = cJSON_GetObjectItem(data,"ack")) && (unsigned long)sys->valueint >= ImoRq_GetSeq(hSkype->hRq))
- return 2; // imoim ACKnowledged this
- else
- {
- if (sys && sys->valueint==0)
- {
- // ACK error, reset to 0, better reset the connection
- PostDisconnect(hSkype);
- }
- return 0; // No ACK, sequence number not incremented :(
- }
- } - for (i=0; i<iCount; i++) - { - if (msg = cJSON_GetArrayItem(msgs, i)) - { - // Is this for me? - if ((sys = cJSON_GetObjectItem(msg,"to")) && - (pszSys = cJSON_GetObjectItem(sys, "system")->valuestring) && - strcmp (pszSys, "client") == 0) - { - if (sys = cJSON_GetObjectItem(msg,"seq")) - { - ImoRq_UpdateAck(hSkype->hRq, sys->valueint+1); - ImoRq_UpdateAck(hSkype->hPoll, sys->valueint+1); - } - - // Callback is only called for system IM - if ((sys = cJSON_GetObjectItem(msg,"from")) && - (pszSys = cJSON_GetObjectItem(sys, "system")->valuestring))
- {
- if ((strcmp (pszSys, "im") == 0 || strcmp (pszSys, "av") == 0) && - (data = cJSON_GetObjectItem(msg,"data")) && - (arr = cJSON_CreateArray())) - { - // Pack data into array for Callback backwards - // compatibility - cJSON *next; - - next = data->next; - data->next = NULL; - cJSON_AddItemToArray (arr, data); - hSkype->StatusCb(arr, hSkype->pUser); - data->next = next; - free(arr); - }
- else if (strcmp (pszSys, "internal") == 0 &&
- (data = cJSON_GetObjectItem(msg,"data")) &&
- (arr = cJSON_CreateArray()))
- {
- // Pack ACK msgs into a fake "ack" method so that callback
- // function can dispatch them without interface change
- cJSON *next;
-
- cJSON_AddStringToObject (data, "name", "ack");
- next = data->next;
- data->next = NULL;
- cJSON_AddItemToArray (arr, data);
- hSkype->StatusCb(arr, hSkype->pUser);
- data->next = next;
- free(arr);
- }
- // Ensure to disable annoying autoaway
- else if (strcmp (pszSys, "preference") == 0 &&
- (data = cJSON_GetObjectItem(msg,"data")) &&
- (prefs = cJSON_GetObjectItem(data, "preferences")))
- {
- int j, nPrefs = cJSON_GetArraySize(prefs);
- cJSON *kind, *thispref, *value, *prefdata;
-
- for (j=0; j<nPrefs; j++)
- {
- if ((pref = cJSON_GetArrayItem(prefs, j)) &&
- (kind = cJSON_GetObjectItem(pref, "kind")) &&
- strcmp (kind->valuestring, "impref") == 0 &&
- (thispref = cJSON_GetObjectItem(pref, "pref")) &&
- strcmp (thispref->valuestring, "auto_away") == 0 &&
- (value = cJSON_GetObjectItem(pref, "value")) &&
- value->type == cJSON_True && hSkype->pszUser &&
- (prefdata = cJSON_CreateObject()))
- {
- cJSON *accs, *acc, *setprefs, *newpref;
-
- if (accs = cJSON_CreateArray())
- {
- if (acc = cJSON_CreateObject())
- {
- cJSON_AddStringToObject(acc, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(acc, "proto", PROTO);
- cJSON_AddItemToArray (accs, acc);
- }
- cJSON_AddItemToObject(prefdata, "accounts", accs);
- }
- if (setprefs = cJSON_CreateArray())
- {
- if (newpref = cJSON_CreateObject())
- {
- cJSON_AddStringToObject(newpref, "kind", kind->valuestring);
- cJSON_AddStringToObject(newpref, "pref", thispref->valuestring);
- cJSON_AddFalseToObject (newpref, "value");
- cJSON_AddItemToArray (setprefs, newpref);
- }
- cJSON_AddItemToObject(prefdata, "preferences", setprefs);
- }
- ImoRq_PostToSys (hSkype->hRq, "set", "preference", prefdata, 1, NULL);
- }
- }
- }
- else if (strcmp (pszSys, "reset") == 0)
- {
- // System requested to reset connection
- // Let's issue a "disconnect" to the callback to let it handle
- // this situation
- }
- } - } - } - } - } - cJSON_Delete(root);
- return 1;
- }
- else
- {
- if (pszExpected && strcmp(pszMsg, pszExpected)==0)
- return 2;
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-static int ManageBuddy(IMOSKYPE *hSkype, char *pszAction, char *pszBuddy, char *pszGroup)
-{
- cJSON *root;
- char *pszRet;
- int iRet = -1;
-
- if (!hSkype->pszUser || !(root=cJSON_CreateObject())) return 0;
- cJSON_AddStringToObject(root, "ssid", ImoRq_SessId(hSkype->hRq));
- cJSON_AddStringToObject(root, "uid", hSkype->pszUser);
- cJSON_AddStringToObject(root, "proto", PROTO);
- cJSON_AddStringToObject(root, "buid", pszBuddy);
- if (pszGroup) cJSON_AddStringToObject(root, "group", pszGroup);
- if (pszRet = ImoRq_PostAmy(hSkype->hRq, pszAction, root))
- iRet = CheckReturn(hSkype, pszRet, "ok")>0;
- cJSON_Delete(root);
- return iRet;
-}
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_skype.h b/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_skype.h deleted file mode 100644 index d9e1697ed6..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imolib/imo_skype.h +++ /dev/null @@ -1,37 +0,0 @@ -#include "cJSON.h"
-
-struct _tagIMOSKYPE;
-typedef struct _tagIMOSKYPE IMOSKYPE;
-// 0 - Message received, you may delete the cJSON object now
-// 1 - Don't delete cJSON object, callback will take care of freeing
-typedef int(*IMOSTATCB)(cJSON *pMsg, void *pUser);
-
-IMOSKYPE *ImoSkype_Init(IMOSTATCB StatusCb, void *pUser);
-void ImoSkype_Exit(IMOSKYPE *hSkype);
-void ImoSkype_CancelPolling(IMOSKYPE *hSkype);
-char *ImoSkype_GetLastError(IMOSKYPE *hSkype);
-char *ImoSkype_GetUserHandle(IMOSKYPE *hSkype);
-
-int ImoSkype_Login(IMOSKYPE *hSkype, char *pszUser, char *pszPass);
-int ImoSkype_Logout(IMOSKYPE *hSkype);
-int ImoSkype_Poll(IMOSKYPE *hSkype);
-int ImoSkype_Typing(IMOSKYPE *hSkype, char *pszBuddy, char *pszStatus);
-int ImoSkype_SetStatus(IMOSKYPE *hSkype, char *pszStatus, char *pszStatusMsg);
-int ImoSkype_SendMessage(IMOSKYPE *hSkype, char *pszBuddy, char *pszMessage, int *prequest_id);
-int ImoSkype_AddBuddy(IMOSKYPE *hSkype, char *pszBuddy);
-int ImoSkype_DelBuddy(IMOSKYPE *hSkype, char *pszBuddy, char *pszGroup);
-int ImoSkype_BlockBuddy(IMOSKYPE *hSkype, char *pszBuddy);
-int ImoSkype_UnblockBuddy(IMOSKYPE *hSkype, char *pszBuddy);
-int ImoSkype_ChangeAlias(IMOSKYPE *hSkype, char *pszBuddy, char *pszNewAlias);
-int ImoSkype_StartVoiceCall(IMOSKYPE *hSkype, char *pszBuddy);
-int ImoSkype_KeepAlive(IMOSKYPE *hSkype);
-int ImoSkype_Ping(IMOSKYPE *hSkype);
-char *ImoSkype_GetAvatar(IMOSKYPE *hSkype, char *pszID, unsigned int *pdwLength);
-int ImoSkype_GetUnreadMsgs(IMOSKYPE *hSkype);
-int ImoSkype_GetAlpha(IMOSKYPE *hSkype);
-
-int ImoSkype_CreateSharedGroup(IMOSKYPE *hSkype, char *pszName);
-int ImoSkype_GroupInvite(IMOSKYPE *hSkype, char *pszGroup, char *pszUser);
-int ImoSkype_GroupKick(IMOSKYPE *hSkype, char *pszGroup, char *pszUser);
-int ImoSkype_GroupTopic(IMOSKYPE *hSkype, char *pszGroup, char *pszTopic);
-int ImoSkype_GroupLeave(IMOSKYPE *hSkype, char *pszGroup);
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imolib/io_layer.c b/plugins/!NotAdopted/IMO2sProxy/src/imolib/io_layer.c deleted file mode 100644 index 1e18464682..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imolib/io_layer.c +++ /dev/null @@ -1,175 +0,0 @@ -/* Module: io_layer.c
- Purpose: IO Layer for Internet communication using libcurl
- Author: leecher
- Date: 30.08.2009
-*/
-#include <curl/curl.h>
-#include <time.h>
-#include <stdlib.h>
-#include <string.h>
-#include "fifo.h"
-#include "io_layer.h"
-
-typedef struct
-{
- IOLAYER vtbl;
- CURL *hCurl;
- TYP_FIFO *hResult;
- char szErrorBuf[CURL_ERROR_SIZE+1];
-} IOLAYER_INST;
-
-static void IoLayer_Exit (IOLAYER *hPIO);
-static char *IoLayer_Post(IOLAYER *hPIO, char *pszUrl, char *pszPostFields, unsigned int cbPostFields, unsigned int *pdwLength);
-static char *IoLayer_Get(IOLAYER *hPIO, char *pszUrl, unsigned int *pdwLength);
-static void IoLayer_Cancel(IOLAYER *hIO);
-static char *IoLayer_GetLastError(IOLAYER *hIO);
-static char *IoLayer_EscapeString(IOLAYER *hIO, char *pszData);
-static void IoLayer_FreeEscapeString(char *pszData);
-static size_t add_data(char *data, size_t size, size_t nmemb, void *ctx);
-
-// -----------------------------------------------------------------------------
-// Interface
-// -----------------------------------------------------------------------------
-
-IOLAYER *IoLayerCURL_Init(void)
-{
- IOLAYER_INST *hIO;
-
- if (!(hIO = calloc(1, sizeof(IOLAYER_INST))))
- return NULL;
-
- if (!(hIO->hCurl = curl_easy_init()))
- {
- free (hIO);
- return NULL;
- }
-
- if (!(hIO->hResult = Fifo_Init(1024)))
- {
- IoLayer_Exit((IOLAYER*)hIO);
- return NULL;
- }
-
- curl_easy_setopt(hIO->hCurl, CURLOPT_USERAGENT, "XMLHttpRequest/1.0");
- curl_easy_setopt(hIO->hCurl, CURLOPT_HEADER, 0);
- curl_easy_setopt(hIO->hCurl, CURLOPT_AUTOREFERER, 1);
-// curl_easy_setopt(hRq->hCurl, CURLOPT_RETURNTRANSFER, 1);
- curl_easy_setopt(hIO->hCurl, CURLOPT_SSL_VERIFYPEER, 0);
- curl_easy_setopt(hIO->hCurl, CURLOPT_SSL_VERIFYHOST, 0);
- curl_easy_setopt(hIO->hCurl, CURLOPT_ERRORBUFFER, hIO->szErrorBuf);
- curl_easy_setopt(hIO->hCurl, CURLOPT_COOKIEFILE, "cookies.txt"); - curl_easy_setopt(hIO->hCurl, CURLOPT_COOKIEJAR, "cookies.txt"); - curl_easy_setopt(hIO->hCurl, CURLOPT_WRITEFUNCTION, add_data);
- curl_easy_setopt(hIO->hCurl, CURLOPT_FILE, hIO);
-
- // Init Vtbl
- hIO->vtbl.Exit = IoLayer_Exit;
- hIO->vtbl.Post = IoLayer_Post;
- hIO->vtbl.Get = IoLayer_Get;
- hIO->vtbl.Cancel = IoLayer_Cancel;
- hIO->vtbl.GetLastError = IoLayer_GetLastError;
- hIO->vtbl.EscapeString = IoLayer_EscapeString;
- hIO->vtbl.FreeEscapeString = IoLayer_FreeEscapeString;
-
- return (IOLAYER*)hIO;
-}
-
-// -----------------------------------------------------------------------------
-
-static void IoLayer_Exit (IOLAYER *hPIO)
-{
- IOLAYER_INST *hIO = (IOLAYER_INST*)hPIO;
-
- if (hIO->hCurl) curl_easy_cleanup(hIO->hCurl);
- if (hIO->hResult) Fifo_Exit(hIO->hResult);
- free (hIO);
-}
-
-// -----------------------------------------------------------------------------
-
-static char *IoLayer_Post(IOLAYER *hPIO, char *pszUrl, char *pszPostFields, unsigned int cbPostFields, unsigned int *pdwLength)
-{
- IOLAYER_INST *hIO = (IOLAYER_INST*)hPIO;
-
- curl_easy_setopt(hIO->hCurl, CURLOPT_POST, 1);
- curl_easy_setopt(hIO->hCurl, CURLOPT_URL, pszUrl);
- curl_easy_setopt(hIO->hCurl, CURLOPT_POSTFIELDS, pszPostFields);
- curl_easy_setopt(hIO->hCurl, CURLOPT_POSTFIELDSIZE, cbPostFields);
- if (curl_easy_perform(hIO->hCurl)) return NULL;
- if (!pdwLength)
- {
- // Get string
- Fifo_Add (hIO->hResult, "", 1);
- return Fifo_Get (hIO->hResult, NULL);
- }
- else
- {
- // Get binary, return size of buffer
- *pdwLength = (unsigned int)-1;
- return Fifo_Get (hIO->hResult, pdwLength);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-static char *IoLayer_Get(IOLAYER *hPIO, char *pszUrl, unsigned int *pdwLength)
-{
- IOLAYER_INST *hIO = (IOLAYER_INST*)hPIO;
-
- curl_easy_setopt(hIO->hCurl, CURLOPT_POST, 0);
- curl_easy_setopt(hIO->hCurl, CURLOPT_URL, pszUrl);
- if (curl_easy_perform(hIO->hCurl)) return NULL;
- if (!pdwLength)
- {
- // Get string
- Fifo_Add (hIO->hResult, "", 1);
- return Fifo_Get (hIO->hResult, NULL);
- }
- else
- {
- // Get binary, return size of buffer
- *pdwLength = (unsigned int)-1;
- return Fifo_Get (hIO->hResult, pdwLength);
- }
-}
-
-// -----------------------------------------------------------------------------
-
-static void IoLayer_Cancel(IOLAYER *hIO)
-{
- // FIXME: Currently not implemented
-}
-
-// -----------------------------------------------------------------------------
-
-static char *IoLayer_GetLastError(IOLAYER *hIO)
-{
- return ((IOLAYER_INST*)hIO)->szErrorBuf;
-}
-
-// -----------------------------------------------------------------------------
-
-static char *IoLayer_EscapeString(IOLAYER *hIO, char *pszData)
-{
- return curl_easy_escape(((IOLAYER_INST*)hIO)->hCurl, pszData, 0);
-}
-
-// -----------------------------------------------------------------------------
-
-static void IoLayer_FreeEscapeString(char *pszData)
-{
- curl_free(pszData);
-}
-
-// -----------------------------------------------------------------------------
-// Static
-// -----------------------------------------------------------------------------
-
-static size_t add_data(char *data, size_t size, size_t nmemb, void *ctx)
-{
- IOLAYER_INST *hIO = (IOLAYER_INST*)ctx;
-
- if (Fifo_Add(hIO->hResult, data, size * nmemb)) return size * nmemb;
- return 0;
-}
-
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imolib/io_layer.h b/plugins/!NotAdopted/IMO2sProxy/src/imolib/io_layer.h deleted file mode 100644 index 13e10cf888..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imolib/io_layer.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef _IOLAYER_H_
-#define _IOLAYER_H_
-
-struct _tagIOLAYER;
-typedef struct _tagIOLAYER IOLAYER;
-
-struct _tagIOLAYER
-{
- void (*Exit) (IOLAYER *hIO);
-
- char *(*Post) (IOLAYER *hIO, char *pszURL, char *pszPostFields, unsigned int cbPostFields, unsigned int *pdwLength);
- char *(*Get) (IOLAYER *hIO, char *pszURL, unsigned int *pdwLength);
- void (*Cancel) (IOLAYER *hIO);
- char *(*GetLastError) (IOLAYER *hIO);
- char *(*EscapeString) (IOLAYER *hIO, char *pszData);
- void (*FreeEscapeString) (char *pszData);
-};
-
-#ifdef WIN32
-IOLAYER *IoLayerW32_Init(void);
-IOLAYER *IoLayerNETLIB_Init(void);
-#endif
-IOLAYER *IoLayerCURL_Init(void);
-
-#endif
diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imolib/io_layer_win32.c b/plugins/!NotAdopted/IMO2sProxy/src/imolib/io_layer_win32.c deleted file mode 100644 index 1fd425ced7..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imolib/io_layer_win32.c +++ /dev/null @@ -1,440 +0,0 @@ -/* Module: io_layer_win32.c - Purpose: IO Layer for Internet communication using WININET (Win32) - Author: leecher - Date: 30.08.2009 -*/
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h> -#include <wininet.h> -#include <time.h> -#include <stdlib.h> -#include <string.h> -#include "fifo.h" -#include "io_layer.h"
-
-#ifndef LongToPtr
-#define DWORD_PTR DWORD
-#endif
-
-/* Set this to use asynchronous I/O
- This is needed as synchronous WININET functions tend to block forever on connection
- loss or other occasions leading to a deadlock of the whole application
- */
-#define ASYNC
-#define ASYNC_CONN_TIMEOUT 5000 // Connection timeout in ms
-#define ASYNC_REQ_TIMEOUT 40000 // HttpSendRequest timeout in ms in async mode (Should be at least 30 sec!)
-
-#pragma comment(lib,"wininet.lib") - -#define INET_FLAGS INTERNET_FLAG_IGNORE_CERT_CN_INVALID | INTERNET_FLAG_IGNORE_CERT_DATE_INVALID | \ - INTERNET_FLAG_NO_CACHE_WRITE | INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_UI | \ - INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_SECURE - -typedef struct -{
- IOLAYER vtbl; - HINTERNET hInet;
- HINTERNET hRequest;
-#ifdef ASYNC
- INTERNET_ASYNC_RESULT stAsyncRes;
- HANDLE hConnectedEvent;
- HANDLE hRequestCompleteEvent;
-#endif - TYP_FIFO *hResult;
- LPVOID lpErrorBuf; -} IOLAYER_INST; -
-static void IoLayer_Exit (IOLAYER *hPIO);
-static char *IoLayer_Post(IOLAYER *hPIO, char *pszURL, char *pszPostFields, unsigned int cbPostFields, unsigned int *pdwLength);
-static char *IoLayer_Get(IOLAYER *hIO, char *pszURL, unsigned int *pdwLength);
-static void IoLayer_Cancel(IOLAYER *hIO);
-static char *IoLayer_GetLastError(IOLAYER *hIO);
-static char *IoLayer_EscapeString(IOLAYER *hPIO, char *pszData);
-static void IoLayer_FreeEscapeString(char *pszData); -static void FetchLastError (IOLAYER_INST *hIO);
-#ifdef ASYNC
-static void __stdcall Callback(HINTERNET hInternet, DWORD dwContext, DWORD dwInternetStatus,
- LPVOID lpStatusInfo, DWORD dwStatusInfoLen);
-#endif - -// ----------------------------------------------------------------------------- -// Interface -// ----------------------------------------------------------------------------- - -IOLAYER *IoLayerW32_Init(void) -{ - IOLAYER_INST *hIO; - - if (!(hIO = calloc(1, sizeof(IOLAYER_INST)))) - return NULL; -
- // Init Inet - if (!(hIO->hInet = InternetOpen ("Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13", - INTERNET_OPEN_TYPE_PRECONFIG, NULL, "<local>",
-#ifdef ASYNC
- INTERNET_FLAG_ASYNC
-#else
- 0
-#endif
- ))) - { - free (hIO); - return NULL; - } -
- if (!(hIO->hResult = Fifo_Init(1024))) - { - IoLayer_Exit((IOLAYER*)hIO); - return NULL; - }
-
-#ifdef ASYNC
- if (InternetSetStatusCallback(hIO->hInet, (INTERNET_STATUS_CALLBACK)&Callback) == INTERNET_INVALID_STATUS_CALLBACK)
- {
- IoLayer_Exit((IOLAYER*)hIO);
- return NULL;
- }
-
- hIO->hConnectedEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- hIO->hRequestCompleteEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
-#endif
-
- //InternetSetCookie ("https://o.imo.im/", "proto", "prpl-skype");
-
- // Init Vtbl
- hIO->vtbl.Exit = IoLayer_Exit;
- hIO->vtbl.Post = IoLayer_Post;
- hIO->vtbl.Get = IoLayer_Get;
- hIO->vtbl.Cancel = IoLayer_Cancel;
- hIO->vtbl.GetLastError = IoLayer_GetLastError;
- hIO->vtbl.EscapeString = IoLayer_EscapeString;
- hIO->vtbl.FreeEscapeString = IoLayer_FreeEscapeString;
-
- return (IOLAYER*)hIO; -} -// ----------------------------------------------------------------------------- - -static void IoLayer_Exit (IOLAYER *hPIO) -{
- IOLAYER_INST *hIO = (IOLAYER_INST*)hPIO;
- - if (hIO->hInet) InternetCloseHandle (hIO->hInet); - if (hIO->lpErrorBuf) LocalFree(hIO->lpErrorBuf); - if (hIO->hResult) Fifo_Exit(hIO->hResult);
-
-#ifdef ASYNC
- if (hIO->hConnectedEvent) CloseHandle (hIO->hConnectedEvent);
- if (hIO->hRequestCompleteEvent) CloseHandle (hIO->hRequestCompleteEvent);
-#endif - free (hIO); -} - -// ----------------------------------------------------------------------------- - -static char *IoLayer_Post(IOLAYER *hPIO, char *pszURL, char *pszPostFields, unsigned int cbPostFields, unsigned int *pdwLength) -{
- IOLAYER_INST *hIO = (IOLAYER_INST*)hPIO;
- URL_COMPONENTS urlInfo = {0}; - HINTERNET hUrl; - DWORD dwFlags = 0, cbFlags = sizeof(dwFlags), dwRemaining = 0;
- char szHostName[INTERNET_MAX_HOST_NAME_LENGTH],
- szURLPath[INTERNET_MAX_URL_LENGTH], *p;
-#ifdef ASYNC
- INTERNET_BUFFERS InetBuff={0};
- InetBuff.dwStructSize = sizeof(InetBuff);
-
- ResetEvent (hIO->hConnectedEvent);
- ResetEvent (hIO->hRequestCompleteEvent);
-#endif -
-//OutputDebugString(pszPostFields);
- urlInfo.dwStructSize = sizeof (URL_COMPONENTS);
- urlInfo.lpszHostName = szHostName;
- urlInfo.dwHostNameLength = sizeof(szHostName);
- urlInfo.lpszUrlPath = szURLPath;
- urlInfo.dwUrlPathLength = sizeof(szURLPath);
- if (!InternetCrackUrl(pszURL, strlen(pszURL), 0, &urlInfo)) return NULL;
- /*
- if (!pszPostFields)
- {
- if (pszPostFields=strchr (pszURL, '?'))
- cbPostFields = strlen(pszPostFields);
- }
- */
- if (!(hUrl = InternetConnect (hIO->hInet, szHostName,
- INTERNET_DEFAULT_HTTPS_PORT, NULL, NULL, INTERNET_SERVICE_HTTP, 0, (DWORD_PTR)hIO))) - {
-#ifdef ASYNC
- if (GetLastError() == ERROR_IO_PENDING)
- {
- if (WaitForSingleObject(hIO->hConnectedEvent, ASYNC_CONN_TIMEOUT) == WAIT_OBJECT_0)
- {
- hUrl = (HINTERNET)hIO->stAsyncRes.dwResult;
- hIO->stAsyncRes.dwResult = 0;
- SetLastError(hIO->stAsyncRes.dwError);
- }
- }
- if (!hUrl)
-#endif
- { - FetchLastError (hIO); - return NULL;
- } - } - - hIO->hRequest = HttpOpenRequest (hUrl, pszPostFields?"POST":"GET", szURLPath, NULL, "https://imo.im/", NULL, - INET_FLAGS, (DWORD_PTR)hIO); - if (!hIO->hRequest) - {
-#ifdef ASYNC
- if (GetLastError() == ERROR_IO_PENDING)
- {
- if (WaitForSingleObject(hIO->hConnectedEvent, ASYNC_CONN_TIMEOUT) == WAIT_OBJECT_0)
- {
- hIO->hRequest = (HINTERNET)hIO->stAsyncRes.dwResult;
- hIO->stAsyncRes.dwResult = 0;
- SetLastError(hIO->stAsyncRes.dwError);
- }
- }
- if (!hUrl)
-#endif
- {
- FetchLastError (hIO); - InternetCloseHandle (hUrl); - return NULL;
- } - } - - InternetQueryOption (hIO->hRequest, INTERNET_OPTION_SECURITY_FLAGS, (LPVOID)&dwFlags, &cbFlags); - dwFlags |= SECURITY_FLAG_IGNORE_UNKNOWN_CA; - InternetSetOption (hIO->hRequest, INTERNET_OPTION_SECURITY_FLAGS, &dwFlags, sizeof (dwFlags));
-
- /*
- {
- char szCookies[4096];
- DWORD cbCookies, dwIndex=0;
-
- OutputDebugString ("Sending headers:\n");
- do
- {
- cbCookies=sizeof(szCookies);
- if (!HttpQueryInfo (hIO->hRequest, HTTP_QUERY_FLAG_REQUEST_HEADERS|HTTP_QUERY_RAW_HEADERS_CRLF, szCookies, &cbCookies, &dwIndex) ||
- GetLastError() != ERROR_SUCCESS)
- break;
- OutputDebugString (szCookies);
- } while (1);
- }
- */
-
-// ASYNC: This needs to block for at least 30 seconds on poll! - if (!(HttpSendRequest (hIO->hRequest, "Content-Type: application/x-www-form-urlencoded; charset=UTF-8\r\n"
- "X-Requested-With: XMLHttpRequest", -1, - pszPostFields, cbPostFields))) - {
-#ifdef ASYNC
- BOOL bRes = FALSE;
-
- if (GetLastError() == ERROR_IO_PENDING)
- {
- if (WaitForSingleObject(hIO->hRequestCompleteEvent, ASYNC_REQ_TIMEOUT) == WAIT_OBJECT_0)
- {
- bRes = hIO->stAsyncRes.dwResult;
- hIO->stAsyncRes.dwResult = 0;
- SetLastError(hIO->stAsyncRes.dwError);
- }
- }
- if (!bRes)
-#endif
- {
- FetchLastError (hIO); - InternetCloseHandle (hIO->hRequest);
- hIO->hRequest = NULL; - InternetCloseHandle (hUrl); - return NULL;
- } - }
-#ifdef ASYNC - else WaitForSingleObject(hIO->hRequestCompleteEvent, ASYNC_REQ_TIMEOUT);
-#endif
-
- /*
- {
- char szCookies[4096];
- DWORD cbCookies, dwIndex=0;
-
- OutputDebugString ("Received headers:\n");
- do
- {
- cbCookies=sizeof(szCookies);
- if (!HttpQueryInfo (hIO->hRequest, HTTP_QUERY_FLAG_REQUEST_HEADERS|HTTP_QUERY_RAW_HEADERS_CRLF, szCookies, &cbCookies, &dwIndex) ||
- GetLastError() != ERROR_SUCCESS)
- break;
- OutputDebugString (szCookies);
- } while (1);
- }
- */
-
-#ifdef ASYNC
- do
- {
- if (!InternetQueryDataAvailable (hIO->hRequest, &InetBuff.dwBufferLength, 0, 0))
- {
- BOOL bRes = FALSE;
-
- if (GetLastError() == ERROR_IO_PENDING)
- {
- if (WaitForSingleObject(hIO->hRequestCompleteEvent, ASYNC_REQ_TIMEOUT) == WAIT_OBJECT_0)
- {
- bRes = hIO->stAsyncRes.dwResult;
- hIO->stAsyncRes.dwResult = 0;
- SetLastError(hIO->stAsyncRes.dwError);
- }
- }
- if (!bRes) break;
- }
- if (InetBuff.dwBufferLength == 0) break;
- if (InetBuff.lpvBuffer = Fifo_AllocBuffer (hIO->hResult, InetBuff.dwBufferLength))
- {
- if (!InternetReadFileEx (hIO->hRequest, &InetBuff, 0, (DWORD_PTR)hIO))
- {
- BOOL bRes=FALSE;
-
- if (GetLastError() == ERROR_IO_PENDING)
- {
- if (WaitForSingleObject(hIO->hRequestCompleteEvent, ASYNC_REQ_TIMEOUT) == WAIT_OBJECT_0)
- {
- bRes = hIO->stAsyncRes.dwResult;
- hIO->stAsyncRes.dwResult = 0;
- SetLastError(hIO->stAsyncRes.dwError);
- }
- }
- if (!bRes) break;
- }
- }
- }
- while(InetBuff.dwBufferLength);
-#else - while (InternetQueryDataAvailable (hIO->hRequest, &dwRemaining, 0, 0) && dwRemaining > 0) - { - if (p = Fifo_AllocBuffer (hIO->hResult, dwRemaining)) - InternetReadFile (hIO->hRequest, p, dwRemaining, &dwRemaining); - }
-#endif
-
- if (!pdwLength)
- {
- // Get string - Fifo_Add (hIO->hResult, "", 1); - p = Fifo_Get (hIO->hResult, NULL);
- }
- else
- {
- // Get binary, return size of buffer
- *pdwLength = (unsigned int)-1;
- p = Fifo_Get (hIO->hResult, pdwLength);
- } - InternetCloseHandle (hIO->hRequest);
- hIO->hRequest = NULL; - InternetCloseHandle (hUrl);
-OutputDebugString(p);
-OutputDebugString("\n");
- return p;
-} - -// ----------------------------------------------------------------------------- - -static char *IoLayer_Get(IOLAYER *hIO, char *pszURL, unsigned int *pdwLength) -{ - return IoLayer_Post (hIO, pszURL, NULL, 0, pdwLength); -}
-
-// -----------------------------------------------------------------------------
-
-static void IoLayer_Cancel(IOLAYER *hPIO)
-{
- IOLAYER_INST *hIO = (IOLAYER_INST*)hPIO;
-
-#ifdef ASYNC
- if (hIO->hRequest)
- {
- hIO->stAsyncRes.dwResult = 0;
- hIO->stAsyncRes.dwError = ERROR_CANCELLED;
- SetEvent(hIO->hRequestCompleteEvent);
- }
-#else
- if (hIO->hRequest && InternetCloseHandle(hIO->hRequest))
- hIO->hRequest = NULL;
-#endif
-}
- -// ----------------------------------------------------------------------------- - -static char *IoLayer_GetLastError(IOLAYER *hIO) -{
- return (char*)((IOLAYER_INST*)hIO)->lpErrorBuf; -} - -// ----------------------------------------------------------------------------- - -static char *IoLayer_EscapeString(IOLAYER *hPIO, char *pszData) -{
- IOLAYER_INST *hIO = (IOLAYER_INST*)hPIO;
- TYP_FIFO *hFifo;
- char szBuf[8], *pszRet;
- unsigned char *p;
- - if (!(hFifo = Fifo_Init(strlen(pszData)))) return NULL;
- for (p=pszData; *p; p++)
- {
- if (isalnum(*p)) Fifo_Add (hFifo, p, 1);
- else {
- wsprintf (szBuf, "%%%02X", *p);
- Fifo_Add (hFifo, szBuf, 3);
- }
- }
- Fifo_Add (hFifo, "", 1);
- if (pszRet = Fifo_Get(hFifo, NULL))
- pszRet = strdup(pszRet);
- Fifo_Exit(hFifo);
- return pszRet; -} - -// ----------------------------------------------------------------------------- - -static void IoLayer_FreeEscapeString(char *pszData) -{ - free (pszData); -} - -// ----------------------------------------------------------------------------- -// Static -// ----------------------------------------------------------------------------- - -static void FetchLastError (IOLAYER_INST *hIO) -{ - if (hIO->lpErrorBuf) LocalFree(hIO->lpErrorBuf); - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, - GetLastError(), MAKELANGID(LANG_NEUTRAL,SUBLANG_DEFAULT), - (LPTSTR)&hIO->lpErrorBuf, 0, NULL); -} -
-#ifdef ASYNC
-static void __stdcall Callback(HINTERNET hInternet, DWORD dwContext, DWORD dwInternetStatus,
- LPVOID lpStatusInfo, DWORD dwStatusInfoLen)
-{
- IOLAYER_INST *hIO = (IOLAYER_INST*)dwContext;
-
-
- switch(dwInternetStatus)
- {
- case INTERNET_STATUS_HANDLE_CREATED:
- SetEvent (hIO->hConnectedEvent);
- break;
- case INTERNET_STATUS_REQUEST_COMPLETE:
- hIO->stAsyncRes = *((INTERNET_ASYNC_RESULT *)lpStatusInfo);
- SetEvent(hIO->hRequestCompleteEvent);
- break;
- }
-}
-#endif
\ No newline at end of file diff --git a/plugins/!NotAdopted/IMO2sProxy/src/imolib/skypetst.c b/plugins/!NotAdopted/IMO2sProxy/src/imolib/skypetst.c deleted file mode 100644 index 5c80533eaf..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/src/imolib/skypetst.c +++ /dev/null @@ -1,211 +0,0 @@ -/* Module: skypetst.c
- Purpose: Very simple and straight forward testing application for Skype imo.im service
- Author: leecher
- Date: 30.08.2009
-*/
-
-#include <stdio.h>
-#include <signal.h>
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-#ifdef WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#else
-#include <unistd.h>
-#include <pthread.h>
-#endif
-#include "imo_skype.h"
-
-static IMOSKYPE *m_hInst = NULL;
-
-// -----------------------------------------------------------------------------
-// Static
-// -----------------------------------------------------------------------------
-static int StatusCallback (cJSON *pMsg, void *pUser)
-{
- char *pszName;
- cJSON *pContent = cJSON_GetArrayItem(pMsg, 0);
-
- if (!pContent) return;
- pszName = cJSON_GetObjectItem(pContent,"name")->valuestring;
-
- if (!strcmp(pszName, "recv_im"))
- {
- // I got a message!
- cJSON *pEdata = cJSON_GetObjectItem(pContent,"edata");
-
- if (pEdata)
- {
- time_t timestamp = (time_t)cJSON_GetObjectItem(pEdata, "timestamp")->valueint;
- char szTimestamp[32];
-
- strftime (szTimestamp, sizeof(szTimestamp), "%d.%m.%Y %H.%M.%S", localtime(×tamp));
- printf ("[%s] %s: %s\n", szTimestamp,
- cJSON_GetObjectItem(pEdata, "alias")->valuestring,
- cJSON_GetObjectItem(pEdata, "msg")->valuestring);
- }
- }
- else if (!strcmp(pszName, "signed_on"))
- {
- // I just signed on.
- cJSON *pEdata = cJSON_GetObjectItem(pContent,"edata");
- char *pszAlias;
-
- if (pEdata && (pszAlias = cJSON_GetObjectItem(pEdata, "alias")->valuestring))
- {
- printf ("My alias is: %s\n", pszAlias);
- }
- }
- else if (!strcmp(pszName, "buddy_added") || !strcmp(pszName, "buddy_status"))
- {
- // Here comes the contact list
- cJSON *pArray = cJSON_GetObjectItem(pContent,"edata"), *pItem;
- int i, iCount;
-
- if (pArray)
- {
- for (i=0, iCount = cJSON_GetArraySize(pArray); i<iCount; i++)
- {
- if (pItem = cJSON_GetArrayItem(pArray, i))
- {
- printf ("%s (%s)\t-\t%s\n",
- cJSON_GetObjectItem(pItem, "alias")->valuestring,
- cJSON_GetObjectItem(pItem, "buid")->valuestring,
- cJSON_GetObjectItem(pItem, "primitive")->valuestring);
- }
- }
- }
- }
- else
- {
- char *pszMsg = cJSON_Print(pMsg);
- fprintf (stderr, "%s\n\n", pszMsg);
- free (pszMsg);
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------------
-
-static void DispatcherThread(void *pDummy)
-{
- while (1)
- ImoSkype_Poll(m_hInst);
-}
-
-// -----------------------------------------------------------------------------
-
-#ifdef WIN32
-static HANDLE m_hThread;
-
-static int Dispatcher_Start(void)
-{
- DWORD ThreadID;
-
- return (m_hThread=CreateThread(NULL, 0,
- (LPTHREAD_START_ROUTINE)DispatcherThread, NULL, 0, &ThreadID))!=0;
-
-}
-
-static int Dispatcher_Stop(void)
-{
- return TerminateThread (m_hThread, 0);
-}
-
-#else
-static pthread_t m_hThread;
-
-static int Dispatcher_Start(void)
-{
- return pthread_create(&m_hThread, NULL, DispatcherThread, NULL)==0;
-}
-
-static int Dispatcher_Stop(void)
-{
- if (pthread_cancel(m_hThread))
- {
- m_hThread=0;
- return 1;
- }
- return 0;
-}
-#endif
-
-// -----------------------------------------------------------------------------
-// EIP
-// -----------------------------------------------------------------------------
-
-int main(int argc, char **argv)
-{
- int iRet = -1;
-
- if (argc<3)
- {
- printf ("Usage: %s [username] [password]\n", argv[0]);
- return -1;
- }
-
- /* Logon */
- if (!(m_hInst = ImoSkype_Init(StatusCallback, NULL)))
- {
- fprintf (stderr, "Initializing failed.\n");
- return -1;
- }
- if (ImoSkype_Login(m_hInst, argv[1], argv[2]) == 1)
- {
- /* Dispatch loop */
- char szLine[4096]={0};
-
- Dispatcher_Start();
- printf ("> ");
- fflush(stdout);
- while (gets(szLine))
- {
- if (strcmp(szLine, "exit") == 0) break;
- if (strcmp(szLine, "help") == 0)
- {
- printf ("msg [buddy] [message]\nstatus [available|away|busy|invisible] <Statusmessage>\nexit\n");
- } else
- if (strncmp(szLine, "msg ", 4) == 0)
- {
- char *pszBuddy;
-
- if (pszBuddy = strtok (szLine+4, " "))
- {
- if (ImoSkype_SendMessage(m_hInst, pszBuddy, pszBuddy+strlen(pszBuddy)+1))
- printf ("Sent.\n");
- else
- printf ("Sending failed: %s.\n", ImoSkype_GetLastError(m_hInst));
- }
- } else
- if (strncmp(szLine, "status ", 7) == 0)
- {
- char *pszStatus;
-
- if (pszStatus = strtok (szLine+7, " "))
- {
- if (ImoSkype_SetStatus(m_hInst, pszStatus, pszStatus+strlen(pszStatus)+1))
- printf ("Status set.\n");
- else
- printf ("Setting status failed: %s.\n", ImoSkype_GetLastError(m_hInst));
- }
- }
- memset (szLine, 0, sizeof(szLine));
- printf ("> ");
- fflush(stdout);
- }
- Dispatcher_Stop();
- ImoSkype_Logout(m_hInst);
- }
- else
- {
- fprintf (stderr, "Login failed: %s\n", ImoSkype_GetLastError(m_hInst));
- return -1;
- }
-
- ImoSkype_Exit(m_hInst);
- return iRet;
-}
diff --git a/plugins/!NotAdopted/IMO2sProxy/structure.txt b/plugins/!NotAdopted/IMO2sProxy/structure.txt deleted file mode 100644 index 37de021e3a..0000000000 --- a/plugins/!NotAdopted/IMO2sProxy/structure.txt +++ /dev/null @@ -1,102 +0,0 @@ -The communication module is divided into multiple layers that
-are replacable or usable on their own.
-First let's start with a list of files and a short description:
-
-+----------------+---+-------------------------------------------------------+
-| Module | T | Description |
-+----------------+---+-------------------------------------------------------+
-| fifo.c | M | A simple fifo (First In, First Out) buffer |
-| memlist.c | M | A simple memory list module |
-| io_layer.c | M | Communication layer for HTTP requests |
-| io_layer_win32.| M | Communication layer WIN32 |
-| imo_request.c | M | Posts XMLHHTP-Requests to imo.im server |
-| cJSON.c | M | JSON parser in C (by Dave Gamble, slightly modified |
-| imo_skype.c | M | Communication layer for imo.im Skype |
-| skypetst.c | X | Testing application for Skype imo.im service |
-| queue.c | M | General Queue functions |
-| msgqueue.c | M | Message queue for incoming messages |
-| callqueue.c | M | Queue of incoming calls |
-| buddylist.c | M | Manages your list of buddies in memory |
-| imo2skypeapi.c | M | Wrapper for imo.im Webservice to SKYPE API |
-| imo2stest.c | X | Simple test application for imo2skypeapi |
-| imo2sproxy.c | M | Skypeproxy implementation to wrap imo2skypeapi |
-| w32browser.c | M | C COM Interface to Internet Explorer for call supp. |
-| main.c | X | Commandline interface for imo2sproxy module |
-| imoproxy.c | X | Miranda plugin implementation for imo2sproxy |
-| skypepluginlink| M | Communication layer with Miranda Skype Plugin 0.0.0.46|
-| socksproxy.c | M | Communication layer with socket protocol. |
-| w32skypeemu.c | M | Communication layer via Win32 Skype API emulation |
-+----------------+---+-------------------------------------------------------+
- [T]ype is: M...Module, X...Executable (Application)
-
-
-Now here is the module list with their dependencies divided into layers:
-
-====================================================================
- IMO.IM Communication layer
-====================================================================
-
-+------------------------------------------------------------------+
-| io_layer.c |
-+------------------------------------------------------------------+
-| Communication layer for HTTP requests |
-| Depends on: fifo.c, Win32:WinInet, linux:libCURL |
-+------------------------------------------------------------------+
- ||
- ||
- \/
-+------------------------------------------------------------------+
-| imo_request.c |
-+------------------------------------------------------------------+
-| Communication module with imo.im |
-| Depends on: fifo.c, cJSON.c, io_layer.c |
-+------------------------------------------------------------------+
- ||
- ||
- \/
-+------------------------------------------------------------------+
-| imo_skype.c |
-+------------------------------------------------------------------+
-| Description: Skype protocol layer for imo.im |
-| Depends on: imo_request.c, cJSON.c |
-| Test application: skypetst.c |
-+------------------------------------------------------------------+
- ||
-====================================================================
- imo.im <--> SkypeAPI wrapper
-====================================================================
- ||
- \/
-+------------------------------------------------------------------+
-| imo2skypeapi.c |
-+------------------------------------------------------------------+
-| Description: Mapper for imo.im to simple implementation of |
-| SkypeAPI |
-| Depends on: fifo.c, memlist.c, buddylist.c, msgqueue.c, |
-| imo_skype.c, (w32browser.c),(libpthread) |
-| Test application: imo2stest.c |
-+------------------------------------------------------------------+
- ||
- ||
- \/
-+------------------------------------------------------------------+
-| imo2sproxy.c |
-+------------------------------------------------------------------+
-| Description: Skypeproxy implementation to wrap imo2skypeapi|
-| for Miranda Plugin and potentially others |
-| Depends on: memlist.c, imo2skypeapi.c, (libpthread) |
-+------------------------------------------------------------------+
- || ||
- || ||
- \/ \/
-+-----------------------------------------++-----------------------------------------+
-| main.c || imoproxy.c |
-+-----------------------------------------++-----------------------------------------+
-| Description: Commandline dispatcher || Description: Miranda IM Plugin |
-| Depends on: memlist.c, imo2skypeapi.c, || Depends on: memlist.c, imo2skypeapi.c, |
-| imo2sproxy.c, (libpthread) || imo2sproxy.c, (libpthread) |
-+-----------------------------------------++-----------------------------------------+
- | | | - +-------------------+ | - | | | -Communication layer: socksproxy.c w32skypeemu.c skypepluginlink.c diff --git a/plugins/!NotAdopted/Skype/Skript1.aps b/plugins/!NotAdopted/Skype/Skript1.aps Binary files differdeleted file mode 100644 index d99f14a71e..0000000000 --- a/plugins/!NotAdopted/Skype/Skript1.aps +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/Skript1.rc b/plugins/!NotAdopted/Skype/Skript1.rc deleted file mode 100644 index cc6bba8cdd..0000000000 --- a/plugins/!NotAdopted/Skype/Skript1.rc +++ /dev/null @@ -1,484 +0,0 @@ -//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Neutral resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
-#ifdef _WIN32
-LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_SETAVATAR DIALOGEX 0, 0, 222, 131
-STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- PUSHBUTTON "Set",IDC_SETAVATAR,10,108,45,13,WS_GROUP
- PUSHBUTTON "Delete",IDC_DELETEAVATAR,57,108,45,13
- CONTROL "",IDC_AVATAR,"Static",SS_BITMAP | SS_CENTERIMAGE |
- SS_SUNKEN | WS_GROUP,10,10,96,93
-END
-
-IDD_OPT_DEFAULT DIALOGEX 0, 0, 310, 223
-STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- CONTROL "Start Skype with Miranda NG if not running using the following command line options:",
- IDC_STARTSKYPE,"Button",BS_AUTOCHECKBOX | WS_GROUP |
- WS_TABSTOP,10,4,290,10
- CONTROL "/NOSPLASH - Don't show splash screen on startup",
- IDC_NOSPLASH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,36,17,
- 264,12
- CONTROL "/MINIMIZED - Start Skype minimized",IDC_MINIMIZED,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,36,28,264,12
- CONTROL "/NOTRAY - Skype tray icon becomes grey and is therefore ""invisible""",
- IDC_NOTRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,36,40,
- 264,12
- CONTROL "/REMOVEABLE - For running portable skype",
- IDC_REMOVEABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,36,
- 51,264,12
- CONTROL "/SECONDARY - This is the second instance",IDC_SECONDARY,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,36,62,264,12
- CONTROL "/DATAPATH - Specify Skype data folder*",IDC_DATAPATHO,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,36,74,264,12
- EDITTEXT IDC_DATAPATH,47,88,236,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_BROWSEDP,285,87,16,15
- CONTROL "Use custom Skype executable*",IDC_CUSTOMCOMMAND,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,36,103,264,10
- EDITTEXT IDC_COMMANDLINE,47,116,236,12,ES_AUTOHSCROLL
- PUSHBUTTON "...",IDC_BROWSECMDL,285,115,16,15
- CTEXT "* Relative path root is Miranda NG folder",
- IDC_STATIC_PATHINFO,10,136,290,8,NOT WS_GROUP
- CONTROL "Shutdown Skype when you close Miranda NG",IDC_SHUTDOWN,
- "Button",BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,10,151,
- 290,10
- CONTROL "Unload Skype when you change to Offline status",
- IDC_UNLOADOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
- 10,164,290,11
- LTEXT "Try at least",IDC_STATIC,10,185,39,8
- EDITTEXT IDC_CONNATTEMPTS,52,183,21,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "times to connect to Skype API before giving up",
- IDC_STATIC,78,185,224,8,NOT WS_GROUP
- LTEXT "User name:",IDC_STATIC,10,206,38,8
- EDITTEXT IDC_USERNAME,52,204,79,12,ES_AUTOHSCROLL
- LTEXT "Password:",IDC_STATIC,148,206,34,8
- EDITTEXT IDC_PASSWORD,186,204,79,12,ES_PASSWORD | ES_AUTOHSCROLL
-END
-
-IDD_DIAL DIALOGEX 0, 0, 198, 46
-STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION |
- WS_SYSMENU
-CAPTION "Dial"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- LTEXT "Number:",IDC_STATIC,7,8,30,11
- COMBOBOX IDC_NUMBER,41,6,149,13,CBS_DROPDOWN | WS_VSCROLL |
- WS_TABSTOP
- DEFPUSHBUTTON "Dial",IDDIAL,88,25,50,14,WS_GROUP
- PUSHBUTTON "Cancel",IDCANCEL,141,25,50,14
-END
-
-IDD_CALLSTAT DIALOGEX 0, 0, 220, 67
-STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION
-CAPTION "%s is calling"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- CONTROL "Join conference with %s",IDC_JOIN,"Button",
- BS_AUTORADIOBUTTON | WS_GROUP,7,7,206,10
- CONTROL "Answer call; set call to %s on hold",IDC_HOLD,"Button",
- BS_AUTORADIOBUTTON,7,19,206,10
- CONTROL "Hang up",IDC_HANGUP,"Button",BS_AUTORADIOBUTTON,7,31,
- 206,10
- DEFPUSHBUTTON "OK",IDOK,163,46,50,14,WS_GROUP
-END
-
-IDD_INPUTBOX DIALOGEX 0, 0, 221, 46
-STYLE DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Dialog"
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- EDITTEXT IDC_TEXT,7,7,207,13,ES_AUTOHSCROLL | WS_GROUP
- DEFPUSHBUTTON "OK",IDOK,112,25,50,14,WS_GROUP
- PUSHBUTTON "Cancel",IDCANCEL,165,25,50,14
-END
-
-IDD_OPTIONS DIALOGEX 0, 0, 313, 249
-STYLE DS_FIXEDSYS | DS_CONTROL | DS_CENTER | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- CONTROL "Tab1",IDC_OPTIONSTAB,"SysTabControl32",0x0,0,-1,313,250
-END
-
-IDD_OPT_PROXY DIALOGEX 0, 0, 310, 223
-STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- CONTROL "Use Skype proxy connection over network instead of local Skype API",
- IDC_USES2S,"Button",BS_AUTOCHECKBOX | WS_GROUP |
- WS_TABSTOP,10,4,290,9
- LTEXT "Host:",IDC_STATIC_HOST,20,21,18,10
- EDITTEXT IDC_HOST,41,19,133,12,ES_AUTOHSCROLL
- LTEXT "Port:",IDC_STATIC_PORT,180,21,16,10,0,WS_EX_RIGHT
- EDITTEXT IDC_PORT,200,19,29,12,ES_AUTOHSCROLL | ES_NUMBER
- CTEXT "* You must restart Miranda NG in order to let the settings take effect",
- IDC_STATIC_RESTART,10,54,290,8,NOT WS_GROUP
- CONTROL "This Skype proxy requires password authentication:",
- IDC_REQPASS,"Button",BS_AUTOCHECKBOX | WS_GROUP |
- WS_TABSTOP,20,38,176,9
- EDITTEXT IDC_PASSWORD,200,36,82,12,ES_PASSWORD | ES_AUTOHSCROLL
-END
-
-IDD_SETDETAILS DIALOGEX 0, 0, 216, 151
-STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- LTEXT "Name:",IDC_STATIC,7,6,61,9
- EDITTEXT IDC_FULLNAME,73,4,141,12,ES_AUTOHSCROLL
- LTEXT "Birthday:",IDC_STATIC,7,20,61,9
- CONTROL "DateTimePicker1",IDC_BIRTHDAY,"SysDateTimePick32",
- DTS_RIGHTALIGN | DTS_APPCANPARSE | WS_TABSTOP,73,18,62,
- 12
- LTEXT "Sex:",IDC_STATIC,7,34,61,9
- COMBOBOX IDC_SEX,73,32,141,12,CBS_DROPDOWNLIST | WS_VSCROLL |
- WS_TABSTOP
- LTEXT "City:",IDC_STATIC,7,48,61,9
- EDITTEXT IDC_CITY,73,46,141,12,ES_AUTOHSCROLL
- LTEXT "Country:",IDC_STATIC,7,62,61,9
- EDITTEXT IDC_COUNTRY,73,60,141,12,ES_AUTOHSCROLL
- LTEXT "Province:",IDC_STATIC,7,76,61,9
- EDITTEXT IDC_PROVINCE,73,74,141,12,ES_AUTOHSCROLL
- LTEXT "Home phone:",IDC_STATIC,7,90,61,9
- EDITTEXT IDC_HOMEPHONE,73,88,141,12,ES_AUTOHSCROLL
- LTEXT "Office phone:",IDC_STATIC,7,104,61,9
- EDITTEXT IDC_OFFICEPHONE,73,102,141,12,ES_AUTOHSCROLL
- LTEXT "Homepage:",IDC_STATIC,7,118,61,9
- EDITTEXT IDC_HOMEPAGE,73,116,141,12,ES_AUTOHSCROLL
- PUSHBUTTON "Save",IDC_SAVEDETAILS,170,134,45,14,WS_GROUP
-END
-
-IDD_OPT_ADVANCED DIALOGEX 0, 0, 310, 223
-STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- CONTROL "Enable Skype menu options (currently: Find/Add user)",
- IDC_ENABLEMENU,"Button",BS_AUTOCHECKBOX | WS_GROUP |
- WS_TABSTOP,10,4,290,9
- CONTROL "Use popup plugin for displaying messages ",IDC_USEPOPUP,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,19,290,9
- CONTROL "Suppress all error messages (not recommended, but if it annoys you... ;)",
- IDC_NOERRORS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,34,
- 290,9
- CONTROL "Use group chat interface for conversations (requires group chat module)",
- IDC_GROUPCHAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,
- 49,290,9
- CONTROL "Mark group chat message as read to avoid notification",
- IDC_GROUPCHATREAD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
- 10,64,290,9
- CONTROL "Keep requested online status on startup under every circumstance",
- IDC_KEEPSTATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,
- 79,290,9
- CONTROL "Use time zone patch",IDC_TIMEZONE,"Button",
- BS_AUTOCHECKBOX | WS_TABSTOP,10,94,290,9
- CONTROL "Ignore time zones",IDC_IGNTZ,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,10,109,290,9
- CONTROL "Show default skype avatar for contacts",
- IDC_SHOWDEFAULTAVATAR,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,10,124,290,9
- CONTROL "Suppress call summary chat message",
- IDC_SUPPRESSCALLSUMMARYMESSAGE,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,10,139,290,9
- CONTROL "Disable support for N/A and SkypeMe status (for Skype 4+)",
- IDC_NOSKYPE3STATS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
- 10,154,290,9
- CONTROL "Show full name in contact list instead of nickname",
- IDC_SHOWFULLNAME,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
- 10,169,290,9
- LTEXT "SkypeOut contacts are in status:",IDC_STATIC,10,186,108,
- 8
- COMBOBOX IDC_SKYPEOUTSTAT,120,184,79,54,CBS_DROPDOWNLIST |
- WS_VSCROLL | WS_TABSTOP
- PUSHBUTTON "Cleanup Nicknames",IDC_CLEANUP,9,201,80,14,BS_MULTILINE |
- WS_GROUP
-END
-
-IDD_OPT_POPUP DIALOGEX 0, 0, 310, 228
-STYLE DS_FIXEDSYS | DS_CONTROL | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- GROUPBOX "Skype Popups",IDC_STATIC,0,1,309,227
- GROUPBOX "Incoming Calls",IDC_STATIC,6,16,297,62,WS_GROUP
- CONTROL "Show incoming calls",IDC_POPUPINCOMING,"Button",
- BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,10,28,278,8
- EDITTEXT IDC_POPUPTIME,16,41,20,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "seconds",IDC_STATIC,41,43,92,8,NOT WS_GROUP
- CONTROL "",IDC_POPUPBACKCOLOR,"ColourPicker",WS_GROUP |
- WS_TABSTOP,142,40,39,12
- LTEXT "Background",IDC_STATIC_POPUPBACKCOLOR,186,42,50,8,
- SS_CENTERIMAGE | NOT WS_GROUP
- CONTROL "Use Windows colors",IDC_USEWINCOLORS,"Button",
- BS_AUTOCHECKBOX | BS_NOTIFY | BS_FLAT | WS_TABSTOP,16,58,
- 121,8
- CONTROL "",IDC_POPUPTEXTCOLOR,"ColourPicker",WS_TABSTOP,142,55,
- 39,12
- LTEXT "Text",IDC_STATIC_POPUPTEXTCOLOR,186,56,50,8,
- SS_CENTERIMAGE | NOT WS_GROUP
- PUSHBUTTON "Preview",IDC_PREVIEW,247,58,50,14,WS_GROUP
- GROUPBOX "Error Messages",IDC_STATIC,6,81,297,62,WS_GROUP
- CONTROL "Display error messages",IDC_POPUPERROR,"Button",
- BS_AUTOCHECKBOX | WS_GROUP | WS_TABSTOP,10,94,278,8
- EDITTEXT IDC_POPUPTIMEERR,16,107,20,12,ES_AUTOHSCROLL | ES_NUMBER
- LTEXT "seconds",IDC_STATIC,41,109,92,8,NOT WS_GROUP
- CONTROL "",IDC_POPUPBACKCOLORERR,"ColourPicker",WS_GROUP |
- WS_TABSTOP,142,106,39,12
- LTEXT "Background",IDC_STATIC_POPUPBACKCOLORERR,186,108,50,8,
- SS_CENTERIMAGE | NOT WS_GROUP
- CONTROL "Use Windows colors",IDC_USEWINCOLORSERR,"Button",
- BS_AUTOCHECKBOX | BS_NOTIFY | BS_FLAT | WS_TABSTOP,16,
- 124,121,8
- CONTROL "",IDC_POPUPTEXTCOLORERR,"ColourPicker",WS_TABSTOP,142,
- 121,39,12
- LTEXT "Text",IDC_STATIC_POPUPTEXTCOLORERR,186,123,50,8,
- SS_CENTERIMAGE | NOT WS_GROUP
- PUSHBUTTON "Preview",IDC_PREVIEWERR,247,124,50,14,WS_GROUP
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO MOVEABLE PURE
-BEGIN
- IDD_SETAVATAR, DIALOG
- BEGIN
- LEFTMARGIN, 10
- RIGHTMARGIN, 212
- TOPMARGIN, 10
- BOTTOMMARGIN, 121
- END
-
- IDD_OPT_DEFAULT, DIALOG
- BEGIN
- LEFTMARGIN, 1
- VERTGUIDE, 10
- VERTGUIDE, 300
- TOPMARGIN, 4
- END
-
- IDD_DIAL, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 190
- TOPMARGIN, 6
- BOTTOMMARGIN, 39
- END
-
- IDD_CALLSTAT, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 213
- TOPMARGIN, 7
- BOTTOMMARGIN, 60
- END
-
- IDD_INPUTBOX, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 214
- TOPMARGIN, 7
- BOTTOMMARGIN, 39
- END
-
- IDD_OPTIONS, DIALOG
- BEGIN
- RIGHTMARGIN, 311
- BOTTOMMARGIN, 243
- END
-
- IDD_OPT_PROXY, DIALOG
- BEGIN
- LEFTMARGIN, 10
- RIGHTMARGIN, 300
- TOPMARGIN, 4
- BOTTOMMARGIN, 221
- END
-
- IDD_SETDETAILS, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 214
- TOPMARGIN, 4
- BOTTOMMARGIN, 148
- END
-
- IDD_OPT_ADVANCED, DIALOG
- BEGIN
- LEFTMARGIN, 10
- RIGHTMARGIN, 300
- TOPMARGIN, 4
- BOTTOMMARGIN, 221
- HORZGUIDE, 4
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_SKYPE ICON DISCARDABLE "res\\skype.ico"
-IDI_INVITE ICON DISCARDABLE "res\\Invite.ico"
-IDI_ADD ICON DISCARDABLE "res\\add.ico"
-IDI_IMPORT ICON DISCARDABLE "res\\import.ico"
-IDI_ERRORS ICON DISCARDABLE "res\\error.ico"
-IDI_MESSAGE ICON DISCARDABLE "res\\message.ico"
-IDI_CALL ICON DISCARDABLE "res\\call.ico"
-IDI_CALLSKYPEOUT ICON DISCARDABLE "res\\skypeout.ico"
-IDI_HOLD ICON DISCARDABLE "res\\hold.ico"
-IDI_RESUME ICON DISCARDABLE "res\\resume.ico"
-IDI_HANGUP ICON DISCARDABLE "res\\hang_up.ico"
-IDI_ONLINE ICON DISCARDABLE "res\\online.ico"
-IDI_CHAT ICON DISCARDABLE "res\\chat.ico"
-IDI_AWAY ICON DISCARDABLE "res\\away.ico"
-IDI_NA ICON DISCARDABLE "res\\na.ico"
-IDI_OCCUPIED ICON DISCARDABLE "res\\occupied.ico"
-IDI_DND ICON DISCARDABLE "res\\dnd.ico"
-IDI_INVISIBLE ICON DISCARDABLE "res\\invisible.ico"
-IDI_OFFLINE ICON DISCARDABLE "res\\offline.ico"
-IDI_PHONE ICON DISCARDABLE "res\\phone.ico"
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,0,0,53
- PRODUCTVERSION 0,0,0,53
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "000004b0"
- BEGIN
- VALUE "Comments", "\0"
- VALUE "CompanyName", "Miranda NG community\0"
- VALUE "FileDescription", "Skype\0"
- VALUE "FileVersion", "0, 0, 0, 53\0"
- VALUE "InternalName", "Skype\0"
- VALUE "LegalCopyright", "Copyright © 2007-2011 leecher - tweety - jls17\0"
- VALUE "LegalTrademarks", "\0"
- VALUE "OriginalFilename", "Skype.dll\0"
- VALUE "PrivateBuild", "\0"
- VALUE "ProductName", "Skype Protocol for Miranda NG\0"
- VALUE "ProductVersion", "0, 0, 0, 53\0"
- VALUE "SpecialBuild", "\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x0, 1200
- END
-END
-
-#endif // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDB_CALL BITMAP MOVEABLE PURE "res\\call.bmp"
-#endif // Neutral resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-// Deutsch (Österreich) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEA)
-#ifdef _WIN32
-LANGUAGE LANG_GERMAN, SUBLANG_GERMAN_AUSTRIAN
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE MOVEABLE PURE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE MOVEABLE PURE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE MOVEABLE PURE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // Deutsch (Österreich) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/plugins/!NotAdopted/Skype/Skype_protocol.dsp b/plugins/!NotAdopted/Skype/Skype_protocol.dsp deleted file mode 100644 index 23710dadd3..0000000000 --- a/plugins/!NotAdopted/Skype/Skype_protocol.dsp +++ /dev/null @@ -1,394 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Skype_protocol" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** NICHT BEARBEITEN **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=Skype_protocol - Win32 Debug UNICODE
-!MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
-!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
-!MESSAGE
-!MESSAGE NMAKE /f "Skype_protocol.mak".
-!MESSAGE
-!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
-!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
-!MESSAGE
-!MESSAGE NMAKE /f "Skype_protocol.mak" CFG="Skype_protocol - Win32 Debug UNICODE"
-!MESSAGE
-!MESSAGE Für die Konfiguration stehen zur Auswahl:
-!MESSAGE
-!MESSAGE "Skype_protocol - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "Skype_protocol - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "Skype_protocol - Win32 Debug UNICODE" (basierend auf "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=xicl6.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "Skype_protocol - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /YX /FD /c
-# SUBTRACT CPP /Fr
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0xc07 /d "NDEBUG"
-# ADD RSC /l 0xc07 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib comctl32.lib Rpcrt4.lib /nologo /dll /machine:I386 /out:"../../bin/release/plugins/skype.dll"
-
-!ELSEIF "$(CFG)" == "Skype_protocol - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /YX /FD /GZ /c
-# SUBTRACT CPP /Fr
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0xc07 /d "_DEBUG"
-# ADD RSC /l 0xc07 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib comctl32.lib Rpcrt4.lib /nologo /dll /debug /machine:I386 /out:"../../bin/debug/plugins/Skype.dll" /pdbtype:sept
-# SUBTRACT LINK32 /map
-
-!ELSEIF "$(CFG)" == "Skype_protocol - Win32 Debug UNICODE"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Skype_protocol___Win32_Debug_UNICODE"
-# PROP BASE Intermediate_Dir "Skype_protocol___Win32_Debug_UNICODE"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Skype_protocol___Win32_Debug_UNICODE"
-# PROP Intermediate_Dir "Skype_protocol___Win32_Debug_UNICODE"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /YX /FD /GZ /c
-# SUBTRACT BASE CPP /Fr
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /D "UNICODE" /D "_UNICODE" /FR /YX /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0xc07 /d "_DEBUG"
-# ADD RSC /l 0xc07 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=xilink6.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib comctl32.lib Rpcrt4.lib /nologo /dll /debug /machine:I386 /out:"../../bin/debug/plugins/Skype.dll" /pdbtype:sept
-# SUBTRACT BASE LINK32 /map
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib comctl32.lib Rpcrt4.lib /nologo /dll /debug /machine:I386 /out:"../../bin/debug Unicode/plugins/Skype.dll" /pdbtype:sept
-# SUBTRACT LINK32 /map
-
-!ENDIF
-
-# Begin Target
-
-# Name "Skype_protocol - Win32 Release"
-# Name "Skype_protocol - Win32 Debug"
-# Name "Skype_protocol - Win32 Debug UNICODE"
-# Begin Group "Quellcodedateien"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\alogon.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\contacts.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\debug.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\gchat.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\memlist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\msglist.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\msgq.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\pthread.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\skype.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\skypeapi.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\skypeopt.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\skypeprofile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\skypesvc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\utf8.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\util.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\voiceservice.c
-# End Source File
-# End Group
-# Begin Group "Header-Dateien"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\alogon.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\contacts.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\debug.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\gchat.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\m_popup.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\m_toptoolbar.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\memlist.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\msglist.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\msgq.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\pthread.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\skype.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\skypeapi.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\skypeopt.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\skypeprofile.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\skypesvc.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\utf8.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\util.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\voiceservice.h
-# End Source File
-# End Group
-# Begin Group "Ressourcendateien"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\res\add.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\away.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\bitmap1.bmp
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\call.bmp
-# End Source File
-# Begin Source File
-
-SOURCE=.\Call.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\call.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\chat.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\DND.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\error.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\hang_up.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\Hangup.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\hold.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\holdcall.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\icon1.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\icon2.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\import.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\invisible.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\Invite.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\message.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\NA.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\occupied.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\offline.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\online.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\phone.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\resume.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\resumecall.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\Skript1.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\skype.ico
-# End Source File
-# Begin Source File
-
-SOURCE=.\res\skypeout.ico
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\changelog.txt
-# End Source File
-# End Target
-# End Project
diff --git a/plugins/!NotAdopted/Skype/Skype_protocol.dsw b/plugins/!NotAdopted/Skype/Skype_protocol.dsw deleted file mode 100644 index 3965e55d3e..0000000000 --- a/plugins/!NotAdopted/Skype/Skype_protocol.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GELÖSCHT WERDEN!
-
-###############################################################################
-
-Project: "Skype_protocol"=.\Skype_protocol.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/plugins/!NotAdopted/Skype/Skype_protocol.mak b/plugins/!NotAdopted/Skype/Skype_protocol.mak deleted file mode 100644 index cf43334fb3..0000000000 --- a/plugins/!NotAdopted/Skype/Skype_protocol.mak +++ /dev/null @@ -1,238 +0,0 @@ -!IF "$(CFG)" == ""
-CFG=Win32 Debug
-!MESSAGE Keine Konfiguration angegeben. Win32 Debug wird als Standard verwendet.
-!ENDIF
-
-!IF "$(CFG)" != "Win32 Release" && "$(CFG)" != "Win32 Debug" && "$(CFG)" != "Win64 Release" && "$(CFG)" != "Win64 Debug" && "$(CFG)" != "Win32 UNICODE Release" && "$(CFG)" != "Win32 UNICODE Debug" && "$(CFG)" != "Win64 UNICODE Release" && "$(CFG)" != "Win64 UNICODE Debug"
-!MESSAGE Ungültige Konfiguration "$(CFG)" angegeben.
-!MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
-!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
-!MESSAGE
-!MESSAGE NMAKE /f "Skype_protocol.mak" CFG="Win32 Debug"
-!MESSAGE
-!MESSAGE Für die Konfiguration stehen zur Auswahl:
-!MESSAGE
-!MESSAGE "Win32 Release"
-!MESSAGE "Win32 Debug"
-!MESSAGE "Win64 Release"
-!MESSAGE "Win64 Debug"
-!MESSAGE "Win32 UNICODE Release"
-!MESSAGE "Win32 UNICODE Debug"
-!MESSAGE "Win64 UNICODE Release"
-!MESSAGE "Win64 UNICODE Debug"
-
-!MESSAGE
-!ERROR Eine ungültige Konfiguration wurde angegeben.
-!ENDIF
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-LINK32=link.exe
-
-LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib wsock32.lib comctl32.lib Rpcrt4.lib /nologo /dll /pdb:"$(INTDIR)\skype.pdb" /out:"$(OUTDIR)/skype.dll" /implib:"$(INTDIR)\skype.lib"
-
-!IF "$(CFG)" == "Win64 Release"
-OUTDIR=.\Release64
-INTDIR=.\Release64
-CPP_PROJ=/nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /Fp"$(INTDIR)\Skype_protocol.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:no
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\Skript1.res" /d "NDEBUG"
-!ELSEIF "$(CFG)" == "Win32 Release"
-OUTDIR=.\Release
-INTDIR=.\Release
-CPP_PROJ=/nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /Fp"$(INTDIR)\Skype_protocol.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:no
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\Skript1.res" /d "NDEBUG"
-!ELSEIF "$(CFG)" == "Win64 Debug"
-OUTDIR=Debug64
-INTDIR=$(OUTDIR)
-CPP_PROJ=/nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /Fp"$(INTDIR)\Skype_protocol.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:yes /debug /pdbtype:sept
-MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\Skript1.res" /d "_DEBUG"
-!ELSEIF "$(CFG)" == "Win32 Debug"
-OUTDIR=.\Debug
-INTDIR=$(OUTDIR)
-CPP_PROJ=/nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /Fp"$(INTDIR)\Skype_protocol.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:yes /debug /pdbtype:sept
-MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\Skript1.res" /d "_DEBUG"
-!ELSEIF "$(CFG)" == "Win64 UNICODE Release"
-OUTDIR=.\Release64-UNICODE
-INTDIR=.\Release64-UNICODE
-CPP_PROJ=/nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /D "UNICODE" /D "_UNICODE" /Fp"$(INTDIR)\Skype_protocol.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:no
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\Skript1.res" /d "NDEBUG"
-!ELSEIF "$(CFG)" == "Win32 UNICODE Release"
-OUTDIR=.\Release-UNICODE
-INTDIR=.\Release-UNICODE
-CPP_PROJ=/nologo /MD /W3 /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /D "UNICODE" /D "_UNICODE" /Fp"$(INTDIR)\Skype_protocol.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:no
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\Skript1.res" /d "NDEBUG"
-!ELSEIF "$(CFG)" == "Win64 UNICODE Debug"
-OUTDIR=Debug64-UNICODE
-INTDIR=$(OUTDIR)
-CPP_PROJ=/nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /D "UNICODE" /D "_UNICODE" /Fp"$(INTDIR)\Skype_protocol.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
-LINK32_FLAGS= $(LINK32_FLAGS) /incremental:yes /debug /pdbtype:sept
-MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\Skript1.res" /d "_DEBUG"
-!ELSEIF "$(CFG)" == "Win32 UNICODE Debug"
-OUTDIR=.\Debug-UNICODE
-INTDIR=$(OUTDIR)
-CPP_PROJ=/nologo /MDd /W3 /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "SKYPE_PROTOCOL_EXPORTS" /D "UNICODE" /D "_UNICODE" /Fp"$(INTDIR)\Skype_protocol.pch" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
-LINK32_FLAGS=$(LINK32_FLAGS) /incremental:yes /debug /pdbtype:sept
-MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
-RSC_PROJ=/l 0xc07 /fo"$(INTDIR)\Skript1.res" /d "_DEBUG"
-!ENDIF
-
-LINK32_OBJS= \
- "$(INTDIR)\contacts.obj" \
- "$(INTDIR)\debug.obj" \
- "$(INTDIR)\gchat.obj" \
- "$(INTDIR)\pthread.obj" \
- "$(INTDIR)\skype.obj" \
- "$(INTDIR)\skypeapi.obj" \
- "$(INTDIR)\skypeopt.obj" \
- "$(INTDIR)\skypeprofile.obj" \
- "$(INTDIR)\skypesvc.obj" \
- "$(INTDIR)\utf8.obj" \
- "$(INTDIR)\voiceservice.obj" \
- "$(INTDIR)\msglist.obj" \
- "$(INTDIR)\memlist.obj" \
- "$(INTDIR)\util.obj" \
- "$(INTDIR)\msgq.obj" \
- "$(INTDIR)\alogon.obj" \
- "$(INTDIR)\Skript1.res"
-
-ALL : "$(OUTDIR)\skype.dll"
-
-
-CLEAN :
- -@erase "$(INTDIR)\contacts.obj"
- -@erase "$(INTDIR)\debug.obj"
- -@erase "$(INTDIR)\gchat.obj"
- -@erase "$(INTDIR)\pthread.obj"
- -@erase "$(INTDIR)\Skript1.res"
- -@erase "$(INTDIR)\skype.obj"
- -@erase "$(INTDIR)\skypeapi.obj"
- -@erase "$(INTDIR)\skypeopt.obj"
- -@erase "$(INTDIR)\skypeprofile.obj"
- -@erase "$(INTDIR)\skypesvc.obj"
- -@erase "$(INTDIR)\msglist.obj"
- -@erase "$(INTDIR)\memlist.obj"
- -@erase "$(INTDIR)\util.obj"
- -@erase "$(INTDIR)\msgq.obj" \
- -@erase "$(INTDIR)\alogon.obj" \
- -@erase "$(INTDIR)\utf8.obj"
- -@erase "$(INTDIR)\vc60.idb"
- -@erase "$(INTDIR)\voiceservice.obj"
- -@erase "$(INTDIR)\skype.exp"
- -@erase "$(INTDIR)\skype.pdb"
- -@erase "$(INTDIR)\skype.lib"
- -@erase "$(OUTDIR)\skype.dll"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-.c{$(INTDIR)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-
-"$(OUTDIR)\skype.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-
-!IF "$(NO_EXTERNAL_DEPS)" != "1"
-!IF EXISTS("Skype_protocol.dep")
-!INCLUDE "Skype_protocol.dep"
-!ELSE
-!MESSAGE Warning: cannot find "Skype_protocol.dep"
-!ENDIF
-!ENDIF
-
-
-SOURCE=.\alogon.c
-
-"$(INTDIR)\alogon.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\contacts.c
-
-"$(INTDIR)\contacts.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\debug.c
-
-"$(INTDIR)\debug.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\gchat.c
-
-"$(INTDIR)\gchat.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\msgq.c
-
-"$(INTDIR)\msgq.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\pthread.c
-
-"$(INTDIR)\pthread.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\skype.c
-
-"$(INTDIR)\skype.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\skypeapi.c
-
-"$(INTDIR)\skypeapi.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\skypeopt.c
-
-"$(INTDIR)\skypeopt.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\skypeprofile.c
-
-"$(INTDIR)\skypeprofile.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\skypesvc.c
-
-"$(INTDIR)\skypesvc.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\utf8.c
-
-"$(INTDIR)\utf8.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\voiceservice.c
-
-"$(INTDIR)\voiceservice.obj" : $(SOURCE) "$(INTDIR)"
-
-
-SOURCE=.\Skript1.rc
-
-"$(INTDIR)\Skript1.res" : $(SOURCE) "$(INTDIR)"
- $(RSC) $(RSC_PROJ) $(SOURCE)
-
diff --git a/plugins/!NotAdopted/Skype/Skype_protocol.sln b/plugins/!NotAdopted/Skype/Skype_protocol.sln deleted file mode 100755 index 8f21435114..0000000000 --- a/plugins/!NotAdopted/Skype/Skype_protocol.sln +++ /dev/null @@ -1,44 +0,0 @@ -
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Skype_protocol", "Skype_protocol.vcxproj", "{5F9243AE-C6C9-4F42-B670-67A97767A50B}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- ANSI Debug|Win32 = ANSI Debug|Win32
- ANSI Debug|x64 = ANSI Debug|x64
- ANSI Release|Win32 = ANSI Release|Win32
- ANSI Release|x64 = ANSI Release|x64
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- x64 Debug|Win32 = x64 Debug|Win32
- x64 Debug|x64 = x64 Debug|x64
- x64 Release|Win32 = x64 Release|Win32
- x64 Release|x64 = x64 Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.ANSI Debug|Win32.ActiveCfg = ANSI Debug|Win32
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.ANSI Debug|Win32.Build.0 = ANSI Debug|Win32
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.ANSI Debug|x64.ActiveCfg = ANSI Debug|x64
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.ANSI Release|Win32.ActiveCfg = ANSI Release|Win32
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.ANSI Release|Win32.Build.0 = ANSI Release|Win32
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.ANSI Release|x64.ActiveCfg = ANSI Release|x64
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.Debug|Win32.ActiveCfg = Debug|Win32
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.Debug|Win32.Build.0 = Debug|Win32
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.Debug|x64.ActiveCfg = Debug|x64
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.Release|Win32.ActiveCfg = Release|Win32
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.Release|Win32.Build.0 = Release|Win32
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.Release|x64.ActiveCfg = Release|x64
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.x64 Debug|Win32.ActiveCfg = x64 Debug|Win32
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.x64 Debug|x64.ActiveCfg = x64 Debug|x64
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.x64 Debug|x64.Build.0 = x64 Debug|x64
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.x64 Release|Win32.ActiveCfg = x64 Release|Win32
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.x64 Release|x64.ActiveCfg = x64 Release|x64
- {5F9243AE-C6C9-4F42-B670-67A97767A50B}.x64 Release|x64.Build.0 = x64 Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/plugins/!NotAdopted/Skype/Skype_protocol.vcproj b/plugins/!NotAdopted/Skype/Skype_protocol.vcproj deleted file mode 100644 index 74e7e4bac0..0000000000 --- a/plugins/!NotAdopted/Skype/Skype_protocol.vcproj +++ /dev/null @@ -1,2843 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9,00"
- Name="Skype_protocol"
- ProjectGUID="{5F9243AE-C6C9-4F42-B670-67A97767A50B}"
- RootNamespace="Skype_protocol"
- TargetFrameworkVersion="0"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="1"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="_USE_32BIT_TIME_T;WIN32;_DEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS"
- MinimalRebuild="true"
- ExceptionHandling="0"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- DebugInformationFormat="4"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/Skype.pdb"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="3"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS"
- MinimalRebuild="true"
- ExceptionHandling="0"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- DebugInformationFormat="3"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/Skype.pdb"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="1"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- OmitFramePointers="true"
- WholeProgramOptimization="true"
- PreprocessorDefinitions="_USE_32BIT_TIME_T;WIN32;NDEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS"
- StringPooling="true"
- ExceptionHandling="0"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="false"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- ProgramDatabaseFile=""
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="0"
- RandomizedBaseAddress="0"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- EmbedManifest="false"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="3"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- OmitFramePointers="true"
- WholeProgramOptimization="true"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS"
- StringPooling="true"
- ExceptionHandling="0"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="false"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- ProgramDatabaseFile=""
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="0"
- RandomizedBaseAddress="0"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- EmbedManifest="false"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="x64 Debug|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="1"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="_WIN64;_DEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS"
- MinimalRebuild="true"
- ExceptionHandling="0"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile=""
- ProgramDataBaseFileName=""
- WarningLevel="4"
- SuppressStartupBanner="true"
- DebugInformationFormat="4"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/Skype.pdb"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="x64 Debug|x64"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="3"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="_WIN64;_DEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS"
- MinimalRebuild="true"
- ExceptionHandling="0"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- DebugInformationFormat="3"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/Skype.pdb"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="x64 Release|Win32"
- OutputDirectory="$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="1"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- OmitFramePointers="true"
- WholeProgramOptimization="true"
- PreprocessorDefinitions="_WIN64;NDEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS"
- StringPooling="true"
- ExceptionHandling="0"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="false"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- ProgramDatabaseFile=""
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="0"
- RandomizedBaseAddress="0"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- EmbedManifest="false"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="x64 Release|x64"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="3"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- OmitFramePointers="true"
- WholeProgramOptimization="true"
- PreprocessorDefinitions="_WIN64;NDEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS"
- StringPooling="true"
- ExceptionHandling="0"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="false"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- ProgramDatabaseFile=""
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="0"
- RandomizedBaseAddress="0"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- EmbedManifest="false"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="ANSI Debug|Win32"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="1"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="_USE_32BIT_TIME_T;WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;_CRT_SECURE_NO_WARNINGS"
- MinimalRebuild="true"
- ExceptionHandling="0"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- DebugInformationFormat="4"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/Skype.pdb"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="ANSI Debug|x64"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="_DEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="3"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS"
- MinimalRebuild="true"
- ExceptionHandling="0"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- DebugInformationFormat="3"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- GenerateDebugInformation="true"
- ProgramDatabaseFile="$(OutDir)/Skype.pdb"
- RandomizedBaseAddress="1"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="ANSI Release|Win32"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="2"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="1"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- OmitFramePointers="true"
- WholeProgramOptimization="true"
- PreprocessorDefinitions="_USE_32BIT_TIME_T;WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;_CRT_SECURE_NO_WARNINGS"
- StringPooling="true"
- ExceptionHandling="0"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="false"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- ProgramDatabaseFile=""
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="0"
- RandomizedBaseAddress="0"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- EmbedManifest="false"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="ANSI Release|x64"
- OutputDirectory="$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
- UseOfMFC="0"
- ATLMinimizesCRunTimeLibraryUsage="false"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- PreprocessorDefinitions="NDEBUG"
- MkTypLibCompatible="true"
- SuppressStartupBanner="true"
- TargetEnvironment="3"
- TypeLibraryName=""
- HeaderFileName=""
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="1"
- OmitFramePointers="true"
- WholeProgramOptimization="true"
- PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS"
- StringPooling="true"
- ExceptionHandling="0"
- RuntimeLibrary="0"
- EnableFunctionLevelLinking="false"
- RuntimeTypeInfo="false"
- PrecompiledHeaderFile=""
- AssemblerListingLocation=""
- ObjectFile="$(IntDir)\"
- ProgramDataBaseFileName="$(IntDir)\vc90.pdb"
- WarningLevel="4"
- SuppressStartupBanner="true"
- CompileAs="1"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG"
- Culture="0"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="wsock32.lib comctl32.lib"
- OutputFile="$(OutDir)\skype.dll"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- ProgramDatabaseFile=""
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- OptimizeForWindows98="0"
- RandomizedBaseAddress="0"
- DataExecutionPrevention="0"
- ImportLibrary=""
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- EmbedManifest="false"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- SuppressStartupBanner="true"
- OutputFile=""
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Quellcodedateien"
- Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
- >
- <File
- RelativePath="contacts.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="debug.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="gchat.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="memlist.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="msglist.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="pthread.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="skype.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="skypeapi.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="skypeopt.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="skypeprofile.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="skypesvc.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="utf8.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath=".\util.c"
- >
- </File>
- <File
- RelativePath="voiceservice.c"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCCLCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- </Filter>
- <Filter
- Name="Header-Dateien"
- Filter="h;hpp;hxx;hm;inl"
- >
- <File
- RelativePath="contacts.h"
- >
- </File>
- <File
- RelativePath="debug.h"
- >
- </File>
- <File
- RelativePath="gchat.h"
- >
- </File>
- <File
- RelativePath="m_popup.h"
- >
- </File>
- <File
- RelativePath="m_toptoolbar.h"
- >
- </File>
- <File
- RelativePath="memlist.h"
- >
- </File>
- <File
- RelativePath="msglist.h"
- >
- </File>
- <File
- RelativePath="pthread.h"
- >
- </File>
- <File
- RelativePath=".\resource.h"
- >
- </File>
- <File
- RelativePath="skype.h"
- >
- </File>
- <File
- RelativePath="skypeapi.h"
- >
- </File>
- <File
- RelativePath="skypeopt.h"
- >
- </File>
- <File
- RelativePath="skypeprofile.h"
- >
- </File>
- <File
- RelativePath="skypesvc.h"
- >
- </File>
- <File
- RelativePath="utf8.h"
- >
- </File>
- <File
- RelativePath=".\util.h"
- >
- </File>
- <File
- RelativePath="voiceservice.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Ressourcendateien"
- Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
- >
- <File
- RelativePath="res\add.ico"
- >
- </File>
- <File
- RelativePath="res\away.ico"
- >
- </File>
- <File
- RelativePath="bitmap1.bmp"
- >
- </File>
- <File
- RelativePath="res\call.bmp"
- >
- </File>
- <File
- RelativePath="res\call.ico"
- >
- </File>
- <File
- RelativePath="Call.ico"
- >
- </File>
- <File
- RelativePath="res\chat.ico"
- >
- </File>
- <File
- RelativePath="res\DND.ico"
- >
- </File>
- <File
- RelativePath="res\error.ico"
- >
- </File>
- <File
- RelativePath="res\hang_up.ico"
- >
- </File>
- <File
- RelativePath="Hangup.ico"
- >
- </File>
- <File
- RelativePath="res\hold.ico"
- >
- </File>
- <File
- RelativePath="holdcall.ico"
- >
- </File>
- <File
- RelativePath="icon1.ico"
- >
- </File>
- <File
- RelativePath="icon2.ico"
- >
- </File>
- <File
- RelativePath="res\import.ico"
- >
- </File>
- <File
- RelativePath="res\invisible.ico"
- >
- </File>
- <File
- RelativePath="res\Invite.ico"
- >
- </File>
- <File
- RelativePath="res\message.ico"
- >
- </File>
- <File
- RelativePath="res\NA.ico"
- >
- </File>
- <File
- RelativePath="res\occupied.ico"
- >
- </File>
- <File
- RelativePath="res\offline.ico"
- >
- </File>
- <File
- RelativePath="res\online.ico"
- >
- </File>
- <File
- RelativePath="res\phone.ico"
- >
- </File>
- <File
- RelativePath="res\resume.ico"
- >
- </File>
- <File
- RelativePath="resumecall.ico"
- >
- </File>
- <File
- RelativePath="Skript1.rc"
- >
- <FileConfiguration
- Name="Debug|Win32"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Debug|x64"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|Win32"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="Release|x64"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|Win32"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Debug|x64"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|Win32"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="x64 Release|x64"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|Win32"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Debug|x64"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|Win32"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- <FileConfiguration
- Name="ANSI Release|x64"
- >
- <Tool
- Name="VCResourceCompilerTool"
- PreprocessorDefinitions=""
- />
- </FileConfiguration>
- </File>
- <File
- RelativePath="res\skype.ico"
- >
- </File>
- <File
- RelativePath="res\skypeout.ico"
- >
- </File>
- </Filter>
- <File
- RelativePath="changelog.txt"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/plugins/!NotAdopted/Skype/Skype_protocol.vcxproj b/plugins/!NotAdopted/Skype/Skype_protocol.vcxproj deleted file mode 100755 index 68a1673cc3..0000000000 --- a/plugins/!NotAdopted/Skype/Skype_protocol.vcxproj +++ /dev/null @@ -1,1211 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="ANSI Debug|Win32">
- <Configuration>ANSI Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="ANSI Debug|x64">
- <Configuration>ANSI Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="ANSI Release|Win32">
- <Configuration>ANSI Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="ANSI Release|x64">
- <Configuration>ANSI Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="x64 Debug|Win32">
- <Configuration>x64 Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="x64 Debug|x64">
- <Configuration>x64 Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="x64 Release|Win32">
- <Configuration>x64 Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="x64 Release|x64">
- <Configuration>x64 Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{5F9243AE-C6C9-4F42-B670-67A97767A50B}</ProjectGuid>
- <RootNamespace>Skype_protocol</RootNamespace>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>MultiByte</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseOfMfc>false</UseOfMfc>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC60.props" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</EmbedManifest>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</EmbedManifest>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">false</LinkIncremental>
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">false</EmbedManifest>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">$(Platform)\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">false</LinkIncremental>
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">false</EmbedManifest>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">$(Platform)\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">true</LinkIncremental>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">$(Platform)\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">false</LinkIncremental>
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">false</EmbedManifest>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">$(Platform)\$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">false</LinkIncremental>
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">false</EmbedManifest>
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'" />
- <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
- <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'" />
- <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'" />
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <Midl>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>Win32</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_USE_32BIT_TIME_T;WIN32;_DEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <ExceptionHandling>
- </ExceptionHandling>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <CompileAs>CompileAsC</CompileAs>
- <AdditionalIncludeDirectories>X:\install\git\miranda\miranda_ng_svn\plugins\ExternalAPI;X:\install\git\miranda\miranda_ng_svn\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;mir_core.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ProgramDatabaseFile>$(OutDir)Skype.pdb</ProgramDatabaseFile>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX86</TargetMachine>
- <AdditionalLibraryDirectories>X:\install\git\miranda\miranda_ng_svn\bin10\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Midl>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>X64</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <ExceptionHandling>
- </ExceptionHandling>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <CompileAs>CompileAsC</CompileAs>
- <AdditionalIncludeDirectories>X:\install\git\miranda\miranda_ng_svn\include;X:\install\git\miranda\miranda_ng_svn\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;mir_core64.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>X:\install\git\miranda\miranda_ng_svn\bin10\Debug64\Plugins\skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ProgramDatabaseFile>$(OutDir)Skype.pdb</ProgramDatabaseFile>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX64</TargetMachine>
- <AdditionalLibraryDirectories>X:\install\git\miranda\miranda_ng_svn\bin10\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <Midl>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>Win32</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- <OmitFramePointers>true</OmitFramePointers>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <PreprocessorDefinitions>_USE_32BIT_TIME_T;WIN32;NDEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <ExceptionHandling>
- </ExceptionHandling>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <FunctionLevelLinking>false</FunctionLevelLinking>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <CompileAs>CompileAsC</CompileAs>
- <AdditionalIncludeDirectories>X:\install\git\miranda\miranda_ng_svn\include;X:\install\git\miranda\miranda_ng_svn\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <ProgramDatabaseFile>
- </ProgramDatabaseFile>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <RandomizedBaseAddress>
- </RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX86</TargetMachine>
- <AdditionalLibraryDirectories>X:\install\git\miranda\miranda_ng_svn\bin10\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Midl>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>X64</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- <OmitFramePointers>true</OmitFramePointers>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <ExceptionHandling>
- </ExceptionHandling>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <FunctionLevelLinking>false</FunctionLevelLinking>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <CompileAs>CompileAsC</CompileAs>
- <AdditionalIncludeDirectories>X:\install\git\miranda\miranda_ng_svn\include;X:\install\git\miranda\miranda_ng_svn\plugins\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;mir_core64.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <ProgramDatabaseFile>
- </ProgramDatabaseFile>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <RandomizedBaseAddress>
- </RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX64</TargetMachine>
- <AdditionalLibraryDirectories>X:\install\git\miranda\miranda_ng_svn\bin10\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">
- <Midl>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>Win32</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_WIN64;_DEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <ExceptionHandling>
- </ExceptionHandling>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>
- </ObjectFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <CompileAs>CompileAsC</CompileAs>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ProgramDatabaseFile>$(OutDir)Skype.pdb</ProgramDatabaseFile>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">
- <Midl>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>X64</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_WIN64;_DEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <ExceptionHandling>
- </ExceptionHandling>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <CompileAs>CompileAsC</CompileAs>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ProgramDatabaseFile>$(OutDir)Skype.pdb</ProgramDatabaseFile>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX64</TargetMachine>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">
- <Midl>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>Win32</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- <OmitFramePointers>true</OmitFramePointers>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <PreprocessorDefinitions>_WIN64;NDEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <ExceptionHandling>
- </ExceptionHandling>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <FunctionLevelLinking>false</FunctionLevelLinking>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <CompileAs>CompileAsC</CompileAs>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <ProgramDatabaseFile>
- </ProgramDatabaseFile>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <RandomizedBaseAddress>
- </RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">
- <Midl>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>X64</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- <OmitFramePointers>true</OmitFramePointers>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <PreprocessorDefinitions>_WIN64;NDEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <ExceptionHandling>
- </ExceptionHandling>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <FunctionLevelLinking>false</FunctionLevelLinking>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <CompileAs>CompileAsC</CompileAs>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <ProgramDatabaseFile>
- </ProgramDatabaseFile>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <RandomizedBaseAddress>
- </RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX64</TargetMachine>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">
- <Midl>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>Win32</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>_USE_32BIT_TIME_T;WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <ExceptionHandling>
- </ExceptionHandling>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <CompileAs>CompileAsC</CompileAs>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ProgramDatabaseFile>$(OutDir)Skype.pdb</ProgramDatabaseFile>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">
- <Midl>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>X64</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>true</MinimalRebuild>
- <ExceptionHandling>
- </ExceptionHandling>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <CompileAs>CompileAsC</CompileAs>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <ProgramDatabaseFile>$(OutDir)Skype.pdb</ProgramDatabaseFile>
- <RandomizedBaseAddress>false</RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX64</TargetMachine>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">
- <Midl>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>Win32</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- <OmitFramePointers>true</OmitFramePointers>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <PreprocessorDefinitions>_USE_32BIT_TIME_T;WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <ExceptionHandling>
- </ExceptionHandling>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <FunctionLevelLinking>false</FunctionLevelLinking>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <CompileAs>CompileAsC</CompileAs>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <ProgramDatabaseFile>
- </ProgramDatabaseFile>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <RandomizedBaseAddress>
- </RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">
- <Midl>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MkTypLibCompatible>true</MkTypLibCompatible>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <TargetEnvironment>X64</TargetEnvironment>
- <TypeLibraryName>
- </TypeLibraryName>
- <HeaderFileName>
- </HeaderFileName>
- </Midl>
- <ClCompile>
- <Optimization>Full</Optimization>
- <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- <OmitFramePointers>true</OmitFramePointers>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;SKYPE_PROTOCOL_EXPORTS;UNICODE;_UNICODE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <StringPooling>true</StringPooling>
- <ExceptionHandling>
- </ExceptionHandling>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <FunctionLevelLinking>false</FunctionLevelLinking>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeaderOutputFile>
- </PrecompiledHeaderOutputFile>
- <AssemblerListingLocation>
- </AssemblerListingLocation>
- <ObjectFileName>$(IntDir)</ObjectFileName>
- <ProgramDataBaseFileName>$(IntDir)vc90.pdb</ProgramDataBaseFileName>
- <WarningLevel>Level4</WarningLevel>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <CompileAs>CompileAsC</CompileAs>
- </ClCompile>
- <ResourceCompile>
- <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <Culture>0x0000</Culture>
- </ResourceCompile>
- <Link>
- <AdditionalDependencies>wsock32.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <OutputFile>$(OutDir)skype.dll</OutputFile>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <ProgramDatabaseFile>
- </ProgramDatabaseFile>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <RandomizedBaseAddress>
- </RandomizedBaseAddress>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>
- </ImportLibrary>
- <TargetMachine>MachineX64</TargetMachine>
- </Link>
- <Bscmake>
- <SuppressStartupBanner>true</SuppressStartupBanner>
- <OutputFile>
- </OutputFile>
- </Bscmake>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="alogon.c" />
- <ClCompile Include="contacts.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="debug.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="gchat.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="memlist.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="msglist.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="msgq.c" />
- <ClCompile Include="pthread.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="skype.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="skypeapi.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="skypeopt.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="skypeprofile.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="skypesvc.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="utf8.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <ClCompile Include="util.c" />
- <ClCompile Include="voiceservice.c">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="contacts.h" />
- <ClInclude Include="debug.h" />
- <ClInclude Include="gchat.h" />
- <ClInclude Include="m_popup.h" />
- <ClInclude Include="m_toptoolbar.h" />
- <ClInclude Include="memlist.h" />
- <ClInclude Include="msglist.h" />
- <ClInclude Include="pthread.h" />
- <ClInclude Include="resource.h" />
- <ClInclude Include="skype.h" />
- <ClInclude Include="skypeapi.h" />
- <ClInclude Include="skypeopt.h" />
- <ClInclude Include="skypeprofile.h" />
- <ClInclude Include="skypesvc.h" />
- <ClInclude Include="utf8.h" />
- <ClInclude Include="util.h" />
- <ClInclude Include="voiceservice.h" />
- </ItemGroup>
- <ItemGroup>
- <None Include="res\add.ico" />
- <None Include="res\away.ico" />
- <None Include="bitmap1.bmp" />
- <None Include="res\call.bmp" />
- <None Include="res\call.ico" />
- <None Include="Call.ico" />
- <None Include="res\chat.ico" />
- <None Include="res\DND.ico" />
- <None Include="res\error.ico" />
- <None Include="res\hang_up.ico" />
- <None Include="Hangup.ico" />
- <None Include="res\hold.ico" />
- <None Include="holdcall.ico" />
- <None Include="icon1.ico" />
- <None Include="icon2.ico" />
- <None Include="res\import.ico" />
- <None Include="res\invisible.ico" />
- <None Include="res\Invite.ico" />
- <None Include="res\message.ico" />
- <None Include="res\NA.ico" />
- <None Include="res\occupied.ico" />
- <None Include="res\offline.ico" />
- <None Include="res\online.ico" />
- <None Include="res\phone.ico" />
- <None Include="res\resume.ico" />
- <None Include="resumecall.ico" />
- <None Include="res\skype.ico" />
- <None Include="res\skypeout.ico" />
- <None Include="changelog.txt" />
- </ItemGroup>
- <ItemGroup>
- <ResourceCompile Include="Skript1.rc">
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='ANSI Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='x64 Release|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ResourceCompile>
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project>
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/alogon.c b/plugins/!NotAdopted/Skype/alogon.c deleted file mode 100644 index 90c3510944..0000000000 --- a/plugins/!NotAdopted/Skype/alogon.c +++ /dev/null @@ -1,129 +0,0 @@ -#include "skype.h"
-#include "debug.h"
-
-extern char g_szProtoName[];
-extern HANDLE SkypeReady;
-
-/**
- * Purpose: Retrieves class name from window
- *
- * Note: This is some sort of hack to return static local variable,
- * but it works :)
- */
-static const TCHAR* getClassName(HWND wnd)
-{
- static TCHAR className[256];
-
- *className=0;
- GetClassName(wnd, &className[0], sizeof(className)/sizeof(className[0]));
- return className;
-}
-
-/**
- * Purpose: Finds a window
- *
- * Note: This function relies on Skype window placement.
- * It should work for Skype 3.x
- */
-static HWND findWindow(HWND parent, const TCHAR* childClassName)
-{
- // Get child window
- // This window is not combo box or edit box
- HWND wnd = GetWindow(parent, GW_CHILD);
- while(wnd != NULL && _tcscmp(getClassName(wnd), childClassName) != 0)
- wnd = GetWindow(wnd, GW_HWNDNEXT);
-
- return wnd;
-}
-
-static BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
-{
- DWORD dwPID;
- const TCHAR *lpszClassName;
-
-
- GetWindowThreadProcessId(hWnd,&dwPID);
- if (lParam != 0 && dwPID != (DWORD)lParam) return TRUE;
- lpszClassName = getClassName(hWnd);
- if(_tcscmp(lpszClassName, _T("tSkMainForm.UnicodeClass")) == 0 ||
- _tcscmp(lpszClassName, _T("TLoginForm.UnicodeClass")) == 0)
- {
- HWND loginControl = GetWindow(hWnd, GW_CHILD);
-
- LOG(("setUserNamePasswordThread: Skype window found!"));
-
- // Sleep for some time, while Skype is loading
- // It loads slowly :(
- //Sleep(5000);
- LOG (("TLoginControl = %S", getClassName(loginControl)));
-
- // Check for login control
- if(_tcscmp(getClassName(loginControl), _T("TLoginControl")) == 0)
- {
- // Find user name window
- HWND userName = findWindow(loginControl, _T("TNavigableTntComboBox.UnicodeClass"));
- HWND password = findWindow(loginControl, _T("TNavigableTntEdit.UnicodeClass"));
-
- LOG (("userName=%08X; password=%08X", userName, password));
- if (userName && password)
- {
- // Set user name and password
- DBVARIANT dbv;
-
- if(!DBGetContactSettingWString(NULL,SKYPE_PROTONAME,"LoginUserName",&dbv))
- {
- SendMessageW(userName, WM_SETTEXT, 0, (LPARAM)dbv.pwszVal);
- DBFreeVariant(&dbv);
- }
-
- if(!DBGetContactSettingWString(NULL,SKYPE_PROTONAME,"LoginPassword",&dbv))
- {
- SendMessageW(password, WM_SETTEXT, 0, (LPARAM)dbv.pwszVal);
- DBFreeVariant(&dbv);
- SendMessageW(password, WM_CHAR, 13, 0);
- }
-
-
- SendMessageW(hWnd,
- WM_COMMAND,
- 0x4a8, // sign-in button; WARNING: This ID can change during newer Skype versions
- (LPARAM)findWindow(loginControl, _T("TTntButton.UnicodeClass")));
- }
- return FALSE;
- }
-
- }
- return TRUE;
-}
-
-DWORD WINAPI setUserNamePasswordThread(LPVOID lpDummy)
-{
- DWORD dwPid = (DWORD)lpDummy;
- HANDLE mutex = CreateMutex(NULL, TRUE, _T("setUserNamePasswordMutex"));
-
- // Check double entrance
- if(GetLastError() == ERROR_ALREADY_EXISTS)
- return 0;
-
- WaitForSingleObject(SkypeReady, 5000);
- EnumWindows (EnumWindowsProc, dwPid);
-
- ReleaseMutex(mutex);
- CloseHandle(mutex);
- return 0;
-}
-
-/**
- * Purpose: Finds Skype window and sets user name and password.
- *
- * Note: This function relies on Skype window placement.
- * It should work for Skype 3.x
- */
-void setUserNamePassword(int dwPid)
-{
- DWORD threadId;
- CreateThread(NULL, 0, &setUserNamePasswordThread, (LPVOID)dwPid, 0, &threadId);
-
- // Give time to thread
- Sleep(100);
-}
diff --git a/plugins/!NotAdopted/Skype/alogon.h b/plugins/!NotAdopted/Skype/alogon.h deleted file mode 100644 index 00d2e7e703..0000000000 --- a/plugins/!NotAdopted/Skype/alogon.h +++ /dev/null @@ -1 +0,0 @@ -void setUserNamePassword(int dwPid);
diff --git a/plugins/!NotAdopted/Skype/changelog.txt b/plugins/!NotAdopted/Skype/changelog.txt deleted file mode 100644 index 60526b1116..0000000000 --- a/plugins/!NotAdopted/Skype/changelog.txt +++ /dev/null @@ -1,330 +0,0 @@ -NOTES
------
-
- You have to manually disable popup of messages in SKYPE, as there is
- currently no function in the API to do this
- Got to File/Options/Instant messages and disable the checkboxes there
-
-
-CODE
-----
- Currently a real mess. At least I splitted it up a bit now.
- But hey, it kinda works... ;)
-
-HISTORY
--------
-
-0.0.0.45 - ! "NA" and "Free for chat" status are available again; NA is supported by skype and Free for chat
- uses skypes "Skype Me" status; better leave it that way
- ! changes to the mood message of a contact were only visible after a status change
- ! plugin was crashing when status changed to offline and a proxy is used
-
-0.0.0.44 - ! menu item "Hang up (Skype)" was show on none skype contacts
- ! fixed serveral bugs in skype startup (including starting skype twice)
- ! show connecting state correctly
- ! hangup while ringing caused a state where contact isnt callable anymore
- * removed "NA" and "Free for chat" status
-
-0.0.0.43 - + Added option to suppress summary chat message after call is finished (jls17)
- ! Fix hangup causes a dial command if opponent hangs up a little bit earlier (jls17)
- ! removed empty chat message on incoming call
- ! empty mood message is send to skype correctly
-
-
-0.0.0.42 - + Added a trick to identify skype 3 version (fingerprint)
-0.0.0.41 - + Added option to enter user name and password. (Patch by NN)
-
-0.0.0.40 - + Support for new core service: get avatar caps
- + Option to show/hide default avatar for contacts
- + Hide Skype Avatar page in user details if >= #27
-
-0.0.0.39 - + Voice service support in normall calls - no support for SkypeOut yet (pescuma)
- ! Made options dialog a little bit smaller, removed frame and set bold frame for popups (pescuma)
- + Add more status to manage for away message
-
-0.0.0.38 - ! Fix the load for pre 0.7.0 #17 build
- * Patch by pescuma for avatar.
-
-0.0.0.37 - ! Avoid empty message from myself on first message received.
- + Add the Get user avatar interface
- * Change the get user info thread
- * code cleanup
- + Support for miranda 0.8
- ! Correct use of folder plugin (using "avatar cache folder"\SKYPE).
-
-0.0.0.36 - ! When settings skype offline, first set proto off then contacts.
- * move the broadcast of status change out of if statement in status change.
- * Set contacts ofline on plugin load (avoid skype contact to be online if starts skype is not checked)
- ! Fix the use of datapath for portable skype
- * Allow to choose no splash - no tray - minimized even if start skype with miranda is not checked.
- ! Fix bug with timestamp in irc
-
-0.0.0.35 - * Use unicode nick, status message, city and country in skype profile.
- ! Fix for sending status change when offline
- * Do not send message to skype if not attached (avoid trying to connect to api at startup)
- ! Fix crash on recieving message with groupchat checked.
-
-0.0.0.34 - + Try to identify if chat message comes from a group chat or not
- + Add a option to flag group chat message as read if not using chat.dll for group chat.
- ! Fix the check of message type (group chat or normal)
-
-0.0.0.33 - ! Fix for flags of event and metacontact (thanks SJE)
- * Next step to custom popup support (in popup option page)
- ! Fix infinite for error popup
-
-0.0.0.32 - ! Improvemnt of the Action message support.
- ! Fix empty message on first chat with a contact.
-
-0.0.0.31 - + First step to Action Message support ( /me )
- + Updater support for File Listing.
- + First step to a custom popup for call notification.
-
-0.0.0.30 - + Add an option to enable/disable the timezone patch
-
-0.0.0.29 - ! Try to fix the bug (set skype offline when closing miranda)
-
-0.0.0.28 - * Improved portable skype integration
-
-0.0.0.27 - * Try to fix the start using custom command line
- + Close skype using custom command line too
-
-0.0.0.26 - + Add a way to use a custom command line to start skype.
-
-0.0.0.25 - ! patch from markcs about timezones.
- ! shutdown patch by sje
-
-0.0.0.24 - * Change options dialog (use tabsrmm uxtheme)
-
-0.0.0.23 - ! Wrong db entry name for cellular (cellucar)
- + Set mirver using is video capabale to identify skype 2.0 user
-
-0.0.0.22 - * Options page redesigned
- * Work around to force refresh of avatar in MyDetail (w8 the avatar change service)
- * Change Skype protocol to Skype in options->Network
- * Free buffer in status message retrieve
- * First step to a details info page.
-
-0.0.0.21 - * Some minor bugfixes
- * Severe bugfix: Message sending routine worked incorrectly (no errors were shown
- even if there were sending-errors)
- * Removed PingPong - thread in favour of WM_TIMER
- * Fixed critical section unlocking in skypeapi.c. In certain cases, critical sections
- were not left correctly.
- * Fixed a bug that caused Miranda to crash on exit with Newstatusnotify plugin
- (thanks to TioDuke for reporting)
- * Hopefully fixed the nasty bug that caused Miranda to lockup on exit.
-
-0.0.0.20 - * Split service and options in two new cpp file.
- * Put the default attemps number to 10
-
-0.0.0.19 - * Add avatar support for own user only (no api to ge contacts avatar)
- * Add set status message.
- * Add Get status message for contact where viewing contact details
- * Change icons (thanks to Faith Healer)
- * Updater support (BETA ONLY)
- * DBeEditor known module support
- * Mods to avoid warning in VC++ 8
- * Implement the MyDetail requested services
-
-0.0.0.18 - * HOTFIX - Double File-Transfer icon removed. Please note that you can't send files
- via drag & drop, because of the nature of Skype API - Skype wants to open its own
- "File/Open" dialog, so I cannot supply a path to the file to be sent, therefore I
- had to add a seperate File-sending function rather than using Miranda's function.
-
-0.0.0.17 - * Startup of Skype in a seperate thread was not solved properly. Now it should really
- start in background
- * The hack for the statusmode-bug is optional in the settings and is turned off
- per default. (Thx to Eddie Hung for reporting problems and help)
- * Added an ugly hack for the Skype-API offline bug (grr.. )
- * Nickname is now set correctly. To cleanup the existing Nicks, please go to
- the options page an push the "Cleanup Nicknames" button.
- This will clean out entries where the Nick was set to the Skype handle
- * Fixed a bug in the message sending routine that caused errors in communication
- (missed messages in Skype that were not fetched..)
- * Added "Hold call" feature while calling
- * Added support for conference calls (if a second user is calling while you
- are in a conversation, you can now choose whether to block the call or let
- the user join you in a conference with the existing caller or to put the
- other caller on hold)
- * Fixed a bug in the code for adding users that were just searched via the
- Skype search-window but never have been in contact list.
- * Fixed some bugs (memleak, nick error, ..) in the Search-Routine for
- Skype-contacts. (thx to Deadman for reporting)
- * Fixed a bug with unknown SKYPE_IN contacts
- * Added file-sending capability (requires new Skype-version)
- * Did a litte code-cleanup
- * Adding / Removing contacts can now be done via the Miranda standard-dialogs if
- you use the newest Skype-Version
- * With the new Skype-version you are able to handle Authorisation-Requests via Miranda
- now.
-
-0.0.0.16 - * Fixed a severe memory-allocation bug in utf8-encoded messages that caused random
- crashes (oops :-O) - Thanks to Ary Dvoretz for reporting.
- * Bug in SkypeStatusMode-Bug fix from last release fixed (protocol stayed offline)
- * Now onlinestatus for SkypeOut-Contacts is configurable
- * Made Menu-Options translatable
- * Added support for calling SkypeOut-Phonenumbers. You can now dial a PSTN-Number
- by calling "Do a SkypeOut call" in the main menu (or top toolbar if the
- toptoolbar plugin is installed) and entering a number or
- by right-clicking on a non-Skype contact and selecting "Call using SkypeOut",
- if there is a phone-Number entry in the User's-Details.
- This, of course, is only working if you have SkypeOut privilege
-
-0.0.0.15 - * Fixed a crash on Miranda-exit when error occured on Skype-Protocol start
- * Fixed Bug #0000006: Now user is asked if he wants to enable the Protocol
- for the current profile, if he starts with a new profile.
- * Fixed Bug #0000002: Now interfacing with Skype is really stopped on going
- offline if the option is enabled. (PingPong-thread killed)
- - This also applies on closing Skype
- * Fixed a memory leak in MsgFetchThread that appeared in the last version because
- of the groupchat-implementation (free() within wrong if clause, ooops ;)
- * Fixed Bug #0000005: When there is a msg from a user that is not on Skype's contact
- list, the user is now added PALF_TEMPORARY and disappears again on next Miranda-start
- * Implemented a fix for Skype API's statusmode bug reported by Markus Mützel:
- If you change the online status while Skype is still connecting, Skype changes to
- the FIRST state that it was requested to change to, after going online, instead of
- the LAST state. However the bug was not reproducable for me.
- * Fixed broken popup-support (I hope)
- * CHANGE of behaviour (inspired by Bug #0000007):
- If you turn off "Start Skype with Miranda", the plugin wouldn't search for a
- running Skype instance anymore.
- * Now when going online and Skype is not launched, Skype will be launched via a
- seperate thread (in background) so that Miranda isn't blocked while Skype is loading
- * Options Dlg. should now be translateable too.
-
-0.0.0.14 -
- * Miranda crash on exit if Skype was not found installed should be
- fixed by now.
- * Implemented compatibility layer for Skype API Protocol V3 and above.
- * Removed some useless code introduced in 0.0.0.12
- * Added some fixes made by TioDuke (thank you!)
- - Using your own Nick instead of your Skype-Handle in conversations
- - LastName 3rd token & above are not ignored any more
- - Status modes "On the phone" and "out to lunch" are mapped now
- * Fixed a bug that caused "Skype API not available" messages under high load.
- (thanks to Romeo28 for testing!)
- * Fixed a bug that caused Message sending thread to wait forever if sending
- a message times out (causing dead threads)
- * Skype contact list should be synced now when Skype-Status changes.
- (thx to Markus Mützel for Bugreport)
- * Implemented a garbage collector that removes old messages from queue
- in order to prevent possible memory exhaustion
- * Added option to disable all modal Error-message dialog boxes (as people
- keep telling me that they are annoyed by them)
- * Added langpack support for error messages
- * Added option to increase the time the protocol is waiting for Skype
- * Added groupchat functions. WARNING: For testing purposes only!
- Currently there is a memleak which I cannot find, but even worse,
- Skype API doesn't seem to support sending to a groupchat, inviting etc.
- So this is currently only experimental! When you send to a groupchat you
- currently send single messages to every user seperately. Skype staff
- didn't answer my question about sending to groupchats so far, so it
- depends on them when this feature will be available for real use.
-
-0.0.0.13 - A few minor fixes:
- * Logging off users shouldn't flood the StatusNotify-Plugin now.
- * Popup-plugin can be enabled/disabled in the options dlg.
- * Implemented support for SkypeOut contacts (they caused crashes)
- * Now using Nick instead of Skype-Handle as Contact list name on
- adding new users, if it is available.
-
-0.0.0.12 - Bugfixing because of strange Skype API behaviour:
- * Adding of contacts that are just searched, but not added in Skype
- should be prevented now.
- * Version number correct again.
-
-0.0.0.11 - Only minor bugfixes:
- * The gender in user-details is now saved correctly to the DB
- (thanks to LeON for the hint!)
- * The Apply-Button should now be disabled in the options DLG by default
- (thanks to sje for the bug report)
- * Contactlist should be reinitialized after a SYNC-Problem now.
- * Bug with usernames that contain commas should be fixed
- * Protocol messages are now shown as popups if Popup-plugin is installed
-
-0.0.0.10 - * Hopefully recovery after sync problem works a bit better now
- (Sync-Problem Messages are no longer shown)
- * Now you can hang up a call directly from a contact's context menu
- * Now implemented support for using Skype over a network. You can use
- the included skypeproxy service to in/output Skype API messages
- on a socket and can connect to it with the plugin.
- So you can, for example, launch the skypeproxy service on your
- Windows-server (eeek! :P) and control Skype from your workstation
- using Miranda. (requested feature by foosmate)
- * Now you can accept incoming calls via Miranda (or hang them up)
- * The status mode bug (clist status menu was not updated properly)
- should be fixed by now.
- * The logfile in the dbeug-build should now always be written to the
- Miranda directory.
-
-0.0.0.9 - * Fixed bug with error when starting Skype with Miranda ("Wheee...")
- * As Skype seems to use new, UNDOCUMENTED Message types (I think it's
- a severe Skype-API bug) I adapted the plugin so that it works
- with new API now. This fixes the problem of not being able to receive
- messages in new Skype versions.
- Skype now sends "MESSAGE TYPE SAID" instead of "MESSAGE TYPE TEXT",
- the bug has been reported to Skype forum.
- (http://forum.skype.com/viewtopic.php?t=15435)
- * Fixed a memory leak in Message-receiving routine
- * Added UTF8-support for Contact properties (does this fix something?)
- * Fixed a memory leak in Startup-routine
- * Finally renamed Plugin from SKYPE_PROTOCOL to SKYPE internally.
- Hopefully it will upgrade your existing DB seamlessly.
- * Now all threads should be sync with Miranda as I'm using the pthread-
- functions "borrowed" from Yahoo protocol.
-
-0.0.0.8 - * Now there is support for the "Occupied" mode, which is mapped to DND
- This is useful for users who do a global statusmodechange so that Skype
- gets to "Occupied" state instead of staying online.
- * Now the protocol doesn't disable itself when you chose to not start
- Skype on startup, instead it stays offline and starts Skype when you
- try to go online.
-
-0.0.0.7 - * Fixed a bug that caused a lockup on Plugin startup (when a Window was not
- reacting to the HWND_BROADCAST) (thx to Cool Blue)
- * Fixed a bug in the Startup-procedure..
- * Now Skype doesn't go offline when you close Miranda (thx to Egodust)
- * Now it should really work unter WIN98 (thx to TioDuke for testing)
- * Implemented feature for Shutting down Skype on going offline and
- restarting Skype on changing to online mode again, as many people requested.
-
-0.0.0.6 - * Added feature requests from kreisquadratur:
- * Option to disable Skype-Menuitems
- * Fixed bug with Apply-Button
- * Using a nicer Skype-Icon now
- * Now using Skype-Timestamp for messages
- * Implementing importing history from skype (see contextmenu of contact)
- * Fixed bug with processing first message of MESSAGES - List
- * Found out, that RegisterClass() doesn't work for UNICODE-Programs on
- non-UNICODE win98, therefore return-value check for RegisterClass removed
- * Fixed a bug that caused a "We got a Sync problem :("
-
-0.0.0.5 - * Fixed a bug that caused the plugin to crash with bigger contact lists
- (Skype API was flooded on startup)
-
-0.0.0.4 - * Missed messages are fetched now
- * User details work now
- * More verbose error msgs now (to help Win98 user debugging his problem)
- * Added option for starting skype with miranda and shutting down
- Skype when closing miranda.
- * You can now chose the command line options to pass to Skype on startup
- * Hopefully the bug with multiple Call - Entries per user is fixed now
- * Protocol name is now "Skype", not "Skype_protocol" - Remember this
- when updating, so DELETE skype_protocol.dll first!!
- * Secured Message Queue with a Mutex
- * Fixed a Message-receiving bug that could cause delays in message-processing
- * Adding a Contact in Skype now also adds it to Miranda immediately
- (Deleting should also work, but doesn't because of a Skype API bug)
- * Added searching for contacts, but this feature seems to be quite useless,
- as Skype API doesn't support adding contacts, so you still have to add
- your contacts in the Skype program, sorry
- In order to do this comfortably, I added a Miranda Menu-Item for adding
- Skype-contacts.
-
-0.0.0.3 - * I hope it's thread-safe now
- * Changing the Online-Status should work correctly now
- * Fixed "We got a sync problem :(" bug - big thx to Azzie
- * Now starts Skype more in the background as proposed by Kreisquadratur
- * Implemented PING-PONG with Skype to detect if Connection to Skype API
- was lost
- * Launching of Skype by Miranda improved
diff --git a/plugins/!NotAdopted/Skype/contacts.c b/plugins/!NotAdopted/Skype/contacts.c deleted file mode 100755 index bdd6571cc4..0000000000 --- a/plugins/!NotAdopted/Skype/contacts.c +++ /dev/null @@ -1,419 +0,0 @@ -/*
- * Contactlist management functions
- */
-
-#include "skype.h"
-#include "skypeapi.h"
-#include "debug.h"
-#include "pthread.h"
-#include "gchat.h"
-#include "voiceservice.h"
-
-#pragma warning (push)
-#pragma warning (disable: 4100) // unreferenced formal parameter
-#include "../../include/m_langpack.h"
-#pragma warning (pop)
-
-#pragma warning (disable: 4706) // assignment within conditional expression
-
-// Imported Globals
-extern HINSTANCE hInst;
-extern BOOL bSkypeOut, bIsImoproxy;
-extern char protocol, g_szProtoName[];
-
-// Handles
-static HANDLE hMenuCallItem, hMenuCallHangup, hMenuSkypeOutCallItem, hMenuHoldCallItem, hMenuFileTransferItem, hMenuChatInitItem;
-
-// Check if alpha blending icons are supported
-// Seems to be not neccessary
-/*
-BOOL SupportAlphaIcons(void) {
- HANDLE hMod;
- DLLVERSIONINFO tDVI={0};
- BOOL retval=FALSE;
- FARPROC pDllGetVersion;
-
- if (!(hMod=LoadLibrary("comctl32.dll"))) return FALSE;
- if (pDllGetVersion=GetProcAddress(hMod, "DllGetVersion")) {
- tDVI.cbSize=sizeof(tDVI);
- if (!pDllGetVersion ((DLLVERSIONINFO *)&tDVI)) {
- if (GetDeviceCaps(GetDC(NULL), BITSPIXEL)*GetDeviceCaps(GetDC(NULL), PLANES)>=32 &&
- tDVI.dwMajorVersion>=6)
- retval=TRUE;
- }
- }
- FreeLibrary(hMod);
- return retval;
-}
-*/
-
-CLISTMENUITEM CallItem(void) {
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.position=-2000005000;
- mi.flags=CMIF_NOTOFFLINE|CMIF_TCHAR;
- mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALL));
- mi.pszContactOwner=SKYPE_PROTONAME;
- mi.ptszName=LPGENT("Call (Skype)");
- mi.pszService=SKYPE_CALL;
-
- return mi;
-}
-
-CLISTMENUITEM SkypeOutCallItem(void) {
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.position=-2000005000;
- mi.flags=CMIF_HIDDEN|CMIF_TCHAR;
- mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALLSKYPEOUT));
- mi.ptszName=LPGENT("Call using SkypeOut");
- mi.pszService=SKYPEOUT_CALL;
-
- return mi;
-}
-
-CLISTMENUITEM HupItem(void) {
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.position=-2000005000;
- mi.flags=CMIF_NOTOFFLINE|CMIF_TCHAR;
- mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_HANGUP));
- mi.pszContactOwner=SKYPE_PROTONAME;
- mi.ptszName=LPGENT("Hang up call (Skype)");
- mi.pszService=SKYPE_CALLHANGUP;
-
- return mi;
-}
-
-CLISTMENUITEM SkypeOutHupItem(void) {
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.position=-2000005000;
- mi.flags=CMIF_TCHAR;
- mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_HANGUP));
- mi.ptszName=LPGENT("Hang up SkypeOut call");
- mi.pszService=SKYPEOUT_CALL;
- return mi;
-}
-
-CLISTMENUITEM HoldCallItem(void) {
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.position=-2000005000;
- mi.flags=CMIF_HIDDEN|CMIF_NOTOFFLINE|CMIF_TCHAR;
- mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_HOLD));
- mi.ptszName=LPGENT("Hold call");
- mi.pszService=SKYPE_HOLDCALL;
- return mi;
-}
-
-CLISTMENUITEM ResumeCallItem(void) {
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.position=-2000005000;
- mi.flags=CMIF_HIDDEN|CMIF_NOTOFFLINE|CMIF_TCHAR;
- mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_RESUME));
- mi.ptszName=LPGENT("Resume call");
- mi.pszService=SKYPE_HOLDCALL;
- return mi;
-}
-
-CLISTMENUITEM FileTransferItem(void) {
- CLISTMENUITEM mi={0};
-
- // Stolen from file.c of Miranda core
- mi.cbSize=sizeof(mi);
- mi.position=-2000020000;
- mi.flags=CMIF_HIDDEN|CMIF_NOTOFFLINE|CMIF_TCHAR;
- mi.hIcon=LoadSkinnedIcon(SKINICON_EVENT_FILE);
- mi.ptszName=LPGENT("&File");
- mi.pszContactOwner=SKYPE_PROTONAME;
- mi.pszService=SKYPE_SENDFILE;
- return mi;
-}
-
-CLISTMENUITEM ChatInitItem(void) {
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.position=-2000020000;
- mi.flags=CMIF_HIDDEN|CMIF_NOTOFFLINE|CMIF_TCHAR;
- mi.hIcon=LoadIcon( hInst, MAKEINTRESOURCE( IDI_INVITE ));
- mi.ptszName=LPGENT("&Open groupchat");
- mi.pszContactOwner=SKYPE_PROTONAME;
- mi.pszService=SKYPE_CHATNEW;
- return mi;
-}
-
-HANDLE add_contextmenu(HANDLE hContact) {
- CLISTMENUITEM mi;
-
- UNREFERENCED_PARAMETER(hContact);
-
- if (!HasVoiceService()) {
- mi=CallItem();
- hMenuCallItem=Menu_AddContactMenuItem(&mi);
-
- mi=HupItem();
- hMenuCallHangup=Menu_AddContactMenuItem(&mi);
- }
-
- mi=SkypeOutCallItem();
- hMenuSkypeOutCallItem=Menu_AddContactMenuItem(&mi);
-
- if (!HasVoiceService()) {
- mi=HoldCallItem();
- hMenuHoldCallItem=Menu_AddContactMenuItem(&mi);
- }
-
- // We cannot use flag PF1_FILESEND for sending files, as Skype opens its own
- // sendfile-Dialog.
- mi=FileTransferItem();
- hMenuFileTransferItem=Menu_AddContactMenuItem(&mi);
-
- mi=ChatInitItem();
- hMenuChatInitItem=Menu_AddContactMenuItem(&mi);
-
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=-2000005000;
- mi.flags=CMIF_TCHAR;
- mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_IMPORT));
- mi.pszContactOwner=SKYPE_PROTONAME;
- mi.ptszName=LPGENT("Import Skype history");
- mi.pszService=SKYPE_IMPORTHISTORY;
- return Menu_AddContactMenuItem(&mi);
-}
-
-HANDLE add_mainmenu(void) {
- CLISTMENUITEM mi={0};
-
- mi.cbSize=sizeof(mi);
- mi.position=-2000005000;
- mi.flags=CMIF_TCHAR;
- mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_ADD));
- mi.pszContactOwner=SKYPE_PROTONAME;
- mi.ptszName=LPGENT("Add Skype contact");
- mi.pszService=SKYPE_ADDUSER;
- return Menu_AddMainMenuItem(&mi);
-}
-
-int __cdecl PrebuildContactMenu(WPARAM wParam, LPARAM lParam) {
- DBVARIANT dbv;
- CLISTMENUITEM mi;
- char *szProto;
- BOOL callAvailable = FALSE;
- BOOL hangupAvailable = FALSE;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (!(szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0))) return 0;
-
- if (!HasVoiceService()) {
- // Clear hold-Item in case it exists
- mi=HoldCallItem();
- mi.flags|=CMIM_ALL;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuHoldCallItem,(LPARAM)&mi);
- }
-
- if (!strcmp(szProto, SKYPE_PROTONAME)) {
- if (!HasVoiceService()) {
- if (!DBGetContactSetting((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
- if (DBGetContactSettingByte((HANDLE)wParam, SKYPE_PROTONAME, "OnHold", 0))
- mi=ResumeCallItem(); else mi=HoldCallItem();
- mi.flags=CMIM_ALL;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuHoldCallItem,(LPARAM)&mi);
-
- callAvailable = FALSE;
- hangupAvailable = TRUE;
-
- DBFreeVariant(&dbv);
- } else { callAvailable = TRUE; hangupAvailable = FALSE; }
-
- if (DBGetContactSettingByte((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)!=0) {
- callAvailable = FALSE;
- hangupAvailable = FALSE;
- }
-
- mi = CallItem();
- mi.flags |= CMIM_ALL | (!callAvailable?CMIF_HIDDEN:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuCallItem,(LPARAM)&mi);
-
- mi = HupItem();
- mi.flags |= CMIM_ALL | (!hangupAvailable?CMIF_HIDDEN:0);
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuCallHangup,(LPARAM)&mi);
- }
-
- // Clear SkypeOut menu in case it exists
- mi=SkypeOutCallItem();
- mi.flags|=CMIM_ALL;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuSkypeOutCallItem,(LPARAM)&mi);
-
- // File sending and groupchat-creation works starting with protocol version 5
- if (protocol>=5) {
- mi=FileTransferItem();
- if (DBGetContactSettingByte((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0)
- mi.flags ^= CMIF_HIDDEN;
- mi.flags |= CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuFileTransferItem,(LPARAM)&mi);
- }
-
- if (protocol>=5 || bIsImoproxy) {
- mi=ChatInitItem();
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseGroupchat", 0) &&
- DBGetContactSettingByte((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)==0)
- mi.flags ^= CMIF_HIDDEN;
- mi.flags |= CMIM_FLAGS;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuChatInitItem,(LPARAM)&mi);
- }
-
- } else if (bSkypeOut) {
- if (!DBGetContactSetting((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
- mi=SkypeOutHupItem();
- DBFreeVariant(&dbv);
- } else {
- mi=SkypeOutCallItem();
- if(!DBGetContactSetting((HANDLE)wParam,"UserInfo","MyPhone0",&dbv)) {
- DBFreeVariant(&dbv);
- mi.flags=0;
- }
- }
- mi.flags|=CMIM_ALL;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)(HANDLE)hMenuSkypeOutCallItem,(LPARAM)&mi);
- }
-
- return 0;
-}
-
-/*
-int ClistDblClick(WPARAM wParam, LPARAM lParam) {
- char *szProto;
-
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 );
- if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) &&
- DBGetContactSettingWord((HANDLE)wParam, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE)==ID_STATUS_ONTHEPHONE) {
- SkypeCall(wParam, 0);
- }
-
- return 0;
-}
-*/
-
-HANDLE find_contact(char *name) {
- char *szProto;
- int tCompareResult;
- HANDLE hContact;
- DBVARIANT dbv;
-
- // already on list?
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
- {
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
- if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==0)
- {
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue;
- tCompareResult = strcmp(dbv.pszVal, name);
- DBFreeVariant(&dbv);
- if (tCompareResult) continue;
- return hContact; // already there, return handle
- }
- }
- return NULL;
-}
-HANDLE find_contactT(TCHAR *name) {
- char *szProto;
- int tCompareResult;
- HANDLE hContact;
- DBVARIANT dbv;
-
- // already on list?
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
- {
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
- if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==0)
- {
- if (DBGetContactSettingTString(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue;
- tCompareResult = _tcscmp(dbv.ptszVal, name);
- DBFreeVariant(&dbv);
- if (tCompareResult) continue;
- return hContact; // already there, return handle
- }
- }
- return NULL;
-}
-
-
-HANDLE add_contact(char *name, DWORD flags) {
- HANDLE hContact;
-
- // already on list?
- if (hContact=find_contact(name)) {
- if (!(flags & PALF_TEMPORARY) && DBGetContactSettingByte(hContact, "CList", "NotOnList", 1)) {
- DBDeleteContactSetting( hContact, "CList", "NotOnList" );
- DBDeleteContactSetting( hContact, "CList", "Hidden" );
- }
- LOG(("add_contact: Found %s", name));
- return hContact; // already there, return handle
- }
- // no, so add
-
- LOG(("add_contact: Adding %s", name));
- hContact=(HANDLE)CallServiceSync(MS_DB_CONTACT_ADD, 0, 0);
- if (hContact) {
- if (CallServiceSync(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact,(LPARAM)SKYPE_PROTONAME)!=0) {
- LOG(("add_contact: Ouch! MS_PROTO_ADDTOCONTACT failed for some reason"));
- CallServiceSync(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
- return NULL;
- }
- if (name[0]) DBWriteContactSettingString(hContact, SKYPE_PROTONAME, SKYPE_NAME, name);
-
- if (flags & PALF_TEMPORARY ) {
- DBWriteContactSettingByte(hContact, "CList", "NotOnList", 1);
- DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
- }
- if (name[0]) {
- SkypeSend("GET USER %s DISPLAYNAME", name);
- } else {LOG(("add_contact: Info: The contact added has no name."));}
- } else {LOG(("add_contact: Ouch! MS_DB_CONTACT_ADD failed for some reason"));}
- LOG(("add_contact succeeded"));
- return hContact;
-}
-
-void logoff_contacts(BOOL bCleanup) {
- HANDLE hContact;
- char *szProto;
- DBVARIANT dbv={0};
-
- LOG(("logoff_contacts: Logging off contacts."));
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
- if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME))
- {
- if (DBGetContactSettingWord(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE)!=ID_STATUS_OFFLINE)
- DBWriteContactSettingWord(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE);
-
- DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "CallId");
- if (DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==1)
- {
- if (DBGetContactSettingTString(hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv)) continue;
- RemChat (dbv.ptszVal);
- DBFreeVariant(&dbv);
- }
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, "Typing_Stream", &dbv) == 0)
- {
- if (bCleanup) SkypeSend ("ALTER APPLICATION libpurple_typing DISCONNECT %s", dbv.pszVal);
- DBFreeVariant(&dbv);
- DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "Typing_Stream");
- }
-
- }
- }
- if (bCleanup && (protocol>=5 || bIsImoproxy)) SkypeSend ("DELETE APPLICATION libpurple_typing");
-}
diff --git a/plugins/!NotAdopted/Skype/contacts.h b/plugins/!NotAdopted/Skype/contacts.h deleted file mode 100644 index 35a400c3e9..0000000000 --- a/plugins/!NotAdopted/Skype/contacts.h +++ /dev/null @@ -1,11 +0,0 @@ -// Prototypes
-HANDLE add_contextmenu(HANDLE hContact);
-HANDLE find_contact(char *name);
-HANDLE find_contactT(TCHAR *name);
-HANDLE add_contact(char *name, DWORD flags);
-HANDLE add_mainmenu(void);
-CLISTMENUITEM HupItem(void);
-CLISTMENUITEM CallItem(void);
-void logoff_contacts(BOOL bCleanup);
-int PrebuildContactMenu(WPARAM, LPARAM);
-//int ClistDblClick(WPARAM, LPARAM);
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/debug.c b/plugins/!NotAdopted/Skype/debug.c deleted file mode 100755 index 879f53b694..0000000000 --- a/plugins/!NotAdopted/Skype/debug.c +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef _DEBUG
-#pragma warning (disable: 4206) // nonstandard extension used : translation unit is empty
-#else
-#include "debug.h"
-
-#define WIN32_LEAN_AND_MEAN
-//#include <windows.h>
-#include <stdio.h>
-//#include <time.h>
-#include "skype.h"
-#include <string.h>
-#include <stdlib.h>
-
-#define INITBUF 1024 /* Initial size of buffer */
-
-#pragma warning (disable: 4706) // assignment within conditional expression
-
-extern char g_szProtoName[];
-
-static CRITICAL_SECTION m_WriteFileMutex;
-static FILE *m_fpLogFile = NULL;
-static char *m_szLogBuf = NULL;
-static DWORD m_iBufSize = 0;
-
-void init_debug(void) {
- char *p;
- char logfile[MAX_PATH];
-
- ZeroMemory(logfile, sizeof(logfile));
- p=logfile+GetModuleFileNameA(NULL, logfile, sizeof(logfile));
- if (!(p=strrchr (logfile, '\\'))) p=logfile; else p++;
- sprintf (p, "%s_log.txt", SKYPE_PROTONAME);
- m_szLogBuf = calloc (1, (m_iBufSize = INITBUF));
- m_fpLogFile = fopen(logfile, "a");
- InitializeCriticalSection(&m_WriteFileMutex);
-}
-
-void end_debug (void) {
- if (m_szLogBuf) free (m_szLogBuf);
- if (m_fpLogFile) fclose (m_fpLogFile);
- DeleteCriticalSection(&m_WriteFileMutex);
-}
-
-void do_log(const char *pszFormat, ...) {
- char *ct, *pNewBuf;
- va_list ap;
- time_t lt;
- INT64 iLen;
-
- if (!m_szLogBuf || !m_fpLogFile) return;
- EnterCriticalSection(&m_WriteFileMutex);
- time(<);
- ct=ctime(<);
- ct[strlen(ct)-1]=0;
- do
- {
- va_start(ap, pszFormat);
- iLen = _vsnprintf(m_szLogBuf, m_iBufSize, pszFormat, ap);
- va_end(ap);
- if (iLen == -1)
- {
- if (!(pNewBuf = (char*)realloc (m_szLogBuf, m_iBufSize*2)))
- {
- iLen = strlen (m_szLogBuf);
- break;
- }
- m_szLogBuf = pNewBuf;
- m_iBufSize*=2;
- }
- } while (iLen == -1);
- fprintf (m_fpLogFile, sizeof(time_t) == sizeof(int) ? "%s (%ld) [%08X] %s\n" : "%s (%lld) [%08X] %s\n", ct, lt, GetCurrentThreadId(), m_szLogBuf);
- fflush (m_fpLogFile);
- LeaveCriticalSection(&m_WriteFileMutex);
-}
-#endif
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/debug.h b/plugins/!NotAdopted/Skype/debug.h deleted file mode 100644 index 9582246251..0000000000 --- a/plugins/!NotAdopted/Skype/debug.h +++ /dev/null @@ -1,23 +0,0 @@ -//#define DEBUG_RELEASE 1
-
-#ifdef DEBUG_RELEASE
- #define _DEBUG 1
-#endif
-
-#ifdef _DEBUG
- void init_debug(void);
- void end_debug (void);
- void do_log(const char *pszFormat, ...);
- #define DEBUG_OUT(a) OUTPUT(a)
- #define TRACE(a) OutputDebugString(a)
- #define TRACEA(a) OutputDebugStringA(a)
- #define TRACEW(a) OutputDebugStringW(a)
- #define LOG(a) do_log a
-#else
- #define DEBUG_OUT(a)
- #define LOG(a)
- #define TRACE(a)
- #define TRACEA(a)
- #define TRACEW(a)
-#endif
-
diff --git a/plugins/!NotAdopted/Skype/deploy.bat b/plugins/!NotAdopted/Skype/deploy.bat deleted file mode 100644 index eee9e164d1..0000000000 --- a/plugins/!NotAdopted/Skype/deploy.bat +++ /dev/null @@ -1,15 +0,0 @@ -@echo off
-set PATH=%PATH%;C:\Programme\WinRAR
-echo Deploying..
-winrar a -apPlugins -ep1 \\linux01\leecher\webserver\Skype\Skype_protocol.zip Release\skype.dll
-rem There is no ANSI x64 Build
-rem winrar a -apPlugins -ep1 \\linux01\leecher\webserver\Skype\Skype_protocol_x64.zip Release64\skype.dll
-winrar a -apPlugins -ep1 \\linux01\leecher\webserver\Skype\Skype_protocol_unicode.zip Release-UNICODE\skype.dll
-winrar a -apPlugins -ep1 \\linux01\leecher\webserver\Skype\Skype_protocol_unicode_x64.zip Release64-UNICODE\skype.dll
-
-winrar a -apDebug -ep1 \\linux01\leecher\webserver\Skype\Skype_protocol_debug.zip Debug\skype.pdb
-winrar a -apDebug\Plugins -ep1 \\linux01\leecher\webserver\Skype\Skype_protocol_debug.zip Debug\skype.dll
-winrar a -apDebug64-UNICODE -ep1 \\linux01\leecher\webserver\Skype\Skype_protocol_debug.zip Debug64-UNICODE\skype.pdb
-winrar a -apDebug64-UNICODE\Plugins -ep1 \\linux01\leecher\webserver\Skype\Skype_protocol_debug.zip Debug64-UNICODE\skype.dll
-winrar a -apDebug-UNICODE -ep1 \\linux01\leecher\webserver\Skype\Skype_protocol_debug.zip Debug-UNICODE\skype.pdb
-winrar a -apDebug-UNICODE\Plugins -ep1 \\linux01\leecher\webserver\Skype\Skype_protocol_debug.zip Debug-UNICODE\skype.dll
diff --git a/plugins/!NotAdopted/Skype/ezxml/ezxml.c b/plugins/!NotAdopted/Skype/ezxml/ezxml.c deleted file mode 100755 index 7f8f5ea17d..0000000000 --- a/plugins/!NotAdopted/Skype/ezxml/ezxml.c +++ /dev/null @@ -1,1033 +0,0 @@ -/* ezxml.c - * - * Copyright 2004-2006 Aaron Voisine <aaron@voisine.org> - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#if defined(WIN32) || defined(_WIN32) -#include <io.h> -#ifndef EZXML_NOMMAP -#define EZXML_NOMMAP -#endif -#endif - -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <string.h> -#include <ctype.h> -#if !defined(WIN32) && !defined(_WIN32) -#include <unistd.h> -#endif -#include <sys/types.h> -#ifndef EZXML_NOMMAP -#include <sys/mman.h> -#endif // EZXML_NOMMAP -#include <sys/stat.h> -#include "ezxml.h" - -#if defined(WIN32) || defined(_WIN32) -#define vsnprintf _vsnprintf -#define snprintf _snprintf -#define open _open -#define read _read -#define write _write -#define close _close -#endif - -#define EZXML_WS "\t\r\n " // whitespace -#define EZXML_ERRL 128 // maximum error string length - -typedef struct ezxml_root *ezxml_root_t; -struct ezxml_root { // additional data for the root tag - struct ezxml xml; // is a super-struct built on top of ezxml struct - ezxml_t cur; // current xml tree insertion point - char *m; // original xml string - size_t len; // length of allocated memory for mmap, -1 for malloc - char *u; // UTF-8 conversion of string if original was UTF-16 - char *s; // start of work area - char *e; // end of work area - char **ent; // general entities (ampersand sequences) - char ***attr; // default attributes - char ***pi; // processing instructions - short standalone; // non-zero if <?xml standalone="yes"?> - char err[EZXML_ERRL]; // error string -}; - -char *EZXML_NIL[] = { NULL }; // empty, null terminated array of strings - -// returns the first child tag with the given name or NULL if not found -ezxml_t ezxml_child(ezxml_t xml, const char *name) -{ - xml = (xml) ? xml->child : NULL; - while (xml && strcmp(name, xml->name)) xml = xml->sibling; - return xml; -} - -// returns the Nth tag with the same name in the same subsection or NULL if not -// found -ezxml_t ezxml_idx(ezxml_t xml, int idx) -{ - for (; xml && idx; idx--) xml = xml->next; - return xml; -} - -// returns the value of the requested tag attribute or NULL if not found -const char *ezxml_attr(ezxml_t xml, const char *attr) -{ - int i = 0, j = 1; - ezxml_root_t root = (ezxml_root_t)xml; - - if (! xml || ! xml->attr) return NULL; - while (xml->attr[i] && strcmp(attr, xml->attr[i])) i += 2; - if (xml->attr[i]) return xml->attr[i + 1]; // found attribute - - while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag - for (i = 0; root->attr[i] && strcmp(xml->name, root->attr[i][0]); i++); - if (! root->attr[i]) return NULL; // no matching default attributes - while (root->attr[i][j] && strcmp(attr, root->attr[i][j])) j += 3; - return (root->attr[i][j]) ? root->attr[i][j + 1] : NULL; // found default -} - -// same as ezxml_get but takes an already initialized va_list -ezxml_t ezxml_vget(ezxml_t xml, va_list ap) -{ - char *name = va_arg(ap, char *); - int idx = -1; - - if (name && *name) { - idx = va_arg(ap, int); - xml = ezxml_child(xml, name); - } - return (idx < 0) ? xml : ezxml_vget(ezxml_idx(xml, idx), ap); -} - -// Traverses the xml tree to retrieve a specific subtag. Takes a variable -// length list of tag names and indexes. The argument list must be terminated -// by either an index of -1 or an empty string tag name. Example: -// title = ezxml_get(library, "shelf", 0, "book", 2, "title", -1); -// This retrieves the title of the 3rd book on the 1st shelf of library. -// Returns NULL if not found. -ezxml_t ezxml_get(ezxml_t xml, ...) -{ - va_list ap; - ezxml_t r; - - va_start(ap, xml); - r = ezxml_vget(xml, ap); - va_end(ap); - return r; -} - -// returns a null terminated array of processing instructions for the given -// target -const char **ezxml_pi(ezxml_t xml, const char *target) -{ - ezxml_root_t root = (ezxml_root_t)xml; - int i = 0; - - if (! root) return (const char **)EZXML_NIL; - while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag - while (root->pi[i] && strcmp(target, root->pi[i][0])) i++; // find target - return (const char **)((root->pi[i]) ? root->pi[i] + 1 : EZXML_NIL); -} - -// set an error string and return root -ezxml_t ezxml_err(ezxml_root_t root, char *s, const char *err, ...) -{ - va_list ap; - int line = 1; - char *t, fmt[EZXML_ERRL]; - - for (t = root->s; t < s; t++) if (*t == '\n') line++; - snprintf(fmt, EZXML_ERRL, "[error near line %d]: %s", line, err); - - va_start(ap, err); - vsnprintf(root->err, EZXML_ERRL, fmt, ap); - va_end(ap); - - return &root->xml; -} - -// Recursively decodes entity and character references and normalizes new lines -// ent is a null terminated array of alternating entity names and values. set t -// to '&' for general entity decoding, '%' for parameter entity decoding, 'c' -// for cdata sections, ' ' for attribute normalization, or '*' for non-cdata -// attribute normalization. Returns s, or if the decoded string is longer than -// s, returns a malloced string that must be freed. -char *ezxml_decode(char *s, char **ent, char t) -{ - char *e, *r = s, *m = s; - long b, c, d, l; - - for (; *s; s++) { // normalize line endings - while (*s == '\r') { - *(s++) = '\n'; - if (*s == '\n') memmove(s, (s + 1), strlen(s)); - } - } - - for (s = r; ; ) { - while (*s && *s != '&' && (*s != '%' || t != '%') && !isspace(*s)) s++; - - if (! *s) break; - else if (t != 'c' && ! strncmp(s, "&#", 2)) { // character reference - if (s[2] == 'x') c = strtol(s + 3, &e, 16); // base 16 - else c = strtol(s + 2, &e, 10); // base 10 - if (! c || *e != ';') { s++; continue; } // not a character ref - - if (c < 0x80) *(s++) = c; // US-ASCII subset - else { // multi-byte UTF-8 sequence - for (b = 0, d = c; d; d /= 2) b++; // number of bits in c - b = (b - 2) / 5; // number of bytes in payload - *(s++) = (0xFF << (7 - b)) | (c >> (6 * b)); // head - while (b) *(s++) = 0x80 | ((c >> (6 * --b)) & 0x3F); // payload - } - - memmove(s, strchr(s, ';') + 1, strlen(strchr(s, ';'))); - } - else if ((*s == '&' && (t == '&' || t == ' ' || t == '*')) || - (*s == '%' && t == '%')) { // entity reference - for (b = 0; ent[b] && strncmp(s + 1, ent[b], strlen(ent[b])); - b += 2); // find entity in entity list - - if (ent[b++]) { // found a match - if ((c = strlen(ent[b])) - 1 > (e = strchr(s, ';')) - s) { - l = (d = (s - r)) + c + strlen(e); // new length - r = (r == m) ? strcpy(malloc(l), r) : realloc(r, l); - e = strchr((s = r + d), ';'); // fix up pointers - } - - memmove(s + c, e + 1, strlen(e)); // shift rest of string - strncpy(s, ent[b], c); // copy in replacement text - } - else s++; // not a known entity - } - else if ((t == ' ' || t == '*') && isspace(*s)) *(s++) = ' '; - else s++; // no decoding needed - } - - if (t == '*') { // normalize spaces for non-cdata attributes - for (s = r; *s; s++) { - if ((l = strspn(s, " "))) memmove(s, s + l, strlen(s + l) + 1); - while (*s && *s != ' ') s++; - } - if (--s >= r && *s == ' ') *s = '\0'; // trim any trailing space - } - return r; -} - -// called when parser finds start of new tag -void ezxml_open_tag(ezxml_root_t root, char *name, char **attr) -{ - ezxml_t xml = root->cur; - - if (xml->name) xml = ezxml_add_child(xml, name, strlen(xml->txt)); - else xml->name = name; // first open tag - - xml->attr = attr; - root->cur = xml; // update tag insertion point -} - -// called when parser finds character content between open and closing tag -void ezxml_char_content(ezxml_root_t root, char *s, size_t len, char t) -{ - ezxml_t xml = root->cur; - char *m = s; - size_t l; - - if (! xml || ! xml->name || ! len) return; // sanity check - - s[len] = '\0'; // null terminate text (calling functions anticipate this) - len = strlen(s = ezxml_decode(s, root->ent, t)) + 1; - - if (! *(xml->txt)) xml->txt = s; // initial character content - else { // allocate our own memory and make a copy - xml->txt = (xml->flags & EZXML_TXTM) // allocate some space - ? realloc(xml->txt, (l = strlen(xml->txt)) + len) - : strcpy(malloc((l = strlen(xml->txt)) + len), xml->txt); - strcpy(xml->txt + l, s); // add new char content - if (s != m) free(s); // free s if it was malloced by ezxml_decode() - } - - if (xml->txt != m) ezxml_set_flag(xml, EZXML_TXTM); -} - -// called when parser finds closing tag -ezxml_t ezxml_close_tag(ezxml_root_t root, char *name, char *s) -{ - if (! root->cur || ! root->cur->name || strcmp(name, root->cur->name)) - return ezxml_err(root, s, "unexpected closing tag </%s>", name); - - root->cur = root->cur->parent; - return NULL; -} - -// checks for circular entity references, returns non-zero if no circular -// references are found, zero otherwise -int ezxml_ent_ok(char *name, char *s, char **ent) -{ - int i; - - for (; ; s++) { - while (*s && *s != '&') s++; // find next entity reference - if (! *s) return 1; - if (! strncmp(s + 1, name, strlen(name))) return 0; // circular ref. - for (i = 0; ent[i] && strncmp(ent[i], s + 1, strlen(ent[i])); i += 2); - if (ent[i] && ! ezxml_ent_ok(name, ent[i + 1], ent)) return 0; - } -} - -// called when the parser finds a processing instruction -void ezxml_proc_inst(ezxml_root_t root, char *s, size_t len) -{ - int i = 0, j = 1; - char *target = s; - - s[len] = '\0'; // null terminate instruction - if (*(s += strcspn(s, EZXML_WS))) { - *s = '\0'; // null terminate target - s += strspn(s + 1, EZXML_WS) + 1; // skip whitespace after target - } - - if (! strcmp(target, "xml")) { // <?xml ... ?> - if ((s = strstr(s, "standalone")) && ! strncmp(s + strspn(s + 10, - EZXML_WS "='\"") + 10, "yes", 3)) root->standalone = 1; - return; - } - - if (! root->pi[0]) *(root->pi = malloc(sizeof(char **))) = NULL; //first pi - - while (root->pi[i] && strcmp(target, root->pi[i][0])) i++; // find target - if (! root->pi[i]) { // new target - root->pi = realloc(root->pi, sizeof(char **) * (i + 2)); - root->pi[i] = malloc(sizeof(char *) * 3); - root->pi[i][0] = target; - root->pi[i][1] = (char *)(root->pi[i + 1] = NULL); // terminate pi list - root->pi[i][2] = _strdup(""); // empty document position list - } - - while (root->pi[i][j]) j++; // find end of instruction list for this target - root->pi[i] = realloc(root->pi[i], sizeof(char *) * (j + 3)); - root->pi[i][j + 2] = realloc(root->pi[i][j + 1], j + 1); - strcpy(root->pi[i][j + 2] + j - 1, (root->xml.name) ? ">" : "<"); - root->pi[i][j + 1] = NULL; // null terminate pi list for this target - root->pi[i][j] = s; // set instruction -} - -// called when the parser finds an internal doctype subset -short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len) -{ - char q, *c, *t, *n = NULL, *v, **ent, **pe; - int i, j; - - pe = memcpy(malloc(sizeof(EZXML_NIL)), EZXML_NIL, sizeof(EZXML_NIL)); - - for (s[len] = '\0'; s; ) { - while (*s && *s != '<' && *s != '%') s++; // find next declaration - - if (! *s) break; - else if (! strncmp(s, "<!ENTITY", 8)) { // parse entity definitions - c = s += strspn(s + 8, EZXML_WS) + 8; // skip white space separator - n = s + strspn(s, EZXML_WS "%"); // find name - *(s = n + strcspn(n, EZXML_WS)) = ';'; // append ; to name - - v = s + strspn(s + 1, EZXML_WS) + 1; // find value - if ((q = *(v++)) != '"' && q != '\'') { // skip externals - s = strchr(s, '>'); - continue; - } - - for (i = 0, ent = (*c == '%') ? pe : root->ent; ent[i]; i++); - ent = realloc(ent, (i + 3) * sizeof(char *)); // space for next ent - if (*c == '%') pe = ent; - else root->ent = ent; - - *(++s) = '\0'; // null terminate name - if ((s = strchr(v, q))) *(s++) = '\0'; // null terminate value - ent[i + 1] = ezxml_decode(v, pe, '%'); // set value - ent[i + 2] = NULL; // null terminate entity list - if (! ezxml_ent_ok(n, ent[i + 1], ent)) { // circular reference - if (ent[i + 1] != v) free(ent[i + 1]); - ezxml_err(root, v, "circular entity declaration &%s", n); - break; - } - else ent[i] = n; // set entity name - } - else if (! strncmp(s, "<!ATTLIST", 9)) { // parse default attributes - t = s + strspn(s + 9, EZXML_WS) + 9; // skip whitespace separator - if (! *t) { ezxml_err(root, t, "unclosed <!ATTLIST"); break; } - if (*(s = t + strcspn(t, EZXML_WS ">")) == '>') continue; - else *s = '\0'; // null terminate tag name - for (i = 0; root->attr[i] && strcmp(n, root->attr[i][0]); i++); - - while (*(n = ++s + strspn(s, EZXML_WS)) && *n != '>') { - if (*(s = n + strcspn(n, EZXML_WS))) *s = '\0'; // attr name - else { ezxml_err(root, t, "malformed <!ATTLIST"); break; } - - s += strspn(s + 1, EZXML_WS) + 1; // find next token - c = (strncmp(s, "CDATA", 5)) ? "*" : " "; // is it cdata? - if (! strncmp(s, "NOTATION", 8)) - s += strspn(s + 8, EZXML_WS) + 8; - s = (*s == '(') ? strchr(s, ')') : s + strcspn(s, EZXML_WS); - if (! s) { ezxml_err(root, t, "malformed <!ATTLIST"); break; } - - s += strspn(s, EZXML_WS ")"); // skip white space separator - if (! strncmp(s, "#FIXED", 6)) - s += strspn(s + 6, EZXML_WS) + 6; - if (*s == '#') { // no default value - s += strcspn(s, EZXML_WS ">") - 1; - if (*c == ' ') continue; // cdata is default, nothing to do - v = NULL; - } - else if ((*s == '"' || *s == '\'') && // default value - (s = strchr(v = s + 1, *s))) *s = '\0'; - else { ezxml_err(root, t, "malformed <!ATTLIST"); break; } - - if (! root->attr[i]) { // new tag name - root->attr = (! i) ? malloc(2 * sizeof(char **)) - : realloc(root->attr, - (i + 2) * sizeof(char **)); - root->attr[i] = malloc(2 * sizeof(char *)); - root->attr[i][0] = t; // set tag name - root->attr[i][1] = (char *)(root->attr[i + 1] = NULL); - } - - for (j = 1; root->attr[i][j]; j += 3); // find end of list - root->attr[i] = realloc(root->attr[i], - (j + 4) * sizeof(char *)); - - root->attr[i][j + 3] = NULL; // null terminate list - root->attr[i][j + 2] = c; // is it cdata? - root->attr[i][j + 1] = (v) ? ezxml_decode(v, root->ent, *c) - : NULL; - root->attr[i][j] = n; // attribute name - } - } - else if (! strncmp(s, "<!--", 4)) s = strstr(s + 4, "-->"); // comments - else if (! strncmp(s, "<?", 2)) { // processing instructions - if ((s = strstr(c = s + 2, "?>"))) - ezxml_proc_inst(root, c, s++ - c); - } - else if (*s == '<') s = strchr(s, '>'); // skip other declarations - else if (*(s++) == '%' && ! root->standalone) break; - } - - free(pe); - return ! *root->err; -} - -// Converts a UTF-16 string to UTF-8. Returns a new string that must be freed -// or NULL if no conversion was needed. -char *ezxml_str2utf8(char **s, size_t *len) -{ - char *u; - size_t l = 0, sl, max = *len; - long c, d; - int b, be = (**s == '\xFE') ? 1 : (**s == '\xFF') ? 0 : -1; - - if (be == -1) return NULL; // not UTF-16 - - u = malloc(max); - for (sl = 2; sl < *len - 1; sl += 2) { - c = (be) ? (((*s)[sl] & 0xFF) << 8) | ((*s)[sl + 1] & 0xFF) //UTF-16BE - : (((*s)[sl + 1] & 0xFF) << 8) | ((*s)[sl] & 0xFF); //UTF-16LE - if (c >= 0xD800 && c <= 0xDFFF && (sl += 2) < *len - 1) { // high-half - d = (be) ? (((*s)[sl] & 0xFF) << 8) | ((*s)[sl + 1] & 0xFF) - : (((*s)[sl + 1] & 0xFF) << 8) | ((*s)[sl] & 0xFF); - c = (((c & 0x3FF) << 10) | (d & 0x3FF)) + 0x10000; - } - - while (l + 6 > max) u = realloc(u, max += EZXML_BUFSIZE); - if (c < 0x80) u[l++] = c; // US-ASCII subset - else { // multi-byte UTF-8 sequence - for (b = 0, d = c; d; d /= 2) b++; // bits in c - b = (b - 2) / 5; // bytes in payload - u[l++] = (0xFF << (7 - b)) | (c >> (6 * b)); // head - while (b) u[l++] = 0x80 | ((c >> (6 * --b)) & 0x3F); // payload - } - } - return *s = realloc(u, *len = l); -} - -// frees a tag attribute list -void ezxml_free_attr(char **attr) { - int i = 0; - char *m; - - if (! attr || attr == EZXML_NIL) return; // nothing to free - while (attr[i]) i += 2; // find end of attribute list - m = attr[i + 1]; // list of which names and values are malloced - for (i = 0; m[i]; i++) { - if (m[i] & EZXML_NAMEM) free(attr[i * 2]); - if (m[i] & EZXML_TXTM) free(attr[(i * 2) + 1]); - } - free(m); - free(attr); -} - -// parse the given xml string and return an ezxml structure -ezxml_t ezxml_parse_str(char *s, size_t len) -{ - ezxml_root_t root = (ezxml_root_t)ezxml_new(NULL); - char q, e, *d, **attr, **a = NULL; // initialize a to avoid compile warning - int l, i, j; - - root->m = s; - if (! len) return ezxml_err(root, NULL, "root tag missing"); - root->u = ezxml_str2utf8(&s, &len); // convert utf-16 to utf-8 - root->e = (root->s = s) + len; // record start and end of work area - - e = s[len - 1]; // save end char - s[len - 1] = '\0'; // turn end char into null terminator - - while (*s && *s != '<') s++; // find first tag - if (! *s) return ezxml_err(root, s, "root tag missing"); - - for (; ; ) { - attr = (char **)EZXML_NIL; - d = ++s; - - if (isalpha(*s) || *s == '_' || *s == ':' || *s < '\0') { // new tag - if (! root->cur) - return ezxml_err(root, d, "markup outside of root element"); - - s += strcspn(s, EZXML_WS "/>"); - while (isspace(*s)) *(s++) = '\0'; // null terminate tag name - - if (*s && *s != '/' && *s != '>') // find tag in default attr list - for (i = 0; (a = root->attr[i]) && strcmp(a[0], d); i++); - - for (l = 0; *s && *s != '/' && *s != '>'; l += 2) { // new attrib - attr = (l) ? realloc(attr, (l + 4) * sizeof(char *)) - : malloc(4 * sizeof(char *)); // allocate space - attr[l + 3] = (l) ? realloc(attr[l + 1], (l / 2) + 2) - : malloc(2); // mem for list of maloced vals - strcpy(attr[l + 3] + (l / 2), " "); // value is not malloced - attr[l + 2] = NULL; // null terminate list - attr[l + 1] = ""; // temporary attribute value - attr[l] = s; // set attribute name - - s += strcspn(s, EZXML_WS "=/>"); - if (*s == '=' || isspace(*s)) { - *(s++) = '\0'; // null terminate tag attribute name - q = *(s += strspn(s, EZXML_WS "=")); - if (q == '"' || q == '\'') { // attribute value - attr[l + 1] = ++s; - while (*s && *s != q) s++; - if (*s) *(s++) = '\0'; // null terminate attribute val - else { - ezxml_free_attr(attr); - return ezxml_err(root, d, "missing %c", q); - } - - for (j = 1; a && a[j] && strcmp(a[j], attr[l]); j +=3); - attr[l + 1] = ezxml_decode(attr[l + 1], root->ent, (a - && a[j]) ? *a[j + 2] : ' '); - if (attr[l + 1] < d || attr[l + 1] > s) - attr[l + 3][l / 2] = EZXML_TXTM; // value malloced - } - } - while (isspace(*s)) s++; - } - - if (*s == '/') { // self closing tag - *(s++) = '\0'; - if ((*s && *s != '>') || (! *s && e != '>')) { - if (l) ezxml_free_attr(attr); - return ezxml_err(root, d, "missing >"); - } - ezxml_open_tag(root, d, attr); - ezxml_close_tag(root, d, s); - } - else if ((q = *s) == '>' || (! *s && e == '>')) { // open tag - *s = '\0'; // temporarily null terminate tag name - ezxml_open_tag(root, d, attr); - *s = q; - } - else { - if (l) ezxml_free_attr(attr); - return ezxml_err(root, d, "missing >"); - } - } - else if (*s == '/') { // close tag - s += strcspn(d = s + 1, EZXML_WS ">") + 1; - if (! (q = *s) && e != '>') return ezxml_err(root, d, "missing >"); - *s = '\0'; // temporarily null terminate tag name - if (ezxml_close_tag(root, d, s)) return &root->xml; - if (isspace(*s = q)) s += strspn(s, EZXML_WS); - } - else if (! strncmp(s, "!--", 3)) { // xml comment - if (! (s = strstr(s + 3, "--")) || (*(s += 2) != '>' && *s) || - (! *s && e != '>')) return ezxml_err(root, d, "unclosed <!--"); - } - else if (! strncmp(s, "![CDATA[", 8)) { // cdata - if ((s = strstr(s, "]]>"))) - ezxml_char_content(root, d + 8, (s += 2) - d - 10, 'c'); - else return ezxml_err(root, d, "unclosed <![CDATA["); - } - else if (! strncmp(s, "!DOCTYPE", 8)) { // dtd - for (l = 0; *s && ((! l && *s != '>') || (l && (*s != ']' || - *(s + strspn(s + 1, EZXML_WS) + 1) != '>'))); - l = (*s == '[') ? 1 : l) s += strcspn(s + 1, "[]>") + 1; - if (! *s && e != '>') - return ezxml_err(root, d, "unclosed <!DOCTYPE"); - d = (l) ? strchr(d, '[') + 1 : d; - if (l && ! ezxml_internal_dtd(root, d, s++ - d)) return &root->xml; - } - else if (*s == '?') { // <?...?> processing instructions - do { s = strchr(s, '?'); } while (s && *(++s) && *s != '>'); - if (! s || (! *s && e != '>')) - return ezxml_err(root, d, "unclosed <?"); - else ezxml_proc_inst(root, d + 1, s - d - 2); - } - else return ezxml_err(root, d, "unexpected <"); - - if (! s || ! *s) break; - *s = '\0'; - d = ++s; - if (*s && *s != '<') { // tag character content - while (*s && *s != '<') s++; - if (*s) ezxml_char_content(root, d, s - d, '&'); - else break; - } - else if (! *s) break; - } - - if (! root->cur) return &root->xml; - else if (! root->cur->name) return ezxml_err(root, d, "root tag missing"); - else return ezxml_err(root, d, "unclosed tag <%s>", root->cur->name); -} - -// Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire -// stream into memory and then parses it. For xml files, use ezxml_parse_file() -// or ezxml_parse_fd() -ezxml_t ezxml_parse_fp(FILE *fp) -{ - ezxml_root_t root; - size_t l, len = 0; - char *s; - - if (! (s = malloc(EZXML_BUFSIZE))) return NULL; - do { - len += (l = fread((s + len), 1, EZXML_BUFSIZE, fp)); - if (l == EZXML_BUFSIZE) s = realloc(s, len + EZXML_BUFSIZE); - } while (s && l == EZXML_BUFSIZE); - - if (! s) return NULL; - root = (ezxml_root_t)ezxml_parse_str(s, len); - root->len = -1; // so we know to free s in ezxml_free() - return &root->xml; -} - -// A wrapper for ezxml_parse_str() that accepts a file descriptor. First -// attempts to mem map the file. Failing that, reads the file into memory. -// Returns NULL on failure. -ezxml_t ezxml_parse_fd(int fd) -{ - ezxml_root_t root; - struct stat st; - size_t l; - void *m; - - if (fd < 0) return NULL; - fstat(fd, &st); - -#ifndef EZXML_NOMMAP - l = (st.st_size + sysconf(_SC_PAGESIZE) - 1) & ~(sysconf(_SC_PAGESIZE) -1); - if ((m = mmap(NULL, l, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0)) != - MAP_FAILED) { - madvise(m, l, MADV_SEQUENTIAL); // optimize for sequential access - root = (ezxml_root_t)ezxml_parse_str(m, st.st_size); - madvise(m, root->len = l, MADV_NORMAL); // put it back to normal - } - else { // mmap failed, read file into memory -#endif // EZXML_NOMMAP - l = read(fd, m = malloc(st.st_size), st.st_size); - root = (ezxml_root_t)ezxml_parse_str(m, l); - root->len = -1; // so we know to free s in ezxml_free() -#ifndef EZXML_NOMMAP - } -#endif // EZXML_NOMMAP - return &root->xml; -} - -// a wrapper for ezxml_parse_fd that accepts a file name -ezxml_t ezxml_parse_file(const char *file) -{ - int fd = open(file, O_RDONLY, 0); - ezxml_t xml = ezxml_parse_fd(fd); - - if (fd >= 0) close(fd); - return xml; -} - -// Encodes ampersand sequences appending the results to *dst, reallocating *dst -// if length excedes max. a is non-zero for attribute encoding. Returns *dst -char *ezxml_ampencode(const char *s, size_t len, char **dst, size_t *dlen, - size_t *max, short a) -{ - const char *e; - - for (e = s + len; s != e; s++) { - while (*dlen + 10 > *max) *dst = realloc(*dst, *max += EZXML_BUFSIZE); - - switch (*s) { - case '\0': return *dst; - case '&': *dlen += sprintf(*dst + *dlen, "&"); break; - case '<': *dlen += sprintf(*dst + *dlen, "<"); break; - case '>': *dlen += sprintf(*dst + *dlen, ">"); break; - case '"': *dlen += sprintf(*dst + *dlen, (a) ? """ : "\""); break; - case '\n': *dlen += sprintf(*dst + *dlen, (a) ? "
" : "\n"); break; - case '\t': *dlen += sprintf(*dst + *dlen, (a) ? "	" : "\t"); break; - case '\r': *dlen += sprintf(*dst + *dlen, "
"); break; - default: (*dst)[(*dlen)++] = *s; - } - } - return *dst; -} - -// Recursively converts each tag to xml appending it to *s. Reallocates *s if -// its length excedes max. start is the location of the previous tag in the -// parent tag's character content. Returns *s. -char *ezxml_toxml_r(ezxml_t xml, char **s, size_t *len, size_t *max, - size_t start, char ***attr) -{ - int i, j; - char *txt = (xml->parent) ? xml->parent->txt : ""; - size_t off = 0; - - // parent character content up to this tag - *s = ezxml_ampencode(txt + start, xml->off - start, s, len, max, 0); - - while (*len + strlen(xml->name) + 4 > *max) // reallocate s - *s = realloc(*s, *max += EZXML_BUFSIZE); - - *len += sprintf(*s + *len, "<%s", xml->name); // open tag - for (i = 0; xml->attr[i]; i += 2) { // tag attributes - if (ezxml_attr(xml, xml->attr[i]) != xml->attr[i + 1]) continue; - while (*len + strlen(xml->attr[i]) + 7 > *max) // reallocate s - *s = realloc(*s, *max += EZXML_BUFSIZE); - - *len += sprintf(*s + *len, " %s=\"", xml->attr[i]); - ezxml_ampencode(xml->attr[i + 1], -1, s, len, max, 1); - *len += sprintf(*s + *len, "\""); - } - - for (i = 0; attr[i] && strcmp(attr[i][0], xml->name); i++); - for (j = 1; attr[i] && attr[i][j]; j += 3) { // default attributes - if (! attr[i][j + 1] || ezxml_attr(xml, attr[i][j]) != attr[i][j + 1]) - continue; // skip duplicates and non-values - while (*len + strlen(attr[i][j]) + 7 > *max) // reallocate s - *s = realloc(*s, *max += EZXML_BUFSIZE); - - *len += sprintf(*s + *len, " %s=\"", attr[i][j]); - ezxml_ampencode(attr[i][j + 1], -1, s, len, max, 1); - *len += sprintf(*s + *len, "\""); - } - *len += sprintf(*s + *len, ">"); - - *s = (xml->child) ? ezxml_toxml_r(xml->child, s, len, max, 0, attr) //child - : ezxml_ampencode(xml->txt, -1, s, len, max, 0); //data - - while (*len + strlen(xml->name) + 4 > *max) // reallocate s - *s = realloc(*s, *max += EZXML_BUFSIZE); - - *len += sprintf(*s + *len, "</%s>", xml->name); // close tag - - while (txt[off] && off < xml->off) off++; // make sure off is within bounds - return (xml->ordered) ? ezxml_toxml_r(xml->ordered, s, len, max, off, attr) - : ezxml_ampencode(txt + off, -1, s, len, max, 0); -} - -// Converts an ezxml structure back to xml. Returns a string of xml data that -// must be freed. -char *ezxml_toxml(ezxml_t xml) -{ - ezxml_t p = (xml) ? xml->parent : NULL, o = (xml) ? xml->ordered : NULL; - ezxml_root_t root = (ezxml_root_t)xml; - size_t len = 0, max = EZXML_BUFSIZE; - char *s = strcpy(malloc(max), ""), *t, *n; - int i, j, k; - - if (! xml || ! xml->name) return realloc(s, len + 1); - while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag - - for (i = 0; ! p && root->pi[i]; i++) { // pre-root processing instructions - for (k = 2; root->pi[i][k - 1]; k++); - for (j = 1; (n = root->pi[i][j]); j++) { - if (root->pi[i][k][j - 1] == '>') continue; // not pre-root - while (len + strlen(t = root->pi[i][0]) + strlen(n) + 7 > max) - s = realloc(s, max += EZXML_BUFSIZE); - len += sprintf(s + len, "<?%s%s%s?>\n", t, *n ? " " : "", n); - } - } - - xml->parent = xml->ordered = NULL; - s = ezxml_toxml_r(xml, &s, &len, &max, 0, root->attr); - xml->parent = p; - xml->ordered = o; - - for (i = 0; ! p && root->pi[i]; i++) { // post-root processing instructions - for (k = 2; root->pi[i][k - 1]; k++); - for (j = 1; (n = root->pi[i][j]); j++) { - if (root->pi[i][k][j - 1] == '<') continue; // not post-root - while (len + strlen(t = root->pi[i][0]) + strlen(n) + 7 > max) - s = realloc(s, max += EZXML_BUFSIZE); - len += sprintf(s + len, "\n<?%s%s%s?>", t, *n ? " " : "", n); - } - } - return realloc(s, len + 1); -} - -// free the memory allocated for the ezxml structure -void ezxml_free(ezxml_t xml) -{ - ezxml_root_t root = (ezxml_root_t)xml; - int i, j; - char **a, *s; - - if (! xml) return; - ezxml_free(xml->child); - ezxml_free(xml->ordered); - - if (! xml->parent) { // free root tag allocations - for (i = 10; root->ent[i]; i += 2) // 0 - 9 are default entites (<>&"') - if ((s = root->ent[i + 1]) < root->s || s > root->e) free(s); - free(root->ent); // free list of general entities - - for (i = 0; (a = root->attr[i]); i++) { - for (j = 1; a[j++]; j += 2) // free malloced attribute values - if (a[j] && (a[j] < root->s || a[j] > root->e)) free(a[j]); - free(a); - } - if (root->attr[0]) free(root->attr); // free default attribute list - - for (i = 0; root->pi[i]; i++) { - for (j = 1; root->pi[i][j]; j++); - free(root->pi[i][j + 1]); - free(root->pi[i]); - } - if (root->pi[0]) free(root->pi); // free processing instructions - - if (root->len == -1) free(root->m); // malloced xml data -#ifndef EZXML_NOMMAP - else if (root->len) munmap(root->m, root->len); // mem mapped xml data -#endif // EZXML_NOMMAP - if (root->u) free(root->u); // utf8 conversion - } - - ezxml_free_attr(xml->attr); // tag attributes - if ((xml->flags & EZXML_TXTM)) free(xml->txt); // character content - if ((xml->flags & EZXML_NAMEM)) free(xml->name); // tag name - free(xml); -} - -// return parser error message or empty string if none -const char *ezxml_error(ezxml_t xml) -{ - while (xml && xml->parent) xml = xml->parent; // find root tag - return (xml) ? ((ezxml_root_t)xml)->err : ""; -} - -// returns a new empty ezxml structure with the given root tag name -ezxml_t ezxml_new(const char *name) -{ - static char *ent[] = { "lt;", "<", "gt;", ">", "quot;", """, - "apos;", "'", "amp;", "&", NULL }; - ezxml_root_t root = (ezxml_root_t)memset(malloc(sizeof(struct ezxml_root)), - '\0', sizeof(struct ezxml_root)); - root->xml.name = (char *)name; - root->cur = &root->xml; - strcpy(root->err, root->xml.txt = ""); - root->ent = memcpy(malloc(sizeof(ent)), ent, sizeof(ent)); - root->attr = root->pi = (char ***)(root->xml.attr = EZXML_NIL); - return &root->xml; -} - -// inserts an existing tag into an ezxml structure -ezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off) -{ - ezxml_t cur, prev, head; - - xml->next = xml->sibling = xml->ordered = NULL; - xml->off = off; - xml->parent = dest; - - if ((head = dest->child)) { // already have sub tags - if (head->off <= off) { // not first subtag - for (cur = head; cur->ordered && cur->ordered->off <= off; - cur = cur->ordered); - xml->ordered = cur->ordered; - cur->ordered = xml; - } - else { // first subtag - xml->ordered = head; - dest->child = xml; - } - - for (cur = head, prev = NULL; cur && strcmp(cur->name, xml->name); - prev = cur, cur = cur->sibling); // find tag type - if (cur && cur->off <= off) { // not first of type - while (cur->next && cur->next->off <= off) cur = cur->next; - xml->next = cur->next; - cur->next = xml; - } - else { // first tag of this type - if (prev && cur) prev->sibling = cur->sibling; // remove old first - xml->next = cur; // old first tag is now next - for (cur = head, prev = NULL; cur && cur->off <= off; - prev = cur, cur = cur->sibling); // new sibling insert point - xml->sibling = cur; - if (prev) prev->sibling = xml; - } - } - else dest->child = xml; // only sub tag - - return xml; -} - -// Adds a child tag. off is the offset of the child tag relative to the start -// of the parent tag's character content. Returns the child tag. -ezxml_t ezxml_add_child(ezxml_t xml, const char *name, size_t off) -{ - ezxml_t child; - - if (! xml) return NULL; - child = (ezxml_t)memset(malloc(sizeof(struct ezxml)), '\0', - sizeof(struct ezxml)); - child->name = (char *)name; - child->attr = EZXML_NIL; - child->txt = ""; - - return ezxml_insert(child, xml, off); -} - -// sets the character content for the given tag and returns the tag -ezxml_t ezxml_set_txt(ezxml_t xml, const char *txt) -{ - if (! xml) return NULL; - if (xml->flags & EZXML_TXTM) free(xml->txt); // existing txt was malloced - xml->flags &= ~EZXML_TXTM; - xml->txt = (char *)txt; - return xml; -} - -// Sets the given tag attribute or adds a new attribute if not found. A value -// of NULL will remove the specified attribute. Returns the tag given. -ezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value) -{ - int l = 0, c; - - if (! xml) return NULL; - while (xml->attr[l] && strcmp(xml->attr[l], name)) l += 2; - if (! xml->attr[l]) { // not found, add as new attribute - if (! value) return xml; // nothing to do - if (xml->attr == EZXML_NIL) { // first attribute - xml->attr = malloc(4 * sizeof(char *)); - xml->attr[1] = _strdup(""); // empty list of malloced names/vals - } - else xml->attr = realloc(xml->attr, (l + 4) * sizeof(char *)); - - xml->attr[l] = (char *)name; // set attribute name - xml->attr[l + 2] = NULL; // null terminate attribute list - xml->attr[l + 3] = realloc(xml->attr[l + 1], - (c = strlen(xml->attr[l + 1])) + 2); - strcpy(xml->attr[l + 3] + c, " "); // set name/value as not malloced - if (xml->flags & EZXML_DUP) xml->attr[l + 3][c] = EZXML_NAMEM; - } - else if (xml->flags & EZXML_DUP) free((char *)name); // name was strduped - - for (c = l; xml->attr[c]; c += 2); // find end of attribute list - if (xml->attr[c + 1][l / 2] & EZXML_TXTM) free(xml->attr[l + 1]); //old val - if (xml->flags & EZXML_DUP) xml->attr[c + 1][l / 2] |= EZXML_TXTM; - else xml->attr[c + 1][l / 2] &= ~EZXML_TXTM; - - if (value) xml->attr[l + 1] = (char *)value; // set attribute value - else { // remove attribute - if (xml->attr[c + 1][l / 2] & EZXML_NAMEM) free(xml->attr[l]); - memmove(xml->attr + l, xml->attr + l + 2, (c - l + 2) * sizeof(char*)); - xml->attr = realloc(xml->attr, (c + 2) * sizeof(char *)); - memmove(xml->attr[c + 1] + (l / 2), xml->attr[c + 1] + (l / 2) + 1, - (c / 2) - (l / 2)); // fix list of which name/vals are malloced - } - xml->flags &= ~EZXML_DUP; // clear strdup() flag - return xml; -} - -// sets a flag for the given tag and returns the tag -ezxml_t ezxml_set_flag(ezxml_t xml, short flag) -{ - if (xml) xml->flags |= flag; - return xml; -} - -// removes a tag along with its subtags without freeing its memory -ezxml_t ezxml_cut(ezxml_t xml) -{ - ezxml_t cur; - - if (! xml) return NULL; // nothing to do - if (xml->next) xml->next->sibling = xml->sibling; // patch sibling list - - if (xml->parent) { // not root tag - cur = xml->parent->child; // find head of subtag list - if (cur == xml) xml->parent->child = xml->ordered; // first subtag - else { // not first subtag - while (cur->ordered != xml) cur = cur->ordered; - cur->ordered = cur->ordered->ordered; // patch ordered list - - cur = xml->parent->child; // go back to head of subtag list - if (strcmp(cur->name, xml->name)) { // not in first sibling list - while (strcmp(cur->sibling->name, xml->name)) - cur = cur->sibling; - if (cur->sibling == xml) { // first of a sibling list - cur->sibling = (xml->next) ? xml->next - : cur->sibling->sibling; - } - else cur = cur->sibling; // not first of a sibling list - } - - while (cur->next && cur->next != xml) cur = cur->next; - if (cur->next) cur->next = cur->next->next; // patch next list - } - } - xml->ordered = xml->sibling = xml->next = NULL; - return xml; -} - -#ifdef EZXML_TEST // test harness -int main(int argc, char **argv) -{ - ezxml_t xml; - char *s; - int i; - - if (argc != 2) return fprintf(stderr, "usage: %s xmlfile\n", argv[0]); - - xml = ezxml_parse_file(argv[1]); - printf("%s\n", (s = ezxml_toxml(xml))); - free(s); - i = fprintf(stderr, "%s", ezxml_error(xml)); - ezxml_free(xml); - return (i) ? 1 : 0; -} -#endif // EZXML_TEST diff --git a/plugins/!NotAdopted/Skype/ezxml/ezxml.h b/plugins/!NotAdopted/Skype/ezxml/ezxml.h deleted file mode 100644 index 3e020788b4..0000000000 --- a/plugins/!NotAdopted/Skype/ezxml/ezxml.h +++ /dev/null @@ -1,167 +0,0 @@ -/* ezxml.h - * - * Copyright 2004-2006 Aaron Voisine <aaron@voisine.org> - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef _EZXML_H -#define _EZXML_H - -#include <stdlib.h> -#include <stdio.h> -#include <stdarg.h> -#include <fcntl.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#define EZXML_BUFSIZE 1024 // size of internal memory buffers -#define EZXML_NAMEM 0x80 // name is malloced -#define EZXML_TXTM 0x40 // txt is malloced -#define EZXML_DUP 0x20 // attribute name and value are strduped - -typedef struct ezxml *ezxml_t; -struct ezxml { - char *name; // tag name - char **attr; // tag attributes { name, value, name, value, ... NULL } - char *txt; // tag character content, empty string if none - size_t off; // tag offset from start of parent tag character content - ezxml_t next; // next tag with same name in this section at this depth - ezxml_t sibling; // next tag with different name in same section and depth - ezxml_t ordered; // next tag, same section and depth, in original order - ezxml_t child; // head of sub tag list, NULL if none - ezxml_t parent; // parent tag, NULL if current tag is root tag - short flags; // additional information -}; - -// Given a string of xml data and its length, parses it and creates an ezxml -// structure. For efficiency, modifies the data by adding null terminators -// and decoding ampersand sequences. If you don't want this, copy the data and -// pass in the copy. Returns NULL on failure. -ezxml_t ezxml_parse_str(char *s, size_t len); - -// A wrapper for ezxml_parse_str() that accepts a file descriptor. First -// attempts to mem map the file. Failing that, reads the file into memory. -// Returns NULL on failure. -ezxml_t ezxml_parse_fd(int fd); - -// a wrapper for ezxml_parse_fd() that accepts a file name -ezxml_t ezxml_parse_file(const char *file); - -// Wrapper for ezxml_parse_str() that accepts a file stream. Reads the entire -// stream into memory and then parses it. For xml files, use ezxml_parse_file() -// or ezxml_parse_fd() -ezxml_t ezxml_parse_fp(FILE *fp); - -// returns the first child tag (one level deeper) with the given name or NULL -// if not found -ezxml_t ezxml_child(ezxml_t xml, const char *name); - -// returns the next tag of the same name in the same section and depth or NULL -// if not found -#define ezxml_next(xml) ((xml) ? xml->next : NULL) - -// Returns the Nth tag with the same name in the same section at the same depth -// or NULL if not found. An index of 0 returns the tag given. -ezxml_t ezxml_idx(ezxml_t xml, int idx); - -// returns the name of the given tag -#define ezxml_name(xml) ((xml) ? xml->name : NULL) - -// returns the given tag's character content or empty string if none -#define ezxml_txt(xml) ((xml) ? xml->txt : "") - -// returns the value of the requested tag attribute, or NULL if not found -const char *ezxml_attr(ezxml_t xml, const char *attr); - -// Traverses the ezxml sturcture to retrieve a specific subtag. Takes a -// variable length list of tag names and indexes. The argument list must be -// terminated by either an index of -1 or an empty string tag name. Example: -// title = ezxml_get(library, "shelf", 0, "book", 2, "title", -1); -// This retrieves the title of the 3rd book on the 1st shelf of library. -// Returns NULL if not found. -ezxml_t ezxml_get(ezxml_t xml, ...); - -// Converts an ezxml structure back to xml. Returns a string of xml data that -// must be freed. -char *ezxml_toxml(ezxml_t xml); - -// returns a NULL terminated array of processing instructions for the given -// target -const char **ezxml_pi(ezxml_t xml, const char *target); - -// frees the memory allocated for an ezxml structure -void ezxml_free(ezxml_t xml); - -// returns parser error message or empty string if none -const char *ezxml_error(ezxml_t xml); - -// returns a new empty ezxml structure with the given root tag name -ezxml_t ezxml_new(const char *name); - -// wrapper for ezxml_new() that strdup()s name -#define ezxml_new_d(name) ezxml_set_flag(ezxml_new(strdup(name)), EZXML_NAMEM) - -// Adds a child tag. off is the offset of the child tag relative to the start -// of the parent tag's character content. Returns the child tag. -ezxml_t ezxml_add_child(ezxml_t xml, const char *name, size_t off); - -// wrapper for ezxml_add_child() that strdup()s name -#define ezxml_add_child_d(xml, name, off) \ - ezxml_set_flag(ezxml_add_child(xml, strdup(name), off), EZXML_NAMEM) - -// sets the character content for the given tag and returns the tag -ezxml_t ezxml_set_txt(ezxml_t xml, const char *txt); - -// wrapper for ezxml_set_txt() that strdup()s txt -#define ezxml_set_txt_d(xml, txt) \ - ezxml_set_flag(ezxml_set_txt(xml, strdup(txt)), EZXML_TXTM) - -// Sets the given tag attribute or adds a new attribute if not found. A value -// of NULL will remove the specified attribute. Returns the tag given. -ezxml_t ezxml_set_attr(ezxml_t xml, const char *name, const char *value); - -// Wrapper for ezxml_set_attr() that strdup()s name/value. Value cannot be NULL -#define ezxml_set_attr_d(xml, name, value) \ - ezxml_set_attr(ezxml_set_flag(xml, EZXML_DUP), strdup(name), strdup(value)) - -// sets a flag for the given tag and returns the tag -ezxml_t ezxml_set_flag(ezxml_t xml, short flag); - -// removes a tag along with its subtags without freeing its memory -ezxml_t ezxml_cut(ezxml_t xml); - -// inserts an existing tag into an ezxml structure -ezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off); - -// Moves an existing tag to become a subtag of dest at the given offset from -// the start of dest's character content. Returns the moved tag. -#define ezxml_move(xml, dest, off) ezxml_insert(ezxml_cut(xml), dest, off) - -// removes a tag along with all its subtags -#define ezxml_remove(xml) ezxml_free(ezxml_cut(xml)) - -#ifdef __cplusplus -} -#endif - -#endif // _EZXML_H diff --git a/plugins/!NotAdopted/Skype/gchat.c b/plugins/!NotAdopted/Skype/gchat.c deleted file mode 100755 index bd3d2bb785..0000000000 --- a/plugins/!NotAdopted/Skype/gchat.c +++ /dev/null @@ -1,910 +0,0 @@ -#include "skype.h"
-#include "skypeapi.h"
-#include "gchat.h"
-#include "contacts.h"
-#include "debug.h"
-#include "utf8.h"
-#include "pthread.h"
-
-#pragma warning (push)
-#pragma warning (disable: 4100) // unreferenced formal parameter
-#include "../../include/m_langpack.h"
-#include "../../include/m_userinfo.h"
-#include "../../include/m_history.h"
-#include "../../include/m_contacts.h"
-#pragma warning (pop)
-
-#ifndef DWLP_USER
-#define DWLP_USER DWL_USER
-#endif
-
-#ifdef _UNICODE
-#define STR "%S"
-#else
-#define STR "%s"
-#endif
-
-#pragma warning (disable: 4706) // assignment within conditional expression
-
-extern HANDLE hInitChat;
-extern HINSTANCE hInst;
-extern char protocol, g_szProtoName[];
-extern DWORD mirandaVersion;
-
-static gchat_contacts *chats=NULL;
-static int chatcount=0;
-static CRITICAL_SECTION m_GCMutex;
-
-// TODO: Disable groupchat for Protocol verisons <5
-
-/****************************************************************************/
-/* Chat management helper functions */
-/****************************************************************************/
-
-/* Get the gchat_contacts entry for the chat with the id szChatId
- If the chat doesn't already exist in the list, it is added.
-
- Parameters: szChatId - String with the chat ID of the chat to be found
- Returns: Pointer to the gchat_contacts entry for the given id.
- NULL on failure (not enough memory)
-*/
-gchat_contacts *GetChat(TCHAR *szChatId) {
- int i;
-
- for (i=0;i<chatcount;i++)
- if (!_tcscmp(chats[i].szChatName, szChatId)) return &chats[i];
- if (chats = (gchat_contacts *)realloc(chats, sizeof(gchat_contacts)*(++chatcount))) {
- memset(&chats[chatcount-1], 0, sizeof(gchat_contacts));
- chats[chatcount-1].szChatName=_tcsdup(szChatId);
- return &chats[chatcount-1];
- }
- return NULL;
-}
-
-/* Removes the gchat_contacts entry for the chat with the id szChatId,
- if it exists.
-
- Parameters: szChatId - String with the chat ID to be removed from list
- */
-void RemChat(TCHAR *szChatId) {
- int i;
-
- for (i=0;i<chatcount;i++)
- if (!_tcscmp(chats[i].szChatName, szChatId)) {
- if (chats[i].szChatName) free(chats[i].szChatName);
- if (chats[i].mJoinedContacts) free(chats[i].mJoinedContacts);
- if (i<--chatcount) memmove(&chats[i], &chats[i+1], (chatcount-i)*sizeof(gchat_contacts));
- chats = (gchat_contacts *)realloc(chats, sizeof(gchat_contacts)*chatcount);
- return;
- }
-}
-
-/* Checks, if the contact with the handle hContact exists in the groupchat
- given in gc
-
- Parameters: gc - gchat_contacts entry for the chat session to be searched
- who - Name of member
- Returns: -1 = Not found
- >=0 = Number of found item
- */
-static int ExistsChatContact(gchat_contacts *gc, const TCHAR *who) {
- int i;
-
- for (i=0;i<gc->mJoinedCount;i++)
- if (_tcscmp(gc->mJoinedContacts[i].who, who)==0) return i;
- return -1;
-}
-
-gchat_contact *GetChatContact(gchat_contacts *gc, const TCHAR *who) {
- int i = ExistsChatContact (gc, who);
-
- if (i==-1) return NULL;
- return &gc->mJoinedContacts[i];
-}
-
-/* Adds contact with the name who to the groupchat given in gc
-
- Parameters: gc -
- Returns: -1 = Contact not found
- -2 = On failure
- >=0 = Number of added item
- */
-static int AddChatContact(gchat_contacts *gc, char *who, TCHAR *pszRole) {
- int i = -2;
- HANDLE hContact;
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- CONTACTINFO ci = {0};
- TCHAR *twho;
-
- LOG (("AddChatContact %s", who));
- if (!(twho = make_nonutf_tchar_string((const unsigned char*)who)))
- return -2;
- if ((i=ExistsChatContact(gc, twho))>=0) return i;
- hContact=find_contact(who);
-
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = gc->szChatName;
- gcd.iType = GC_EVENT_JOIN;
-
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.ptszStatus = pszRole?pszRole:_T("USER");
- gce.time = (DWORD)time(NULL);
- gce.dwFlags = GCEF_ADDTOLOG | GC_TCHAR;
-
- ci.cbSize = sizeof(ci);
- ci.szProto = SKYPE_PROTONAME;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- ci.hContact = hContact;
-
- if (hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal;
- else gce.ptszNick=twho;
-
- gce.ptszUID=twho;
- if (!CallService(MS_GC_EVENT, 0, (LPARAM)&gce)) {
- if ((gc->mJoinedContacts=realloc(gc->mJoinedContacts, (gc->mJoinedCount+1)*sizeof(gchat_contact))))
- {
- gc->mJoinedContacts[i=gc->mJoinedCount].hContact=hContact;
- _tcscpy (gc->mJoinedContacts[i].szRole, gce.ptszStatus);
- _tcscpy (gc->mJoinedContacts[i].who, twho);
- gc->mJoinedCount++;
- }
- }
- if (ci.pszVal) mir_free (ci.pszVal);
- free_nonutf_tchar_string (twho);
- return i;
-}
-
-void RemChatContact(gchat_contacts *gc, const TCHAR *who) {
- int i;
-
- if (!gc) return;
- for (i=0;i<gc->mJoinedCount;i++)
- if (_tcscmp(gc->mJoinedContacts[i].who, who)==0) {
- if (i<--gc->mJoinedCount)
- memmove(&gc->mJoinedContacts[i], &gc->mJoinedContacts[i+1], (gc->mJoinedCount-i)*sizeof(gchat_contact));
- if (gc->mJoinedCount) gc->mJoinedContacts = realloc(gc->mJoinedContacts, sizeof(gchat_contact)*gc->mJoinedCount);
- else {free (gc->mJoinedContacts); gc->mJoinedContacts = NULL; }
- return;
- }
-}
-
-HANDLE find_chat(TCHAR *chatname) {
- char *szProto;
- int tCompareResult;
- HANDLE hContact;
- DBVARIANT dbv;
-
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
- if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) &&
- DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==1)
- {
- if (DBGetContactSettingTString(hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv)) continue;
- tCompareResult = _tcscmp(dbv.ptszVal, chatname);
- DBFreeVariant(&dbv);
- if (tCompareResult) continue;
- return hContact; // already there, return handle
- }
- }
- return NULL;
-}
-
-#ifdef _UNICODE
-HANDLE find_chatA(char *chatname) {
- char *szProto;
- int tCompareResult;
- HANDLE hContact;
- DBVARIANT dbv;
-
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
- if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) &&
- DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==1)
- {
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv)) continue;
- tCompareResult = strcmp(dbv.pszVal, chatname);
- DBFreeVariant(&dbv);
- if (tCompareResult) continue;
- return hContact; // already there, return handle
- }
- }
- return NULL;
-}
-#endif
-
-
-
-int __cdecl AddMembers(char *szSkypeMsg) {
- BYTE *contactmask=NULL;
- DBVARIANT dbv2;
- CONTACTINFO ci={0};
- char *ptr, *who, *nextoken;
- TCHAR *szChatId;
- int i, iRet = 0;
- gchat_contacts *gc;
-
- LOG(("AddMembers STARTED"));
- if (!(ptr=strstr(szSkypeMsg, " MEMBERS"))) return -1;
- EnterCriticalSection(&m_GCMutex);
- ptr[0]=0;
- szChatId = make_nonutf_tchar_string((const unsigned char*)szSkypeMsg+5);
- ptr+=9;
- if (find_chat(szChatId) && (gc=GetChat(szChatId)) &&
- !DBGetContactSettingString(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv2))
- {
- char *pszMemObjs, *token;
-
- if (protocol>=7 && (pszMemObjs = SkypeGet ("CHAT", szSkypeMsg+5, "MEMBEROBJECTS"))) {
- // Add new contacts (protocol 7+ with memberobjects, supports roles)
- for (token=strtok_r(pszMemObjs, ", ", &nextoken); token; token=strtok_r(NULL, ", ", &nextoken)) {
- if (!(who = SkypeGet ("CHATMEMBER", token, "IDENTITY"))) continue;
- if (strcmp(who, dbv2.pszVal)) {
- char *pszRole;
- TCHAR *ptszRole = NULL;
-
- if (pszRole = SkypeGet ("CHATMEMBER", token, "ROLE"))
- ptszRole = make_nonutf_tchar_string((const unsigned char*)pszRole);
-
- i=AddChatContact(gc, who, ptszRole);
- free_nonutf_tchar_string (ptszRole);
- if (pszRole) free (pszRole);
- if (i>=0 && !contactmask && !(contactmask = (unsigned char*)calloc(gc->mJoinedCount, 1))) i=-2;
- if (!(contactmask= (unsigned char *) realloc(contactmask, gc->mJoinedCount))) {
- iRet = -1;
- free (who);
- break;
- }
- contactmask[i]=TRUE;
- }
- free (who);
- }
- free (pszMemObjs);
- }
- else
- {
- // Add new contacts (normal)
- for (who=strtok_r(ptr, " ", &nextoken); who; who=strtok_r(NULL, " ", &nextoken)) {
- if (strcmp(who, dbv2.pszVal)) {
- i=AddChatContact(gc, who, NULL);
- if (i>=0 && !contactmask && !(contactmask = (unsigned char*)calloc(gc->mJoinedCount, 1))) i=-2;
- if (i<0 || !(contactmask= (unsigned char *) realloc(contactmask, gc->mJoinedCount))) {
- iRet = -1;
- break;
- }
- contactmask[i]=TRUE;
- }
- }
- }
- // Quit contacts which are no longer there
- if (iRet == 0 && contactmask) {
- GCDEST gcd = {0};
- GCEVENT gce = {0};
-
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = szChatId;
- gcd.iType = GC_EVENT_QUIT;
-
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.time = (DWORD)time(NULL);
- gce.dwFlags = GCEF_ADDTOLOG | GC_TCHAR;
-
- ci.cbSize = sizeof(ci);
- ci.szProto = SKYPE_PROTONAME;
- ci.dwFlag = CNF_DISPLAY;
-
- for (i=0;i<gc->mJoinedCount;i++)
- if (!contactmask[i])
- {
- ci.hContact = gc->mJoinedContacts[i].hContact;
- ci.dwFlag = CNF_TCHAR;
- if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal;
- else gce.ptszNick=gc->mJoinedContacts[i].who;
- RemChatContact(gc, gc->mJoinedContacts[i].who);
- gce.ptszUID = gc->mJoinedContacts[i].who;
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- if (ci.pszVal) {
- mir_free (ci.pszVal);
- ci.pszVal=NULL;
- }
- }
- // We don't do this, because the dialog group-chat may have been started intentionally
- /*
- if (gc->mJoinedCount == 1) {
- // switch back to normal session
- KillChatSession(&gcd);
- }
- */
- }
- if (contactmask) free(contactmask);
- DBFreeVariant(&dbv2);
- } else iRet = -1;
- free_nonutf_tchar_string (szChatId);
- LeaveCriticalSection(&m_GCMutex);
- LOG(("AddMembers DONE"));
- return iRet;
-}
-
-void AddMembersThread(char *szSkypeMsg)
-{
- AddMembers (szSkypeMsg);
- free (szSkypeMsg);
-}
-
-/****************************************************************************/
-/* Window procedures */
-/****************************************************************************/
-BOOL CALLBACK InputBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg) {
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
- SetWindowLong (hwndDlg, DWLP_USER, lParam);
- SetDlgItemText (hwndDlg, IDC_TEXT, (TCHAR*)lParam);
- return TRUE;
- }
-
- case WM_COMMAND:
- switch ( LOWORD( wParam )) {
- case IDOK:
- {
- GetDlgItemText(hwndDlg, IDC_TEXT, (TCHAR*)GetWindowLong(hwndDlg, DWLP_USER), MAX_BUF-1*sizeof(TCHAR));
- EndDialog(hwndDlg, 1);
- break;
- }
- case IDCANCEL:
- EndDialog(hwndDlg, 0);
- break;
- } }
- return FALSE;
-}
-
-/****************************************************************************/
-/* Core Chat management functions */
-/****************************************************************************/
-
-/* We have a new Groupchat
-
- This hook is called when a new chat is initialised.
- Parameters: wParam = (char *)Name of new chat session [Has to be ASCIIZ/UTF8]
- lParam = 1 - Create groupchat, but don't open it
- 0 - Default - open groupchat after init
-*/
-int __cdecl ChatInit(WPARAM wParam, LPARAM lParam) {
- GCSESSION gcw = {0};
- GCEVENT gce = {0};
- GCDEST gcd = {0};
- DBVARIANT dbv, dbv2;
- char *szChatName;
- int iRet = -1;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (!wParam) return -1;
-
- gcw.cbSize = sizeof(GCSESSION);
- gcw.iType = GCW_CHATROOM;
- gcw.pszModule = SKYPE_PROTONAME;
- gcw.dwFlags = GC_TCHAR;
-
- if (!(szChatName = SkypeGet ("CHAT", (char *)wParam, "FRIENDLYNAME")) || !*szChatName)
- gcw.ptszName=TranslateT("Unknown"); else {
-#ifdef _UNICODE
- gcw.ptszName=make_unicode_string((const unsigned char*)szChatName);
- free (szChatName);
- szChatName = (char*)gcw.ptszName;
-#else
- gcw.ptszName=szChatName;
-#endif
- }
- gcw.ptszID = make_nonutf_tchar_string((const unsigned char*)wParam);
- gcw.pszStatusbarText = NULL;
- EnterCriticalSection(&m_GCMutex);
- if (!CallService(MS_GC_NEWSESSION, 0, (LPARAM)&gcw)) {
- char *szChatRole;
-
- gce.cbSize = sizeof(GCEVENT);
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = (TCHAR*)gcw.ptszID;
- gcd.iType = GC_EVENT_ADDGROUP;
- gce.pDest = &gcd;
- gce.ptszStatus = _T("CREATOR");
- gce.dwFlags = GC_TCHAR;
- // BUG: Groupchat returns nonzero on success here in earlier versions, so we don't check
- // it here
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- gce.ptszStatus = _T("MASTER");
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- gce.ptszStatus = _T("HELPER");
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- gce.ptszStatus = _T("USER");
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- gce.ptszStatus = _T("LISTENER");
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- gce.ptszStatus = _T("APPLICANT");
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
-
- gcd.iType = GC_EVENT_JOIN;
- gce.ptszStatus = NULL;
- if (protocol >=7 && (szChatRole = SkypeGet ("CHAT", (char *)wParam, "MYROLE"))) {
- if (strncmp(szChatRole, "ERROR", 5))
- {
-#ifdef _UNICODE
- gce.ptszStatus = make_unicode_string((const unsigned char*)szChatRole);
- free (szChatRole);
-#else
- gce.ptszStatus = szChatRole;
-#endif
- }
- }
- if (!gce.ptszStatus) gce.ptszStatus=_tcsdup(_T("CREATOR"));
-
- if (!DBGetContactSettingTString(NULL, SKYPE_PROTONAME, "Nick", &dbv)) {
- if (!DBGetContactSettingTString(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv2)) {
- gce.ptszNick = dbv.ptszVal;
- gce.ptszUID = dbv2.ptszVal;
- gce.time = 0;
- gce.bIsMe = TRUE;
- gce.dwFlags |= GCEF_ADDTOLOG;
- if (!CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce)) {
- gce.cbSize = sizeof(GCEVENT);
- gcd.iType = GC_EVENT_CONTROL;
- gce.pDest = &gcd;
- if (!lParam) CallService(MS_GC_EVENT, SESSION_INITDONE, (LPARAM)&gce);
- CallService(MS_GC_EVENT, SESSION_ONLINE, (LPARAM)&gce);
- CallService(MS_GC_EVENT, lParam?WINDOW_HIDDEN:WINDOW_VISIBLE, (LPARAM)&gce);
- SkypeSend ("GET CHAT %s MEMBERS", (char *)wParam);
- iRet = 0;
- } else {LOG (("ChatInit: Joining 'me' failed."));}
- }
- DBFreeVariant(&dbv2);
- }
- free ((void*)gce.ptszStatus);
- DBFreeVariant(&dbv);
- }
- free (szChatName);
- free_nonutf_tchar_string ((void*)gcw.ptszID);
- LeaveCriticalSection(&m_GCMutex);
- return iRet;
-}
-
-/* Open new Groupchat
-
- Parameters: szChatId = (char *)Name of new chat session
-*/
-int __cdecl ChatStart(char *szChatId, BOOL bJustCreate) {
- LOG(("ChatStart: New groupchat started"));
- if (!szChatId || NotifyEventHooks(hInitChat, (WPARAM)szChatId, bJustCreate)) return -1;
- return 0;
-}
-
-
-void KillChatSession(GCDEST *gcd) {
- GCEVENT gce = {0};
-
- EnterCriticalSection(&m_GCMutex);
- LOG(("KillChatSession: Groupchatsession terminated."));
- gce.cbSize = sizeof(GCEVENT);
- gce.dwFlags = GC_TCHAR;
- gce.pDest = gcd;
- gcd->iType = GC_EVENT_CONTROL;
- if (SkypeSend ("ALTER CHAT "STR" LEAVE", gcd->ptszID) == 0)
- {
- CallService(MS_GC_EVENT, SESSION_OFFLINE, (LPARAM)&gce);
- CallService(MS_GC_EVENT, SESSION_TERMINATE, (LPARAM)&gce);
- }
- LeaveCriticalSection(&m_GCMutex);
-}
-
-void InviteUser(TCHAR *szChatId) {
- HMENU tMenu = CreatePopupMenu();
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0), hInvitedUser;
- DBVARIANT dbv;
- HWND tWindow;
- POINT pt;
- gchat_contacts *gc;
- int j;
-
- if (!szChatId || !(gc=GetChat(szChatId))) return;
-
- // add the heading
- AppendMenu(tMenu, MF_STRING|MF_GRAYED|MF_DISABLED, (UINT_PTR)0, TranslateT("&Invite user..."));
- AppendMenu(tMenu, MF_SEPARATOR, (UINT_PTR)1, NULL);
-
- // generate a list of contact
- while (hContact) {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact,0 );
- if (szProto && !strcmp(SKYPE_PROTONAME, szProto) &&
- !DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0) &&
- DBGetContactSettingWord(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE)!=ID_STATUS_OFFLINE)
- {
- BOOL alreadyInSession = FALSE;
- for (j=0; j<gc->mJoinedCount; j++) {
- if (gc->mJoinedContacts[j].hContact==hContact) {
- alreadyInSession = TRUE;
- break;
- }
- }
- if (!alreadyInSession)
- AppendMenu(tMenu, MF_STRING, (UINT_PTR)hContact,
- (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR));
- }
- hContact = (HANDLE)CallService( MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact, 0);
- }
-
- tWindow = CreateWindow(_T("EDIT"),_T(""),0,1,1,1,1,NULL,NULL,hInst,NULL);
-
- GetCursorPos (&pt);
- hInvitedUser = (HANDLE)TrackPopupMenu(tMenu, TPM_NONOTIFY | TPM_LEFTALIGN | TPM_TOPALIGN | TPM_RETURNCMD, pt.x, pt.y, 0, tWindow, NULL);
- DestroyMenu(tMenu);
- DestroyWindow(tWindow);
-
- if (!hInvitedUser || DBGetContactSettingString(hInvitedUser, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
- return;
- SkypeSend ("ALTER CHAT "STR" ADDMEMBERS %s", szChatId, dbv.pszVal);
- DBFreeVariant(&dbv);
-
-}
-
-static void KickUser (HANDLE hContact, GCHOOK *gch)
-{
- char *ptr;
-
- EnterCriticalSection(&m_GCMutex);
- if (SkypeSend ("ALTER CHAT "STR" KICK "STR, gch->pDest->ptszID, gch->ptszUID)!=-1) {
- if (ptr=SkypeRcv("ALTER CHAT KICK", 2000)) {
- if (strncmp(ptr, "ERROR", 5)) {
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- CONTACTINFO ci = {0};
- DBVARIANT dbv;
-
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = (TCHAR*)gch->pDest->ptszID;
- gcd.iType = GC_EVENT_KICK;
-
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.time = (DWORD)time(NULL);
- gce.dwFlags = GCEF_ADDTOLOG | GC_TCHAR;
- gce.ptszUID= gch->ptszUID;
-
- ci.cbSize = sizeof(ci);
- ci.szProto = SKYPE_PROTONAME;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- ci.hContact = hContact;
- if (hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal;
- else gce.ptszNick=gce.ptszUID;
-
- if (!DBGetContactSettingTString(NULL, SKYPE_PROTONAME, "Nick", &dbv)) {
- gce.ptszStatus = dbv.ptszVal;
- CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
- RemChatContact (GetChat(gcd.ptszID), gch->ptszUID);
- DBFreeVariant(&dbv);
- }
- if (ci.pszVal) mir_free (ci.pszVal);
- }
- free (ptr);
- }
- }
- LeaveCriticalSection(&m_GCMutex);
-}
-
-void SetChatTopic (TCHAR *szChatId, TCHAR *szTopic, BOOL bSet)
-{
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- HANDLE hContact = find_chat (szChatId);
- char *szUTFTopic;
-
- gce.cbSize = sizeof(GCEVENT);
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = szChatId;
- gcd.iType = GC_EVENT_TOPIC;
- gce.pDest = &gcd;
- gce.ptszText = szTopic;
- gce.dwFlags = GCEF_ADDTOLOG | GC_TCHAR;
- gce.time = (DWORD)time (NULL);
- gce.dwFlags = GC_TCHAR;
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- gcd.iType = GC_EVENT_SETSBTEXT;
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
-
- if (bSet) {
-#ifdef _UNICODE
- szUTFTopic=(char*)make_utf8_string(szTopic);
-#else
- if (utf8_encode(szTopic, &szUTFTopic)==-1) szUTFTopic = NULL;
-#endif
- if (szUTFTopic) {
- SkypeSend ("ALTER CHAT "STR" SETTOPIC %s", szChatId, szUTFTopic);
- free (szUTFTopic);
- }
- testfor ("ALTER CHAT SETTOPIC", INFINITE);
- }
-
- if (hContact)
- DBWriteContactSettingTString(hContact, SKYPE_PROTONAME, "Nick", szTopic);
-}
-
-
-int GCEventHook(WPARAM wParam,LPARAM lParam) {
- GCHOOK *gch = (GCHOOK*) lParam;
- gchat_contacts *gc = GetChat(gch->pDest->ptszID);
-
- UNREFERENCED_PARAMETER(wParam);
-
- if(gch) {
- if (!_stricmp(gch->pDest->pszModule, SKYPE_PROTONAME)) {
-
- switch (gch->pDest->iType) {
- case GC_SESSION_TERMINATE: {
- HANDLE hContact;
-
- if (gc->mJoinedCount == 1) {
- // switch back to normal session
- // I don't know if this behaviour isn't a bit annoying, therefore, we
- // don't do this now, until a user requests this feature :)
-
- // open up srmm dialog when quit while 1 person left
-// CallService(MS_MSG_SENDMESSAGE, (WPARAM)gc->mJoinedContacts[0].hContact, 0);
-
- RemChatContact(gc, gc->mJoinedContacts[0].who);
- }
- // Delete Chatroom from Contact list, as we don't need it anymore...?
- if (hContact = find_chat(gc->szChatName))
- CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
- RemChat(gc->szChatName);
-
- break;
- }
- case GC_USER_MESSAGE:
- if(gch && gch->ptszText && _tcslen(gch->ptszText) > 0) {
- DBVARIANT dbv, dbv2;
- CCSDATA ccs = {0};
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- TCHAR *pEnd;
-
- // remove the ending linebreak
- for (pEnd = &gch->ptszText[_tcslen(gch->ptszText) - 1];
- *pEnd==_T('\r') || *pEnd==_T('\n'); pEnd--) *pEnd=0;
- // Send message to the chat-contact
- if (ccs.hContact = find_chat(gch->pDest->ptszID)) {
-#ifdef _UNICODE
- // If PREF_UTF is supported, just convert it to UTF8 and pass the buffer to PSS_MESSAGE
- if (mirandaVersion >= 0x070000) {
- ccs.lParam = (LPARAM)make_utf8_string(gch->ptszText);
- ccs.wParam = PREF_UTF;
- CallProtoService (SKYPE_PROTONAME, PSS_MESSAGE, 0, (LPARAM)&ccs);
- free ((void*)ccs.lParam);
- } else {
- // Otherwise create this strange dual miranda-format
- ccs.lParam = (LPARAM)calloc(3, _tcslen(gch->ptszText)+1);
- wcstombs ((char*)ccs.lParam, gch->ptszText, _tcslen(gch->ptszText)+1);
- _tcscpy ((TCHAR*)((char*)ccs.lParam+strlen((char*)ccs.lParam)+1), gch->ptszText);
- ccs.wParam = PREF_UNICODE;
- CallProtoService (SKYPE_PROTONAME, PSS_MESSAGE, 0, (LPARAM)&ccs);
- free ((void*)ccs.lParam);
- }
-#else
- ccs.lParam = (LPARAM)gch->ptszText;
- ccs.wParam = PREF_TCHAR;
- CallProtoService (SKYPE_PROTONAME, PSS_MESSAGE, 0, (LPARAM)&ccs);
-#endif
- }
-
- // Add our line to the chatlog
- gcd.pszModule = gch->pDest->pszModule;
- gcd.ptszID = gch->pDest->ptszID;
- if ( _tcsncmp(gch->ptszText, _T("/me "), 4)==0 && _tcslen(gch->ptszText)>4) {
- gce.ptszText = gch->ptszText+4;
- gcd.iType = GC_EVENT_ACTION;
- }
- else {
- gce.ptszText = gch->ptszText;
- gcd.iType = GC_EVENT_MESSAGE;
- }
-
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- if (DBGetContactSettingTString(NULL, SKYPE_PROTONAME, "Nick", &dbv)) gce.ptszNick=TranslateT("Me");
- else gce.ptszNick = dbv.ptszVal;
- DBGetContactSettingTString(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv2);
- gce.ptszUID = dbv2.ptszVal;
- gce.time = (DWORD)time(NULL);
- gce.dwFlags = GCEF_ADDTOLOG | GC_TCHAR;
- gce.bIsMe = TRUE;
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- if (dbv.pszVal) DBFreeVariant(&dbv);
- if (dbv2.pszVal) DBFreeVariant(&dbv2);
- }
- break;
- case GC_USER_CHANMGR:
- InviteUser(gch->pDest->ptszID);
- break;
- case GC_USER_PRIVMESS: {
- HANDLE hContact = find_contactT(gch->ptszUID);
- if (hContact) CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
- break;
-
- }
- case GC_USER_LOGMENU:
- switch(gch->dwData) {
- case 10: InviteUser(gch->pDest->ptszID); break;
- case 20: KillChatSession(gch->pDest); break;
- case 30:
- {
- TCHAR *ptr, buf[MAX_BUF];
-
- ptr = SkypeGetT ("CHAT", gch->pDest->ptszID, "TOPIC");
- _tcscpy(buf, ptr);
- free(ptr);
- if (DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_INPUTBOX), NULL, InputBoxDlgProc, (LPARAM)&buf))
- SetChatTopic (gch->pDest->ptszID, buf, TRUE);
- break;
- }
- }
- break;
- case GC_USER_NICKLISTMENU: {
- HANDLE hContact = find_contactT(gch->ptszUID);
-
- switch(gch->dwData) {
- case 10:CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); break;
- case 20:CallService(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)hContact, 0); break;
- case 30: KickUser(hContact, gch); break;
- case 110: KillChatSession(gch->pDest); break;
- }
- break;
- }
- default:
- break;
- }
- }
-
- }
- return 0;
-}
-
-int __cdecl GCMenuHook(WPARAM wParam,LPARAM lParam) {
- GCMENUITEMS *gcmi= (GCMENUITEMS*) lParam;
- DBVARIANT dbv;
- TCHAR* szInvite = TranslateT("&Invite user...");
- TCHAR* szLeave = TranslateT("&Leave chat session");
- TCHAR* szTopic = TranslateT("Set &Topic...");
- TCHAR* szDetails = TranslateT("User &details");
- TCHAR* szHistory = TranslateT("User &history");
- TCHAR* szKick = TranslateT("&Kick user");
-
- static struct gc_item Item_log[] = {
- {NULL, 10, MENU_ITEM, FALSE},
- {NULL, 30, MENU_ITEM, FALSE},
- {NULL, 20, MENU_ITEM, FALSE}
- };
- static struct gc_item Item_nicklist_me[] = {
- {NULL, 20, MENU_ITEM, FALSE},
- {_T(""), 100, MENU_SEPARATOR, FALSE},
- {NULL, 110, MENU_ITEM, FALSE}
- };
- static struct gc_item Item_nicklist[] = {
- {NULL, 10, MENU_ITEM, FALSE},
- {NULL, 20, MENU_ITEM, FALSE},
- {NULL, 30, MENU_ITEM, FALSE}
- };
-
- UNREFERENCED_PARAMETER(wParam);
-
- Item_log[0].pszDesc = szInvite;
- Item_log[1].pszDesc = szTopic;
- Item_log[2].pszDesc = szLeave;
- Item_nicklist_me[0].pszDesc = szHistory;
- Item_nicklist_me[2].pszDesc = szLeave;
- Item_nicklist[0].pszDesc = szDetails;
- Item_nicklist[1].pszDesc = szHistory;
- Item_nicklist[2].pszDesc = szKick;
-
- LOG (("GCMenuHook started."));
- if(gcmi) {
- if (!_stricmp(gcmi->pszModule, SKYPE_PROTONAME)) {
- switch (gcmi->Type)
- {
- case MENU_ON_LOG:
- gcmi->nItems = sizeof(Item_log)/sizeof(Item_log[0]);
- gcmi->Item = &Item_log[0];
- LOG (("GCMenuHook: Items in log window: %d", gcmi->nItems));
- break;
- case MENU_ON_NICKLIST:
- if (DBGetContactSettingTString(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1;
- if (!lstrcmp(dbv.ptszVal, gcmi->pszUID)) {
- gcmi->nItems = sizeof(Item_nicklist_me)/sizeof(Item_nicklist_me[0]);
- gcmi->Item = &Item_nicklist_me[0];
- } else {
- gchat_contacts *gcs = GetChat(gcmi->pszID);
- gchat_contact *gc = gcs?GetChatContact(gcs, gcmi->pszUID):NULL;
- gcmi->nItems = sizeof(Item_nicklist)/sizeof(Item_nicklist[0]);
-
- Item_nicklist[2].bDisabled = FALSE;
- if (gc && !gc->hContact)
- {
- gcmi->nItems -= 2;
- gcmi->Item = &Item_nicklist[2];
- }
- else
- gcmi->Item = &Item_nicklist[0];
- /*
- if (protocol<7) Item_nicklist[2].bDisabled = TRUE;
- else {
- TCHAR *szChatRole;
- if (szChatRole = SkypeGetT ("CHAT", gcmi->pszID, "MYROLE")) {
- if (_tcscmp(szChatRole, _T("MASTER")) && _tcscmp(szChatRole, _T("CREATOR")))
- Item_nicklist[2].bDisabled = TRUE;
- free (szChatRole);
- }
- }*/
-
- }
- DBFreeVariant(&dbv);
- break;
- }
- } else {LOG (("GCMenuHook: ERROR: Not our protocol."));}
- } else {LOG (("GCMenuHook: ERROR: No gcmi"));}
- LOG (("GCMenuHook: terminated."));
- return 0;
-}
-
-INT_PTR GCOnLeaveChat(WPARAM wParam,LPARAM lParam)
-{
- HANDLE hContact = (HANDLE)wParam;
- DBVARIANT dbv;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (DBGetContactSettingTString(hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv) == 0)
- {
- GCDEST gcd = {0};
-
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.iType = GC_EVENT_CONTROL;
- gcd.ptszID = dbv.ptszVal;
- KillChatSession(&gcd);
- DBFreeVariant(&dbv);
- }
- return 0;
-}
-
-INT_PTR GCOnJoinChat(WPARAM wParam,LPARAM lParam)
-{
- HANDLE hContact = (HANDLE)wParam;
- DBVARIANT dbv;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv) == 0)
- {
- ChatStart (dbv.pszVal, FALSE);
- DBFreeVariant(&dbv);
- }
- return 0;
-}
-
-void GCInit(void)
-{
- InitializeCriticalSection (&m_GCMutex);
-}
-
-void GCExit(void)
-{
- int i;
-
- DeleteCriticalSection (&m_GCMutex);
- for (i=0;i<chatcount;i++) {
- if (chats[i].szChatName) free(chats[i].szChatName);
- if (chats[i].mJoinedContacts) free(chats[i].mJoinedContacts);
- }
- if (chats) free (chats);
- chats = NULL;
- chatcount = 0;
-}
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/gchat.h b/plugins/!NotAdopted/Skype/gchat.h deleted file mode 100644 index 1bb105d8b5..0000000000 --- a/plugins/!NotAdopted/Skype/gchat.h +++ /dev/null @@ -1,47 +0,0 @@ -// m_chat users these BaseTSD types, so if we are compiling with an old PSDK, these typedefs
-// are not there, so better define them, just in case...
-#ifndef LongToPtr
-#define DWORD_PTR DWORD
-#endif
-
-#pragma warning (push)
-#pragma warning (disable: 4201) // nonstandard extension used : nameless struct/union
-#include "../../include/m_chat.h"
-#pragma warning (pop)
-
-#define MAX_BUF 256 // Buffer for topic-string
-
-typedef struct {
- HANDLE hContact;
- TCHAR who[33];
- TCHAR szRole[12];
-} gchat_contact;
-
-typedef struct {
- TCHAR* szChatName; // name of chat session
- gchat_contact* mJoinedContacts; // contacts
- int mJoinedCount; // contacts count
-} gchat_contacts;
-
-int ChatInit(WPARAM, LPARAM);
-int __cdecl ChatStart(char *szChatId, BOOL bJustCreate);
-gchat_contacts *GetChat(TCHAR *szChatId);
-HANDLE find_chat(TCHAR *chatname);
-#ifdef _UNICODE
-HANDLE find_chatA(char *chatname);
-#else
-#define find_chatA find_chat
-#endif
-void RemChatContact(gchat_contacts*, const TCHAR*);
-gchat_contact *GetChatContact(gchat_contacts *gc, const TCHAR *who);
-int AddMembers(char*);
-void AddMembersThread(char *szSkypeMsg);
-void RemChat(TCHAR *szChatId);
-int GCEventHook (WPARAM, LPARAM);
-int GCMenuHook (WPARAM, LPARAM);
-void KillChatSession(GCDEST*);
-INT_PTR GCOnLeaveChat(WPARAM wParam,LPARAM lParam);
-INT_PTR GCOnJoinChat(WPARAM wParam,LPARAM lParam);
-void GCInit(void);
-void GCExit(void);
-void SetChatTopic (TCHAR *szChatId, TCHAR *szTopic, BOOL bSet);
diff --git a/plugins/!NotAdopted/Skype/m_popup.h b/plugins/!NotAdopted/Skype/m_popup.h deleted file mode 100644 index 243c8ac1b6..0000000000 --- a/plugins/!NotAdopted/Skype/m_popup.h +++ /dev/null @@ -1,307 +0,0 @@ -/*
-===============================================================================
- PopUp plugin
-Plugin Name: PopUp
-Plugin authors: Luca Santarelli aka hrk (hrk@users.sourceforge.net)
- Victor Pavlychko aka zazoo (zazoo@ua.fm)
-===============================================================================
-The purpose of this plugin is to give developers a common "platform/interface"
-to show PopUps. It is born from the source code of NewStatusNotify, another
-plugin I've made.
-
-Remember that users *must* have this plugin enabled, or they won't get any
-popup. Write this in the requirements, do whatever you wish ;-)... but tell
-them!
-===============================================================================
-*/
-#ifndef M_POPUP_H
-#define M_POPUP_H
-
-/*
-NOTE! Since Popup 1.0.1.2 there is a main meun group called "PopUps" where I
-have put a "Enable/Disable" item. You can add your own "enable/disable" items
-by adding these lines before you call MS_CLIST_ADDMAINMENUITEM:
-mi.pszPopUpName = Translate("PopUps");
-mi.position = 0; //You don't need it and it's better if you put it to zero.
-*/
-
-//#define MAX_CONTACTNAME 32
-//#define MAX_SECONDLINE 40
-#define MAX_CONTACTNAME 2048
-#define MAX_SECONDLINE 2048
-
-#define POPUP_USE_SKINNED_BG 0xffffffff
-
-//This is the basic data you'll need to fill and pass to the service function.
-typedef struct {
- HANDLE lchContact; //Handle to the contact, can be NULL (main contact).
- HICON lchIcon; //Handle to a icon to be shown. Cannot be NULL.
- char lpzContactName[MAX_CONTACTNAME]; //This is the contact name or the first line in the plugin. Cannot be NULL.
- char lpzText[MAX_SECONDLINE]; //This is the second line text. Users can choose to hide it. Cannot be NULL.
- COLORREF colorBack; //COLORREF to be used for the background. Can be NULL, default will be used.
- COLORREF colorText; //COLORREF to be used for the text. Can be NULL, default will be used.
- WNDPROC PluginWindowProc; //Read below. Can be NULL; default will be used.
- void * PluginData; //Read below. Can be NULL.
-} POPUPDATA, * LPPOPUPDATA;
-
-typedef struct {
- HANDLE lchContact;
- HICON lchIcon;
- char lpzContactName[MAX_CONTACTNAME];
- char lpzText[MAX_SECONDLINE];
- COLORREF colorBack; //Set background to POPUP_USE_SKINNED_BG to turn on skinning
- COLORREF colorText;
- WNDPROC PluginWindowProc;
- void * PluginData;
- int iSeconds; //Custom delay time in seconds. -1 means "forever", 0 means "default time".
- LPCTSTR lpzClass; //PopUp class. Used with skinning. See PopUp/AddClass for details
- COLORREF skinBack; //Background color for colorizable skins
- char cZero[16 - sizeof(LPCTSTR) - sizeof(COLORREF)];
- //some unused bytes which may come useful in the future.
-} POPUPDATAEX, *LPPOPUPDATAEX;
-
-/*
-When you call MS_POPUP_ADDPOPUP, my plugin will check if the given POPUPDATA structure is filled with acceptable values. If not, the data will be rejected and no popup will be shown.
-
-- lpzText should be given, because it's really bad if a user chooses to have the second line displayed
-and it's empty :-) Just write it and let the user choose if it will be displayed or not.
-
-- PluginWindowProc is a WNDPROC address you have to give me. Why? What? Where? Calm down 8)
-My plugin will take care of the creation of the popup, of the destruction of the popup, of the come into
-view and the hiding of the popup. Transparency, animations... all this stuff.
-My plugin will not (as example) open the MessageWindow when you left click on a popup.
-Why? Because I don't know if your popup desires to open the MessageWindow :))))
-This means that you need to make a WNDPROC which takes care of the WM_messages you need.
-For example, WM_COMMAND or WM_CONTEXTMENU or WM_LMOUSEUP or whatever.
-At the end of your WNDPROC remember to "return DefWindowProc(hwnd, msg, wParam, lParam);"
-When you process a message that needs a return value (an example could be WM_CTLCOLORSTATIC,
-but you don't need to catch it 'cause it's my plugin's job), simply return the nedeed value. :)
-The default WNDPROC does nothing.
-
-- PluginData is a pointer to a void, which means a pointer to anything. You can make your own structure
-to store the data you need (example: a status information, a date, your name, whatever) and give me a
-pointer to that struct.
-You will need to destroy that structure and free the memory when the PopUp is going to be destroyed. You'll know this when you receive a UM_FREEPLUGINDATA. The name tells it all: free your own plugin data.
-
-Appendix A: Messages my plugin will handle and your WNDPROC will never see.
-WM_CREATE, WM_DESTROY, WM_TIMER, WM_ERASEBKGND
-WM_CTLCOLOR* [whatever it may be: WM_CTLCOLORDLG, WM_CTLCOLORSTATIC...]
-WM_PAINT, WM_PRINT, WM_PRINTCLIENT
-
-Appendix B: "What do I need to do?!?".
-Here is an example in C.
-
-//Your plugin is in /plugins/myPlugin/ or in miranda32/something/
-#include "../../plugins/PopUp/m_popup.h"
-
-Define your own plugin data if you need it. In this example, we need it and we'll use NewStatusNotify as example: thsi plugin shows a popup when someone in your contact list changes his/hers status. We'll need to know his status, both current and old one.
-typedef struct {
- WORD oldStatus;
- WORD newStatus;
-} MY_PLUGIN_DATA;
-
-When we need to show the popup, we do:
-{
- POPUPDATA ppd;
- hContact = A_VALID_HANDLE_YOU_GOT_FROM_SOMEWHERE;
- hIcon = A_VALID_HANDLE_YOU_GOT_SOMEWHERE;
- char * lpzContactName = (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)lhContact,0);
- //99% of the times you'll just copy this line.
- //1% of the times you may wish to change the contact's name. I don't know why you should, but you can.
- char * lpzText;
- //The text for the second line. You could even make something like: char lpzText[128]; lstrcpy(lpzText, "Hello world!"); It's your choice.
- COLORREF colorBack = GetSysColor(COLOR_BTNFACE); //The colour of Miranda's option Pages (and many other windows...)
- COLORREF colorText = RGB(255,255,255); //White.
- MY_PLUGIN_DATA * mpd = (MY_PLUGIN_DATA*)malloc(sizeof(MY_PLUGIN_DATA));
-
- ZeroMemory(ppd, sizeof(ppd)); //This is always a good thing to do.
- ppd.lchContact = (HANDLE)hContact; //Be sure to use a GOOD handle, since this will not be checked.
- ppd.lchIcon = hIcon;
- lstrcpy(ppd.lpzContactName, lpzContactName);
- lstrcpy(ppd.lpzText, lpzText);
- ppd.colorBack = colorBack;
- ppd.colorText = colorText;
- ppd.PluginWindowProc = (WNDPROC)PopupDlgProc;
-
- //Now the "additional" data.
- mpd->oldStatus = ID_STATUS_OFFLINE;
- mpd->newStatus = ID_STATUS_ONLINE;
-
- //Now that the plugin data has been filled, we add it to the PopUpData.
- ppd.PluginData = mpd;
-
- //Now that every field has been filled, we want to see the popup.
- CallService(MS_POPUP_ADDPOPUP, (WPARAM)&ppd, 0);
-}
-
-Obviously, you have previously declared some:
-static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- switch(message) {
- case WM_COMMAND:
- if ((HIWORD)wParam == STN_CLICKED) { //It was a click on the Popup.
- PUDeletePopUp(hWnd);
- return TRUE;
- }
- break;
- case UM_FREEPLUGINDATA: {
- MY_PLUGIN_DATA * mpd = NULL;
- mpd = (MY_PLUGIN_DATA*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)mpd);
- if (mdp > 0) free(mpd);
- return TRUE; //TRUE or FALSE is the same, it gets ignored.
- }
- default:
- break;
- }
- return DefWindowProc(hWnd, message, wParam, lParam);
-}
-*/
-
-/*
-Creates, adds and shows a popup, given a (valid) POPUPDATA structure pointer.
-wParam = (WPARAM)(*POPUPDATA)PopUpDataAddress
-lParam = 0
-Returns: > 0 on success, 0 if creation went bad, -1 if the PopUpData contained unacceptable values.
-NOTE: it returns -1 if the PopUpData was not valid, if there were already too many popups, if the module was disabled.
-Otherwise, it can return anything else...
-*/
-#define MS_POPUP_ADDPOPUP "PopUp/AddPopUp"
-static int __inline PUAddPopUp(POPUPDATA* ppdp) {
- return CallService(MS_POPUP_ADDPOPUP, (WPARAM)ppdp,0);
-}
-
-#define MS_POPUP_ADDPOPUPEX "PopUp/AddPopUpEx"
-static int __inline PUAddPopUpEx(POPUPDATAEX* ppdp) {
- return CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)ppdp,0);
-}
-
-/*
-Returns the handle to the contact associated to the specified PopUpWindow.
-You will probably need to know this handle inside your WNDPROC. Exampole: you want to open the MessageWindow. :-)
-Call MS_POPUP_GETCONTACT on the hWnd you were given in the WNDPROC.
-wParam = (WPARAM)(HWND)hPopUpWindow
-lParam = 0;
-Returns: the HANDLE of the contact. Can return NULL, meaning it's the main contact. -1 means failure.
-*/
-#define MS_POPUP_GETCONTACT "PopUp/GetContact"
-static HANDLE __inline PUGetContact(HWND hPopUpWindow) {
- return (HANDLE)CallService(MS_POPUP_GETCONTACT, (WPARAM)hPopUpWindow,0);
-}
-
-/*
-wParam = (WPARAM)(HWND)hPopUpWindow
-lParam = (LPARAM)(PLUGINDATA*)PluginDataAddress;
-Returns: the address of the PLUGINDATA structure. Can return NULL, meaning nothing was given. -1 means failure.
-IMPORTANT NOTE: it doesn't seem to work if you do:
-CallService(..., (LPARAM)aPointerToAStruct);
-and then use that struct.
-Do this, instead:
-aPointerToStruct = CallService(..., (LPARAM)aPointerToAStruct);
-and it will work. Just look at the example I've written above (PopUpDlgProc).
-*/
-#define MS_POPUP_GETPLUGINDATA "PopUp/GetPluginData"
-static void __inline * PUGetPluginData(HWND hPopUpWindow) {
- long * uselessPointer = NULL;
- return (void*)CallService(MS_POPUP_GETPLUGINDATA,(WPARAM)hPopUpWindow,(LPARAM)uselessPointer);
-}
-
-/*
-wParam = 0
-lParam = 0
-Returns: 0 if the user has chosen not to have the second line, 1 if he choose to have the second line.
-*/
-#define MS_POPUP_ISSECONDLINESHOWN "PopUp/IsSecondLineShown"
-static BOOL __inline PUIsSecondLineShown() {
- return (BOOL)CallService(MS_POPUP_ISSECONDLINESHOWN,0,0);
-}
-
-/*
-Requests an action or an answer from PopUp module.
-wParam = (WPARAM)wpQuery
-returns 0 on success, -1 on error, 1 on stupid calls ;-)
-*/
-#define PUQS_ENABLEPOPUPS 1 //returns 0 if state was changed, 1 if state wasn't changed
-#define PUQS_DISABLEPOPUPS 2 // " "
-#define PUQS_GETSTATUS 3 //Returns 1 (TRUE) if popups are enabled, 0 (FALSE) if popups are disabled.
-
-#define MS_POPUP_QUERY "PopUp/Query"
-
-/*
-UM_FREEPLUGINDATA
-wParam = lParam = 0. Process this message if you have allocated your own memory. (i.e.: POPUPDATA.PluginData != NULL)
-*/
-#define UM_FREEPLUGINDATA (WM_USER + 0x0200)
-
-/*
-UM_DESTROYPOPUP
-wParam = lParam = 0. Send this message when you want to destroy the popup, or use the function below.
-*/
-#define UM_DESTROYPOPUP (WM_USER + 0x0201)
-static int __inline PUDeletePopUp(HWND hWndPopUp) {
- return (int)SendMessage(hWndPopUp, UM_DESTROYPOPUP,0,0);
-}
-
-/*
-UM_INITPOPUP
-wParam = (WPARAM)(HWND)hPopUpWindow (but this is useless, since I'll directly send it to your hPopUpWindow
-lParam = 0.
-This message is sent to the PopUp when its creation has been finished, so POPUPDATA (and thus your PluginData) is reachable.
-Catch it if you needed to catch WM_CREATE or WM_INITDIALOG, which you'll never ever get in your entire popup-life.
-Return value: if you process this message, return 0. If you don't process it, return 0. Do whatever you like ;-)
-*/
-#define UM_INITPOPUP (WM_USER + 0x0202)
-
-/*
-wParam = (WPARAM)(HWND)hPopUpWindow
-lParam = (LPARAM)(char*)lpzNewText
-returns: > 0 for success, -1 for failure, 0 if the failure is due to second line not being shown. (but you could call PUIsSecondLineShown() before changing the text...)
-Changes the text displayed in the second line of the popup.
-*/
-#define MS_POPUP_CHANGETEXT "PopUp/Changetext"
-static int __inline PUChangeText(HWND hWndPopUp, LPCTSTR lpzNewText) {
- return (int)CallService(MS_POPUP_CHANGETEXT, (WPARAM)hWndPopUp, (LPARAM)lpzNewText);
-}
-
-/*
-This is mainly for developers.
-Shows a warning message in a PopUp. It's useful if you need a "MessageBox" like function, but you don't want a modal window (which will interfere with a DialogProcedure. MessageBox steals focus and control, this one not.
-wParam = (char*) lpzMessage
-lParam = 0;
-Returns: 0 if the popup was shown, -1 in case of failure.
-*/
-#define SM_WARNING 0x01 //Triangle icon.
-#define SM_NOTIFY 0x02 //Exclamation mark icon.
-#define MS_POPUP_SHOWMESSAGE "PopUp/ShowMessage"
-
-static int __inline PUShowMessage(char* lpzText, BYTE kind) {
- return (int)CallService(MS_POPUP_SHOWMESSAGE, (WPARAM)lpzText,(LPARAM)kind);
-}
-
-/*
-Each skinned popup (e.g. with colorBack == POPUP_USE_SKINNED_BG) should have
-class set. Then you can choose separate skin for each class (for example, you
-can create separate class for your plugin and use it for all ypu popups. User
-would became able to choose skin for your popups independently from others)
-
-You have to register popup class before using it. To do so call "PopUp/AddClass"
-with lParam = (LPARAM)(const char *)popUpClassName.
-
-All class names are translated (via Translate()) before being added to list. You
-should use english names for them.
-
-There are three predefined classes and one for backward compatability.
-
-Note that you can add clases after popup wal loaded, e.g. you shoul intercept
-ME_SYSTEM_MODULESLOADED event
-*/
-#define MS_POPUP_ADDCLASS "PopUp/AddClass"
-#define POPUP_CLASS_DEFAULT "Default"
-#define POPUP_CLASS_WARNING "Warning"
-#define POPUP_CLASS_NOTIFY "Notify"
-#define POPUP_CLASS_OLDAPI "PopUp 1.0.1.x compatability" // for internal purposes
-
-static void __inline PUAddClass(const char *lpzClass){
- CallService(MS_POPUP_ADDCLASS, 0, (LPARAM)lpzClass);
-}
-
-#endif
diff --git a/plugins/!NotAdopted/Skype/m_toptoolbar.h b/plugins/!NotAdopted/Skype/m_toptoolbar.h deleted file mode 100644 index 6b1a0182be..0000000000 --- a/plugins/!NotAdopted/Skype/m_toptoolbar.h +++ /dev/null @@ -1,107 +0,0 @@ -
-#ifndef M_TOPTOOLBAR_H
-#define M_TOPTOOLBAR_H
-
-//button flags
-#define TTBBF_DISABLED 1
-#define TTBBF_VISIBLE 2
-#define TTBBF_PUSHED 4
-#define TTBBF_SHOWTOOLTIP 8
-#define TTBBF_DRAWBORDER 16//draw border for bitmap,bitmap must be WxH 16x12
-#define TTBBF_ISSEPARATOR 32
-
-//for internal launch buttons
-#define TTBBF_ISLBUTTON 64
-
-typedef struct {
- int cbSize;
- HBITMAP hbBitmapUp;
- HBITMAP hbBitmapDown;
- char *pszServiceUp;
- char *pszServiceDown;
- DWORD dwFlags;
- LPARAM lParamUp;
- WPARAM wParamUp;
- LPARAM lParamDown;
- WPARAM wParamDown;
- char *name;
-
-} TTBButton, * lpTTBButton;
-
-//=== EVENTS ===
-/*
-toptoolbar/moduleloaded event
-wParam = lParam = 0
-Called when the toolbar services are available
-
-!!!Warning you may work with TTB services only in this event or later.
-
-*/
-#define ME_TTB_MODULELOADED "TopToolBar/ModuleLoaded"
-
-
-
-//=== SERVICES ===
-/*
-toptoolbar/addbutton service
-wparam = (TTBButton*)lpTTBButton
-lparam = 0
-returns: hTTBButton - handle of added button on success, -1 on failure.
-*/
-#define MS_TTB_ADDBUTTON "TopToolBar/AddButton"
-
-/*
-toptoolbar/removebutton service
-wparam = (HANDLE)hTTButton
-lparam = 0
-returns: 0 on success, -1 on failure.
-*/
-#define MS_TTB_REMOVEBUTTON "TopToolBar/RemoveButton"
-
-/*
-toptoolbar/setstate service
-wparam = (HANDLE)hTTButton
-lparam = (LPARAM) state
-returns: 0 on success, -1 on failure.
-*/
-#define TTBST_PUSHED 1
-#define TTBST_RELEASED 2
-
-#define MS_TTB_SETBUTTONSTATE "TopToolBar/SetState"
-
-/*
-toptoolbar/getstate service
-wparam = (HANDLE)hTTButton
-lparam = 0
-returns: state on success, -1 on failure.
-*/
-#define MS_TTB_GETBUTTONSTATE "TopToolBar/GetState"
-
-/*
-toptoolbar/getoptions service
-(HIWORD)wparam = (HANDLE)hTTButton
-(LOWORD)wparam = TTBO_FLAG
-lparam = 0,or lparam=lpTTBButton if flag=TTBO_ALLDATA
-returns: value on success, -1 on failure.
-*/
-#define TTBO_FLAGS 0 //get/set all flags
-#define TTBO_POS 1 //position
-#define TTBO_WIDTH 2 //not impemented
-#define TTBO_HEIGHT 3 //not impemented
-#define TTBO_TIPNAME 4 //tool tip name
-#define TTBO_ALLDATA 5 //change all data via lparam=lpTTBButton
-
-
-#define MS_TTB_GETBUTTONOPTIONS "TopToolBar/GetOptions"
-
-/*
-toptoolbar/setoptions service
-(HIWORD)wparam = (HANDLE)hTTButton
-(LOWORD)wparam = TTBO_FLAG
-lparam = value
-returns: 1 on success, -1 on failure.
-*/
-#define MS_TTB_SETBUTTONOPTIONS "TopToolBar/SetOptions"
-
-
-#endif
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/make.bat b/plugins/!NotAdopted/Skype/make.bat deleted file mode 100644 index 0821b0041f..0000000000 --- a/plugins/!NotAdopted/Skype/make.bat +++ /dev/null @@ -1,6 +0,0 @@ -cmd /c make_w32
-cmd /c make_w64
-cmd /c make_debug_w32
-cmd /c make_debug_w64
-pause
-deploy
diff --git a/plugins/!NotAdopted/Skype/make_w32.bat b/plugins/!NotAdopted/Skype/make_w32.bat deleted file mode 100644 index ebcd4cfcb1..0000000000 --- a/plugins/!NotAdopted/Skype/make_w32.bat +++ /dev/null @@ -1,5 +0,0 @@ -call "F:\Programme\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
-nmake -f Skype_protocol.mak CFG="Win32 Release" clean
-nmake -f Skype_protocol.mak CFG="Win32 Release"
-nmake -f Skype_protocol.mak CFG="Win32 UNICODE Release" clean
-nmake -f Skype_protocol.mak CFG="Win32 UNICODE Release"
diff --git a/plugins/!NotAdopted/Skype/make_w64.bat b/plugins/!NotAdopted/Skype/make_w64.bat deleted file mode 100644 index 619679433c..0000000000 --- a/plugins/!NotAdopted/Skype/make_w64.bat +++ /dev/null @@ -1,6 +0,0 @@ -call f:\PlatformSDK\SetEnv /X64 /RETAIL
-rem There is no ANSI x64 Miranda build
-rem nmake -f Skype_protocol.mak CFG="Win64 Release" clean
-rem nmake -f Skype_protocol.mak CFG="Win64 Release"
-nmake -f Skype_protocol.mak CFG="Win64 UNICODE Release" clean
-nmake -f Skype_protocol.mak CFG="Win64 UNICODE Release"
diff --git a/plugins/!NotAdopted/Skype/memlist.c b/plugins/!NotAdopted/Skype/memlist.c deleted file mode 100644 index 3d880feb23..0000000000 --- a/plugins/!NotAdopted/Skype/memlist.c +++ /dev/null @@ -1,248 +0,0 @@ -// The omnipresent memory list, WIN32 implementation, thread safe
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include "memlist.h"
-
-#pragma warning (disable: 4706) // assignment within conditional expression
-
-struct _tagLIST
-{
- unsigned int uiCount;
- unsigned int uiCapacity;
- void **apStorage;
- HANDLE hHeap;
- CRITICAL_SECTION cs;
-};
-
-
-TYP_LIST *List_Init(unsigned int uiCapacity)
-{
- HANDLE hHeap = GetProcessHeap();
- TYP_LIST *pstHandle;
-
- pstHandle = (TYP_LIST *)HeapAlloc(hHeap, 0, sizeof(TYP_LIST));
- if (!pstHandle) return NULL;
- pstHandle->uiCount = 0;
- pstHandle->uiCapacity = uiCapacity;
- if (uiCapacity == 0)
- pstHandle->apStorage = NULL;
- else
- {
- pstHandle->apStorage = (void **)HeapAlloc(hHeap, 0, sizeof(void *)*uiCapacity);
- if (!pstHandle->apStorage)
- {
- HeapFree (hHeap, 0, pstHandle);
- return NULL;
- }
- }
- pstHandle->hHeap = hHeap;
- InitializeCriticalSection (&pstHandle->cs);
- return pstHandle;
-}
-
-void List_Exit(TYP_LIST *pstHandle)
-{
- if (pstHandle->apStorage)
- HeapFree (pstHandle->hHeap, 0, pstHandle->apStorage);
- DeleteCriticalSection (&pstHandle->cs);
- HeapFree (pstHandle->hHeap, 0, pstHandle);
-}
-
-BOOL List_Push(TYP_LIST *pstHandle, void *pItem)
-{
- return List_InsertElementAt(pstHandle, pItem,pstHandle->uiCount);
-}
-
-void *List_Pop (TYP_LIST *pstHandle)
-{
- if (pstHandle->uiCount)
- return List_RemoveElementAt(pstHandle ,pstHandle->uiCount-1);
- else return NULL;
-}
-
-BOOL List_InsertElementAt(TYP_LIST *pstHandle, void *pItem, unsigned int uiPos)
-{
- unsigned int uiStep;
- void **apNewStorage;
-
- EnterCriticalSection (&pstHandle->cs);
- if (uiPos > pstHandle->uiCount)
- uiPos = pstHandle->uiCount;
-
- if (pstHandle->uiCount >= pstHandle->uiCapacity)
- {
- uiStep = pstHandle->uiCount*2;
- if (uiStep < 8) uiStep = 8;
-
- if (!pstHandle->apStorage)
- apNewStorage = (void **)HeapAlloc(pstHandle->hHeap, 0, sizeof(void *)*uiStep);
- else
- apNewStorage = HeapReAlloc (pstHandle->hHeap, 0, pstHandle->apStorage, sizeof(void *)*uiStep);
- if (!apNewStorage)
- {
- LeaveCriticalSection (&pstHandle->cs);
- return FALSE;
- }
- pstHandle->apStorage = apNewStorage;
- pstHandle->uiCapacity = uiStep;
- }
-
- if (uiPos<pstHandle->uiCount)
- MoveMemory (&pstHandle->apStorage[uiPos+1], &pstHandle->apStorage[uiPos], (pstHandle->uiCount-uiPos)*sizeof(void*));
- pstHandle->apStorage[uiPos] = pItem;
- pstHandle->uiCount++;
- LeaveCriticalSection (&pstHandle->cs);
- return TRUE;
-}
-
-void *List_RemoveElementAt(TYP_LIST *pstHandle, unsigned int uiPos)
-{
- void *pRet;
-
- EnterCriticalSection (&pstHandle->cs);
- pRet = pstHandle->apStorage[uiPos];
- if (uiPos<pstHandle->uiCount)
- MoveMemory (&pstHandle->apStorage[uiPos], &pstHandle->apStorage[uiPos+1], (pstHandle->uiCount-uiPos)*sizeof(void*));
- pstHandle->uiCount--;
- LeaveCriticalSection (&pstHandle->cs);
- return pRet;
-}
-
-unsigned int List_Count(TYP_LIST *pstHandle)
-{
- return pstHandle->uiCount;
-}
-
-void *List_ElementAt(TYP_LIST *pstHandle,unsigned int uiPos)
-{
- void *pRet = NULL;
-
- EnterCriticalSection (&pstHandle->cs);
- if (uiPos < pstHandle->uiCount)
- pRet = pstHandle->apStorage[uiPos];
- LeaveCriticalSection (&pstHandle->cs);
- return pRet;
-}
-
-void *List_Top(TYP_LIST *pstHandle)
-{
- if (pstHandle->uiCount)
- return List_ElementAt (pstHandle, pstHandle->uiCount-1);
- else return NULL;
-}
-
-#ifdef _INC_STDLIB
-void List_Sort(TYP_LIST *pstHandle, int (*pFunc)(const void*,const void*))
-{
- EnterCriticalSection (&pstHandle->cs);
- qsort(pstHandle->apStorage,pstHandle->uiCount,sizeof(void *),pFunc);
- LeaveCriticalSection (&pstHandle->cs);
-}
-#endif
-
-
-void List_FreeElements(TYP_LIST *pstHandle)
-{
- void *pEntry;
- HANDLE hHeap = GetProcessHeap();
-
- while (pEntry = List_Pop(pstHandle))
- HeapFree (hHeap, 0, pEntry);
-}
-
-BOOL List_BinarySearch(TYP_LIST *hPList,
- int (*pPFunc)(const void *pstPElement,const void *pstPToFind),
- const void *pstPToFind,int *piPToInsert)
-{
- unsigned int
- iStart,
- iEnd,
- iInd;
- int iRetCompare;
-
- if (hPList == NULL)
- {
- *piPToInsert = 0;
- return FALSE;
- }
-
- iStart = 0;
- if (hPList->uiCount == 0)
- {
- *piPToInsert = 0;
- return FALSE;
- }
- EnterCriticalSection (&hPList->cs);
- iEnd = hPList->uiCount-1;
-
- iRetCompare = (*pPFunc)(hPList->apStorage[0],pstPToFind);
- if (iRetCompare >= 0)
- {
- *piPToInsert = 0;
- LeaveCriticalSection (&hPList->cs);
- return iRetCompare == 0;
- }
-
- iRetCompare = (*pPFunc)(hPList->apStorage[iEnd],pstPToFind);
- if (iRetCompare < 0)
- {
- *piPToInsert = hPList->uiCount;
- LeaveCriticalSection (&hPList->cs);
- return FALSE;
- }
- else if (iRetCompare == 0)
- {
- *piPToInsert = hPList->uiCount-1;
- LeaveCriticalSection (&hPList->cs);
- return TRUE;
- }
-
- // Otherwise C4702: unreachable code below
- #pragma warning (suppress: 4127) // conditional expression is constant
- while(1)
- {
- switch (iEnd-iStart)
- {
- case 0:
- *piPToInsert = iStart;
- LeaveCriticalSection (&hPList->cs);
- return FALSE;
- case 1:
- *piPToInsert = iStart+1;
- LeaveCriticalSection (&hPList->cs);
- return FALSE;
- default:
- iInd = iStart + (iEnd-iStart)/2;
- iRetCompare = (*pPFunc)(hPList->apStorage[iInd],pstPToFind);
- if (iRetCompare == 0)
- {
- *piPToInsert = iInd;
- LeaveCriticalSection (&hPList->cs);
- return TRUE;
- }
- if (iRetCompare < 0)
- iStart = iInd;
- else
- iEnd = iInd;
- break;
- }
- }
-
- LeaveCriticalSection (&hPList->cs);
- return FALSE;
-}
-
-BOOL List_InsertSort(TYP_LIST *hPList,
- int (*pPFunc)(const void *pstPElement,const void *pstPToFind),
- void *pItem)
-{
- int iListInd;
-
- if (!List_BinarySearch(hPList,pPFunc,(void *)pItem,&iListInd))
- {
- return List_InsertElementAt (hPList, pItem, iListInd);
- }
- return FALSE;
-}
-
-
diff --git a/plugins/!NotAdopted/Skype/memlist.h b/plugins/!NotAdopted/Skype/memlist.h deleted file mode 100644 index de4d52bdd1..0000000000 --- a/plugins/!NotAdopted/Skype/memlist.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __MEMLIST_H__
-#define __MEMLIST_H__
-
-// Optional for programs linked against CRT:
-// Remove this if you want a proper plain WIN32-App
-//#include <stdlib.h>
-
-struct _tagLIST;
-typedef struct _tagLIST TYP_LIST;
-
-TYP_LIST *List_Init(unsigned int uiCapacity);
-void List_Exit(TYP_LIST *pstHandle);
-BOOL List_Push(TYP_LIST *pstHandle, void *pItem);
-void *List_Pop (TYP_LIST *pstHandle);
-BOOL List_InsertElementAt(TYP_LIST *pstHandle, void *pItem, unsigned int uiPos);
-void *List_RemoveElementAt(TYP_LIST *pstHandle, unsigned int uiPos);
-unsigned int List_Count(TYP_LIST *pstHandle);
-void *List_ElementAt(TYP_LIST *pstHandle,unsigned int uiPos);
-void *List_Top(TYP_LIST *pstHandle);
-void List_FreeElements(TYP_LIST *pstHandle);
-BOOL List_BinarySearch(TYP_LIST *hPList,
- int (*pPFunc)(const void *pstPElement,const void *pstPToFind),
- const void *pstPToFind,int *piPToInsert);
-BOOL List_InsertSort(TYP_LIST *hPList,
- int (*pPFunc)(const void *pstPElement,const void *pstPToFind),
- void *pItem);
-
-#ifdef _INC_STDLIB
-void List_Sort(TYP_LIST *pstHandle, int (*pFunc)(const void*,const void*));
-#else
-#undef RtlMoveMemory
-NTSYSAPI
-VOID
-NTAPI
-RtlMoveMemory (
- VOID UNALIGNED *Destination,
- CONST VOID UNALIGNED *Source,
- SIZE_T Length
- );
-
-#endif
-
-#endif
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/msglist.c b/plugins/!NotAdopted/Skype/msglist.c deleted file mode 100644 index 113d6e5a5d..0000000000 --- a/plugins/!NotAdopted/Skype/msglist.c +++ /dev/null @@ -1,86 +0,0 @@ -#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include "memlist.h"
-#include "debug.h"
-#include "msglist.h"
-
-#define MSGLIST_TIMEOUT 1800 // Chatmessage references will be kept for 30 minutes
-
-static TYP_LIST *m_hMsgList = NULL;
-
-static int CmpProc(const void *pstPElement,const void *pstPToFind)
-{
- return (DWORD)pstPToFind - ((TYP_MSGLENTRY*)pstPElement)->uMsgNum;
-}
-
-void MsgList_Init(void)
-{
- m_hMsgList = List_Init(128);
-}
-
-void MsgList_Exit(void)
-{
- if (!m_hMsgList) return;
- List_FreeElements (m_hMsgList);
- List_Exit(m_hMsgList);
- m_hMsgList = NULL;
-}
-
-TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, HANDLE hEvent)
-{
- TYP_MSGLENTRY *pEntry;
- int iListInd;
- BOOL bFound;
-
- LOG (("MsgList_Add (%d, %08X)", uMsgNum, hEvent));
- if (!m_hMsgList || !hEvent) return FALSE;
- bFound = List_BinarySearch(m_hMsgList,CmpProc,(void *)uMsgNum,&iListInd);
- if (!bFound) pEntry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TYP_MSGLENTRY));
- else pEntry = List_ElementAt (m_hMsgList, iListInd);
- if (!pEntry) return NULL;
- pEntry->uMsgNum = uMsgNum;
- pEntry->hEvent = hEvent;
- pEntry->tEdited = 0;
- time(&pEntry->t);
- if (!bFound) return List_InsertElementAt (m_hMsgList, pEntry, iListInd)?pEntry:NULL;
- return pEntry;
-}
-
-
-TYP_MSGLENTRY *MsgList_FindMessage(DWORD uMsgNum)
-{
- TYP_MSGLENTRY *pEntry;
- int iPos;
-
- LOG (("MsgList_FindEvent (%d)", uMsgNum));
- if (m_hMsgList && List_BinarySearch(m_hMsgList, CmpProc, (void*)uMsgNum, &iPos))
- {
- pEntry = List_ElementAt (m_hMsgList, iPos);
- time(&pEntry->t); // Touch it, so that it doesn't get thrown away too soon
- LOG (("MsgList_FindEvent(%d): %08X", uMsgNum, pEntry->hEvent));
- return pEntry;
- }
- return NULL;
-}
-
-void MsgList_CollectGarbage(void)
-{
- unsigned int i;
- TYP_MSGLENTRY *pEntry;
- time_t t;
-
- if (!m_hMsgList) return;
- time(&t);
- t-=MSGLIST_TIMEOUT;
- for (i=0; i<List_Count(m_hMsgList); i++)
- {
- pEntry = List_ElementAt (m_hMsgList, i);
- if (pEntry->t < t)
- {
- LOG (("MsgList_CollectGarbage throwing out msg %d", pEntry->uMsgNum));
- HeapFree (GetProcessHeap(), 0, List_RemoveElementAt (m_hMsgList, i));
- i--;
- }
- }
-}
-
diff --git a/plugins/!NotAdopted/Skype/msglist.h b/plugins/!NotAdopted/Skype/msglist.h deleted file mode 100644 index 66a271ef18..0000000000 --- a/plugins/!NotAdopted/Skype/msglist.h +++ /dev/null @@ -1,15 +0,0 @@ -#include <time.h>
-
-typedef struct {
- DWORD uMsgNum;
- HANDLE hEvent;
- HANDLE hMetaEvent;
- time_t t;
- time_t tEdited;
-} TYP_MSGLENTRY;
-
-void MsgList_Init(void);
-void MsgList_Exit(void);
-TYP_MSGLENTRY *MsgList_Add(DWORD uMsgNum, HANDLE hEvent);
-TYP_MSGLENTRY *MsgList_FindMessage(DWORD uMsgNum);
-void MsgList_CollectGarbage(void);
diff --git a/plugins/!NotAdopted/Skype/msgq.c b/plugins/!NotAdopted/Skype/msgq.c deleted file mode 100644 index 48790e1c29..0000000000 --- a/plugins/!NotAdopted/Skype/msgq.c +++ /dev/null @@ -1,90 +0,0 @@ -/*
- * Implements a simple message queue for send and receive queue.
- * We could use memlist.c, but it's not efficient
- * enough for this purpose (would always memmove on removing first
- * element), therefore it's implemented as tail queue.
- */
-
-#include "skype.h"
-#include "msgq.h"
-#include "debug.h"
-
-
-void MsgQ_Init(TYP_MSGQ *q)
-{
- TAILQ_INIT(&q->l);
- InitializeCriticalSection (&q->cs);
-}
-
-void MsgQ_Exit(TYP_MSGQ *q)
-{
- struct MsgQueue *ptr;
-
- EnterCriticalSection(&q->cs);
- while (ptr=q->l.tqh_first)
- free(MsgQ_RemoveMsg(q, ptr));
- LeaveCriticalSection(&q->cs);
- DeleteCriticalSection (&q->cs);
-}
-
-BOOL MsgQ_Add(TYP_MSGQ *q, char *msg)
-{
- struct MsgQueue *ptr;
-
- if (!(ptr=(struct MsgQueue*)malloc(sizeof(struct MsgQueue))))
- return FALSE;
- ptr->message = _strdup(msg); // Don't forget to free!
- ptr->tAdded = SkypeTime(NULL);
- SkypeTime(&ptr->tReceived);
- EnterCriticalSection(&q->cs);
- TAILQ_INSERT_TAIL(&q->l, ptr, l);
- //LOG (("MsgQ_Add (%s) @%lu/%ld", msg, ptr->tReceived, ptr->tAdded));
- LeaveCriticalSection(&q->cs);
- return TRUE;
-}
-
-char *MsgQ_RemoveMsg(TYP_MSGQ *q, struct MsgQueue *ptr)
-{
- char *msg;
-
- if (!ptr) return NULL;
- TAILQ_REMOVE(&q->l, ptr, l);
- msg=ptr->message;
- free(ptr);
- return msg;
-}
-
-char *MsgQ_Get(TYP_MSGQ *q)
-{
- char *msg;
-
- EnterCriticalSection(&q->cs);
- msg=MsgQ_RemoveMsg(q, q->l.tqh_first);
- LeaveCriticalSection(&q->cs);
- return msg;
-}
-
-int MsgQ_CollectGarbage(TYP_MSGQ *q, time_t age)
-{
- struct MsgQueue *ptr;
- int i=0;
-
- EnterCriticalSection(&q->cs);
- ptr=q->l.tqh_first;
- while (ptr)
- {
- if (ptr->tAdded && SkypeTime(NULL)-ptr->tAdded>age)
- {
- struct MsgQueue *ptr_;
- LOG(("GarbageCollector throwing out message: %s", ptr->message));
- ptr_=ptr;
- ptr=ptr->l.tqe_next;
- free(MsgQ_RemoveMsg(q, ptr_));
- i++;
- continue;
- }
- ptr=ptr->l.tqe_next;
- }
- LeaveCriticalSection(&q->cs);
- return i;
-}
diff --git a/plugins/!NotAdopted/Skype/msgq.h b/plugins/!NotAdopted/Skype/msgq.h deleted file mode 100644 index 4eb666944b..0000000000 --- a/plugins/!NotAdopted/Skype/msgq.h +++ /dev/null @@ -1,64 +0,0 @@ -#include <time.h>
-
-// ----------------------------------------------------------------------
-// Stolen from *nix sys/queue.h
-// ----------------------------------------------------------------------
-/*
- * Tail queue definitions.
- */
-#define TAILQ_HEAD(name, type) \
-struct name { \
- struct type *tqh_first; /* first element */ \
- struct type **tqh_last; /* addr of last next element */ \
-}
-
-#define TAILQ_ENTRY(type) \
-struct { \
- struct type *tqe_next; /* next element */ \
- struct type **tqe_prev; /* address of previous next element */ \
-}
-
-
-/*
- * Tail queue functions.
- */
-#define TAILQ_INIT(head) { \
- (head)->tqh_first = NULL; \
- (head)->tqh_last = &(head)->tqh_first; \
-}
-
-#define TAILQ_INSERT_TAIL(head, elm, field) { \
- (elm)->field.tqe_next = NULL; \
- (elm)->field.tqe_prev = (head)->tqh_last; \
- *(head)->tqh_last = (elm); \
- (head)->tqh_last = &(elm)->field.tqe_next; \
-}
-
-#define TAILQ_REMOVE(head, elm, field) { \
- if (((elm)->field.tqe_next) != NULL) \
- (elm)->field.tqe_next->field.tqe_prev = \
- (elm)->field.tqe_prev; \
- else \
- (head)->tqh_last = (elm)->field.tqe_prev; \
- *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
-}
-// ----------------------------------------------------------------------
-
-struct MsgQueue {
- TAILQ_ENTRY(MsgQueue) l;
- char *message;
- time_t tAdded;
- time_t tReceived;
-};
-typedef struct
-{
- TAILQ_HEAD(tag_msgq, MsgQueue) l;
- CRITICAL_SECTION cs;
-} TYP_MSGQ;
-
-void MsgQ_Init(TYP_MSGQ *q);
-void MsgQ_Exit(TYP_MSGQ *q);
-BOOL MsgQ_Add(TYP_MSGQ *q, char *msg);
-char *MsgQ_RemoveMsg(TYP_MSGQ *q, struct MsgQueue *ptr);
-char *MsgQ_Get(TYP_MSGQ *q);
-int MsgQ_CollectGarbage(TYP_MSGQ *q, time_t age);
diff --git a/plugins/!NotAdopted/Skype/pthread.c b/plugins/!NotAdopted/Skype/pthread.c deleted file mode 100755 index 95271125e8..0000000000 --- a/plugins/!NotAdopted/Skype/pthread.c +++ /dev/null @@ -1,71 +0,0 @@ -/*
- * $Id: pthread.c,v 1.4 2003/12/19 12:53:36 gena01 Exp $
- *
- * Skype Miranda Plugin
- *
- * Authors: Gennady Feldman (aka Gena01)
- * Laurent Marechal (aka Peorth)
- *
- * Code borrowed for Skype plugin. Fixed to compile on Mingw by G.Feldman
- * Original Copyright (c) 2003 Robert Rainwater
- *
- * This code is under GPL and is based on AIM, MSN and Miranda source code.
- * I want to thank Robert Rainwater and George Hazan for their code and support
- * and for answering some of my questions during development of this plugin.
- */
-
-//#include "skype.h"
-
-/* Gena01 - added some defined to fix compilation with mingw gcc */
-/* __try/__finally taken from abiword patch found on the web */
-//#if 0
-// #include <crtdbg.h>
-///#else
-//#define __try
-//#define __except(x) if (0) /* don't execute handler */
-//#define __finally
-
-//#define _try __try
-//#define _except __except
-//#define _finally __finally
-//#endif
-/*
-#include <excpt.h>
-
-struct pthread_arg
-{
- HANDLE hEvent;
- void (*threadcode) (void *);
- void *arg;
-};
-
-void pthread_r(struct pthread_arg *fa)
-{
- void (*callercode) (void *) = fa->threadcode;
- void *arg = fa->arg;
- CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
- Miranda_Terminated
- SetEvent(fa->hEvent);
- __try {
- callercode(arg);
- }
- __finally {
- CallService(MS_SYSTEM_THREAD_POP, 0, 0);
- }
-}
-
-unsigned long pthread_create(pThreadFunc parFunc, void *arg)
-{
- unsigned long rc;
- struct pthread_arg fa;
- fa.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- fa.threadcode = parFunc;
- fa.arg = arg;
- rc = _beginthread((pThreadFunc) pthread_r, 0, &fa);
- if ((unsigned long) -1L != rc) {
- WaitForSingleObject(fa.hEvent, INFINITE);
- }
- CloseHandle(fa.hEvent);
- return rc;
-}
-*/
diff --git a/plugins/!NotAdopted/Skype/pthread.h b/plugins/!NotAdopted/Skype/pthread.h deleted file mode 100755 index b8b6eb615e..0000000000 --- a/plugins/!NotAdopted/Skype/pthread.h +++ /dev/null @@ -1,25 +0,0 @@ -/*
- * $Id: pthread.h,v 1.3 2003/10/05 04:03:05 gena01 Exp $
- *
- * Skype Miranda Plugin
- *
- * Authors: Gennady Feldman (aka Gena01)
- * Laurent Marechal (aka Peorth)
- *
- * Code borrowed for Skype plugin. Fixed to compile on Mingw by G.Feldman
- * Original Copyright (c) 2003 Robert Rainwater
- *
- * This code is under GPL and is based on AIM, MSN and Miranda source code.
- * I want to thank Robert Rainwater and George Hazan for their code and support
- * and for answering some of my questions during development of this plugin.
- */
-#ifndef PTHREAD_H
-#define PTHREAD_H
-
-typedef CRITICAL_SECTION pthread_mutex_t;
-#define pthread_mutex_init(pmutex) InitializeCriticalSection(pmutex)
-#define pthread_mutex_destroy(pmutex) DeleteCriticalSection(pmutex)
-#define pthread_mutex_lock(pmutex) EnterCriticalSection(pmutex)
-#define pthread_mutex_unlock(pmutex) LeaveCriticalSection(pmutex)
-
-#endif
diff --git a/plugins/!NotAdopted/Skype/readme.txt b/plugins/!NotAdopted/Skype/readme.txt deleted file mode 100644 index 333f92d90a..0000000000 --- a/plugins/!NotAdopted/Skype/readme.txt +++ /dev/null @@ -1,47 +0,0 @@ -Skype Protocol - Maybe we can call it beta now? ;)
-
-As so many people requested it, here is now a implementation of the Skype
-protocol for Miranda IM.
-Note, that this is just a wrapper for the Skype-API, which means that Skype
-has to be running while you use this plugin.
-The plugin should be able to launch Skype, if it is not running on startup.
-Please note, that I never coded a protocol-plugin for Miranda before, so
-expect it to be buggy and unstable, I hope I have some time to correct the
-severest bugs and to add more features soon.
-No warranty, whatsoever! I suggest that you back up your existing Miranda
-Database before using this plugin, just to be sure you have a backup if
-it runs amok ;-) Feel free to improve the ugly sourcecode.
-Please give me feedback, if it works for you, it would be interesting.
-
-NOTES - READ THEM CAREFULLY!
-----------------------------
-
- * You need Skype 1.0.0.97 or above in order to have access to the Skype API
- * You have to manually disable popup of messages in SKYPE, as there is
- currently no function in the API to do this
- Got to File/Options/Short messages and disable the checkboxes there
- Otherwise you would get all Skype-Messages twice (in Skype AND Miranda)
- * If you always get "Unknown event" when a call is incoming and you are using
- the NewEventNotify-plugin or Tabsrmm then go to the plugin's options
- (Sessions / Event Notifications / Announce events of type) and disable
- "other events" there.
- * Importing history for a contact can be launched by clickting "import History"
- in the context menu of a contact. The importing takes place in the background.
- AS soon, as it's finished, you will be notified by a messagebox.
- This feature is still buggy and quite a bit unpredictable.
- * There is a nice Iconset with the original Skype-Icons created by X-Byte
- Thanks for that. Grab it at http://dose.0wnz.at/Skype/Skype_icons.zip
- * Skype API bug: When you set Skype offline via API, the contacts stay online
- I made a Miranda-sie workaround for this now, but it's a Skype-API bug,
- not a plugin-bug
- * Skype API bug: when you rename Skypeout-contacts in Skype, their new nicks
- aren't sent correctly via the API, instead, the previous nick is sent and
- therefore the Miranda-name is not up-to-date after nick change.
- This is not a plugin bug either.
-BUGS
-----
-
- * To track bugs, you have to make a Debug-Build out from the source.
- The plugin then will log the Skype-API communication to a logfile
- called skype_log.txt so that we may se what caused the crash.
-
diff --git a/plugins/!NotAdopted/Skype/res/8060.ico b/plugins/!NotAdopted/Skype/res/8060.ico Binary files differdeleted file mode 100644 index 0769ddb8b2..0000000000 --- a/plugins/!NotAdopted/Skype/res/8060.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/Copy of online.ico b/plugins/!NotAdopted/Skype/res/Copy of online.ico Binary files differdeleted file mode 100644 index c9376943cb..0000000000 --- a/plugins/!NotAdopted/Skype/res/Copy of online.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/DND.ico b/plugins/!NotAdopted/Skype/res/DND.ico Binary files differdeleted file mode 100644 index ace441c3ad..0000000000 --- a/plugins/!NotAdopted/Skype/res/DND.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/Invite.ico b/plugins/!NotAdopted/Skype/res/Invite.ico Binary files differdeleted file mode 100644 index 12af3b8ab8..0000000000 --- a/plugins/!NotAdopted/Skype/res/Invite.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/NA.ico b/plugins/!NotAdopted/Skype/res/NA.ico Binary files differdeleted file mode 100644 index 5bb7dba823..0000000000 --- a/plugins/!NotAdopted/Skype/res/NA.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/add.ico b/plugins/!NotAdopted/Skype/res/add.ico Binary files differdeleted file mode 100644 index b0e9903bbe..0000000000 --- a/plugins/!NotAdopted/Skype/res/add.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/add2.ico b/plugins/!NotAdopted/Skype/res/add2.ico Binary files differdeleted file mode 100644 index e7593bb787..0000000000 --- a/plugins/!NotAdopted/Skype/res/add2.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/auth.ico b/plugins/!NotAdopted/Skype/res/auth.ico Binary files differdeleted file mode 100644 index 9bf01c59a4..0000000000 --- a/plugins/!NotAdopted/Skype/res/auth.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/away.ico b/plugins/!NotAdopted/Skype/res/away.ico Binary files differdeleted file mode 100644 index 7993291dcc..0000000000 --- a/plugins/!NotAdopted/Skype/res/away.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/call.bmp b/plugins/!NotAdopted/Skype/res/call.bmp Binary files differdeleted file mode 100644 index 7da6ac53cf..0000000000 --- a/plugins/!NotAdopted/Skype/res/call.bmp +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/call.ico b/plugins/!NotAdopted/Skype/res/call.ico Binary files differdeleted file mode 100644 index 43516a3c0f..0000000000 --- a/plugins/!NotAdopted/Skype/res/call.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/chat.ico b/plugins/!NotAdopted/Skype/res/chat.ico Binary files differdeleted file mode 100644 index cf6e01e93d..0000000000 --- a/plugins/!NotAdopted/Skype/res/chat.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/conference.ico b/plugins/!NotAdopted/Skype/res/conference.ico Binary files differdeleted file mode 100644 index bd6b1518fb..0000000000 --- a/plugins/!NotAdopted/Skype/res/conference.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/error.ico b/plugins/!NotAdopted/Skype/res/error.ico Binary files differdeleted file mode 100644 index e191cbf754..0000000000 --- a/plugins/!NotAdopted/Skype/res/error.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/hang_up.ico b/plugins/!NotAdopted/Skype/res/hang_up.ico Binary files differdeleted file mode 100644 index dacfcd4935..0000000000 --- a/plugins/!NotAdopted/Skype/res/hang_up.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/history.ico b/plugins/!NotAdopted/Skype/res/history.ico Binary files differdeleted file mode 100644 index c406120433..0000000000 --- a/plugins/!NotAdopted/Skype/res/history.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/hold.ico b/plugins/!NotAdopted/Skype/res/hold.ico Binary files differdeleted file mode 100644 index 3ad69006a7..0000000000 --- a/plugins/!NotAdopted/Skype/res/hold.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/import.ico b/plugins/!NotAdopted/Skype/res/import.ico Binary files differdeleted file mode 100644 index 863d45cd6b..0000000000 --- a/plugins/!NotAdopted/Skype/res/import.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/invisible.ico b/plugins/!NotAdopted/Skype/res/invisible.ico Binary files differdeleted file mode 100644 index b734f6a495..0000000000 --- a/plugins/!NotAdopted/Skype/res/invisible.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/message.ico b/plugins/!NotAdopted/Skype/res/message.ico Binary files differdeleted file mode 100644 index c4ca27be54..0000000000 --- a/plugins/!NotAdopted/Skype/res/message.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/occupied.ico b/plugins/!NotAdopted/Skype/res/occupied.ico Binary files differdeleted file mode 100644 index a0baafec21..0000000000 --- a/plugins/!NotAdopted/Skype/res/occupied.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/offline.ico b/plugins/!NotAdopted/Skype/res/offline.ico Binary files differdeleted file mode 100644 index e26af6fdec..0000000000 --- a/plugins/!NotAdopted/Skype/res/offline.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/online.ico b/plugins/!NotAdopted/Skype/res/online.ico Binary files differdeleted file mode 100644 index ae1a3df64f..0000000000 --- a/plugins/!NotAdopted/Skype/res/online.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/pause.ico b/plugins/!NotAdopted/Skype/res/pause.ico Binary files differdeleted file mode 100644 index de366073da..0000000000 --- a/plugins/!NotAdopted/Skype/res/pause.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/phone.ico b/plugins/!NotAdopted/Skype/res/phone.ico Binary files differdeleted file mode 100644 index 1a13073ce6..0000000000 --- a/plugins/!NotAdopted/Skype/res/phone.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/resume.ico b/plugins/!NotAdopted/Skype/res/resume.ico Binary files differdeleted file mode 100644 index 294bad488e..0000000000 --- a/plugins/!NotAdopted/Skype/res/resume.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/search.ico b/plugins/!NotAdopted/Skype/res/search.ico Binary files differdeleted file mode 100644 index e28bef60e1..0000000000 --- a/plugins/!NotAdopted/Skype/res/search.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/skype.ico b/plugins/!NotAdopted/Skype/res/skype.ico Binary files differdeleted file mode 100644 index b267bbb5fc..0000000000 --- a/plugins/!NotAdopted/Skype/res/skype.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/skypeout.ico b/plugins/!NotAdopted/Skype/res/skypeout.ico Binary files differdeleted file mode 100644 index 6d135bae96..0000000000 --- a/plugins/!NotAdopted/Skype/res/skypeout.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/res/skyping.ico b/plugins/!NotAdopted/Skype/res/skyping.ico Binary files differdeleted file mode 100644 index 59fdb4482d..0000000000 --- a/plugins/!NotAdopted/Skype/res/skyping.ico +++ /dev/null diff --git a/plugins/!NotAdopted/Skype/resource.h b/plugins/!NotAdopted/Skype/resource.h deleted file mode 100644 index 5f57feb9a3..0000000000 --- a/plugins/!NotAdopted/Skype/resource.h +++ /dev/null @@ -1,124 +0,0 @@ -//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by Skript1.rc
-//
-#define IDI_SKYPE 102
-#define IDI_ONLINE 104
-#define IDI_OFFLINE 105
-#define IDI_AWAY 128
-#define IDI_CHAT 129
-#define IDI_INVISIBLE 130
-#define IDI_NA 131
-#define IDI_DND 158
-#define IDI_OCCUPIED 159
-#define IDI_ADD 160
-#define IDI_IMPORT 161
-#define IDI_ERRORS 162
-#define IDI_MESSAGE 163
-#define IDI_CALL 164
-#define IDI_CALLSKYPEOUT 165
-#define IDI_HOLD 166
-#define IDI_RESUME 167
-#define IDI_HANGUP 168
-#define IDI_AVATAR 169
-#define IDD_OPTIONS 170
-#define IDI_INVITE 170
-#define IDD_DIAL 171
-#define IDB_CALL 172
-#define IDD_INPUTBOX 172
-#define IDD_CALLSTAT 173
-#define IDD_SETAVATAR 174
-#define IDD_OPT_DEFAULT 175
-#define IDD_OPT_PROXY 176
-#define IDD_SETDETAILS 177
-#define IDD_OPT_ADVANCED 178
-#define IDD_OPT_POPUP 179
-#define IDI_PHONE 1002
-#define IDC_SHUTDOWN 1004
-#define IDC_ENABLEMENU 1005
-#define IDC_UNLOADOFFLINE 1006
-#define IDC_USES2S 1007
-#define IDC_HOST 1008
-#define IDC_PORT 1009
-#define IDC_REQPASS 1010
-#define IDC_PASSWORD 1011
-#define IDC_USEPOPUP 1012
-#define IDC_GROUPCHAT 1014
-#define IDC_NOERRORS 1015
-#define IDC_CONNATTEMPTS 1016
-#define IDC_GROUPCHATREAD 1016
-#define IDC_SKYPEOUTSTAT 1018
-#define IDC_NUMBER 1019
-#define IDDIAL 1020
-#define IDC_KEEPSTATE 1021
-#define IDC_CLEANUP 1022
-#define IDC_JOIN 1023
-#define IDC_TIMEZONE 1023
-#define IDC_HOLD 1024
-#define IDC_SHOWDEFAULTAVATAR 1024
-#define IDC_HANGUP 1025
-#define IDC_IGNTZ 1025
-#define IDC_AVATAR 1026
-#define IDC_NOSKYPE3STATS 1026
-#define IDC_SETAVATAR 1027
-#define IDC_SHOWFULLNAME 1027
-#define IDC_DELETEAVATAR 1028
-#define IDC_STARTSKYPE 1029
-#define IDC_NOTRAY 1030
-#define IDC_NOSPLASH 1031
-#define IDC_MINIMIZED 1032
-#define IDC_TEXT 1033
-#define IDC_CUSTOMCOMMAND 1033
-#define IDC_OPTIONSTAB 1034
-#define IDC_REMOVEABLE 1034
-#define IDC_FULLNAME 1035
-#define IDC_DATAPATHO 1035
-#define IDC_BIRTHDAY 1036
-#define IDC_SECONDARY 1036
-#define IDC_SEX 1037
-#define IDC_CITY 1038
-#define IDC_COUNTRY 1039
-#define IDC_PROVINCE 1040
-#define IDC_HOMEPHONE 1041
-#define IDC_OFFICEPHONE 1042
-#define IDC_HOMEPAGE 1043
-#define IDC_SAVEDETAILS 1044
-#define IDC_COMMANDLINE 1045
-#define IDC_DATAPATH 1046
-#define IDC_POPUPINCOMING 1049
-#define IDC_PREVIEW 1050
-#define IDC_POPUPTEXTCOLOR 1051
-#define IDC_POPUPTIME 1052
-#define IDC_POPUPBACKCOLOR 1053
-#define IDC_USEWINCOLORS 1054
-#define IDC_POPUPERROR 1055
-#define IDC_USERNAME 1055
-#define IDC_PREVIEWERR 1056
-#define IDC_EDIT2 1056
-#define IDC_POPUPTIMEERR 1057
-#define IDC_POPUPBACKCOLORERR 1058
-#define IDC_POPUPTEXTCOLORERR 1059
-#define IDC_USEWINCOLORSERR 1060
-#define IDC_SUPPRESSCALLSUMMARYMESSAGE 1061
-#define IDC_AUTODETECTION 1062
-#define IDC_STATIC_HOST 1063
-#define IDC_STATIC_PORT 1064
-#define IDC_BROWSEDP 1065
-#define IDC_BROWSECMDL 1066
-#define IDC_STATIC_POPUPBACKCOLOR 1066
-#define IDC_STATIC_POPUPTEXTCOLOR 1067
-#define IDC_STATIC_POPUPTEXTCOLORERR 1068
-#define IDC_STATIC_POPUPBACKCOLORERR 1069
-#define IDC_STATIC_PATHINFO 1070
-#define IDC_STATIC_RESTART 1071
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 181
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1072
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/plugins/!NotAdopted/Skype/skype.c b/plugins/!NotAdopted/Skype/skype.c deleted file mode 100755 index 39a8c0c47f..0000000000 --- a/plugins/!NotAdopted/Skype/skype.c +++ /dev/null @@ -1,3483 +0,0 @@ -/*
-
-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 "skype.h"
-#include "debug.h"
-#include "skypeapi.h"
-#include "skypesvc.h"
-#include "contacts.h"
-#include "utf8.h"
-#include "pthread.h"
-#include "gchat.h"
-#include "m_toptoolbar.h"
-#include "voiceservice.h"
-#include "msglist.h"
-#include "memlist.h"
-#include <sys/timeb.h>
-#ifndef INVALID_FILE_ATTRIBUTES
-#define INVALID_FILE_ATTRIBUTES 0xFFFFFFFF
-#endif
-/*#ifdef _WIN64
-#pragma comment (lib, "bufferoverflowU.lib")
-#endif*/
-
-#pragma warning (disable: 4706) // assignment within conditional expression
-
-POPUPDATAT MessagePopup;
-
-// Exported Globals
-HWND hSkypeWnd=NULL, g_hWnd=NULL, hSkypeWndSecondary=NULL, hForbiddenSkypeWnd = NULL;
-HANDLE SkypeReady, SkypeMsgReceived, hInitChat=NULL, httbButton=NULL, FetchMessageEvent=NULL;
-BOOL SkypeInitialized=FALSE, MirandaShuttingDown=FALSE, PopupServiceExists=FALSE;
-BOOL UseSockets=FALSE, bSkypeOut=FALSE, bProtocolSet=FALSE, bIsImoproxy=FALSE;
-char skype_path[MAX_PATH], protocol=2, *pszProxyCallout=NULL, g_szProtoName[_MAX_FNAME]="SKYPE";
-int SkypeStatus=ID_STATUS_OFFLINE, hSearchThread=-1, receivers=1;
-long sendwatchers = 0, rcvwatchers = 0;
-UINT ControlAPIAttach, ControlAPIDiscover;
-LONG AttachStatus=-1;
-HINSTANCE hInst;
-HANDLE hProtocolAvatarsFolder;
-char DefaultAvatarsFolder[MAX_PATH+1];
-DWORD mirandaVersion;
-int hLangpack = 0;
-
-CRITICAL_SECTION RingAndEndcallMutex, QueryThreadMutex, TimeMutex;
-
-// Module Internal Globals
-HANDLE MessagePumpReady;
-HANDLE hChatEvent=NULL, hChatMenu=NULL;
-HANDLE hEvInitChat=NULL, hBuddyAdded=NULL;
-HANDLE hMenuAddSkypeContact=NULL;
-
-DWORD msgPumpThreadId = 0;
-#ifdef SKYPEBUG_OFFLN
-HANDLE GotUserstatus;
-#endif
-
-BOOL bModulesLoaded=FALSE;
-char *RequestedStatus=NULL; // To fix Skype-API Statusmode-bug
-char cmdMessage[12]="MESSAGE", cmdPartner[8]="PARTNER"; // Compatibility commands
-
-
-
-// Direct assignment of user properties to a DB-Setting
-static const settings_map m_settings[]= {
- {"LANGUAGE", "Language1"},
- {"PROVINCE", "State"},
- {"CITY", "City"},
- {"PHONE_HOME", "Phone"},
- {"PHONE_OFFICE", "CompanyPhone"},
- {"PHONE_MOBILE", "Cellular"},
- {"HOMEPAGE", "Homepage"},
- {"ABOUT", "About"}
- };
-
-// Imported Globals
-extern status_map status_codes[];
-
-BOOL (WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD) = 0;
-
-HMODULE hUxTheme = 0;
-
-// function pointers, use typedefs for casting to shut up the compiler when using GetProcAddress()
-
-typedef BOOL (WINAPI *PITA)();
-typedef HANDLE (WINAPI *POTD)(HWND, LPCWSTR);
-typedef UINT (WINAPI *PDTB)(HANDLE, HDC, int, int, RECT *, RECT *);
-typedef UINT (WINAPI *PCTD)(HANDLE);
-typedef UINT (WINAPI *PDTT)(HANDLE, HDC, int, int, LPCWSTR, int, DWORD, DWORD, RECT *);
-
-PITA pfnIsThemeActive = 0;
-POTD pfnOpenThemeData = 0;
-PDTB pfnDrawThemeBackground = 0;
-PCTD pfnCloseThemeData = 0;
-PDTT pfnDrawThemeText = 0;
-
-#define FIXED_TAB_SIZE 100 // default value for fixed width tabs
-
-typedef struct {
- char msgnum[16];
- BOOL getstatus;
- BOOL bIsRead;
- BOOL bDontMarkSeen;
- BOOL QueryMsgDirection;
- TYP_MSGLENTRY *pMsgEntry;
-} fetchmsg_arg;
-
-typedef struct {
- HANDLE hContact;
- char szId[16];
-} msgsendwt_arg;
-
-/*
- * visual styles support (XP+)
- * returns 0 on failure
- */
-
-int InitVSApi()
-{
- if((hUxTheme = LoadLibraryA("uxtheme.dll")) == 0)
- return 0;
-
- pfnIsThemeActive = (PITA)GetProcAddress(hUxTheme, "IsThemeActive");
- pfnOpenThemeData = (POTD)GetProcAddress(hUxTheme, "OpenThemeData");
- pfnDrawThemeBackground = (PDTB)GetProcAddress(hUxTheme, "DrawThemeBackground");
- pfnCloseThemeData = (PCTD)GetProcAddress(hUxTheme, "CloseThemeData");
- pfnDrawThemeText = (PDTT)GetProcAddress(hUxTheme, "DrawThemeText");
-
- MyEnableThemeDialogTexture = (BOOL (WINAPI *)(HANDLE, DWORD))GetProcAddress(hUxTheme, "EnableThemeDialogTexture");
- if(pfnIsThemeActive != 0 && pfnOpenThemeData != 0 && pfnDrawThemeBackground != 0 && pfnCloseThemeData != 0 && pfnDrawThemeText != 0) {
- return 1;
- }
- return 0;
-}
-
-/*
- * unload uxtheme.dll
- */
-
-int FreeVSApi()
-{
- if(hUxTheme != 0)
- FreeLibrary(hUxTheme);
- return 0;
-}
-
-// Plugin Info
-PLUGININFOEX pluginInfo = {
- sizeof(PLUGININFOEX),
- "Skype Protocol",
- PLUGIN_MAKE_VERSION(0,0,0,52),
- "Support for Skype network",
- "leecher - tweety - jls17",
- "leecher@dose.0wnz.at - tweety@user.berlios.de",
- "© 2004-2011 leecher - tweety",
- "http://developer.berlios.de/projects/mgoodies/",
- UNICODE_AWARE,
- { 0xa71f8335, 0x7b87, 0x4432, { 0xb8, 0xa3, 0x81, 0x47, 0x94, 0x31, 0xc6, 0xf5 } } // {A71F8335-7B87-4432-B8A3-81479431C6F5}
-};
-
-#define MAPDND 1 // Map Occupied to DND status and say that you support it
-//#define MAPNA 1 // Map NA status to Away and say that you support it
-
-/* P R O G R A M */
-
-void RegisterToDbeditorpp(void)
-{
- // known modules list
- if (ServiceExists("DBEditorpp/RegisterSingleModule"))
- CallService("DBEditorpp/RegisterSingleModule", (WPARAM)SKYPE_PROTONAME, 0);
-}
-
-/*void RegisterToUpdate(void)
-{
- //Use for the Updater plugin
- if(ServiceExists(MS_UPDATE_REGISTER))
- {
- Update update = {0};
- char szVersion[16];
-
- update.szComponentName = pluginInfo.shortName;
- update.pbVersion = (BYTE *)CreateVersionStringPlugin((PLUGININFO *)&pluginInfo, szVersion);
- update.cpbVersion = (DWORD)strlen((char *)update.pbVersion);
-
-#ifdef _WIN64
-#ifdef _UNICODE
- update.szBetaUpdateURL = "http://dose.0wnz.at/miranda/Skype/Skype_protocol_unicode_x64.zip";
-#else
- update.szBetaUpdateURL = "http://dose.0wnz.at/miranda/Skype/Skype_protocol_x64.zip";
-#endif
- update.szBetaVersionURL = "http://dose.0wnz.at/miranda/Skype/";
- update.pbBetaVersionPrefix = (BYTE *)"SKYPE version ";
- update.szUpdateURL = update.szBetaUpdateURL; // FIXME!!
- update.szVersionURL = update.szBetaVersionURL; // FIXME
- update.pbVersionPrefix = update.pbBetaVersionPrefix; //FIXME
-#else
-#ifdef _UNICODE
- update.szBetaUpdateURL = "http://dose.0wnz.at/miranda/Skype/Skype_protocol_unicode.zip";
-#else
- update.szBetaUpdateURL = "http://dose.0wnz.at/miranda/Skype/Skype_protocol.zip";
-#endif
- update.szBetaVersionURL = "http://dose.0wnz.at/miranda/Skype/";
- update.pbBetaVersionPrefix = (BYTE *)"SKYPE version ";
-#ifdef _UNICODE
- update.szUpdateURL = update.szBetaUpdateURL; // FIXME!!
- update.szVersionURL = update.szBetaVersionURL; // FIXME
- update.pbVersionPrefix = update.pbBetaVersionPrefix; //FIXME
-#else
- update.szUpdateURL = "http://addons.miranda-im.org/feed.php?dlfile=3200";
- update.szVersionURL = "http://addons.miranda-im.org/details.php?action=viewfile&id=3200";
- update.pbVersionPrefix = (BYTE *)"<span class=\"fileNameHeader\">Skype Protocol</span>";
-#endif
-#endif
-
- update.cpbVersionPrefix = (DWORD)strlen((char *)update.pbVersionPrefix);
- update.cpbBetaVersionPrefix = (DWORD)strlen((char *)update.pbBetaVersionPrefix);
-
- CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
-
- }
-}*/
-
-/*
- * ShowMessage
- *
- * Shows a popup, if the popup plugin is enabled.
- * mustShow: 1 -> If Popup-Plugin is not available/disabled, show Message
- * in a Messagewindow
- * If the Popup-Plugin is enabled, let the message stay on
- * screen until someone clicks it away.
- * 0 -> If Popup-Plugin is not available/disabled, skip message
- * Returns 0 on success, -1 on failure
- *
- */
-int ShowMessage(int iconID, TCHAR *lpzText, int mustShow) {
-
-
-
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "SuppressErrors", 0)) return -1;
- lpzText=TranslateTS(lpzText);
-
- if (bModulesLoaded && PopupServiceExists && ServiceExists(MS_POPUP_ADDPOPUPT) && DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UsePopup", 0) && !MirandaShuttingDown) {
- BOOL showPopup, popupWindowColor;
- unsigned int popupBackColor, popupTextColor;
- int popupTimeSec;
-
- popupTimeSec = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupTimeSecErr", 4);
- popupTextColor = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupTextColorErr", GetSysColor(COLOR_WINDOWTEXT));
- popupBackColor = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupBackColorErr", GetSysColor(COLOR_BTNFACE));
- popupWindowColor = ( 0 != DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "popupWindowColorErr", TRUE));
- showPopup = ( 0 != DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "showPopupErr", TRUE));
-
- MessagePopup.lchContact = NULL;
- MessagePopup.lchIcon = LoadIcon(hInst,MAKEINTRESOURCE(iconID));
- MessagePopup.colorBack = ! popupWindowColor ? popupBackColor : GetSysColor(COLOR_BTNFACE);
- MessagePopup.colorText = ! popupWindowColor ? popupTextColor : GetSysColor(COLOR_WINDOWTEXT);
- MessagePopup.iSeconds = popupTimeSec;
- MessagePopup.PluginData = (void *)1;
-
- lstrcpy(MessagePopup.lptzText, lpzText);
-
-#ifdef _UNICODE
- mbstowcs (MessagePopup.lptzContactName, SKYPE_PROTONAME, strlen(SKYPE_PROTONAME)+1);
-#else
- lstrcpy(MessagePopup.lptzContactName, SKYPE_PROTONAME);
-#endif
-
- if(showPopup)
- CallService(MS_POPUP_ADDPOPUPT,(WPARAM)&MessagePopup,0);
-
- return 0;
- }
- else {
-
- if (mustShow==1) MessageBox(NULL,lpzText,_T("Skype Protocol"), MB_OK | MB_ICONWARNING);
- return 0;
- }
-}
-#ifdef _UNICODE
-int ShowMessageA(int iconID, char *lpzText, int mustShow) {
- WCHAR *lpwText;
- int iRet;
- size_t len = mbstowcs (NULL, lpzText, strlen(lpzText));
- if (len == -1 || !(lpwText = calloc(len+1,sizeof(WCHAR)))) return -1;
- mbstowcs (lpwText, lpzText, strlen(lpzText));
- iRet = ShowMessage(iconID, lpwText, mustShow);
- free (lpwText);
- return iRet;
-}
-#endif
-
-// processing Hooks
-
-int HookContactAdded(WPARAM wParam, LPARAM lParam) {
- char *szProto;
-
- UNREFERENCED_PARAMETER(lParam);
-
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 );
- if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME))
- add_contextmenu((HANDLE)wParam);
- return 0;
-}
-
-int HookContactDeleted(WPARAM wParam, LPARAM lParam) {
- char *szProto;
-
- UNREFERENCED_PARAMETER(lParam);
-
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, wParam, 0 );
- if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME)) {
- DBVARIANT dbv;
- int retval;
-
- if (DBGetContactSettingString((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 1;
- retval=SkypeSend("SET USER %s BUDDYSTATUS 1", dbv.pszVal);
- DBFreeVariant(&dbv);
- if (retval) return 1;
- }
- return 0;
-}
-
-void GetInfoThread(HANDLE hContact) {
- DBVARIANT dbv;
- int i;
- char *ptr;
- BOOL bSetNick = FALSE;
- // All properties are already handled in the WndProc, so we just consume the
- // messages here to do proper ERROR handling
- // If you add something here, be sure to handle it in WndProc, but let it
- // fall through there so that message gets added to the queue in order to be
- // consumed by SkypeGet
- char *pszProps[] = {
- "BIRTHDAY", "COUNTRY", "SEX", "MOOD_TEXT", "TIMEZONE", "IS_VIDEO_CAPABLE"};
-
-
- LOG (("GetInfoThread started."));
- EnterCriticalSection (&QueryThreadMutex);
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
- {
- LOG (("GetInfoThread terminated, cannot find Skype Name for contact %08X.", hContact));
- LeaveCriticalSection (&QueryThreadMutex);
- return;
- }
-
- if (ptr=SkypeGet ("USER", dbv.pszVal, "DISPLAYNAME")) {
- // WndProc sets Nick accordingly
- if (*ptr) bSetNick = TRUE;
- free (ptr);
- }
-
- if (ptr=SkypeGet ("USER", dbv.pszVal, "FULLNAME")) {
- if (*ptr && !bSetNick && DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "ShowFullname", 1)) {
- // No Displayname and FULLNAME requested
- SkypeDBWriteContactSettingUTF8String(hContact, SKYPE_PROTONAME, "Nick", ptr);
- bSetNick = TRUE;
- }
- free (ptr);
- }
-
- if (!bSetNick) {
- // Still no nick set, so use SKYPE Nickname
- DBWriteContactSettingString(hContact, SKYPE_PROTONAME, "Nick", dbv.pszVal);
- }
-
-
- if (!bIsImoproxy)
- {
- for (i=0; i<sizeof(pszProps)/sizeof(pszProps[0]); i++)
- if (ptr=SkypeGet ("USER", dbv.pszVal, pszProps[i])) free (ptr);
- } else {
- if (ptr=SkypeGet ("USER", dbv.pszVal, "MOOD_TEXT")) free (ptr);
- }
-
- if (protocol >= 7 || bIsImoproxy) {
- // Notify about the possibility of an avatar
- ACKDATA ack = {0};
- ack.cbSize = sizeof( ACKDATA );
- ack.szModule = SKYPE_PROTONAME;
- ack.hContact = hContact;
- ack.type = ACKTYPE_AVATAR;
- ack.result = ACKRESULT_STATUS;
-
- CallService( MS_PROTO_BROADCASTACK, 0, ( LPARAM )&ack );
- //if (ptr=SkypeGet ("USER", dbv.pszVal, "RICH_MOOD_TEXT")) free (ptr);
- }
-
- if (!bIsImoproxy)
- {
- for (i=0; i<sizeof(m_settings)/sizeof(m_settings[0]); i++)
- if (ptr=SkypeGet ("USER", dbv.pszVal, m_settings[i].SkypeSetting)) free (ptr);
- }
-
- ProtoBroadcastAck(SKYPE_PROTONAME, hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
- LeaveCriticalSection(&QueryThreadMutex);
- DBFreeVariant(&dbv);
- LOG (("GetInfoThread terminated gracefully."));
-}
-
-time_t SkypeTime(time_t *timer) {
- struct _timeb tb;
-
- EnterCriticalSection (&TimeMutex);
- _ftime(&tb);
- if (timer) *timer=tb.time;
- LeaveCriticalSection (&TimeMutex);
- return tb.time;
-}
-
-
-void BasicSearchThread(char *nick) {
- PROTOSEARCHRESULT psr={0};
- char *cmd=NULL, *token=NULL, *ptr=NULL, *nextoken;
- time_t st;
-
- LOG (("BasicSearchThread started."));
- EnterCriticalSection (&QueryThreadMutex);
- SkypeTime(&st);
- if (SkypeSend("SEARCH USERS %s", nick)==0 && (cmd=SkypeRcvTime("USERS", st, INFINITE))) {
- if (strncmp(cmd, "ERROR", 5)) {
- psr.cbSize=sizeof(psr);
- for (token=strtok_r(cmd+5, ", ", &nextoken); token; token=strtok_r(NULL, ", ", &nextoken)) {
- TCHAR *t = mir_utf8decodeT(token), *_ptr = NULL;
- psr.nick=psr.id=t;
- psr.lastName=NULL;
- psr.firstName=NULL;
- psr.email=NULL;
- if (ptr=SkypeGet("USER", token, "FULLNAME")) {
- // We cannot use strtok() to seperate first & last name here,
- // because we already use it for parsing the user list
- // So we use our own function
- _ptr = mir_utf8decodeT(ptr);
- if (psr.lastName=_tcschr(_ptr, ' ')) {
- *psr.lastName=0;
- psr.lastName++;
- LOG(("BasicSearchThread: lastName=%s", psr.lastName));
- }
- psr.firstName=_ptr;
- LOG(("BasicSearchThread: firstName=%s", psr.firstName));
- }
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)hSearchThread, (LPARAM)(PROTOSEARCHRESULT*)&psr);
- if (ptr) free(ptr);
- if(t) mir_free(t);
- if(_ptr) mir_free(_ptr);
- }
- } else {
- OUT(cmd);
- }
- free(cmd);
- }
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)hSearchThread, 0);
- free(nick);
- LeaveCriticalSection(&QueryThreadMutex);
- LOG (("BasicSearchThread terminated gracefully."));
- return;
-}
-
-INT_PTR SkypeDBWriteContactSettingUTF8String(HANDLE hContact,const char *szModule,const char *szSetting,const char *val)
-{
- DBCONTACTWRITESETTING cws;
- INT_PTR iRet;
-
- // Try to save it as UTF8 sting to DB. If this doesn't succeed (i.e. older Miranda version), we convert
- // accordingly and try to save again.
-
- cws.szModule=szModule;
- cws.szSetting=szSetting;
- cws.value.type=DBVT_UTF8;
- cws.value.pszVal=(char*)val;
- // DBVT_UTF8 support started with version 0.5.0.0, right...?
- if (mirandaVersion < 0x050000 || (iRet = CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws)))
- {
- // Failed, try to convert and then try again
- cws.value.type=DBVT_TCHAR;
- if (!(cws.value.ptszVal = make_tchar_string((const unsigned char*)val))) return -1;
- iRet = CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws);
- free (cws.value.pszVal);
- }
- return iRet;
-}
-
-
-// added by TioDuke
-void GetDisplaynameThread(char *dummy) {
- DBVARIANT dbv;
- char *ptr;
-
- UNREFERENCED_PARAMETER(dummy);
-
- LOG(("GetDisplaynameThread started."));
- if (DBGetContactSettingString(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) {
- LOG(("GetDisplaynameThread terminated."));
- return;
- }
- EnterCriticalSection(&QueryThreadMutex);
- if ((ptr=SkypeGet("USER", dbv.pszVal, "FULLNAME"))) {
- if (*ptr) SkypeDBWriteContactSettingUTF8String(NULL, SKYPE_PROTONAME, "Nick", ptr);
- free(ptr);
- }
- DBFreeVariant(&dbv);
- LeaveCriticalSection(&QueryThreadMutex);
- LOG(("GetDisplaynameThread terminated gracefully."));
-}
-
-
-// Starts importing history from Skype
-INT_PTR ImportHistory(WPARAM wParam, LPARAM lParam) {
- DBVARIANT dbv;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (DBGetContactSettingByte((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoom", 0)) {
- if (DBGetContactSettingString((HANDLE)wParam, SKYPE_PROTONAME, "ChatRoomID", &dbv)) return 0;
- SkypeSend ("GET CHAT %s CHATMESSAGES", dbv.pszVal);
- } else {
- if (DBGetContactSettingString((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return 0;
- SkypeSend("SEARCH %sS %s", cmdMessage, dbv.pszVal);
- }
- DBFreeVariant(&dbv);
- return 0;
-}
-
-int SearchFriends(void) {
- char *ptr, *token, *pStat, *nextoken;
- int iRet = 0;
- time_t st;
-
- SkypeTime(&st);
- if (SkypeSend("SEARCH FRIENDS")!=-1 && (ptr=SkypeRcvTime("USERS", st, INFINITE)))
- {
- if (strncmp(ptr, "ERROR", 5)) {
- if (ptr+5) {
- for (token=strtok_r(ptr+5, ", ", &nextoken); token; token=strtok_r(NULL, ", ", &nextoken)) {
- if (!(pStat = SkypeGet("USER", token, "ONLINESTATUS")))
- {
- iRet = -1;
- break;
- }
- free (pStat);
- }
- }
- } else iRet=-1;
- free(ptr);
- } else iRet=-1;
- return iRet;
-}
-
-void __cdecl SearchUsersWaitingMyAuthorization(void *dummy) {
- char *cmd, *token, *nextoken;
-
- UNREFERENCED_PARAMETER(dummy);
-
- if (SkypeSend("#UWA SEARCH USERSWAITINGMYAUTHORIZATION")) return;
- if (!(cmd=SkypeRcv("#UWA USERS", INFINITE))) return;
- if (!strncmp(cmd, "ERROR", 5)) {
- free(cmd);
- return;
- }
-
- token=strtok_r(cmd+10, ", ", &nextoken);
- while (token) {
- CCSDATA ccs={0};
- PROTORECVEVENT pre={0};
- HANDLE hContact;
- char *firstname=NULL, *lastname=NULL, *pCurBlob;
-
- LOG(("Awaiting auth: %s", token));
- ccs.szProtoService=PSR_AUTH;
- ccs.hContact=hContact=add_contact(token, PALF_TEMPORARY);
- ccs.wParam=0;
- ccs.lParam=(LPARAM)⪯
- pre.flags=0;
- pre.timestamp=(DWORD)SkypeTime(NULL);
-
- /* blob is: */
- //DWORD protocolSpecific HANDLE hContact
- //ASCIIZ nick, firstName, lastName, e-mail, requestReason
- if (firstname=SkypeGet("USER", token, "FULLNAME"))
- if (lastname=strchr(firstname, ' ')) {
- *lastname=0;
- lastname++;
- }
-
- pre.lParam=sizeof(DWORD)*2 + strlen(token)+5;
- if (firstname) pre.lParam += strlen(firstname);
- if (lastname) pre.lParam += strlen(lastname);
- if (pre.szMessage = pCurBlob = (char *)calloc(1, pre.lParam)) {
- pCurBlob+=sizeof(DWORD); // Not used
- *(DWORD*)pCurBlob = (DWORD)hContact; pCurBlob += sizeof(DWORD);
- strcpy((char *)pCurBlob,token); pCurBlob += strlen((char *)pCurBlob)+1;
- if (firstname) {
- strcpy((char *)pCurBlob,firstname);
- if (lastname) {
- pCurBlob+=strlen((char *)pCurBlob)+1;
- strcpy((char *)pCurBlob,lastname);
- }
- }
- CallService(MS_PROTO_CHAINRECV,0,(LPARAM)&ccs);
- free(pre.szMessage);
- }
- if (firstname) free(firstname);
- token=strtok_r(NULL, ", ", &nextoken);
- }
- free(cmd);
- return;
-}
-
-void SearchFriendsThread(char *dummy) {
- UNREFERENCED_PARAMETER(dummy);
-
- if (!SkypeInitialized) return;
- LOG(("SearchFriendsThread started."));
- EnterCriticalSection(&QueryThreadMutex);
- SkypeInitialized=FALSE;
- SearchFriends();
- SkypeInitialized=TRUE;
- LeaveCriticalSection(&QueryThreadMutex);
- LOG(("SearchFriendsThread terminated gracefully."));
-}
-
-void __cdecl SearchRecentChats(void *dummy) {
- char *cmd, *token, *nextoken;
-
- UNREFERENCED_PARAMETER(dummy);
-
- if (SkypeSend("#RCH SEARCH RECENTCHATS")) return;
- if (!(cmd=SkypeRcv("#RCH CHATS", INFINITE))) return;
- if (!strncmp(cmd, "ERROR", 5)) {
- free(cmd);
- return;
- }
-
- for (token=strtok_r(cmd+10, ", ", &nextoken); token; token=strtok_r(NULL, ", ", &nextoken)) {
- char *pszStatus = SkypeGet ("CHAT", token, "STATUS");
-
- if (pszStatus) {
- if (!strcmp(pszStatus, "MULTI_SUBSCRIBED")) {
- // Add chatrooms for active multisubscribed chats
- /*if (!find_chatA(token)) */{
- char *pszTopic;
-
- EnterCriticalSection (&QueryThreadMutex);
- ChatStart(token, TRUE);
- if (pszTopic = SkypeGet ("CHAT", token, "TOPIC")) {
- TCHAR *psztChatName, *psztTopic;
-
- if (!*pszTopic) {
- free (pszTopic);
- if (pszTopic = SkypeGet ("CHAT", token, "FRIENDLYNAME"));
- }
- psztChatName = make_nonutf_tchar_string((const unsigned char*)token);
- psztTopic = make_tchar_string((const unsigned char*)pszTopic);
- SetChatTopic (psztChatName, psztTopic, FALSE);
- free_nonutf_tchar_string(psztChatName);
- free (psztTopic);
- free (pszTopic);
- }
- LeaveCriticalSection (&QueryThreadMutex);
- }
- }
- free (pszStatus);
- }
- }
- free(cmd);
- return;
-}
-
-
-void __cdecl SkypeSystemInit(char *dummy) {
- static BOOL Initializing=FALSE;
- DBVARIANT dbv={0};
-
- UNREFERENCED_PARAMETER(dummy);
-
- LOG (("SkypeSystemInit thread started."));
- if (SkypeInitialized || Initializing)
- {
- LOG (("SkypeSystemInit terminated, nothing to do."));
- return;
- }
- Initializing=TRUE;
-// Do initial Skype-Tasks
- logoff_contacts(FALSE);
-// Add friends
-
- // Clear currentuserhandle entries from queue
- while (testfor ("CURRENTUSERHANDLE", 0));
- if (SkypeSend(SKYPE_PROTO)==-1 || !testfor("PROTOCOL", INFINITE) ||
- SkypeSend("GET CURRENTUSERHANDLE")==-1 ||
- SkypeSend("GET PRIVILEGE SKYPEOUT")==-1) {
- Initializing=FALSE;
- LOG (("SkypeSystemInit thread stopped with failure."));
- return;
- }
-
- if(DBGetContactSettingString(NULL,SKYPE_PROTONAME,"LoginUserName",&dbv) == 0)
- {
- if (*dbv.pszVal)
- {
- char *pszUser;
-
- // Username is set in Plugin, therefore we need to match it
- // against CURRENTUSERHANDLE
- if (pszUser = SkypeRcv ("CURRENTUSERHANDLE", INFINITE))
- {
- memmove (pszUser, pszUser+18, strlen(pszUser+17));
- if (_stricmp(dbv.pszVal, pszUser))
- {
- char szError[256];
-
- // Doesn't match, maybe we have a second Skype instance we have to take
- // care of? If in doubt, let's wait a while for it to report its hWnd to us.
- LOG (("Userhandle %s doesn't match username %s from settings", pszUser, dbv.pszVal));
- if (!hSkypeWndSecondary) Sleep(3000);
- if (hSkypeWndSecondary)
- {
- hSkypeWnd = hSkypeWndSecondary;
- hSkypeWndSecondary = NULL;
- Initializing=FALSE;
- while (testfor ("CURRENTUSERHANDLE", 0));
- LOG (("Trying to init secondary Skype instance"));
- SkypeSystemInit(dummy);
- }
- else
- {
- hForbiddenSkypeWnd = hSkypeWnd;
-
- // If we need to start Skype as secondary instance, we should do it now
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "StartSkype", 1) &&
- DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "secondary", 0))
- {
- int oldstatus;
-
- hSkypeWnd = NULL;
- AttachStatus=-1;
- if (g_hWnd) KillTimer (g_hWnd, 1);
- oldstatus = SkypeStatus;
- InterlockedExchange((long *)&SkypeStatus, ID_STATUS_CONNECTING);
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, SkypeStatus);
- ConnectToSkypeAPI(skype_path, 1);
- }
- if (hForbiddenSkypeWnd == hSkypeWnd && !hSkypeWndSecondary)
- {
- int oldstatus;
-
- sprintf (szError, "Username '%s' provided by Skype API doesn't match username '%s' in "
- "your settings. Please either remove username setting in you configuration or correct "
- "it. Will not connect!", pszUser, dbv.pszVal);
- OUTPUTA (szError);
- Initializing=FALSE;
- AttachStatus=-1;
- logoff_contacts(FALSE);
- if (g_hWnd) KillTimer (g_hWnd, 1);
- hSkypeWnd = NULL;
- oldstatus = SkypeStatus;
- InterlockedExchange((long *)&SkypeStatus, ID_STATUS_OFFLINE);
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, SkypeStatus);
- }
- }
- }
- free (pszUser);
- }
- }
- DBFreeVariant(&dbv);
- if (!Initializing) return;
- }
-
-#ifdef SKYPEBUG_OFFLN
- if (!ResetEvent(GotUserstatus) || SkypeSend("GET USERSTATUS")==-1 ||
- WaitForSingleObject(GotUserstatus, INFINITE)==WAIT_FAILED)
- {
- LOG (("SkypeSystemInit thread stopped with failure."));
- Initializing=FALSE;
- return;
- }
- if (SkypeStatus!=ID_STATUS_OFFLINE)
-#endif
- if (SearchFriends()==-1) {
- LOG (("SkypeSystemInit thread stopped with failure."));
- Initializing=FALSE;
- return;
- }
- if (protocol>=5 || bIsImoproxy) {
- SkypeSend ("CREATE APPLICATION libpurple_typing");
- testfor ("CREATE APPLICATION libpurple_typing", 2000);
- }
- if (protocol>=5 || bIsImoproxy) {
- SearchUsersWaitingMyAuthorization(NULL);
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseGroupchat", 0))
- SearchRecentChats(NULL);
- }
- SkypeSend("SEARCH MISSED%sS", cmdMessage);
-
-
-#ifndef SKYPEBUG_OFFLN
- if (SkypeSend("GET USERSTATUS")==-1)
- {
- LOG (("SkypeSystemInit thread stopped with failure."));
- Initializing=FALSE;
- return;
- }
-#endif
- SetTimer (g_hWnd, 1, PING_INTERVAL, NULL);
- SkypeInitialized=TRUE;
- Initializing=FALSE;
- LOG (("SkypeSystemInit thread terminated gracefully."));
- return;
-}
-
-void FirstLaunch(char *dummy) {
- int counter=0;
-
- UNREFERENCED_PARAMETER(dummy);
-
- LOG (("FirstLaunch thread started."));
- if (!DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "StartSkype", 1) || ConnectToSkypeAPI(skype_path, FALSE)==-1)
- {
- int oldstatus=SkypeStatus;
-
- LOG(("OnModulesLoaded starting offline.."));
- InterlockedExchange((long *)&SkypeStatus, ID_STATUS_OFFLINE);
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, SkypeStatus);
- }
- if (AttachStatus==-1 || AttachStatus==SKYPECONTROLAPI_ATTACH_REFUSED || AttachStatus==SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE) {
- LOG (("FirstLaunch thread stopped because of invalid Attachstatus."));
- return;
- }
-
- // When you launch Skype and Attach is Successfull, it still takes some time
- // until it becomes available for receiving messages.
- // Let's probe this with PINGing
- LOG(("CheckIfApiIsResponding Entering test loop"));
- for ( ;; ) {
- LOG(("Test #%d", counter));
- if (SkypeSend("PING")==-1) counter ++; else break;
- if (counter>=20) {
- OUTPUT(_T("Cannot reach Skype API, plugin disfunct."));
- LOG (("FirstLaunch thread stopped: cannot reach Skype API."));
- return;
- }
- Sleep(500);
- }
- LOG(("CheckIfApiIsResponding: Testing for PONG"));
- testfor("PONG", 2000); // Flush PONG from MsgQueue
-
- forkthread(( pThreadFunc )SkypeSystemInit, 0, NULL);
- LOG (("FirstLaunch thread terminated gracefully."));
-}
-
-int CreateTopToolbarButton(WPARAM wParam, LPARAM lParam) {
- TTBButton ttb={0};
-
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(lParam);
-
- ttb.cbSize = sizeof(ttb);
- ttb.dwFlags = TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP|TTBBF_DRAWBORDER;
- ttb.hbBitmapDown = ttb.hbBitmapUp = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_CALL));
- ttb.pszServiceDown = ttb.pszServiceUp = SKYPEOUT_CALL;
- ttb.name=Translate("Do a SkypeOut-call");
- if ((int)(httbButton=(HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttb, 0))==-1) httbButton=0;
- return 0;
-}
-
-
-int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
- bModulesLoaded=TRUE;
-
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(lParam);
-
- PopupServiceExists = ServiceExists(MS_POPUP_ADDPOPUPEX);
-
- logoff_contacts(FALSE);
-
- HookEventsLoaded();
- //RegisterToUpdate();
- RegisterToDbeditorpp();
- VoiceServiceModulesLoaded();
- GCInit();
-
- add_contextmenu(NULL);
- if ( ServiceExists( MS_GC_REGISTER ))
- {
- GCREGISTER gcr = {0};
- static COLORREF crCols[1] = {0};
- char szEvent[MAXMODULELABELLENGTH];
-
- gcr.cbSize = sizeof( GCREGISTER );
- gcr.dwFlags = GC_CHANMGR | GC_TCHAR; // |GC_ACKMSG; // TODO: Not implemented yet
- gcr.ptszModuleDispName = _T("Skype protocol");
- gcr.pszModule = SKYPE_PROTONAME;
- if (CallService(MS_GC_REGISTER, 0, (LPARAM)&gcr))
- {
- OUTPUT(_T("Unable to register with Groupchat module!"));
- }
- _snprintf (szEvent, sizeof(szEvent), "%s\\ChatInit", SKYPE_PROTONAME);
- hInitChat = CreateHookableEvent(szEvent);
- hEvInitChat = HookEvent(szEvent, ChatInit);
-
- hChatEvent = HookEvent(ME_GC_EVENT, GCEventHook);
- hChatMenu = HookEvent(ME_GC_BUILDMENU, GCMenuHook);
- CreateServiceFunction (SKYPE_CHATNEW, SkypeChatCreate);
- CreateProtoService (PS_LEAVECHAT, GCOnLeaveChat);
- CreateProtoService (PS_JOINCHAT, GCOnJoinChat);
- }
- // Try folder service first
- hProtocolAvatarsFolder = NULL;
- if (ServiceExists(MS_FOLDERS_REGISTER_PATH))
- {
- char *tmpPath;
-
- if (!ServiceExists (MS_UTILS_REPLACEVARS) || !(tmpPath = Utils_ReplaceVars("%miranda_avatarcache%")))
- tmpPath = PROFILE_PATH;
- mir_snprintf(DefaultAvatarsFolder, sizeof(DefaultAvatarsFolder), "%s\\%s", tmpPath, SKYPE_PROTONAME);
- hProtocolAvatarsFolder = (HANDLE) FoldersRegisterCustomPath(SKYPE_PROTONAME, "Avatars Cache", DefaultAvatarsFolder);
- }
-
- if (hProtocolAvatarsFolder == NULL)
- {
- // Use defaults
- CallService(MS_DB_GETPROFILEPATH, (WPARAM) MAX_PATH, (LPARAM) DefaultAvatarsFolder);
- mir_snprintf(DefaultAvatarsFolder, sizeof(DefaultAvatarsFolder), "%s\\%s", DefaultAvatarsFolder, SKYPE_PROTONAME);
- CreateDirectoryA(DefaultAvatarsFolder, NULL);
- }
-
- forkthread(( pThreadFunc )FirstLaunch, 0, NULL);
- return 0;
-}
-
-void FetchMessageThread(fetchmsg_arg *pargs) {
- char *who=NULL, *type=NULL, *chat=NULL, *users=NULL, *msg=NULL, *status=NULL;
- char *ptr, *msgptr, szPartnerHandle[32], szBuf[128];
- int direction=0, msglen = 0;
- DWORD timestamp = 0, lwr=0;
- CCSDATA ccs={0};
- PROTORECVEVENT pre={0};
- HANDLE hContact = NULL, hDbEvent, hChat = NULL;
- DBEVENTINFO dbei={0};
- DBVARIANT dbv={0};
- fetchmsg_arg args;
- BOOL bEmoted=FALSE, isGroupChat=FALSE, bHasPartList=FALSE;
- BOOL bUseGroupChat = DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseGroupchat", 0);
-
- if (!pargs) return;
- args = *pargs;
- free (pargs);
-
- sprintf (szPartnerHandle, "%s_HANDLE", cmdPartner);
- pre.lParam = strtoul(args.msgnum, NULL, 10);
- if (args.bIsRead) pre.flags |= PREF_CREATEREAD;
- //pEvent = MsgList_FindMessage(pre.lParam);
-
- // Get Timestamp
- if (!args.pMsgEntry || !args.pMsgEntry->tEdited) {
- if (!(ptr=SkypeGet (cmdMessage, args.msgnum, "TIMESTAMP"))) return;
- if (strncmp(ptr, "ERROR", 5)) timestamp=atol(ptr);
- else timestamp=(DWORD)SkypeTime(NULL);
- free(ptr);
- } else timestamp=(DWORD)(args.pMsgEntry->tEdited);
-
- __try {
- // Get Chatname (also to determine if we need to relay this to a groupchat)
- if (!(chat=SkypeGetErr (cmdMessage, args.msgnum, "CHATNAME"))) __leave;
- if (hChat = find_chatA(chat)) isGroupChat=TRUE;
-
- // Get chat status
- if ((status=SkypeGetErr ("CHAT", chat, "STATUS")) &&
- !strcmp(status, "MULTI_SUBSCRIBED")) isGroupChat=TRUE;
-
- // Get chat type
- if (!(type=SkypeGetErr (cmdMessage, args.msgnum, "TYPE"))) __leave;
- bEmoted = strcmp(type, "EMOTED")==0;
- if (strcmp(type, "MULTI_SUBSCRIBED")==0) isGroupChat=TRUE;
-
- // Group chat handling
- if (isGroupChat && strcmp(type, "TEXT") && strcmp(type, "SAID") && strcmp(type, "UNKNOWN") && !bEmoted) {
- if (bUseGroupChat) {
- BOOL bAddedMembers = FALSE;
-
- if (!strcmp(type,"SAWMEMBERS") || !strcmp(type, "CREATEDCHATWITH"))
- {
- // We have a new Groupchat
- LOG(("FetchMessageThread CHAT SAWMEMBERS"));
- if (!hChat) ChatStart(chat, FALSE);
- __leave;
- }
- if (!strcmp(type,"KICKED"))
- {
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- CONTACTINFO ci = {0};
-
- if (!hChat) __leave;
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = make_nonutf_tchar_string((const unsigned char*)chat);
- gcd.iType = GC_EVENT_KICK;
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.dwFlags = GCEF_ADDTOLOG | GC_TCHAR;
- gce.time = timestamp;
-
- if (users=SkypeGetErr (cmdMessage, args.msgnum, "USERS")) {
- ci.hContact = find_contact(users);
- gce.ptszUID= make_nonutf_tchar_string((const unsigned char*)users);
- if (who=SkypeGetErr (cmdMessage, args.msgnum, szPartnerHandle)) {
- gce.ptszStatus= make_nonutf_tchar_string((const unsigned char*)who);
- ci.cbSize = sizeof(ci);
- ci.szProto = SKYPE_PROTONAME;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal;
- else gce.ptszNick=gce.ptszUID;
-
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- RemChatContact (GetChat(gcd.ptszID), gce.ptszUID);
- free_nonutf_tchar_string((void*)gce.ptszStatus);
- if (ci.pszVal) mir_free (ci.pszVal);
- }
- free_nonutf_tchar_string((void*)gce.ptszUID);
- }
- free_nonutf_tchar_string((void*)gcd.ptszID);
- __leave;
- }
- if (!strcmp(type,"SETROLE"))
- {
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- CONTACTINFO ci = {0};
- gchat_contact *gcContact;
- char *pszRole;
-
- // FROM_HANDLE - Wer hats gesetzt
- // USERS - Wessen Rolle wurde gesetzt
- // ROLE - Die neue Rolle
- if (!hChat) __leave;
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = make_nonutf_tchar_string((const unsigned char*)chat);
- gcd.iType = GC_EVENT_REMOVESTATUS;
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.dwFlags = GCEF_ADDTOLOG | GC_TCHAR;
- gce.time = timestamp;
-
- if (users=SkypeGetErr (cmdMessage, args.msgnum, "USERS")) {
- gce.ptszUID= make_nonutf_tchar_string((const unsigned char*)users);
- if (who=SkypeGetErr (cmdMessage, args.msgnum, szPartnerHandle)) {
- ci.cbSize = sizeof(ci);
- ci.szProto = SKYPE_PROTONAME;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- ci.hContact = find_contact(who);
- if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
- gce.ptszText=_tcsdup(ci.pszVal);
- mir_free (ci.pszVal);
- ci.pszVal = NULL;
- }
- else gce.ptszText=make_tchar_string((const unsigned char*)who);
-
- ci.hContact = find_contact(users);
- if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal;
- else gce.ptszNick=gce.ptszUID;
-
- if (gcContact = GetChatContact(GetChat(gcd.ptszID), gce.ptszUID))
- {
- gce.ptszStatus = gcContact->szRole;
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- }
- if (pszRole=SkypeGetErr (cmdMessage, args.msgnum, "ROLE")) {
- gce.ptszStatus = make_nonutf_tchar_string((const unsigned char*)pszRole);
- gcd.iType = GC_EVENT_ADDSTATUS;
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- free_nonutf_tchar_string((void*)gce.ptszStatus);
- free (pszRole);
- }
- free((void*)gce.ptszText);
- if (ci.pszVal) mir_free (ci.pszVal);
- }
- free_nonutf_tchar_string((void*)gce.ptszUID);
- }
- free_nonutf_tchar_string((void*)gcd.ptszID);
- __leave;
- }
- if (!strcmp(type,"SETTOPIC"))
- {
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- CONTACTINFO ci = {0};
-
- LOG(("FetchMessageThread CHAT SETTOPIC"));
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = make_nonutf_tchar_string((const unsigned char*)chat);
- gcd.iType = GC_EVENT_TOPIC;
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.dwFlags = GCEF_ADDTOLOG | GC_TCHAR;
- gce.time = timestamp;
- if (who=SkypeGetErr (cmdMessage, args.msgnum, szPartnerHandle)) {
- ci.hContact = find_contact(who);
- gce.ptszUID = make_nonutf_tchar_string((const unsigned char*)who);
- ci.cbSize = sizeof(ci);
- ci.szProto = SKYPE_PROTONAME;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal;
- else gce.ptszNick=gce.ptszUID;
-
- if (ptr=SkypeGetErr (cmdMessage, args.msgnum, "BODY")) {
- gce.ptszText = make_tchar_string((const unsigned char*)ptr);
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- free ((void*)gce.ptszText);
- free (ptr);
- }
- free_nonutf_tchar_string ((void*)gce.ptszUID);
- if (ci.pszVal) mir_free (ci.pszVal);
- }
- free_nonutf_tchar_string((void*)gcd.ptszID);
- if (!args.bDontMarkSeen)
- {
- MsgList_Add (pre.lParam, INVALID_HANDLE_VALUE);
- SkypeSend("SET %s %s SEEN", cmdMessage, args.msgnum);
- }
- __leave;
- }
- if (!strcmp(type,"LEFT") || (bAddedMembers = strcmp(type,"ADDEDMEMBERS")==0))
- {
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- CONTACTINFO ci = {0};
- char *pszInvited = Translate("invited ");
-
- LOG(("FetchMessageThread CHAT LEFT or ADDEDMEMBERS"));
- if (bAddedMembers) {
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = make_nonutf_tchar_string((const unsigned char*)chat);
- gcd.iType = GC_EVENT_ACTION;
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.dwFlags = GCEF_ADDTOLOG | GC_TCHAR;
- gce.time = timestamp;
- if (users=SkypeGetErr (cmdMessage, args.msgnum, "USERS")) {
- // We assume that users buffer has enough room for "invited" string
- memmove (users+strlen(pszInvited), users, strlen(users)+1);
- memcpy (users, pszInvited, strlen(pszInvited));
- gce.ptszText= make_tchar_string((const unsigned char*)users);
- if (who=SkypeGetErr (cmdMessage, args.msgnum, szPartnerHandle)) {
- DBVARIANT dbv;
-
- if (DBGetContactSettingString(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv)==0) {
- gce.bIsMe = strcmp(who, dbv.pszVal)==0;
- DBFreeVariant(&dbv);
- }
- if (!gce.bIsMe) ci.hContact = find_contact(who);
- gce.ptszUID= make_nonutf_tchar_string((const unsigned char*)who);
- ci.cbSize = sizeof(ci);
- ci.szProto = SKYPE_PROTONAME;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal;
- else gce.ptszNick=gce.ptszUID;
-
- CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce);
- free_nonutf_tchar_string((void*)gce.ptszUID);
- if (ci.pszVal) mir_free (ci.pszVal);
- }
- if (gce.ptszText) free ((void*)gce.ptszText);
- }
- free_nonutf_tchar_string ((void*)gcd.ptszID);
- }
- if (!args.QueryMsgDirection) SkypeSend ("GET CHAT %s MEMBERS", chat);
- __leave;
- }
- }
- __leave;
- }
-
- // Need to get the status?
- if (args.getstatus) {
- char *status;
-
- if (protocol<4) InterlockedIncrement (&rcvwatchers);
- status=SkypeGetID(cmdMessage, args.msgnum, "STATUS");
- if (protocol<4) InterlockedDecrement (&rcvwatchers);
- if (!status) __leave;
- if (!strcmp(status, "SENT")) direction=DBEF_SENT;
- free(status);
- }
-
- // Who sent it?
- if (!(who=SkypeGetErr (cmdMessage, args.msgnum, szPartnerHandle))) __leave;
-
- // Get contact handle
- LOG(("FetchMessageThread Finding contact handle"));
- DBGetContactSettingString(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv);
- if (dbv.pszVal && !strcmp (who, dbv.pszVal))
- {
- char *pTok, *nextoken;
-
- // It's from me.. But to whom?
- // CHATMESSAGE .. USERS doesn't return anything, so we have to query the CHAT-Object
- if (!(ptr=SkypeGetErr ("CHAT", chat, "ACTIVEMEMBERS"))) {
- DBFreeVariant (&dbv);
- __leave;
- }
-
- for (pTok = strtok_r (ptr, " ", &nextoken); pTok; pTok=strtok_r(NULL, " ", &nextoken)) {
- if (strcmp (pTok, dbv.pszVal)) break; // Take the first dude in the list who is not me
- }
-
- if (!pTok) {
- free (ptr);
- DBFreeVariant (&dbv);
- __leave; // We failed
- }
- free (who);
- who=memmove (ptr, pTok, strlen(pTok)+1);
- direction = DBEF_SENT;
- }
- DBFreeVariant (&dbv);
-
- if (!(hContact=find_contact(who))) {
- // Permanent adding of user obsolete, we use the BUDDYSTATUS now (bug #0000005)
- ResetEvent(hBuddyAdded);
- SkypeSend("GET USER %s BUDDYSTATUS", who);
- WaitForSingleObject(hBuddyAdded, INFINITE);
- if (!(hContact=find_contact(who))) {
- // Arrgh, the user has been deleted from contact list.
- // In this case, we add him temp. to receive the msg at least.
- hContact=add_contact(who, PALF_TEMPORARY);
- }
- }
- // Text which was sent (on edited msg, BODY may already be in queue, check)
- sprintf (szBuf, "GET %s %s BODY", cmdMessage, args.msgnum);
- if (!args.pMsgEntry || !args.pMsgEntry->tEdited || !(ptr=SkypeRcv(szBuf+4, 1000)))
- {
- if (SkypeSend(szBuf)==-1 || !(ptr=SkypeRcv(szBuf+4, INFINITE)))
- __leave;
- }
- if (strncmp(ptr, "ERROR", 5)) {
- msgptr = ptr+strlen(szBuf+4)+1;
- bHasPartList = strncmp(msgptr,"<partlist ",10)==0;
- if (args.pMsgEntry && args.pMsgEntry->tEdited) {
- // Mark the message as edited
- if (!*msgptr && args.pMsgEntry->hEvent != INVALID_HANDLE_VALUE) {
- // Empty message and edited -> Delete event
- if ((int)(hContact = (HANDLE)CallService (MS_DB_EVENT_GETCONTACT, (WPARAM)args.pMsgEntry->hEvent, 0)) != -1) {
- CallService (MS_DB_EVENT_DELETE, (WPARAM)hContact, (LPARAM)args.pMsgEntry->hEvent);
- free (ptr);
- __leave;
- }
- } else {
- msgptr-=9;
- memcpy (msgptr, "[EDITED] ", 9);
- }
- }
- if( bEmoted && !isGroupChat) {
- CONTACTINFO ci = {0};
- int newlen;
- char *pMsg, *pszUTFnick=NULL;
- ci.cbSize = sizeof(ci);
- ci.szProto = SKYPE_PROTONAME;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- if (ci.hContact = hContact) {
- CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci);
- if (ci.pszVal) {
-#ifdef _UNICODE
- pszUTFnick = (char*)make_utf8_string(ci.pszVal);
-#else
- utf8_encode (ci.pszVal, &pszUTFnick);
-#endif
- mir_free (ci.pszVal);
- }
- }
- newlen = strlen(msgptr) + (pszUTFnick?strlen(pszUTFnick):0) + 9;
- if (pMsg = malloc(newlen)) {
- sprintf (pMsg, "** %s%s%s **", (pszUTFnick?pszUTFnick:""),(pszUTFnick?" ":""),(char*)msgptr);
- free (ptr);
- ptr = msgptr = pMsg;
- }
- if (pszUTFnick) free(pszUTFnick);
- }
-
- if (mirandaVersion >= 0x070000 && // 0.7.0+ supports PREF_UTF flag, no need to decode UTF8
- !isGroupChat) { // I guess Groupchat doesn't support UTF8?
- msg = ptr;
- pre.flags |= PREF_UTF;
- } else { // Older version has to decode either UTF8->ANSI or UTF8->UNICODE
- // This could be replaced by mir_getUTFI - functions for Miranda 0.5+ builds, but we stay
- // 0.4 compatible for backwards compatibility. Unfortunately this requires us to link with utf8.c
-#ifdef _UNICODE
- int wcLen;
-#endif
-
- if (utf8_decode(msgptr, &msg)==-1) {
- free(ptr);
- __leave;
- }
-#ifdef _UNICODE
- msglen = strlen(msg)+1;
- msgptr = (char*)make_unicode_string ((const unsigned char*)msgptr);
- wcLen = (_tcslen((TCHAR*)msgptr)+1)*sizeof(TCHAR);
- msg=realloc(msg, msglen+wcLen);
- memcpy (msg+msglen, msgptr, wcLen);
- free(msgptr);
- pre.flags |= PREF_UNICODE;
-#endif
- msgptr = msg;
- free (ptr);
- }
- msglen = strlen(msgptr)+1;
- } else {
- free (ptr);
- __leave;
- }
- // skype sends some xml statics after a call has finished. Check if thats the case and suppress it if necessary...
- if ((DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "SuppressCallSummaryMessage", 1) &&
- bHasPartList) || msgptr[0]==0) __leave;
-
- if (isGroupChat && bUseGroupChat) {
- GCDEST gcd = {0};
- GCEVENT gce = {0};
- DBVARIANT dbv = {0};
- CONTACTINFO ci = {0};
-
- LOG(("FetchMessageThread This is a group chat message"));
- if (!hChat) ChatStart(chat, FALSE);
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = make_nonutf_tchar_string((const unsigned char*)chat);
- gcd.iType = bEmoted?GC_EVENT_ACTION:GC_EVENT_MESSAGE;
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- if ((gce.bIsMe = (direction&DBEF_SENT)?TRUE:FALSE) &&
- DBGetContactSettingString(NULL, SKYPE_PROTONAME, SKYPE_NAME, &dbv)==0)
- {
- free(who);
- who = _strdup(dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- gce.ptszUID = make_nonutf_tchar_string((const unsigned char*)who);
- ci.cbSize = sizeof(ci);
- ci.szProto = SKYPE_PROTONAME;
- ci.dwFlag = CNF_DISPLAY | CNF_TCHAR;
- ci.hContact = !gce.bIsMe?hContact:NULL;
- gce.ptszNick=gce.ptszUID;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal;
- gce.time = timestamp>0?timestamp:(DWORD)SkypeTime(NULL);
- gce.pszText = msgptr;
- if (pre.flags & PREF_UNICODE) gce.pszText += msglen;
- gce.dwFlags = GCEF_ADDTOLOG | GC_TCHAR;
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- MsgList_Add (pre.lParam, INVALID_HANDLE_VALUE); // Mark as groupchat
- if (ci.pszVal) mir_free (ci.pszVal);
- free_nonutf_tchar_string((void*)gce.ptszUID);
- free_nonutf_tchar_string(gcd.ptszID);
-
- // Yes, we have successfully read the msg
- if (!args.bDontMarkSeen)
- SkypeSend("SET %s %s SEEN", cmdMessage, args.msgnum);
- __leave;
- }
-
- if (args.QueryMsgDirection || (direction&DBEF_SENT)) {
- // Check if the timestamp is valid
- dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=0;
- if (hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDFIRST,(WPARAM)hContact,0)) {
- CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei);
- lwr=dbei.timestamp;
- }
- dbei.cbSize=sizeof(dbei);
- dbei.cbBlob=0;
- dbei.timestamp=0;
- if (hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDLAST,(WPARAM)hContact,0))
- CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei);
- LOG(("FetchMessageThread timestamp %ld between %ld and %ld", timestamp, lwr, dbei.timestamp));
- if (timestamp<lwr || (direction&DBEF_SENT)) {
- TYP_MSGLENTRY *pme;
-
- LOG(("FetchMessageThread Adding event"));
- if (!(dbei.szModule=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0)))
- dbei.szModule=SKYPE_PROTONAME;
- dbei.cbBlob=msglen;
- if (pre.flags & PREF_UNICODE)
- dbei.cbBlob += sizeof(WCHAR)*( (DWORD)wcslen((WCHAR*)&msgptr[dbei.cbBlob])+1);
- dbei.pBlob=(PBYTE)msgptr;
- dbei.timestamp=timestamp>0?timestamp:(DWORD)SkypeTime(NULL);
- dbei.flags=direction;
- if (pre.flags & PREF_CREATEREAD) dbei.flags|=DBEF_READ;
- if (pre.flags & PREF_UTF) dbei.flags|=DBEF_UTF;
- dbei.eventType=EVENTTYPE_MESSAGE;
- pme = MsgList_Add (pre.lParam, (HANDLE)CallServiceSync(MS_DB_EVENT_ADD, (WPARAM)(HANDLE)hContact, (LPARAM)&dbei));
-
- // We could call MS_PROTO_CHAINSEND if we want to have MetaContact adding the history for us,
- // however we all know that CCSDATA doesn't contain timestamp-information which is
- // really bad on importing history for example, as all messages would be added with current
- // timestamp. This would cause unreliable jumbled timestamps in metacontact, so we better do this
- // ourself.
- if (DBGetContactSettingByte(hContact, "MetaContacts", "IsSubcontact", 0))
- {
- DWORD dwMetaLink = DBGetContactSettingDword(hContact, "MetaContacts", "MetaLink", MAXDWORD);
- HANDLE hMetaContact;
-
- if (dwMetaLink != MAXDWORD && (hMetaContact = GetMetaHandle(dwMetaLink)))
- {
- dbei.szModule=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hMetaContact, 0);
- pme->hMetaEvent = (HANDLE)CallServiceSync(MS_DB_EVENT_ADD, (WPARAM)(HANDLE)hMetaContact, (LPARAM)&dbei);
- }
- }
-
- if (!args.QueryMsgDirection && !args.bDontMarkSeen)
- SkypeSend("SET %s %s SEEN", cmdMessage, args.msgnum);
- }
- }
-
-
- if (!(direction&DBEF_SENT) && (!args.QueryMsgDirection || (args.QueryMsgDirection && timestamp>dbei.timestamp))) {
- LOG(("FetchMessageThread Normal message add..."));
- // Normal message received, process it
- ccs.szProtoService = PSR_MESSAGE;
- ccs.hContact = hContact;
- ccs.wParam = 0;
- ccs.lParam = (LPARAM)⪯
- pre.flags |= direction;
- if(isGroupChat && DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "MarkGroupchatRead", 0))
- pre.flags |= PREF_CREATEREAD;
- pre.timestamp = timestamp>0?timestamp:(DWORD)SkypeTime(NULL);
- pre.szMessage = msgptr;
- CallServiceSync(MS_PROTO_CHAINRECV, 0, (LPARAM) &ccs);
-
- // Yes, we have successfully read the msg
- if (!args.bDontMarkSeen) SkypeSend("SET %s %s SEEN", cmdMessage, args.msgnum);
- }
- }
- __finally {
- if (status) free(status);
- if (msg) free(msg);
- if (users) free(users);
- if (chat) free(chat);
- if (type) free(type);
- if (who) free (who);
- }
-
-}
-
-void FetchMessageThreadSync(fetchmsg_arg *pargs) {
- // Secure this thread with a mutex.
- // This is needed to ensure that we get called after an old msg in the queue has
- // been added so that MsgList_FindEntry will find it.
- WaitForSingleObject (FetchMessageEvent, 30000); // Wait max. 30 sec. for previous message fetch to complete
- if ((pargs->pMsgEntry = MsgList_FindMessage(strtoul(pargs->msgnum, NULL, 10))) && !pargs->pMsgEntry->tEdited) {
- // Better don't do this, as we set the msg as read and with this code, we would
- // mark messages not opened by user as read which isn't that good
- /*
- if (pargs->bIsRead && pMsgEvent->hEvent != INVALID_HANDLE_VALUE)
- {
- HANDLE hContact;
- if ((int)(hContact = (HANDLE)CallService (MS_DB_EVENT_GETCONTACT, (WPARAM)pMsgEntry->hEvent, 0)) != -1)
- CallService (MS_DB_EVENT_MARKREAD, (WPARAM)hContact, (LPARAM)hDBEvent);
- }
- */
- free (pargs);
- }
- else FetchMessageThread (pargs);
- SetEvent (FetchMessageEvent);
-}
-
-static int MsglCmpProc(const void *pstPElement,const void *pstPToFind)
-{
- return strcmp ((char*)((fetchmsg_arg*)pstPElement)->pMsgEntry, (char*)((fetchmsg_arg*)pstPToFind)->pMsgEntry);
-}
-
-void MessageListProcessingThread(char *str) {
- char *token, *nextoken, *chat=NULL;
- fetchmsg_arg *args;
- TYP_LIST *hListMsgs = List_Init(32);
- int i, nCount;
-
- // Frst we need to sort the message timestamps
- for ((token=strtok_r(str, ", ", &nextoken)); token; token=strtok_r(NULL, ", ", &nextoken)) {
- if (args=calloc(1, sizeof(fetchmsg_arg)+sizeof(DWORD))) {
- strncpy (args->msgnum, token, sizeof(args->msgnum));
- args->getstatus=TRUE;
- args->bIsRead=TRUE;
- args->bDontMarkSeen=TRUE;
- args->QueryMsgDirection=TRUE;
- (char*)args->pMsgEntry = SkypeGet ("CHATMESSAGE", token, "TIMESTAMP"); // Bad abuse of pointer
- if (!chat) chat=SkypeGet ("CHATMESSAGE", token, "CHATNAME");
- if (args->pMsgEntry) List_InsertSort (hListMsgs, MsglCmpProc, args);
- else free(args);
- }
- }
- for (i=0, nCount=List_Count(hListMsgs); i<nCount; i++) {
- args = List_ElementAt (hListMsgs, i);
- free (args->pMsgEntry);
- args->pMsgEntry = NULL;
- FetchMessageThreadSync (args);
- }
- if (chat) {
- SkypeSend ("GET CHAT %s MEMBERS", chat);
- free (chat);
- }
- List_Exit (hListMsgs);
- free (str);
-}
-
-char *GetCallerHandle(char *szSkypeMsg) {
- return SkypeGet(szSkypeMsg, "PARTNER_HANDLE", "");
-}
-
-
-HANDLE GetCallerContact(char *szSkypeMsg) {
- char *szHandle;
- HANDLE hContact=NULL;
-
- if (!(szHandle=GetCallerHandle(szSkypeMsg))) return NULL;
- if (!(hContact=find_contact(szHandle))) {
- // If it's a SkypeOut-contact, PARTNER_HANDLE = SkypeOUT number
- DBVARIANT dbv;
- int tCompareResult;
-
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, "SkypeOutNr", &dbv)) continue;
- tCompareResult = strcmp(dbv.pszVal, szHandle);
- DBFreeVariant(&dbv);
- if (tCompareResult) continue; else break;
- }
- }
- free(szHandle);
- if (!hContact) {LOG(("GetCallerContact Not found!"));}
- return hContact;
-}
-
-HANDLE GetMetaHandle(DWORD dwId) {
- HANDLE hContact;
- char *szProto;
-
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
- if (szProto!=NULL && !strcmp(szProto, "MetaContacts") &&
- DBGetContactSettingDword(hContact, "MetaContacts", "MetaID", MAXDWORD)==dwId)
- return hContact;
- }
- return 0;
-}
-
-LRESULT CALLBACK InCallPopUpProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
-{
- switch(msg)
- {
- case WM_COMMAND:
- break;
-
- case WM_CONTEXTMENU:
- SendMessage(hwnd,UM_DESTROYPOPUP,0,0);
- break;
- case UM_FREEPLUGINDATA:
- //Here we'd free our own data, if we had it.
- return FALSE;
- case UM_INITPOPUP:
- break;
- case UM_DESTROYPOPUP:
- break;
- case WM_NOTIFY:
- default:
- break;
- }
- return DefWindowProc(hwnd,msg,wParam,lParam);
-}
-
-void RingThread(char *szSkypeMsg) {
- HANDLE hContact;
- DBEVENTINFO dbei={0};
- DBVARIANT dbv;
- char *ptr = NULL;
-
- // We use a single critical section for the RingThread- and the EndCallThread-functions
- // so that only one function is running at the same time. This is needed, because when
- // a initated and unaccepted call (which is still ringing) is hangup/canceled, skype
- // sends two messages. First "CALL xxx STATUS RINGING" .. second "CALL xx STATUS CANCELED".
- // This starts two independend threads (first: RingThread; second: EndCallThread). Now
- // the two message are processed in reverse order sometimes. This causes the EndCallThread to
- // delete the contacts "CallId" property and after that the RingThread saves the contacts
- // "CallId" again. After that its not possible to call this contact, because the plugin
- // thinks that there is already a call going and the hangup-function isnt working, because
- // skype doesnt accept status-changes for finished calls. The CriticalSection syncronizes
- // the threads and the messages are processed in correct order.
- // Not the best solution, but it works.
- EnterCriticalSection (&RingAndEndcallMutex);
-
- LOG(("RingThread started."));
- if (protocol >= 5) SkypeSend ("MINIMIZE");
- if (hContact=GetCallerContact(szSkypeMsg)) {
- // Make sure that an answering thread is not already in progress so that we don't get
- // the 'Incoming call' event twice
- if (!DBGetContactSettingString(hContact, SKYPE_PROTONAME, "CallId", &dbv)) {
- DBFreeVariant(&dbv);
- LOG(("RingThread terminated."));
- goto l_exitRT;
- }
- DBWriteContactSettingString(hContact, SKYPE_PROTONAME, "CallId", szSkypeMsg);
- }
-
- if (!(ptr=SkypeGet(szSkypeMsg, "TYPE", ""))) {
- LOG(("RingThread terminated."));
- goto l_exitRT;;
- }
-
- if (!strncmp(ptr, "INCOMING", 8))
- NofifyVoiceService(hContact, szSkypeMsg, VOICE_STATE_RINGING);
- else
- NofifyVoiceService(hContact, szSkypeMsg, VOICE_STATE_CALLING);
-
- if (!strncmp(ptr, "INCOMING", 8)) {
- if (!hContact) {
- char *szHandle;
-
- if (szHandle=GetCallerHandle(szSkypeMsg)) {
- if (!(hContact=add_contact(szHandle, PALF_TEMPORARY))) {
- free(szHandle);
- goto l_exitRT;
- }
- DBDeleteContactSetting(hContact, "CList", "Hidden");
- DBWriteContactSettingWord(hContact, SKYPE_PROTONAME, "Status", (WORD)SkypeStatusToMiranda("SKYPEOUT"));
- DBWriteContactSettingString(hContact, SKYPE_PROTONAME, "SkypeOutNr", szHandle);
- free(szHandle);
- } else goto l_exitRT;
- }
- }
-
- if (HasVoiceService()) {
- // Voice service will handle it
- goto l_exitRT;
- }
-
- dbei.cbSize=sizeof(dbei);
- dbei.eventType=EVENTTYPE_CALL;
- dbei.szModule=SKYPE_PROTONAME;
- dbei.timestamp=(DWORD)SkypeTime(NULL);
- dbei.pBlob=(unsigned char*)Translate("Phonecall");
- dbei.cbBlob=strlen((const char*)dbei.pBlob)+1;
- if (!strncmp(ptr, "INCOMING", 8))
- {
- CLISTEVENT cle={0};
- char toolTip[256];
-
- if(PopupServiceExists)
- {
- BOOL showPopup, popupWindowColor;
- unsigned int popupBackColor, popupTextColor;
- int popupTimeSec;
- POPUPDATAT InCallPopup;
- TCHAR * lpzContactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR);
-
- popupTimeSec = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupTimeSec", 4);
- popupTextColor = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupTextColor", GetSysColor(COLOR_WINDOWTEXT));
- popupBackColor = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupBackColor", GetSysColor(COLOR_BTNFACE));
- popupWindowColor = (0 != DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "popupWindowColor", TRUE));
- showPopup = (0 != DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "showPopup", TRUE));
-
- InCallPopup.lchContact = hContact;
- InCallPopup.lchIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALL));
- InCallPopup.colorBack = ! popupWindowColor ? popupBackColor : GetSysColor(COLOR_BTNFACE);
- InCallPopup.colorText = ! popupWindowColor ? popupTextColor : GetSysColor(COLOR_WINDOWTEXT);
- InCallPopup.iSeconds = popupTimeSec;
- InCallPopup.PluginWindowProc = (WNDPROC)InCallPopUpProc;
- InCallPopup.PluginData = (void *)1;
-
- lstrcpy(InCallPopup.lptzText, TranslateT("Incoming Skype Call"));
-
- lstrcpy(InCallPopup.lptzContactName, lpzContactName);
-
- if(showPopup)
- CallService(MS_POPUP_ADDPOPUPT,(WPARAM)&InCallPopup,0);
-
- }
- cle.cbSize=sizeof(cle);
- cle.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALL));
- cle.pszService=SKYPE_ANSWERCALL;
- dbei.flags=DBEF_READ;
- cle.hContact=hContact;
- cle.hDbEvent=(HANDLE)CallService(MS_DB_EVENT_ADD,(WPARAM)hContact,(LPARAM)&dbei);
- _snprintf(toolTip,sizeof(toolTip),Translate("Incoming call from %s"),(char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0));
- cle.pszTooltip=toolTip;
- CallServiceSync(MS_CLIST_ADDEVENT,0,(LPARAM)&cle);
- }
- else
- {
- dbei.flags=DBEF_SENT;
- CallService(MS_DB_EVENT_ADD,(WPARAM)hContact,(LPARAM)&dbei);
- }
-
-l_exitRT:
- if (ptr) free (ptr);
- free(szSkypeMsg);
- LeaveCriticalSection (&RingAndEndcallMutex);
-}
-
-void EndCallThread(char *szSkypeMsg) {
- HANDLE hContact=NULL, hDbEvent;
- DBEVENTINFO dbei={0};
- DBVARIANT dbv;
- int tCompareResult;
-
- // We use a single critical section for the RingThread- and the EndCallThread-functions
- // so that only one function is running at the same time. This is needed, because when
- // a initated and unaccepted call (which is still ringing) is hangup/canceled, skype
- // sends two messages. First "CALL xxx STATUS RINGING" .. second "CALL xx STATUS CANCELED".
- // This starts two independend threads (first: RingThread; second: EndCallThread). Now
- // the two message are processed in reverse order sometimes. This causes the EndCallThread to
- // delete the contacts "CallId" property and after that the RingThread saves the contacts
- // "CallId" again. After that its not possible to call this contact, because the plugin
- // thinks that there is already a call going and the hangup-function isnt working, because
- // skype doesnt accept status-changes for finished calls. The CriticalSection syncronizes
- // the threads and the messages are processed in correct order.
- // Not the best solution, but it works.
- EnterCriticalSection (&RingAndEndcallMutex);
-
- LOG(("EndCallThread started."));
- if (szSkypeMsg) {
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, "CallId", &dbv)) continue;
- tCompareResult = strcmp(dbv.pszVal, szSkypeMsg);
- DBFreeVariant(&dbv);
- if (tCompareResult) continue; else break;
- }
- }
- if (hContact)
- {
- NofifyVoiceService(hContact, szSkypeMsg, VOICE_STATE_ENDED);
-
- DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "CallId");
-
- if (!HasVoiceService()) {
- dbei.cbSize=sizeof(dbei);
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDFIRSTUNREAD,(WPARAM)hContact,0);
- while(hDbEvent) {
- dbei.cbBlob=0;
- CallService(MS_DB_EVENT_GET,(WPARAM)hDbEvent,(LPARAM)&dbei);
- if (!(dbei.flags&(DBEF_SENT|DBEF_READ)) && dbei.eventType==EVENTTYPE_CALL) {
- CallService(MS_DB_EVENT_MARKREAD,(WPARAM)hContact,(LPARAM)hDbEvent);
- CallService(MS_CLIST_REMOVEEVENT,(WPARAM)hContact,(LPARAM)hDbEvent);
- }
- if (dbei.pBlob) free(dbei.pBlob);
- hDbEvent=(HANDLE)CallService(MS_DB_EVENT_FINDNEXT,(WPARAM)hDbEvent,0);
- }
- }
-
- if (!DBGetContactSettingString(hContact, SKYPE_PROTONAME, "SkypeOutNr", &dbv)) {
- DBFreeVariant(&dbv);
- if (!strcmp((char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0), SKYPE_PROTONAME) &&
- DBGetContactSettingByte(hContact, "CList", "NotOnList", 0)
- )
- CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
- }
- }
- free(szSkypeMsg);
- LeaveCriticalSection (&RingAndEndcallMutex);
-}
-
-void HoldCallThread(char *szSkypeMsg) {
- HANDLE hContact;
-
- LOG(("HoldCallThread started"));
- if (!szSkypeMsg) {
- LOG(("HoldCallThread terminated."));
- return;
- }
- if (hContact=GetCallerContact(szSkypeMsg)) {
- DBWriteContactSettingByte(hContact, SKYPE_PROTONAME, "OnHold", 1);
- NofifyVoiceService(hContact, szSkypeMsg, VOICE_STATE_ON_HOLD);
- }
- free(szSkypeMsg);
- LOG(("HoldCallThread terminated gracefully"));
-}
-
-void ResumeCallThread(char *szSkypeMsg) {
- HANDLE hContact;
-
- LOG(("ResumeCallThread started"));
- if (!szSkypeMsg) {
- LOG(("ResumeCallThread terminated."));
- return;
- }
- if (hContact=GetCallerContact(szSkypeMsg)) {
- DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "OnHold");
- NofifyVoiceService(hContact, szSkypeMsg, VOICE_STATE_TALKING);
- }
- free(szSkypeMsg);
- LOG(("ResumeCallThread terminated gracefully."));
-}
-
-int SetUserStatus(void) {
- if (RequestedStatus && AttachStatus!=-1) {
- if (SkypeSend("SET USERSTATUS %s", RequestedStatus)==-1) return 1;
- }
- return 0;
-}
-
-void LaunchSkypeAndSetStatusThread(void *newStatus) {
-
-/* if (!DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UnloadOnOffline", 0)) {
- logoff_contacts();
- return 1;
- }
-*/
- int oldStatus=SkypeStatus;
- static BOOL bLaunching = FALSE;
-
- UNREFERENCED_PARAMETER(newStatus);
-
- if (bLaunching) return;
- bLaunching = TRUE;
- LOG (("LaunchSkypeAndSetStatusThread started."));
- InterlockedExchange((long *)&SkypeStatus, (int)ID_STATUS_CONNECTING);
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, SkypeStatus);
-
- if (ConnectToSkypeAPI(skype_path, 1)!=-1) {
- forkthread(( pThreadFunc )SkypeSystemInit, 0, NULL);
- //InterlockedExchange((long *)&SkypeStatus, (int)newStatus);
- //ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, SkypeStatus);
- SetUserStatus();
- }
-
- LOG (("LaunchSkypeAndSetStatusThread terminated gracefully."));
- bLaunching = FALSE;
-}
-
-LONG APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam)
-{
- PCOPYDATASTRUCT CopyData;
- char *ptr, *szSkypeMsg=NULL, *nick, *buf;
- static char *onlinestatus=NULL;
- static BOOL RestoreUserStatus=FALSE;
- int sstat, oldstatus, flag;
- HANDLE hContact;
- fetchmsg_arg *args;
- static int iReentranceCnt = 0;
-
- iReentranceCnt++;
- switch (message)
- {
- case WM_COPYDATA:
- LOG(("WM_COPYDATA start"));
- if(hSkypeWnd==(HWND)wParam) {
- char *pData;
- CopyData=(PCOPYDATASTRUCT)lParam;
- pData = (char*)CopyData->lpData;
- while (*pData==' ') pData++;
- szSkypeMsg=_strdup((char*)pData);
- ReplyMessage(1);
- LOG(("< %s", szSkypeMsg));
-
- if (!strncmp(szSkypeMsg, "CONNSTATUS", 10)) {
- if (!strncmp(szSkypeMsg+11, "LOGGEDOUT", 9)) {
- SkypeInitialized=FALSE;
- ResetEvent(SkypeReady);
- AttachStatus=-1;
- sstat=ID_STATUS_OFFLINE;
- if (g_hWnd) KillTimer (g_hWnd, 1);
- logoff_contacts(TRUE);
- } else
- sstat=SkypeStatusToMiranda(szSkypeMsg+11);
-
- if (sstat) {
- oldstatus=SkypeStatus;
- InterlockedExchange((long*)&SkypeStatus, sstat);
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, SkypeStatus);
- if (sstat!=ID_STATUS_OFFLINE) {
- if (sstat!=ID_STATUS_CONNECTING && (oldstatus==ID_STATUS_OFFLINE || oldstatus==ID_STATUS_CONNECTING)) {
-
- SkypeInitialized=FALSE;
- forkthread(( pThreadFunc )SkypeSystemInit, 0, NULL);
- }
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "KeepState", 0)) RestoreUserStatus=TRUE;
- }
-
-// if (SkypeStatus==ID_STATUS_ONLINE) SkypeSend("SEARCH MISSEDMESSAGES");
- }
-// break;
- }
- if (!strncmp(szSkypeMsg, "USERSTATUS", 10)) {
-// if ((sstat=SkypeStatusToMiranda(szSkypeMsg+11)) && SkypeStatus!=ID_STATUS_CONNECTING) {
- if ((sstat=SkypeStatusToMiranda(szSkypeMsg+11))) {
- if (RestoreUserStatus && RequestedStatus) {
- RestoreUserStatus=FALSE;
- SkypeSend ("SET USERSTATUS %s", RequestedStatus);
- }
- oldstatus=SkypeStatus;
- InterlockedExchange((long*)&SkypeStatus, sstat);
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, sstat);
-#ifdef SKYPEBUG_OFFLN
- if ((oldstatus==ID_STATUS_OFFLINE || oldstatus==ID_STATUS_CONNECTING) &&
- SkypeStatus!=ID_STATUS_CONNECTING && SkypeStatus!=ID_STATUS_OFFLINE)
- forkthread(( pThreadFunc )SearchFriendsThread, 0, NULL);
-#endif
- }
-#ifdef SKYPEBUG_OFFLN
- SetEvent(GotUserstatus);
-#endif
- break;
- }
- if (!strncmp(szSkypeMsg, "APPLICATION libpurple_typing", 28)) {
- char *nextoken, *p;
-
- if (p=strtok_r(szSkypeMsg+29, " ", &nextoken))
- {
- if (!strcmp (p, "STREAMS")) {
- char *pStr;
-
- while (p=strtok_r(NULL, " ", &nextoken)) {
- if (pStr = strchr(p, ':')) {
- *pStr=0;
- if (hContact=find_contact(p)) {
- *pStr=':';
- DBWriteContactSettingString(hContact, SKYPE_PROTONAME, "Typing_Stream", p);
- }
- }
- }
- }
- else if (!strcmp (p, "DATAGRAM")) {
- if (p=strtok_r(NULL, " ", &nextoken)) {
- char *pStr;
-
- if (pStr = strchr(p, ':')) {
- *pStr=0;
- if (hContact=find_contact(p)) {
- *pStr=':';
- DBWriteContactSettingString(hContact, SKYPE_PROTONAME, "Typing_Stream", p);
-
- if (p=strtok_r(NULL, " ", &nextoken)) {
- LPARAM lTyping = PROTOTYPE_CONTACTTYPING_OFF;
-
- if (!strcmp(p, "PURPLE_TYPING")) lTyping=PROTOTYPE_CONTACTTYPING_INFINITE;
- CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, lTyping);
- break;
- }
- }
- }
- }
- }
- }
- }
- if (!strncmp(szSkypeMsg, "USER ", 5)) {
- char *nextoken;
-
- buf=_strdup(szSkypeMsg+5);
- nick=strtok_r(buf, " ", &nextoken);
- ptr=strtok_r(NULL, " ", &nextoken);
-
- if (strcmp(ptr, "BUDDYSTATUS")) {
- if (!strcmp(ptr, "RECEIVEDAUTHREQUEST")) {
- forkthread(( pThreadFunc )SearchUsersWaitingMyAuthorization, 0, NULL);
- free (buf);
- break;
- }
-
- if (!(hContact=find_contact(nick)) && strcmp(ptr, "FULLNAME")) {
- SkypeSend("GET USER %s BUDDYSTATUS", nick);
- free (buf);
- break;
- }
-
- if (!strcmp(ptr, "ONLINESTATUS")) {
- if (SkypeStatus!=ID_STATUS_OFFLINE)
- {
- DBWriteContactSettingWord(hContact, SKYPE_PROTONAME, "Status", (WORD)SkypeStatusToMiranda(ptr+13));
- if((WORD)SkypeStatusToMiranda(ptr+13) != ID_STATUS_OFFLINE)
- {
- LOG(("WndProc Status is not offline so get user info"));
- forkthread(GetInfoThread, 0, hContact);
- }
- }
- }
-
-
- /* We handle the following properties right here in the wndProc, in case that
- * Skype protocol broadcasts them to us.
- *
- * However, we still let them be added to the Message queue im memory, as they
- * may get consumed by GetInfoThread.
- * This is necessary to have a proper error handling in case the property is
- * not supported (i.e. imo2sproxy).
- *
- * If one of the property GETs returns an error, the error-message has to be
- * removed from the message queue, as the error is the answer to the query.
- * If we don't remove the ERRORs from the list, another consumer may see the ERROR
- * as a reply to his query and process it.
- * In case the SKYPE Protocol really broadcasts one of these messages without being
- * requested by GetInfoThread (i.e. MOOD_TEXT), the garbage collector will take
- * care of them and remove them after some time.
- * This may not be the most efficient way, but ensures that we finally do proper
- * error handling.
- */
- if (!strcmp(ptr, "FULLNAME")) {
- char *nm;
-
- if (nm = strtok_r(NULL, " ", &nextoken))
- {
- SkypeDBWriteContactSettingUTF8String(hContact, SKYPE_PROTONAME, "FirstName", nm);
- if (!(nm=strtok_r(NULL, "", &nextoken))) DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "LastName");
- else
- SkypeDBWriteContactSettingUTF8String(hContact, SKYPE_PROTONAME, "LastName", nm);
- }
- } else
- if (!strcmp(ptr, "BIRTHDAY")) {
- unsigned int y, m, d;
- if (sscanf(ptr+9, "%04d%02d%02d", &y, &m, &d)==3) {
- DBWriteContactSettingWord(hContact, SKYPE_PROTONAME, "BirthYear", (WORD)y);
- DBWriteContactSettingByte(hContact, SKYPE_PROTONAME, "BirthMonth", (BYTE)m);
- DBWriteContactSettingByte(hContact, SKYPE_PROTONAME, "BirthDay", (BYTE)d);
- } else {
- DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "BirthYear");
- DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "BirthMonth");
- DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "BirthDay");
- }
- } else
- if (!strcmp(ptr, "COUNTRY")) {
- if (ptr[8]) {
- struct CountryListEntry *countries;
- int countryCount, i;
-
- CallService(MS_UTILS_GETCOUNTRYLIST, (WPARAM)&countryCount, (LPARAM)&countries);
- for (i=0; i<countryCount; i++) {
- if (countries[i].id == 0 || countries[i].id == 0xFFFF) continue;
- if (!_stricmp(countries[i].szName, ptr+8))
- {
- DBWriteContactSettingWord(hContact, SKYPE_PROTONAME, "Country", (BYTE)countries[i].id);
- break;
- }
- }
- } else DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "Country");
- } else
- if (!strcmp(ptr, "SEX")) {
- if (ptr[4]) {
- BYTE sex=0;
- if (!_stricmp(ptr+4, "MALE")) sex=0x4D;
- if (!_stricmp(ptr+4, "FEMALE")) sex=0x46;
- if (sex) DBWriteContactSettingByte(hContact, SKYPE_PROTONAME, "Gender", sex);
- } else DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "Gender");
- } else
- /* if (!strcmp(ptr, "AVATAR" )){
- LOG("WndProc", "AVATAR");
- if (!(hContact=find_contact(nick)))
- SkypeSend("GET USER %s BUDDYSTATUS", nick);
- else
- {
- TCHAR *unicode = NULL;
-
- if(utf8_decode((ptr+9), &Avatar)==-1) break;
-
- if( ServiceExists(MS_AV_SETAVATAR) )
- {
- CallService(MS_AV_SETAVATAR,(WPARAM) hContact,(LPARAM) Avatar);
- }
- else
- {
-
- if(DBWriteContactSettingTString(hContact, "ContactPhoto", "File", Avatar))
- {
- #if defined( _UNICODE )
- char buff[TEXT_LEN];
- WideCharToMultiByte(code_page, 0, Avatar, -1, buff, TEXT_LEN, 0, 0);
- buff[TEXT_LEN] = 0;
- DBWriteContactSettingString(hContact, "ContactPhoto", "File", buff);
- #endif
- }
-
- }
-
-
- }
- free(buf);
- break;
- }
- */
- if (!strcmp(ptr, "MOOD_TEXT")){
-
- LOG(("WndProc MOOD_TEXT"));
- SkypeDBWriteContactSettingUTF8String (hContact, "CList", "StatusMsg", ptr+10);
- } else
- if (!strcmp(ptr, "TIMEZONE")){
- time_t temp;
- struct tm tms;
- int value=atoi(ptr+9), tz;
-
- LOG(("WndProc: TIMEZONE %s", nick));
-
- if (value && !DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "IgnoreTimeZones", 0)) {
- temp = SkypeTime(NULL);
- tms = *localtime(&temp);
- //memcpy(&tms,localtime(&temp), sizeof(tm));
- //tms = localtime(&temp)
- tz=(value >= 86400 )?(256-((2*(atoi(ptr+9)-86400))/3600)):((-2*(atoi(ptr+9)-86400))/3600);
- if (tms.tm_isdst == 1 && DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseTimeZonePatch", 0))
- {
- LOG(("WndProc: Using the TimeZonePatch"));
- DBWriteContactSettingByte(hContact, "UserInfo", "Timezone", (BYTE)(tz+2));
- }
- else
- {
- LOG(("WndProc: Not using the TimeZonePatch"));
- DBWriteContactSettingByte(hContact, "UserInfo", "Timezone", (BYTE)(tz+0));
- }
- } else {
- LOG(("WndProc: Deleting the TimeZone in UserInfo Section"));
- DBDeleteContactSetting(hContact, "UserInfo", "Timezone");
- }
- } else
- if (!strcmp(ptr, "IS_VIDEO_CAPABLE")){
- if (!_stricmp(ptr + 17, "True"))
- DBWriteContactSettingString(hContact, SKYPE_PROTONAME, "MirVer", "Skype 2.0");
- else
- DBWriteContactSettingString(hContact, SKYPE_PROTONAME, "MirVer", "Skype");
- } else
- if (!strcmp(ptr, "RICH_MOOD_TEXT")) {
- DBWriteContactSettingString(hContact, SKYPE_PROTONAME, "MirVer", "Skype 3.0");
- } else
- if (!strcmp(ptr, "DISPLAYNAME")) {
- // Skype Bug? -> If nickname isn't customised in the Skype-App, this won't return anything :-(
- if (ptr[12])
- SkypeDBWriteContactSettingUTF8String(hContact, SKYPE_PROTONAME, "Nick", ptr+12);
- } else // Other proerties that can be directly assigned to a DB-Value
- {
- int i;
- char *pszProp;
-
- for (i=0; i<sizeof(m_settings)/sizeof(m_settings[0]); i++) {
- if (!strcmp(ptr, m_settings[i].SkypeSetting)) {
- pszProp = ptr+strlen(m_settings[i].SkypeSetting)+1;
- if (*pszProp)
- SkypeDBWriteContactSettingUTF8String(hContact, SKYPE_PROTONAME, m_settings[i].MirandaSetting, pszProp);
- else
- DBDeleteContactSetting(hContact, SKYPE_PROTONAME, m_settings[i].MirandaSetting);
- }
- }
- }
- } else { // BUDDYSTATUS:
- flag=0;
- switch(atoi(ptr+12)) {
- case 1: if (hContact=find_contact(nick)) CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); break;
- case 0: break;
- case 2: flag=PALF_TEMPORARY;
- case 3: add_contact(nick, flag);
- SkypeSend("GET USER %s ONLINESTATUS", nick);
- break;
- }
- free(buf);
- if (!SetEvent(hBuddyAdded)) TellError(GetLastError());
- break;
- }
- free(buf);
- }
- if (!strncmp(szSkypeMsg, "CURRENTUSERHANDLE", 17)) { // My username
- DBVARIANT dbv={0};
-
- if(DBGetContactSettingString(NULL,SKYPE_PROTONAME,"LoginUserName",&dbv) ||
- !*dbv.pszVal || _stricmp (szSkypeMsg+18, dbv.pszVal)==0)
- {
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, SKYPE_NAME, szSkypeMsg+18);
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "Nick", szSkypeMsg+18);
- forkthread(( pThreadFunc )GetDisplaynameThread, 0, NULL);
- }
- if (dbv.pszVal) DBFreeVariant(&dbv);
- }
- if (strstr(szSkypeMsg, "AUTOAWAY") || !strncmp(szSkypeMsg, "OPEN ",5) ||
- (SkypeInitialized && !strncmp (szSkypeMsg, "PONG", 4)) ||
- !strncmp (szSkypeMsg, "MINIMIZE", 8))
- {
- // Currently we do not process these messages
- break;
- }
- if (!strncmp(szSkypeMsg, "CHAT ", 5)) {
- // Currently we only process these notifications
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseGroupchat", 0) &&
- (ptr = strchr (szSkypeMsg, ' ')) && (ptr = strchr (++ptr, ' ')))
- {
- if (strncmp(ptr, " MEMBERS", 8) == 0) {
- LOG(("WndProc AddMembers"));
- forkthread(( pThreadFunc )AddMembersThread, 0, _strdup(szSkypeMsg));
- } else
- if (strncmp(ptr, " FRIENDLYNAME ", 14) == 0) {
- // Chat session name
- HANDLE hContact;
-
- *ptr=0;
- if (hContact = find_chatA(szSkypeMsg+5))
- {
- GCDEST gcd = {0};
- GCEVENT gce = {0};
-
- if (DBGetContactSettingWord(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE) !=
- ID_STATUS_OFFLINE)
- {
- gcd.pszModule = SKYPE_PROTONAME;
- gcd.ptszID = make_nonutf_tchar_string((const unsigned char*)szSkypeMsg+5);
- gcd.iType = GC_EVENT_CHANGESESSIONAME;
- gce.cbSize = sizeof(GCEVENT);
- gce.pDest = &gcd;
- gce.ptszText = make_tchar_string((const unsigned char*)ptr+14);
- gce.dwFlags = GC_TCHAR;
- if (gce.ptszText) {
- CallService(MS_GC_EVENT, 0, (LPARAM)&gce);
- DBWriteContactSettingTString (hContact, SKYPE_PROTONAME, "Nick", gce.ptszText);
- free((void*)gce.ptszText);
- }
- free_nonutf_tchar_string((void*)gcd.ptszID);
- }
- }
- *ptr=' ';
- } else
- if (strncmp(ptr, " CHATMESSAGES ", 14) == 0) {
- forkthread(( pThreadFunc )MessageListProcessingThread, 0, _strdup(ptr+14));
- break;
- }
- }
- }
- if (!strncmp(szSkypeMsg, "CALL ",5)) {
- // incoming calls are already processed by Skype, so no need for us
- // to do this.
- // However we can give a user the possibility to hang up a call via Miranda's
- // context menu
- if (ptr=strstr(szSkypeMsg, " STATUS ")) {
- ptr[0]=0; ptr+=8;
- if (!strcmp(ptr, "RINGING") || !strcmp(ptr, "ROUTING")) forkthread(( pThreadFunc )RingThread, 0, _strdup(szSkypeMsg));
- if (!strcmp(ptr, "FAILED") || !strcmp(ptr, "FINISHED") ||
- !strcmp(ptr, "MISSED") || !strcmp(ptr, "REFUSED") ||
- !strcmp(ptr, "BUSY") || !strcmp(ptr, "CANCELLED"))
- forkthread(( pThreadFunc )EndCallThread, 0, _strdup(szSkypeMsg));
- if (!strcmp(ptr, "ONHOLD") || !strcmp(ptr, "LOCALHOLD") ||
- !strcmp(ptr, "REMOTEHOLD")) forkthread(( pThreadFunc )HoldCallThread, 0, _strdup(szSkypeMsg));
- if (!strcmp(ptr, "INPROGRESS")) forkthread(( pThreadFunc )ResumeCallThread, 0, _strdup(szSkypeMsg));
- break;
- } else if ((!strstr(szSkypeMsg, "PARTNER_HANDLE") && !strstr(szSkypeMsg, "FROM_HANDLE"))
- && !strstr(szSkypeMsg, "TYPE")) break;
- }
- if (!strncmp(szSkypeMsg, "PRIVILEGE SKYPEOUT", 18)) {
- if (!strncmp(szSkypeMsg+19, "TRUE", 4)) {
- if (!bSkypeOut) {
- CLISTMENUITEM mi={0};
-
- bSkypeOut=TRUE;
- mi.cbSize=sizeof(mi);
- mi.position=-2000005000;
- mi.flags=0;
- mi.hIcon=LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALLSKYPEOUT));
- mi.pszContactOwner=SKYPE_PROTONAME;
- mi.pszName=Translate("Do a SkypeOut-call");
- mi.pszService=SKYPEOUT_CALL;
- Menu_AddMainMenuItem(&mi);
- }
-
- } else {
- bSkypeOut=FALSE;
- if (httbButton) {
- CallService(MS_TTB_REMOVEBUTTON, (WPARAM)httbButton, 0);
- httbButton=0;
- }
- }
- break;
- }
- if (!strncmp(szSkypeMsg, "MESSAGES", 8) || !strncmp(szSkypeMsg, "CHATMESSAGES", 12)) {
- if (strlen(szSkypeMsg)<=(UINT)(strchr(szSkypeMsg, ' ')-szSkypeMsg+1))
- {
- LOG(( "%s %d %s %d", szSkypeMsg,(UINT)(strchr(szSkypeMsg, ' ')-szSkypeMsg+1),
- strchr(szSkypeMsg, ' '), strlen(szSkypeMsg)));
- break;
- }
- LOG(("MessageListProcessingThread launched"));
- forkthread(( pThreadFunc )MessageListProcessingThread, 0, _strdup(strchr(szSkypeMsg, ' ')+1));
- break;
- }
- if (!strncmp(szSkypeMsg, "MESSAGE", 7) || !strncmp(szSkypeMsg, "CHATMESSAGE", 11))
- {
- char *pMsgNum;
- TYP_MSGLENTRY *pEntry;
-
- if ((pMsgNum = strchr (szSkypeMsg, ' ')) && (ptr = strchr (++pMsgNum, ' ')))
- {
- BOOL bFetchMsg = FALSE;
-
- if (strncmp(ptr, " EDITED_TIMESTAMP", 17) == 0) {
- ptr[0]=0;
- if (pEntry = MsgList_FindMessage(strtoul(pMsgNum, NULL, 10))) {
- pEntry->tEdited = atol(ptr+18);
- }
- bFetchMsg = TRUE;
- } else bFetchMsg = (strncmp(ptr, " STATUS RE", 10) == 0 && !rcvwatchers) ||
- (strncmp(ptr, " STATUS SENT", 12) == 0 && !sendwatchers);
-
- if (bFetchMsg) {
- // If new message is available, fetch it
- ptr[0]=0;
- if (!(args=(fetchmsg_arg *)calloc(1, sizeof(*args)))) break;
- strncpy (args->msgnum, pMsgNum, sizeof(args->msgnum));
- args->getstatus=FALSE;
- //args->bIsRead = strncmp(ptr+8, "READ", 4) == 0;
- forkthread(( pThreadFunc )FetchMessageThreadSync, 0, args);
- break;
- }
- }
- }
- if (!strncmp(szSkypeMsg, "ERROR 68", 8)) {
- LOG(("We got a sync problem :( -> SendMessage() will try to recover..."));
- break;
- }
- if (!strncmp(szSkypeMsg, "PROTOCOL ", 9)) {
- if ((protocol=(char)atoi(szSkypeMsg+9))>=3) {
- strcpy(cmdMessage, "CHATMESSAGE");
- strcpy(cmdPartner, "FROM");
- }
- bProtocolSet = TRUE;
-
- if (protocol<5 && !hMenuAddSkypeContact &&
- DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "EnableMenu", 1))
- {
- hMenuAddSkypeContact = add_mainmenu();
- }
- }
- LOG(("SkypeMsgAdd launched"));
- SkypeMsgAdd(szSkypeMsg);
- ReleaseSemaphore(SkypeMsgReceived, receivers, NULL);
- }
- break;
-
- case WM_TIMER:
- if (iReentranceCnt>1) break;
- if (!bIsImoproxy) SkypeSend("PING");
- SkypeMsgCollectGarbage(MAX_MSG_AGE);
- MsgList_CollectGarbage();
- if (receivers>1)
- {
- LOG(("Watchdog WARNING: there are still %d receivers waiting for MSGs", receivers));
- }
- break;
-
- case WM_CLOSE:
- PostQuitMessage (0);
- break;
- case WM_DESTROY:
- KillTimer (hWndDlg, 1);
- break;
-
- default:
- if(message==ControlAPIAttach) {
- // Skype responds with Attach to the discover-message
- if ((HWND)wParam == hForbiddenSkypeWnd) {
- ResetEvent(SkypeReady);
- break;
- }
- AttachStatus=lParam;
- if (lParam==SKYPECONTROLAPI_ATTACH_SUCCESS) {
- LOG (("AttachStatus success, got hWnd %08X", (HWND)wParam));
-
- if (hSkypeWnd && (HWND)wParam!=hSkypeWnd && IsWindow(hSkypeWnd))
- hSkypeWndSecondary = (HWND)wParam;
- else {
- hSkypeWnd=(HWND)wParam; // Skype gave us the communication window handle
- hSkypeWndSecondary = NULL;
- }
- }
- if (AttachStatus!=SKYPECONTROLAPI_ATTACH_API_AVAILABLE &&
- AttachStatus!=SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE)
- {
- LOG(("Attaching: SkypeReady fired, Attachstatus is %d", AttachStatus));
- SetEvent(SkypeReady);
- }
- AttachStatus=lParam;
- break;
- }
- --iReentranceCnt;
- return (DefWindowProc(hWndDlg, message, wParam, lParam));
- }
- LOG(("WM_COPYDATA exit (%08X)", message));
- if (szSkypeMsg) free(szSkypeMsg);
- --iReentranceCnt;
- return 1;
-}
-
-void TellError(DWORD err) {
- LPVOID lpMsgBuf;
-
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL);
- MessageBox( NULL, (TCHAR*)lpMsgBuf, _T("GetLastError"), MB_OK|MB_ICONINFORMATION );
- LocalFree( lpMsgBuf );
- return;
-}
-
-
-// SERVICES //
-INT_PTR SkypeSetStatus(WPARAM wParam, LPARAM lParam)
-{
- int oldStatus, iRet;
- BOOL UseCustomCommand, UnloadOnOffline;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (MirandaShuttingDown) return 0;
- LOG (("SkypeSetStatus enter"));
- UseCustomCommand = DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseCustomCommand", 0);
- UnloadOnOffline = DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UnloadOnOffline", 0);
-
- //if (!SkypeInitialized && !DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UnloadOnOffline", 0)) return 0;
-
- // Workaround for Skype status-bug
- if ((int)wParam==ID_STATUS_OFFLINE) logoff_contacts(TRUE);
- if (SkypeStatus==(int)wParam) return 0;
- oldStatus = SkypeStatus;
-
- if ((int)wParam==ID_STATUS_CONNECTING) return 0;
-#ifdef MAPDND
- if ((int)wParam==ID_STATUS_OCCUPIED || (int)wParam==ID_STATUS_ONTHEPHONE) wParam=ID_STATUS_DND;
- if ((int)wParam==ID_STATUS_OUTTOLUNCH) wParam=ID_STATUS_NA;
-#endif
-#ifdef MAPNA
- if ((int)wParam==ID_STATUS_NA) wParam = ID_STATUS_AWAY;
-#endif
-
- RequestedStatus=MirandaStatusToSkype((int)wParam);
-
- /*
- if (SkypeStatus != ID_STATUS_OFFLINE)
- {
- InterlockedExchange((long*)&SkypeStatus, (int)wParam);
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldStatus, SkypeStatus);
- }
- */
-
- if ((int)wParam==ID_STATUS_OFFLINE && UnloadOnOffline)
- {
- if(UseCustomCommand)
- {
- DBVARIANT dbv;
- if(!DBGetContactSettingString(NULL,SKYPE_PROTONAME,"CommandLine",&dbv))
- {
- CloseSkypeAPI(dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- }
- else
- {
- CloseSkypeAPI(skype_path);
- }
-
- } else if (AttachStatus==-1)
- {
- forkthread(LaunchSkypeAndSetStatusThread, 0, (void *)wParam);
- return 0;
- }
-
- iRet = SetUserStatus();
- LOG (("SkypeSetStatus exit"));
- return iRet;
-}
-
-INT64 __stdcall SendBroadcast( HANDLE hContact, int type, int result, HANDLE hProcess, LPARAM lParam )
-{
- ACKDATA ack = {0};
- ack.cbSize = sizeof( ACKDATA );
- ack.szModule = SKYPE_PROTONAME;
- ack.hContact = hContact;
- ack.type = type;
- ack.result = result;
- ack.hProcess = hProcess;
- ack.lParam = lParam;
- return CallService( MS_PROTO_BROADCASTACK, 0, ( LPARAM )&ack );
-}
-
-static void __cdecl SkypeGetAwayMessageThread( HANDLE hContact )
-{
- DBVARIANT dbv;
- if ( !DBGetContactSettingString( hContact, "CList", "StatusMsg", &dbv )) {
- SendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )dbv.pszVal );
- DBFreeVariant( &dbv );
- }
- else SendBroadcast( hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, ( HANDLE )1, ( LPARAM )0 );
-}
-
-INT_PTR SkypeGetAwayMessage(WPARAM wParam,LPARAM lParam)
-{
- CCSDATA* ccs = ( CCSDATA* )lParam;
-
- UNREFERENCED_PARAMETER(wParam);
-
- forkthread( SkypeGetAwayMessageThread, 0, ccs->hContact );
- return 1;
-}
-
-#define POLYNOMIAL (0x488781ED) /* This is the CRC Poly */
-#define TOPBIT (1 << (WIDTH - 1)) /* MSB */
-#define WIDTH 32
-
-static int GetFileHash(char* filename)
-{
- HANDLE hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
- int remainder = 0, byte, bit;
- char data[1024];
- DWORD dwRead;
-
- if(hFile == INVALID_HANDLE_VALUE) return 0;
-
- do
- {
- // Read file chunk
- dwRead = 0;
- ReadFile(hFile, data, 1024, &dwRead, NULL);
-
- /* loop through each byte of data */
- for (byte = 0; byte < (int) dwRead; ++byte) {
- /* store the next byte into the remainder */
- remainder ^= (data[byte] << (WIDTH - 8));
- /* calculate for all 8 bits in the byte */
- for ( bit = 8; bit > 0; --bit) {
- /* check if MSB of remainder is a one */
- if (remainder & TOPBIT)
- remainder = (remainder << 1) ^ POLYNOMIAL;
- else
- remainder = (remainder << 1);
- }
- }
- } while(dwRead == 1024);
-
- CloseHandle(hFile);
-
- return remainder;
-}
-
-static int _GetFileSize(char* filename)
-{
- HANDLE hFile = CreateFileA(filename, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL);
- int size;
-
- if(hFile == INVALID_HANDLE_VALUE)
- return 0;
- size = GetFileSize(hFile, NULL);
- CloseHandle(hFile);
- return size;
-}
-
-/* RetrieveUserAvatar
- *
- * Purpose: Get a user avatar from skype itself
- * Params : param=(void *)(HANDLE)hContact
- */
-void RetrieveUserAvatar(void *param)
-{
- HANDLE hContact = (HANDLE) param, file;
- PROTO_AVATAR_INFORMATION AI={0};
- ACKDATA ack = {0};
- DBVARIANT dbv;
- char AvatarFile[MAX_PATH+1], AvatarTmpFile[MAX_PATH+10], *ptr, *pszTempFile;
-
- if (hContact == NULL)
- return;
-
- // Mount default ack
- ack.cbSize = sizeof( ACKDATA );
- ack.szModule = SKYPE_PROTONAME;
- ack.hContact = hContact;
- ack.type = ACKTYPE_AVATAR;
- ack.result = ACKRESULT_FAILED;
-
- AI.cbSize = sizeof( AI );
- AI.hContact = hContact;
-
- // Get skype name
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv) == 0)
- {
- if (dbv.pszVal)
- {
- // Get filename
- FoldersGetCustomPath(hProtocolAvatarsFolder, AvatarFile, sizeof(AvatarFile), DefaultAvatarsFolder);
- mir_snprintf(AvatarTmpFile, sizeof(AvatarTmpFile), "AVATAR 1 %s\\%s_tmp.jpg", AvatarFile, dbv.pszVal);
- pszTempFile = AvatarTmpFile+9;
- mir_snprintf(AvatarFile, sizeof(AvatarFile), "%s\\%s.jpg", AvatarFile, dbv.pszVal);
-
- // Just to be sure
- DeleteFileA(pszTempFile);
- file = CreateFileA(pszTempFile, 0, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- if (file != INVALID_HANDLE_VALUE)
- {
- CloseHandle(file);
- if (ptr=SkypeGet ("USER", dbv.pszVal, AvatarTmpFile))
- {
- if (strncmp(ptr, "ERROR", 5) &&
- GetFileAttributesA(pszTempFile) != INVALID_FILE_ATTRIBUTES)
- {
- ack.result = ACKRESULT_SUCCESS;
-
- // Is no avatar image?
- if (!DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "ShowDefaultSkypeAvatar", 0)
- && GetFileHash(pszTempFile) == 0x8d34e05d && _GetFileSize(pszTempFile) == 3751)
- {
- // Has no avatar
- AI.format = PA_FORMAT_UNKNOWN;
- ack.hProcess = (HANDLE)&AI;
- DeleteFileA(AvatarFile);
- }
- else
- {
- // Got it
- MoveFileExA(pszTempFile, AvatarFile, MOVEFILE_REPLACE_EXISTING);
- AI.format = PA_FORMAT_JPEG;
- strcpy(AI.filename, AvatarFile);
- ack.hProcess = (HANDLE)&AI;
- }
-
- }
- free (ptr);
- }
- DeleteFileA(pszTempFile);
- }
-
- }
- DBFreeVariant(&dbv);
- }
- CallService( MS_PROTO_BROADCASTACK, 0, ( LPARAM )&ack );
-}
-
-
-/* SkypeGetAvatarInfo
- *
- * Purpose: Set user avatar in profile
- * Params : wParam=0
- * lParam=(LPARAM)(const char*)filename
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam)
-{
-
- DBVARIANT dbv;
- PROTO_AVATAR_INFORMATION* AI = ( PROTO_AVATAR_INFORMATION* )lParam;
- if (AI->hContact == NULL) // User
- {
- if (!DBGetContactSettingString(NULL,SKYPE_PROTONAME, "AvatarFile", &dbv))
- {
- lstrcpynA(AI->filename, dbv.pszVal, sizeof(AI->filename));
- DBFreeVariant(&dbv);
- return GAIR_SUCCESS;
- }
- else
- return GAIR_NOAVATAR;
- }
- else // Contact
- {
- DBVARIANT dbv;
- char AvatarFile[MAX_PATH+1];
-
- if (protocol < 7 && !bIsImoproxy)
- return GAIR_NOAVATAR;
-
- if (wParam & GAIF_FORCE)
- {
- // Request anyway
- forkthread(RetrieveUserAvatar, 0, (void *) AI->hContact);
- return GAIR_WAITFOR;
- }
-
- if (DBGetContactSettingString(AI->hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
- // No skype name ??
- return GAIR_NOAVATAR;
-
- if (dbv.pszVal == NULL)
- {
- // No skype name ??
- DBFreeVariant(&dbv);
- return GAIR_NOAVATAR;
- }
-
- // Get filename
- FoldersGetCustomPath(hProtocolAvatarsFolder, AvatarFile, sizeof(AvatarFile), DefaultAvatarsFolder);
- mir_snprintf(AvatarFile, sizeof(AvatarFile), "%s\\%s.jpg", AvatarFile, dbv.pszVal);
- DBFreeVariant(&dbv);
-
- // Check if the file exists
- if (GetFileAttributesA(AvatarFile) == INVALID_FILE_ATTRIBUTES)
- return GAIR_NOAVATAR;
-
- // Return the avatar
- AI->format = PA_FORMAT_JPEG;
- strcpy(AI->filename, AvatarFile);
- return GAIR_SUCCESS;
- }
-}
-
-
-/* SkypeGetAvatarCaps
- *
- * Purpose: Query avatar caps for a protocol
- * Params : wParam=One of AF_*
- * lParam=Depends on wParam
- * Returns: Depends on wParam
- */
-INT_PTR SkypeGetAvatarCaps(WPARAM wParam, LPARAM lParam)
-{
- switch(wParam)
- {
- case AF_MAXSIZE:
- {
- POINT *p = (POINT *) lParam;
- if (p == NULL)
- return -1;
-
- p->x = 96;
- p->y = 96;
- return 0;
- }
- case AF_PROPORTION:
- {
- return PIP_NONE;
- }
- case AF_FORMATSUPPORTED:
- {
- if (lParam == PA_FORMAT_PNG || lParam == PA_FORMAT_JPEG)
- return TRUE;
- else
- return FALSE;
- }
- case AF_ENABLED:
- {
- return TRUE;
- }
- case AF_DONTNEEDDELAYS:
- {
- return FALSE;
- }
- }
- return -1;
-}
-
-
-INT_PTR SkypeGetStatus(WPARAM wParam, LPARAM lParam) {
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(lParam);
-
- return SkypeStatus;
-}
-
-INT_PTR SkypeGetInfo(WPARAM wParam,LPARAM lParam) {
- CCSDATA *ccs = (CCSDATA *) lParam;
-
- UNREFERENCED_PARAMETER(wParam);
-
- forkthread(GetInfoThread, 0, ccs->hContact);
- return 0;
-}
-
-INT_PTR SkypeAddToList(WPARAM wParam, LPARAM lParam) {
- PROTOSEARCHRESULT *psr=(PROTOSEARCHRESULT*)lParam;
- char *name = NULL;
- HANDLE ret = INVALID_HANDLE_VALUE;
-
- LOG(("SkypeAddToList Adding API function called"));
- if (psr->cbSize!=sizeof(PROTOSEARCHRESULT) || !psr->nick) return 0;
- LOG(("SkypeAddToList OK"));
- name = mir_utf8encodeT(psr->nick);
- ret = add_contact(name, wParam);
- mir_free(name);
- return (INT_PTR)ret;
-}
-
-INT_PTR SkypeBasicSearch(WPARAM wParam, LPARAM lParam) {
- UNREFERENCED_PARAMETER(wParam);
-
- LOG(("SkypeBasicSearch %s", (char *)lParam));
- if (!SkypeInitialized) return 0;
- return (hSearchThread=forkthread(( pThreadFunc )BasicSearchThread, 0, _strdup((char *)lParam)));
-}
-
-void MessageSendWatchThread(msgsendwt_arg *arg) {
- char *str, *err;
-
- // sendwatchers need to be incremented before starting this thread
- LOG(("MessageSendWatchThread started."));
- str=SkypeRcvMsg(arg->szId, SkypeTime(NULL)-1, arg->hContact, DBGetContactSettingDword(NULL,"SRMsg","MessageTimeout",TIMEOUT_MSGSEND)+1000);
- InterlockedDecrement (&sendwatchers);
- if (str)
- {
- if (!DBGetContactSettingByte(arg->hContact, SKYPE_PROTONAME, "ChatRoom", 0)) {
- if (err=GetSkypeErrorMsg(str)) {
- ProtoBroadcastAck(SKYPE_PROTONAME, arg->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 1, (LPARAM)Translate(err));
- free(err);
- free(str);
- free(arg);
- LOG(("MessageSendWatchThread terminated."));
- return;
- }
- ProtoBroadcastAck(SKYPE_PROTONAME, arg->hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
- }
- free(str);
- LOG(("MessageSendWatchThread terminated gracefully."));
- }
- free (arg);
-}
-
-INT_PTR SkypeSendMessage(WPARAM wParam, LPARAM lParam) {
- CCSDATA *ccs = (CCSDATA *) lParam;
- DBVARIANT dbv;
- BOOL sendok=TRUE;
- char *msg = (char *) ccs->lParam, *utfmsg=NULL, *mymsgcmd=cmdMessage, szId[16]={0};
- static DWORD dwMsgNum = 0;
- BYTE bIsChatroom = 0 != DBGetContactSettingByte(ccs->hContact, SKYPE_PROTONAME, "ChatRoom", 0);
-
- UNREFERENCED_PARAMETER(wParam);
-
- if (bIsChatroom)
- {
- if (DBGetContactSettingString(ccs->hContact, SKYPE_PROTONAME, "ChatRoomID", &dbv))
- return 0;
- mymsgcmd="CHATMESSAGE";
- }
- else
- {
- if (DBGetContactSettingString(ccs->hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
- return 0;
- mymsgcmd="MESSAGE";
- }
-
- if (ccs->wParam & PREF_UTF) {
- utfmsg = msg;
- } else if (ccs->wParam & PREF_UNICODE) {
- utfmsg = (char*)make_utf8_string((WCHAR*)(msg+strlen(msg)+1));
- } else {
- if (utf8_encode(msg, &utfmsg)==-1) utfmsg=NULL;
- }
- if (protocol>=4) {
- InterlockedIncrement ((LONG*)&dwMsgNum);
- sprintf (szId, "#M%d ", dwMsgNum++);
- }
- InterlockedIncrement (&sendwatchers);
- if (!utfmsg || SkypeSend("%s%s %s %s", szId, mymsgcmd, dbv.pszVal, utfmsg)) sendok=FALSE;
- if (utfmsg && utfmsg!=msg) free(utfmsg);
- DBFreeVariant(&dbv);
-
- if (sendok) {
- msgsendwt_arg *psendarg = calloc(1, sizeof(msgsendwt_arg));
-
- if (psendarg) {
- psendarg->hContact = ccs->hContact;
- strcpy (psendarg->szId, szId);
- forkthread(MessageSendWatchThread, 0, psendarg);
- } else InterlockedDecrement (&sendwatchers);
- return 1;
- } else InterlockedDecrement (&sendwatchers);
- if (!bIsChatroom)
- ProtoBroadcastAck(SKYPE_PROTONAME, ccs->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, (HANDLE) 1, (LPARAM)Translate("Connection to Skype lost"));
- return 0;
-}
-
-INT_PTR SkypeRecvMessage(WPARAM wParam, LPARAM lParam)
-{
- DBEVENTINFO dbei={0};
- CCSDATA *ccs = (CCSDATA *) lParam;
- PROTORECVEVENT *pre = (PROTORECVEVENT *) ccs->lParam;
-
- UNREFERENCED_PARAMETER(wParam);
-
- DBDeleteContactSetting(ccs->hContact, "CList", "Hidden");
- dbei.cbSize = sizeof(dbei);
- dbei.szModule = SKYPE_PROTONAME;
- dbei.timestamp = pre->timestamp;
- if (pre->flags & PREF_CREATEREAD) dbei.flags|=DBEF_READ;
- if (pre->flags & PREF_UTF) dbei.flags|=DBEF_UTF;
- dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = strlen(pre->szMessage) + 1;
- if (pre->flags & PREF_UNICODE)
- dbei.cbBlob += sizeof( wchar_t )*( (DWORD)wcslen(( wchar_t* )&pre->szMessage[dbei.cbBlob] )+1 );
- dbei.pBlob = (PBYTE) pre->szMessage;
- MsgList_Add (pre->lParam, (HANDLE)CallService(MS_DB_EVENT_ADD, (WPARAM)ccs->hContact, (LPARAM)&dbei));
- return 0;
-}
-
-INT_PTR SkypeUserIsTyping(WPARAM wParam, LPARAM lParam) {
- DBVARIANT dbv={0};
- HANDLE hContact = (HANDLE)wParam;
-
- if (protocol<5 && !bIsImoproxy) return 0;
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, "Typing_Stream", &dbv)) {
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv) == 0) {
- char szCmd[256];
- _snprintf (szCmd, sizeof(szCmd),
- "ALTER APPLICATION libpurple_typing CONNECT %s", dbv.pszVal);
- SkypeSend (szCmd);
- DBFreeVariant (&dbv);
- testfor (szCmd, 2000);
- // TODO: We should somehow cache the typing notify result and send it
- // after we got a connection, but in the meantime this notification won't
- // get sent on first run
- }
- return 0;
- }
-
- SkypeSend ("ALTER APPLICATION libpurple_typing DATAGRAM %s %s", dbv.pszVal,
- (lParam==PROTOTYPE_SELFTYPING_ON?"PURPLE_TYPING":"PURPLE_NOT_TYPING"));
- DBFreeVariant(&dbv);
- return 0;
-}
-
-
-INT_PTR SkypeSendAuthRequest(WPARAM wParam, LPARAM lParam) {
- CCSDATA* ccs = (CCSDATA*)lParam;
- DBVARIANT dbv;
- int retval;
-
- UNREFERENCED_PARAMETER(wParam);
-
- if (!ccs->lParam || DBGetContactSettingString(ccs->hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
- return 1;
- retval = SkypeSend("SET USER %s BUDDYSTATUS 2 %s", dbv.pszVal, (char *)ccs->lParam);
- DBFreeVariant(&dbv);
- if (retval) return 1; else return 0;
-}
-
-INT_PTR SkypeRecvAuth(WPARAM wParam, LPARAM lParam) {
- DBEVENTINFO dbei = {0};
- CCSDATA* ccs = (CCSDATA*)lParam;
- PROTORECVEVENT* pre = (PROTORECVEVENT*)ccs->lParam;
-
- UNREFERENCED_PARAMETER(wParam);
-
- DBDeleteContactSetting(ccs->hContact, "CList", "Hidden");
-
- dbei.cbSize = sizeof(dbei);
- dbei.szModule = SKYPE_PROTONAME;
- dbei.timestamp = pre->timestamp;
- dbei.flags = ((pre->flags & PREF_CREATEREAD)?DBEF_READ:0);
- dbei.eventType = EVENTTYPE_AUTHREQUEST;
- dbei.cbBlob = pre->lParam;
- dbei.pBlob = (PBYTE)pre->szMessage;
-
- CallService(MS_DB_EVENT_ADD, (WPARAM)NULL, (LPARAM)&dbei);
- return 0;
-}
-
-char *__skypeauth(WPARAM wParam) {
- DBEVENTINFO dbei={0};
-
- if (!SkypeInitialized) return NULL;
-
- dbei.cbSize = sizeof(dbei);
- if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, wParam, 0))==-1 ||
- !(dbei.pBlob = (unsigned char*)malloc(dbei.cbBlob)))
- { return NULL; }
-
- if (CallService(MS_DB_EVENT_GET, wParam, (LPARAM)&dbei) ||
- dbei.eventType != EVENTTYPE_AUTHREQUEST ||
- strcmp(dbei.szModule, SKYPE_PROTONAME))
- {
- free(dbei.pBlob);
- return NULL;
- }
- return (char *)dbei.pBlob;
-}
-
-INT_PTR SkypeAuthAllow(WPARAM wParam, LPARAM lParam) {
- char *pBlob;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (pBlob=__skypeauth(wParam))
- {
- int retval=SkypeSend("SET USER %s ISAUTHORIZED TRUE", pBlob+sizeof(DWORD)*2);
- free(pBlob);
- if (!retval) return 0;
- }
- return 1;
-}
-
-INT_PTR SkypeAuthDeny(WPARAM wParam, LPARAM lParam) {
- char *pBlob;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (pBlob=__skypeauth(wParam))
- {
- int retval=SkypeSend("SET USER %s ISAUTHORIZED FALSE", pBlob+sizeof(DWORD)*2);
- free(pBlob);
- if (!retval) return 0;
- }
- return 1;
-}
-
-
-INT_PTR SkypeAddToListByEvent(WPARAM wParam, LPARAM lParam) {
- char *pBlob;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (pBlob=__skypeauth(wParam))
- {
- HANDLE hContact = add_contact(pBlob+sizeof(DWORD)*2, LOWORD(wParam));
- free(pBlob);
- if (hContact) return (int)hContact;
- }
- return 0;
-}
-
-INT_PTR SkypeRegisterProxy(WPARAM wParam, LPARAM lParam) {
- UNREFERENCED_PARAMETER(wParam);
-
- if (!lParam) {
- free (pszProxyCallout);
- pszProxyCallout = NULL;
- }
- pszProxyCallout = _strdup((char*)lParam);
- bIsImoproxy = TRUE;
- return 0;
-}
-
-
-void CleanupNicknames(char *dummy) {
- HANDLE hContact;
- char *szProto;
- DBVARIANT dbv, dbv2;
-
- UNREFERENCED_PARAMETER(dummy);
-
- LOG(("CleanupNicknames Cleaning up..."));
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
- if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) &&
- DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0)==0)
- {
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) continue;
- if (DBGetContactSettingString(hContact, SKYPE_PROTONAME, "Nick", &dbv2)) {
- DBFreeVariant(&dbv);
- continue;
- }
- DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "Nick");
- GetInfoThread(hContact);
- DBFreeVariant(&dbv);
- DBFreeVariant(&dbv2);
- }
- }
- OUTPUT(_T("Cleanup finished."));
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// EnterBitmapFileName - enters a bitmap filename
-
-int __stdcall EnterBitmapFileName( char* szDest )
-{
- char szFilter[ 512 ];
- OPENFILENAMEA ofn = {0};
- *szDest = 0;
-
- CallService( MS_UTILS_GETBITMAPFILTERSTRINGS, sizeof szFilter, ( LPARAM )szFilter );
- ofn.lStructSize = sizeof( OPENFILENAME );
- ofn.lpstrFilter = szFilter;
- ofn.lpstrFile = szDest;
- ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
- ofn.nMaxFile = MAX_PATH;
- ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = "bmp";
- if ( !GetOpenFileNameA( &ofn ))
- return 1;
-
- return ERROR_SUCCESS;
-}
-
-int MirandaExit(WPARAM wParam, LPARAM lParam) {
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(lParam);
-
- MirandaShuttingDown=TRUE;
- return 0;
-}
-
-int OkToExit(WPARAM wParam, LPARAM lParam) {
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(lParam);
-
-// logoff_contacts();
- MirandaShuttingDown=TRUE;
-
- // Trigger all semaphores and events just to be sure that there is no deadlock
- ReleaseSemaphore(SkypeMsgReceived, receivers, NULL);
- SetEvent (SkypeReady);
- SetEvent (MessagePumpReady);
-#ifdef SKYPEBUG_OFFLN
- SetEvent(GotUserstatus);
-#endif
- SetEvent (hBuddyAdded);
-
- SkypeFlush ();
- PostMessage (g_hWnd, WM_CLOSE, 0, 0);
- return 0;
-}
-
-
-struct PLUGINDI {
- char **szSettings;
- int dwCount;
-};
-
-// Taken from pluginopts.c and modified
-int EnumOldPluginName(const char *szSetting,LPARAM lParam)
-{
- struct PLUGINDI *pdi=(struct PLUGINDI*)lParam;
- if (pdi && lParam) {
- pdi->szSettings=(char**)realloc(pdi->szSettings,(pdi->dwCount+1)*sizeof(char*));
- pdi->szSettings[pdi->dwCount++]=_strdup(szSetting);
- }
- return 0;
-}
-
-// Are there any Skype users on list?
-// 1 --> Yes
-// 0 --> No
-int AnySkypeusers(void)
-{
- HANDLE hContact;
- DBVARIANT dbv;
- int tCompareResult;
-
- // already on list?
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- hContact != NULL;
- hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
- {
- // GETCONTACTBASEPROTO doesn't work on not loaded protocol, therefore get
- // protocol from DB
- if (DBGetContactSettingString(hContact, "Protocol", "p", &dbv)) continue;
- tCompareResult = !strcmp(dbv.pszVal, SKYPE_PROTONAME);
- DBFreeVariant(&dbv);
- if (tCompareResult) return 1;
- }
- return 0;
-}
-
-
-void UpgradeName(char *OldName)
-{
- DBCONTACTENUMSETTINGS cns;
- DBCONTACTWRITESETTING cws;
- DBVARIANT dbv;
- HANDLE hContact=NULL;
- struct PLUGINDI pdi;
-
- LOG(("Updating old database settings if there are any..."));
- cns.pfnEnumProc=EnumOldPluginName;
- cns.lParam=(LPARAM)&pdi;
- cns.szModule=OldName;
- cns.ofsSettings=0;
-
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
-
- for ( ;; ) {
- memset(&pdi,0,sizeof(pdi));
- CallService(MS_DB_CONTACT_ENUMSETTINGS,(WPARAM)hContact,(LPARAM)&cns);
- // Upgrade Protocol settings to new string
- if (pdi.szSettings) {
- int i;
-
- LOG(("We're currently upgrading..."));
- for (i=0;i<pdi.dwCount;i++) {
- if (!DBGetContactSettingString(hContact, OldName, pdi.szSettings[i], &dbv)) {
- cws.szModule=SKYPE_PROTONAME;
- cws.szSetting=pdi.szSettings[i];
- cws.value=dbv;
- if (!CallService(MS_DB_CONTACT_WRITESETTING,(WPARAM)hContact,(LPARAM)&cws))
- DBDeleteContactSetting(hContact,OldName,pdi.szSettings[i]);
- DBFreeVariant(&dbv);
- }
- free(pdi.szSettings[i]);
- }
- free(pdi.szSettings);
- }
- // Upgrade Protocol assignment, if we are not main contact
- if (hContact && !DBGetContactSettingString(hContact, "Protocol", "p", &dbv)) {
- if (!strcmp(dbv.pszVal, OldName))
- DBWriteContactSettingString(hContact, "Protocol", "p", SKYPE_PROTONAME);
- DBFreeVariant(&dbv);
- }
- if (!hContact) break;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
- }
-
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "UpgradeDone", (BYTE)1);
- return;
-}
-
-void __cdecl MsgPump (char *dummy)
-{
- MSG msg;
-
- WNDCLASS WndClass;
-
- UNREFERENCED_PARAMETER(dummy);
-
- // Create window class
- WndClass.style = CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS;
- WndClass.lpfnWndProc = (WNDPROC)WndProc;
- WndClass.cbClsExtra = 0;
- WndClass.cbWndExtra = 0;
- WndClass.hInstance = hInst;
- WndClass.hIcon = NULL;
- WndClass.hCursor = NULL;
- WndClass.hbrBackground = NULL;
- WndClass.lpszMenuName = NULL;
- WndClass.lpszClassName = _T("SkypeApiDispatchWindow");
- RegisterClass(&WndClass);
- // Do not check the retval of RegisterClass, because on non-unicode
- // win98 it will fail, as it is a stub that returns false() there
-
- // Create main window
- g_hWnd=CreateWindowEx( WS_EX_APPWINDOW|WS_EX_WINDOWEDGE,
- _T("SkypeApiDispatchWindow"), _T(""), WS_BORDER|WS_SYSMENU|WS_MINIMIZEBOX,
- CW_USEDEFAULT, CW_USEDEFAULT, 128, 128, NULL, 0, (HINSTANCE)WndClass.hInstance, 0);
-
- LOG (("Created Dispatch window with handle %08X", (long)g_hWnd));
- if (!g_hWnd) {
- OUTPUT(_T("Cannot create window."));
- TellError(GetLastError());
- SetEvent(MessagePumpReady);
- return;
- }
- ShowWindow(g_hWnd, 0);
- UpdateWindow(g_hWnd);
- msgPumpThreadId = GetCurrentThreadId();
- SetEvent(MessagePumpReady);
-
- LOG (("Messagepump started."));
- while (GetMessage (&msg, NULL, 0, 0) > 0 && !Miranda_Terminated()) {
- TranslateMessage (&msg);
- DispatchMessage (&msg);
- }
- UnregisterClass (WndClass.lpszClassName, hInst);
- LOG (("Messagepump stopped."));
-}
-
-// DLL Stuff //
-
-__declspec(dllexport) PLUGININFOEX* MirandaPluginInfo(DWORD mirVersion)
-{
- mirandaVersion = mirVersion;
-
- pluginInfo.cbSize = sizeof(PLUGININFOEX);
- return (PLUGININFOEX*) &pluginInfo;
-}
-
-__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirVersion)
-{
- mirandaVersion = mirVersion;
-
- return &pluginInfo;
-}
-
-static const MUUID interfaces[] = {MUUID_SKYPE_CALL, MIID_LAST};
-__declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
-{
- return interfaces;
-}
-
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
-{
- UNREFERENCED_PARAMETER(fdwReason);
- UNREFERENCED_PARAMETER(lpvReserved);
-
- hInst = hinstDLL;
- return TRUE;
-}
-
-
-int PreShutdown(WPARAM wParam, LPARAM lParam) {
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(lParam);
-
- PostThreadMessage(msgPumpThreadId, WM_QUIT, 0, 0);
- return 0;
-}
-
-int __declspec(dllexport) Load()
-{
- PROTOCOLDESCRIPTOR pd = {0};
- DWORD Buffsize;
- HKEY MyKey;
- BOOL SkypeInstalled;
- BOOL UseCustomCommand;
- WSADATA wsaData = {0};
- char path[MAX_PATH];
-
- mir_getLP(&pluginInfo);
-
- GetModuleFileNameA( hInst, path, sizeof( path ));
- _splitpath (path, NULL, NULL, SKYPE_PROTONAME, NULL);
- CharUpperA( SKYPE_PROTONAME );
-
- InitializeCriticalSection(&RingAndEndcallMutex);
- InitializeCriticalSection(&QueryThreadMutex);
- InitializeCriticalSection(&TimeMutex);
-
-
-#ifdef _DEBUG
- init_debug();
-#endif
-
- LOG(("Load: Skype Plugin loading..."));
-
- // We need to upgrade SKYPE_PROTOCOL internal name to Skype if not already done
- if (!DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UpgradeDone", 0))
- UpgradeName("SKYPE_PROTOCOL");
-
- // Initialisation of Skype MsgQueue must be done because of Cleanup in end and
- // Mutex is also initialized here.
- LOG(("SkypeMsgInit initializing Skype MSG-queue"));
- if (SkypeMsgInit()==-1) {
- OUTPUT(_T("Memory allocation error on startup."));
- return 0;
- }
-
- // On first run on new profile, ask user, if he wants to enable the plugin in
- // this profile
- // --> Fixing Issue #0000006 from bugtracker.
- if (!DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "FirstRun", 0)) {
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "FirstRun", 1);
- if (AnySkypeusers()==0) // First run, it seems :)
- if (MessageBox(NULL, TranslateT("This seems to be the first time that you're running the Skype protocol plugin. Do you want to enable the protocol for this Miranda-Profile? (If you chose NO, you can always enable it in the plugin options later."), _T("Welcome!"), MB_ICONQUESTION|MB_YESNO)==IDNO) {
- char path[MAX_PATH], *filename;
- GetModuleFileNameA(hInst, path, sizeof(path));
- if (filename = strrchr(path,'\\')+1)
- DBWriteContactSettingByte(NULL,"PluginDisable",filename,1);
- return 0;
- }
- }
-
-
- // Check if Skype is installed
- SkypeInstalled=TRUE;
- UseCustomCommand = (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseCustomCommand", 0);
- UseSockets = (BOOL)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseSkype2Socket", 0);
-
- if (!UseSockets && !UseCustomCommand)
- {
- BOOL is_key_opened = FALSE;
- if (RegOpenKeyEx(HKEY_CURRENT_USER, _T("Software\\Skype\\Phone"), 0, KEY_READ, &MyKey)!=ERROR_SUCCESS)
- {
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Skype\\Phone"), 0, KEY_READ, &MyKey)!=ERROR_SUCCESS)
- {
- SkypeInstalled=FALSE;
- }
- else
- is_key_opened = TRUE;
- }
- else
- is_key_opened = TRUE;
-
- Buffsize=sizeof(skype_path);
-
- if(is_key_opened)
- {
- if (SkypeInstalled==FALSE)
- skype_path[0]=0;
- else if (RegQueryValueExA(MyKey, "SkypePath", NULL, NULL, (unsigned char *)skype_path, &Buffsize)!=ERROR_SUCCESS)
- {
- //OUTPUT("Skype was not found installed :( \nMaybe you are using portable skype.");
- RegCloseKey(MyKey);
- skype_path[0]=0;
- //return 0;
- }
- else
- RegCloseKey(MyKey);
- }
- }
- WSAStartup(MAKEWORD(2,2), &wsaData);
-
- // Start Skype connection
- if (!(ControlAPIAttach=RegisterWindowMessage(_T("SkypeControlAPIAttach"))) || !(ControlAPIDiscover=RegisterWindowMessage(_T("SkypeControlAPIDiscover"))))
- {
- OUTPUT(_T("Cannot register Window message."));
- return 0;
- }
-
- SkypeMsgReceived=CreateSemaphore(NULL, 0, MAX_MSGS, NULL);
- if (!(SkypeReady=CreateEvent(NULL, TRUE, FALSE, NULL)) ||
- !(MessagePumpReady=CreateEvent(NULL, FALSE, FALSE, NULL)) ||
-#ifdef SKYPEBUG_OFFLN
- !(GotUserstatus=CreateEvent(NULL, TRUE, FALSE, NULL)) ||
-#endif
- !(hBuddyAdded=CreateEvent(NULL, FALSE, FALSE, NULL)) ||
- !(FetchMessageEvent=CreateEvent(NULL, FALSE, TRUE, NULL))) {
- OUTPUT(_T("Unable to create Mutex!"));
- return 0;
- }
-
- /* Register the module */
- ZeroMemory(&pd, sizeof(pd));
- pd.cbSize = PROTOCOLDESCRIPTOR_V3_SIZE;
- pd.szName = SKYPE_PROTONAME;
- pd.type = PROTOTYPE_PROTOCOL;
- CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
-
- VoiceServiceInit();
-
- CreateServices();
- HookEvents();
- InitVSApi();
- MsgList_Init();
-
- HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown);
-
- // Startup Message-pump
- forkthread (( pThreadFunc )MsgPump, 0, NULL);
- WaitForSingleObject(MessagePumpReady, INFINITE);
- return 0;
-}
-
-
-
-int __declspec( dllexport ) Unload(void)
-{
- BOOL UseCustomCommand = DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseCustomCommand", 0);
- BOOL Shutdown = DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "Shutdown", 0);
-
- LOG (("Unload started"));
-
- if ( Shutdown && ((skype_path && skype_path[0]) ||UseCustomCommand) ) {
-
- if(UseCustomCommand)
- {
- DBVARIANT dbv;
- if(!DBGetContactSettingString(NULL,SKYPE_PROTONAME,"CommandLine",&dbv))
- {
- char szAbsolutePath[MAX_PATH];
-
- TranslateMirandaRelativePathToAbsolute(dbv.pszVal, szAbsolutePath, FALSE);
- _spawnl(_P_NOWAIT, szAbsolutePath, szAbsolutePath, "/SHUTDOWN", NULL);
- LOG (("Unload Sent /shutdown to %s", szAbsolutePath));
- DBFreeVariant(&dbv);
- }
- }
- else
- {
- _spawnl(_P_NOWAIT, skype_path, skype_path, "/SHUTDOWN", NULL);
- LOG (("Unload Sent /shutdown to %s", skype_path));
- }
-
- }
- SkypeMsgCleanup();
- //WSACleanup();
- FreeVSApi();
- UnhookEvents();
- UnhookEvent(hChatEvent);
- UnhookEvent (hChatMenu);
- UnhookEvent (hEvInitChat);
- DestroyHookableEvent(hInitChat);
- VoiceServiceExit();
- GCExit();
- MsgList_Exit();
-
- CloseHandle(SkypeReady);
- CloseHandle(SkypeMsgReceived);
-#ifdef SKYPEBUG_OFFLN
- CloseHandle(GotUserstatus);
-#endif
- CloseHandle(MessagePumpReady);
- CloseHandle(hBuddyAdded);
- CloseHandle(FetchMessageEvent);
-
- DeleteCriticalSection(&RingAndEndcallMutex);
- DeleteCriticalSection(&QueryThreadMutex);
-
- SkypeRegisterProxy (0, 0);
- LOG (("Unload: Shutdown complete"));
-#ifdef _DEBUG
- end_debug();
-#endif
- DeleteCriticalSection(&TimeMutex);
- return 0;
-}
diff --git a/plugins/!NotAdopted/Skype/skype.h b/plugins/!NotAdopted/Skype/skype.h deleted file mode 100755 index c34e26909a..0000000000 --- a/plugins/!NotAdopted/Skype/skype.h +++ /dev/null @@ -1,187 +0,0 @@ -#pragma once
-
-#define _CRT_SECURE_NO_DEPRECATE 1
-#define TEXT_LEN 1024
-#define CP_ACP 0
-
-#define code_page CP_ACP;
-#define MIRANDA_CUSTOM_LP
-
-
-// System includes
-#include <stdio.h>
-#include <windows.h>
-#include <commctrl.h>
-#include <process.h>
-#include <time.h>
-#include "resource.h"
-#include <stdlib.h>
-#include <stddef.h>
-#include <shlobj.h>
-#include <time.h>
-#include "util.h"
-
-#pragma warning (push)
-#pragma warning (disable: 4100) // unreferenced formal parameter
-
-// Miranda Includes
-#include <newpluginapi.h>
-#include <m_utils.h>
-#include <m_protosvc.h>
-#include <m_protomod.h>
-#include <m_skin.h>
-#include <m_message.h>
-#include <m_database.h>
-#include <m_clist.h>
-#include <m_system.h>
-#include <m_folders.h>
-#include <m_options.h>
-#include <m_langpack.h>
-#include <m_userinfo.h>
-#include <m_avatars.h>
-#include <m_contacts.h>
-#include <m_popup.h>
-
-#pragma warning (pop)
-
-// MyDetails defines
-
-// wParam=NULL
-// lParam=(char *) new nickname - do not free
-// return=0 for sucess
-#define PS_SETMYNICKNAME "/SetNickname"
-
-// Optional, default value is 1024
-// wParam=NULL
-// lParam=NULL
-// return= <=0 for error, >0 the max length of the nick
-#define PS_GETMYNICKNAMEMAXLENGTH "/GetMyNicknameMaxLength"
-
-// wParam=(char *)Buffer to file name
-// lParam=(int)Buffer size
-// return=0 for sucess
-#define PS_GETMYAVATAR "/GetMyAvatar"
-
-// wParam=0
-// lParam=(const char *)Avatar file name
-// return=0 for sucess
-#define PS_SETMYAVATAR "/SetMyAvatar"
-
-
-// Program defines
-#define SKYPE_NAME "Username"
-#define SKYPE_PROTO "PROTOCOL 7"
-#define SKYPE_PROTONAME g_szProtoName // Name of our protocol, taken from .DLL name
-#define MAX_MSGS 128 // Maximum messages in queue
-#define MAX_USERLEN 32 // Maximum length of a username in Skype
-#define PING_INTERVAL 10000 // Ping every 10000 msec to see if Skype is still available
-#define USEPOPUP 1 // Use the popup-plugin?
-#define TIMEOUT_MSGSEND 9000 // Stolen from msgdialog.c
-#define MAX_MSG_AGE 30 // Maximum age in seconds before a Message from queue gets trashed
-#define SKYPEBUG_OFFLN 1 // Activate fix for the SkypeAPI Offline-Bug
-
-// Program hooks
-typedef struct {
- char ChatNew[MAXMODULELABELLENGTH];
- char SetAvatar[MAXMODULELABELLENGTH];
- char SendFile[MAXMODULELABELLENGTH];
- char HoldCall[MAXMODULELABELLENGTH];
- char AnswerCall[MAXMODULELABELLENGTH];
- char ImportHistory[MAXMODULELABELLENGTH];
- char AddUser[MAXMODULELABELLENGTH];
- char SkypeOutCallUser[MAXMODULELABELLENGTH];
- char CallHangupUser[MAXMODULELABELLENGTH];
- char CallUser[MAXMODULELABELLENGTH];
-} SKYPE_SVCNAMES;
-#define SKYPE_CALL g_svcNames.CallUser
-#define SKYPE_CALLHANGUP g_svcNames.CallHangupUser
-#define SKYPEOUT_CALL g_svcNames.SkypeOutCallUser
-#define SKYPE_ADDUSER g_svcNames.AddUser
-#define SKYPE_IMPORTHISTORY g_svcNames.ImportHistory
-#define SKYPE_ANSWERCALL g_svcNames.AnswerCall
-#define SKYPE_HOLDCALL g_svcNames.HoldCall
-#define SKYPE_SENDFILE g_svcNames.SendFile
-#define SKYPE_SETAVATAR g_svcNames.SetAvatar
-#define SKYPE_CHATNEW g_svcNames.ChatNew
-#define EVENTTYPE_CALL 2000
-
-#ifndef __SKYPESVC_C__
-extern SKYPE_SVCNAMES g_svcNames;
-#endif
-
-// Skype API Communication services
-#define PSS_SKYPEAPIMSG "/SendSkypeAPIMsg"
-#define SKYPE_REGPROXY "/RegisterProxySvc"
-
-#define MUUID_SKYPE_CALL { 0x245241eb, 0x178c, 0x4b3f, { 0x91, 0xa, 0x4c, 0x4d, 0xf0, 0xa0, 0xc3, 0xb6 } }
-
-
-// Common used code-pieces
-#define OUTPUT(a) ShowMessage(IDI_ERRORS, a, 1);
-#define OUTPUTA(a) ShowMessageA(IDI_ERRORS, a, 1);
-
-typedef void ( __cdecl* pThreadFunc )( void* );
-
-// Prototypes
-
-void __cdecl SkypeSystemInit(char *);
-void __cdecl MsgPump (char *dummy);
-void PingPong(void);
-void CheckIfApiIsResponding(char *);
-void TellError(DWORD err);
-int ShowMessage(int, TCHAR*, int);
-#ifdef _UNICODE
-int ShowMessageA(int iconID, char *lpzText, int mustShow);
-#else
-#define ShowMessageA ShowMessage
-#endif
-void EndCallThread(char *);
-void GetInfoThread(HANDLE);
-int OnDetailsInit( WPARAM, LPARAM );
-INT_PTR SkypeGetAvatarInfo(WPARAM wParam,LPARAM lParam);
-INT_PTR SkypeGetAvatarCaps(WPARAM wParam,LPARAM lParam);
-INT_PTR SkypeGetAwayMessage(WPARAM wParam,LPARAM lParam);
-int HookContactAdded(WPARAM wParam, LPARAM lParam);
-int HookContactDeleted(WPARAM wParam, LPARAM lParam);
-INT_PTR ImportHistory(WPARAM wParam, LPARAM lParam);
-int CreateTopToolbarButton(WPARAM wParam, LPARAM lParam);
-int OnModulesLoaded(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeSetStatus(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeGetStatus(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeGetInfo(WPARAM wParam,LPARAM lParam);
-INT_PTR SkypeAddToList(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeBasicSearch(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeSendMessage(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeRecvMessage(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeUserIsTyping(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeSendAuthRequest(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeRecvAuth(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeAuthAllow(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeAuthDeny(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeAddToListByEvent(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeRegisterProxy(WPARAM wParam, LPARAM lParam);
-time_t SkypeTime(time_t *timer);
-void MessageSendWatchThread(HANDLE hContact);
-int OkToExit(WPARAM wParam, LPARAM lParam);
-int MirandaExit(WPARAM wParam, LPARAM lParam);
-int __stdcall EnterBitmapFileName( char* szDest );
-void CleanupNicknames(char *dummy);
-int InitVSApi();
-int FreeVSApi();
-HANDLE GetMetaHandle(DWORD dwId);
-void LaunchSkypeAndSetStatusThread(void *newStatus);
-
-// Write contact setting as UTF-8 for convenience, if possible. Older Miranda IM versions will store it as ANSI
-INT_PTR SkypeDBWriteContactSettingUTF8String(HANDLE hContact,const char *szModule,const char *szSetting,const char *val);
-
-// Structs
-
-typedef struct {
- char *SkypeSetting;
- char *MirandaSetting;
-} settings_map;
-
-// Optional includes
-#ifdef USEPOPUP
- #include "../../include/m_popup.h"
-#endif
diff --git a/plugins/!NotAdopted/Skype/skypeapi.c b/plugins/!NotAdopted/Skype/skypeapi.c deleted file mode 100755 index 1b2b81e10d..0000000000 --- a/plugins/!NotAdopted/Skype/skypeapi.c +++ /dev/null @@ -1,1705 +0,0 @@ -/*
- * SkypeAPI - All more or less important functions that deal with Skype
- */
-
-#include "skype.h"
-#include "skypeapi.h"
-#include "utf8.h"
-#include "debug.h"
-#include "contacts.h"
-#include "skypeproxy.h"
-#include "pthread.h"
-#include "gchat.h"
-#include "alogon.h"
-#include "msgq.h"
-#pragma warning (push)
-#pragma warning (disable: 4100) // unreferenced formal parameter
-#include "../../include/m_utils.h"
-#include "../../include/m_langpack.h"
-#pragma warning (push)
-#include "m_toptoolbar.h"
-
-#pragma warning (disable: 4706) // assignment within conditional expression
-
-// Imported Globals
-extern HWND hSkypeWnd, g_hWnd;
-extern BOOL SkypeInitialized, UseSockets, MirandaShuttingDown, bIsImoproxy;
-extern int SkypeStatus, receivers;
-extern HANDLE SkypeReady, SkypeMsgReceived, httbButton;
-extern UINT ControlAPIAttach, ControlAPIDiscover;
-extern LONG AttachStatus;
-extern HINSTANCE hInst;
-extern PLUGININFOEX pluginInfo;
-extern HANDLE hProtocolAvatarsFolder, hHookSkypeApiRcv;
-extern char DefaultAvatarsFolder[MAX_PATH+1], *pszProxyCallout, protocol, g_szProtoName[];
-
-// -> Skype Message Queue functions //
-
-static TYP_MSGQ SkypeMsgs, SkypeSendQueue;
-
-status_map status_codes[] = {
- {ID_STATUS_AWAY, "AWAY"},
- {ID_STATUS_NA, "NA"},
- {ID_STATUS_DND, "DND"},
- {ID_STATUS_ONLINE, "ONLINE"},
- {ID_STATUS_FREECHAT, "SKYPEME"}, // Unfortunately Skype API tells us userstatus ONLINE, if we are free for chat
- {ID_STATUS_OFFLINE, "OFFLINE"},
- {ID_STATUS_INVISIBLE, "INVISIBLE"},
- {ID_STATUS_CONNECTING, "CONNECTING"},
- {0, NULL}
-};
-
-//status_map
-
-
-static CRITICAL_SECTION ConnectMutex;
-static BOOL rcvThreadRunning=FALSE, isConnecting = FALSE;
-static SOCKET ClientSocket=INVALID_SOCKET;
-static HANDLE SkypeMsgToSend=NULL;
-
-static char *m_szSendBuf = NULL;
-static DWORD m_iBufSize = 0;
-
-
-static int _ConnectToSkypeAPI(char *path, BOOL bStart);
-
-
-/* SkypeReceivedMessage
- *
- * Purpose: Hook to be called when a message is received, if some caller is
- * using our internal I/O services.
- * Params : wParam - Not used
- * lParam - COPYDATASTRUCT like in WM_COPYDATA
- * Returns: Result from SendMessage
- */
-INT_PTR SkypeReceivedAPIMessage(WPARAM wParam, LPARAM lParam) {
- return SendMessage(g_hWnd, WM_COPYDATA, (WPARAM)hSkypeWnd, lParam);
-}
-
-/*
- * Skype via Socket --> Skype2Socket connection
- */
-
-void rcvThread(char *dummy) {
- unsigned int length;
- char *buf;
- COPYDATASTRUCT CopyData;
- int rcv;
-
- if (!UseSockets) return;
- rcvThreadRunning=TRUE;
- for ( ;; ) {
- if (ClientSocket==INVALID_SOCKET) {
- rcvThreadRunning=FALSE;
- return;
- }
- LOG(("rcvThread Receiving from socket.."));
- if ((rcv=recv(ClientSocket, (char *)&length, sizeof(length), 0))==SOCKET_ERROR || rcv==0) {
- rcvThreadRunning=FALSE;
- if (rcv==SOCKET_ERROR) {LOG(("rcvThread Socket error"));}
- else {LOG(("rcvThread lost connection, graceful shutdown"));}
- return;
- }
- LOG(("rcvThread Received length, recieving message.."));
- buf=(char *)calloc(1, length+1);
- if ((rcv = recv(ClientSocket, buf, length, 0))==SOCKET_ERROR || rcv==0) {
- rcvThreadRunning=FALSE;
- if (rcv==SOCKET_ERROR) {LOG(("rcvThread Socket error"));}
- else {LOG(("rcvThread lost connection, graceful shutdown"));}
- free(buf);
- return;
- }
- LOG(("Received message: %s", buf));
-
- CopyData.dwData=0;
- CopyData.lpData=buf;
- CopyData.cbData=(DWORD)strlen(buf)+1;
- if (!SendMessage(g_hWnd, WM_COPYDATA, (WPARAM)hSkypeWnd, (LPARAM)&CopyData))
- {
- LOG(("SendMessage failed: %08X", GetLastError()));
- }
- free(buf);
- }
-}
-
-void sendThread(char *dummy) {
- COPYDATASTRUCT CopyData;
- LRESULT SendResult;
- int oldstatus;
- unsigned int length;
- char *szMsg;
-
- while (SkypeMsgToSend) {
- if (WaitForSingleObject(SkypeMsgToSend, INFINITE) != WAIT_OBJECT_0) return;
- if (!(szMsg = MsgQ_Get(&SkypeSendQueue))) continue;
- length=(unsigned int)strlen(szMsg);
-
- if (UseSockets) {
- if (send(ClientSocket, (char *)&length, sizeof(length), 0) != SOCKET_ERROR &&
- send(ClientSocket, szMsg, length, 0) != SOCKET_ERROR) {
- free (szMsg);
- continue;
- }
- SendResult = 0;
- } else {
- CopyData.dwData=0;
- CopyData.lpData=szMsg;
- CopyData.cbData=length+1;
-
- // Internal comm channel
- if (pszProxyCallout) {
- CallService (pszProxyCallout, 0, (LPARAM)&CopyData);
- free(szMsg);
- continue;
- }
-
- // If this didn't work, proceed with normal Skype API
- if (!hSkypeWnd)
- {
- LOG(("SkypeSend: DAMN! No Skype window handle! :("));
- }
- SendResult=SendMessage(hSkypeWnd, WM_COPYDATA, (WPARAM)g_hWnd, (LPARAM)&CopyData);
- LOG(("SkypeSend: SendMessage returned %d", SendResult));
- free(szMsg);
- }
- if (!SendResult) {
- SkypeInitialized=FALSE;
- AttachStatus=-1;
- ResetEvent(SkypeReady);
- if (g_hWnd) KillTimer (g_hWnd, 1);
- if (SkypeStatus!=ID_STATUS_OFFLINE) {
- // Go offline
- logoff_contacts(FALSE);
- oldstatus=SkypeStatus;
- InterlockedExchange((long *)&SkypeStatus, (int)ID_STATUS_OFFLINE);
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, SkypeStatus);
- }
- // Reconnect to Skype
- ResetEvent(SkypeReady);
- forkthread(LaunchSkypeAndSetStatusThread, 0, (void *)ID_STATUS_ONLINE);
- WaitForSingleObject (SkypeReady, 10000);
- // SendMessageTimeout(HWND_BROADCAST, ControlAPIDiscover, (WPARAM)g_hWnd, 0, SMTO_ABORTIFHUNG, 3000, NULL);
- }
- }
-}
-
-
-/*
- * Skype Messagequeue - Implemented as a linked list
- */
-
-/* SkypeMsgInit
- *
- * Purpose: Initializes the Skype Message queue and API
- * Returns: 0 - Success
- * -1 - Memory allocation failure
- */
-int SkypeMsgInit(void) {
-
- MsgQ_Init(&SkypeMsgs);
- MsgQ_Init(&SkypeSendQueue);
- InitializeCriticalSection(&ConnectMutex);
- if (SkypeMsgToSend=CreateSemaphore(NULL, 0, MAX_MSGS, NULL)) {
- if (m_szSendBuf = malloc(m_iBufSize=512)) {
- if (_beginthread(( pThreadFunc )sendThread, 0, NULL)!=-1)
- return 0;
- free(m_szSendBuf);
- }
- CloseHandle (SkypeMsgToSend);
- }
- return -1;
-}
-
-/* SkypeMsgAdd
- *
- * Purpose: Add Message to linked list
- * Params : msg - Message to add to queue
- * Returns: 0 - Success
- * -1 - Memory allocation failure
- */
-int SkypeMsgAdd(char *msg) {
- return MsgQ_Add(&SkypeMsgs, msg)?0:-1;
-}
-
-/* SkypeMsgCleanup
- *
- * Purpose: Clean up the whole MESSagequeue - free() all
- */
-void SkypeMsgCleanup(void) {
- int i;
-
- LOG(("SkypeMsgCleanup Cleaning up message queue.."));
- if (receivers>1)
- {
- LOG (("SkypeMsgCleanup Releasing %d receivers", receivers));
- for (i=0;i<receivers; i++)
- {
- SkypeMsgAdd ("ERROR Semaphore was blocked");
- }
- ReleaseSemaphore (SkypeMsgReceived, receivers, NULL);
- }
-
- EnterCriticalSection(&ConnectMutex);
- MsgQ_Exit(&SkypeMsgs);
- LeaveCriticalSection(&ConnectMutex);
- DeleteCriticalSection(&ConnectMutex);
- CloseHandle(SkypeMsgToSend);
- SkypeMsgToSend=NULL;
- MsgQ_Exit(&SkypeSendQueue);
- if (m_szSendBuf)
- {
- free (m_szSendBuf);
- m_szSendBuf = NULL;
- m_iBufSize = 0;
- }
- LOG(("SkypeMsgCleanup Done."));
-}
-
-/* SkypeMsgGet
- *
- * Purpose: Fetch next message from message queue
- * Returns: The next message
- * Warning: Don't forget to free() return value!
- */
-char *SkypeMsgGet(void) {
- return MsgQ_Get(&SkypeMsgs);
-}
-
-// Message sending routine, for internal use by SkypeSend
-static int __sendMsg(char *szMsg) {
- COPYDATASTRUCT CopyData;
-
- LOG(("> %s", szMsg));
-
- // Fake PING-PONG, as PING-PONG is not supported by Skype2Socket
- if ((UseSockets || bIsImoproxy) && !strcmp(szMsg, "PING")) {
- CopyData.dwData=0;
- CopyData.lpData="PONG";
- CopyData.cbData=5;
- SendMessage(g_hWnd, WM_COPYDATA, (WPARAM)hSkypeWnd, (LPARAM)&CopyData);
- return 0;
- }
-
- if (UseSockets && ClientSocket==INVALID_SOCKET) return -1;
- if (!MsgQ_Add(&SkypeSendQueue, szMsg) || !ReleaseSemaphore(SkypeMsgToSend, 1, NULL))
- return -1;
- return 0;
-}
-
-/* SkypeSend
- *
- * Purpose: Sends the specified message to the Skype API.
- * If it fails, try to reconnect zu the Skype API
- * Params: use like sprintf without first param (dest. buffer)
- * Returns: 0 - Success
- * -1 - Failure
- */
-int SkypeSend(char *szFmt, ...) {
- char *pNewBuf;
- va_list ap;
- size_t iLen;
-
- // 0.0.0.17+ - Build message-String from supplied parameter list
- // so the user doesn't have to care about memory allocation any more.
- // 0.0.0.47+ - No more restrictions apply to the format string.
- // The temporary buffer remains allocated during the session and gets
- // dynamically expanded when needed. This makes sense, as this function
- // is used very often and therefore it is faster to not allocate
- // memory on every send.
- if (!m_szSendBuf && !(m_szSendBuf=malloc(m_iBufSize=512))) return -1;
- do
- {
- va_start(ap, szFmt);
- iLen = _vsnprintf(m_szSendBuf, m_iBufSize, szFmt, ap);
- va_end(ap);
- if (iLen == -1)
- {
- if (!(pNewBuf = (char*)realloc (m_szSendBuf, m_iBufSize*2)))
- {
- iLen = strlen (m_szSendBuf);
- break;
- }
- m_szSendBuf = pNewBuf;
- m_iBufSize*=2;
- }
- } while (iLen == -1);
-
- return __sendMsg(m_szSendBuf);
-}
-
-/* SkypeRcvTime
- *
- * Purpose: Wait, until either the message "what" is received or maxwait-Time has passed
- * or there was an error and return it
- * Params : what - Wait for this string-part at the beginning of a received string
- * If the first character of the string is NULL, the rest after the NULL
- * character will be searched in the entire received message-string.
- * You can tokenize the string by using NULL characters.
- * You HAVE TO end the string with a extra \0, otherwise the tokenizer
- * will run amok in memory!
- * st - The message timestamp must be newer or equal to st.
- * Set to 0, if you do not need this and want the first message of this
- * kind in the queue.
- * maxwait - Wait this time before returning, if nothing was received,
- * can be INFINITE
- * Returns: The received message containing "what" or a ERROR-Message or NULL if
- * time is up and nothing was received
- * Warning: Don't forget to free() return value!
- */
-char *SkypeRcvTime(char *what, time_t st, DWORD maxwait) {
- char *msg, *token=NULL;
- struct MsgQueue *ptr;
- int j;
- DWORD dwWaitStat;
- BOOL bChatMsg = FALSE, bIsChatMsg = FALSE;
-
- LOG (("SkypeRcv - Requesting answer: %s", what));
- if (what) bChatMsg = strncmp(what, "CHATMESSAGE", 11)==0;
- do {
- EnterCriticalSection(&SkypeMsgs.cs);
- // First, search for the requested message. On second run, also accept an ERROR
- for (j=0; j<2; j++)
- {
- for (ptr=SkypeMsgs.l.tqh_first; ptr; ptr=ptr->l.tqe_next) {
- if (what && what[0]==0) {
- // Tokenizer syntax active
- token=what+1;
- while (*token) {
- if (!strstr (ptr->message, token)) {
- token=NULL;
- break;
- }
- token+=strlen(token)+1;
- }
- }
-
- //if (j==1) {LOG(("SkypeRcv compare %s (%lu) -- %s (%lu)", ptr->message, ptr->tReceived, what, st));}
- if ((st == 0 || ptr->tReceived >= st) &&
- (what==NULL || token || (what[0] && !strncmp(ptr->message, what, strlen(what))) ||
- (bIsChatMsg = (j==1 && bChatMsg && !strncmp(ptr->message, what+4, strlen(what+4)))) ||
- (j==1 && !strncmp(ptr->message, "ERROR", 5))))
- {
- msg=MsgQ_RemoveMsg(&SkypeMsgs, ptr);
- LOG(("<SkypeRcv: %s", msg));
- if (bIsChatMsg) {
- msg=realloc(msg, strlen(msg)+5);
- memmove (msg+4, msg, strlen(msg)+1);
- memcpy (msg, "CHAT", 4);
-
- // This may be a sign that protocol negotiation failed, so we can try to send
- // our supported protocol version again, just in case... (Skype API bug?)
- //SkypeSend(SKYPE_PROTO);
- }
- LeaveCriticalSection(&SkypeMsgs.cs);
- return msg;
- }
- }
- }
- LeaveCriticalSection(&SkypeMsgs.cs);
- InterlockedIncrement ((long *)&receivers); //receivers++;
- dwWaitStat = WaitForSingleObject(SkypeMsgReceived, maxwait);
- if (receivers>1) InterlockedDecrement ((long *)&receivers); // receivers--;
- if (receivers>1) {LOG (("SkypeRcv: %d receivers still waiting", receivers));}
-
- } while(dwWaitStat == WAIT_OBJECT_0 && !MirandaShuttingDown);
- InterlockedDecrement ((long *)&receivers);
- LOG(("<SkypeRcv: (empty)"));
- return NULL;
-}
-char *SkypeRcv(char *what, DWORD maxwait) {
- return SkypeRcvTime(what, 0, maxwait);
-}
-
-char *SkypeRcvMsg(char *what, time_t st, HANDLE hContact, DWORD maxwait) {
- char *msg, msgid[32]={0}, *pMsg, *pCurMsg;
- struct MsgQueue *ptr;
- INT64 iLenWhat = strlen(what);
- DWORD dwWaitStat;
- BOOL bIsError, bProcess;
-
- LOG (("SkypeRcvMsg - Requesting answer: %s ", what));
- do {
- EnterCriticalSection(&SkypeMsgs.cs);
- ptr=SkypeMsgs.l.tqh_first;
- while(ptr) {
- //LOG (("SkypeRcvMsg - msg: %s -- %s", ptr->message, what));
- pCurMsg = ptr->message;
- bIsError = FALSE;
- if (*what && !strncmp(pCurMsg, what, iLenWhat)) {
- // Now we received a MESSAGE with an identifier. So this one is definitely for us
- // However the status can be SENDING instead of SENT and next message with this number
- // isn't using the ID anymore, so we have to save the ID as new identifier for message recognition
- pCurMsg+=iLenWhat;
- if ((pMsg = strchr (pCurMsg, ' ')) && (pMsg=strchr (pMsg+1, ' ')))
- strncpy (msgid, pCurMsg, pMsg-pCurMsg);
- else if (strncmp (pCurMsg, "ERROR", 5) == 0) bIsError = TRUE;
- }
-
- if ((*msgid && strncmp (pCurMsg, msgid, strlen(msgid)) == 0) ||
- (!*what && ptr->tReceived >= st &&
- (strncmp(pCurMsg, "MESSAGE", 7) == 0 || strncmp(pCurMsg, "CHATMESSAGE", 11) == 0 )
- ) || bIsError ||
- (ptr->tReceived >= st && ptr->tReceived <=st+1 &&
- (bIsError=(strncmp(pCurMsg, "ERROR 26", 8)==0 || strncmp(pCurMsg, "ERROR 43", 8)==0))
- ) )
- {
- bProcess = bIsError;
- if (!bIsError) {
- if ((pMsg = strchr (pCurMsg, ' ')) && (pMsg=strchr (pMsg+1, ' '))) {
- pMsg++;
- if (strncmp (pMsg, "STATUS ", 7) == 0) {
- pMsg+=7;
- if (strcmp (pMsg, "SENDING") == 0 &&
- DBGetContactSettingWord(hContact, SKYPE_PROTONAME, "Status", ID_STATUS_OFFLINE)!=ID_STATUS_OFFLINE) {
- // Remove dat shit
- struct MsgQueue *ptr_=ptr->l.tqe_next;
-
- free(MsgQ_RemoveMsg(&SkypeMsgs, ptr));
- ptr=ptr_;
- continue;
- }
- bProcess = (strcmp (pMsg, "SENT") == 0 || strcmp (pMsg, "QUEUED") == 0 ||
- strcmp (pMsg, "FAILED") == 0 || strcmp (pMsg, "IGNORED") == 0 ||
- strcmp (pMsg, "SENDING") == 0);
- }
- }
- }
- if (bProcess) {
- msg=MsgQ_RemoveMsg(&SkypeMsgs, ptr);
- LOG(("<SkypeRcv: %s", msg));
- LeaveCriticalSection(&SkypeMsgs.cs);
- return msg;
- }
- }
- ptr=ptr->l.tqe_next;
- }
- LeaveCriticalSection(&SkypeMsgs.cs);
- InterlockedIncrement ((long *)&receivers); //receivers++;
- dwWaitStat = WaitForSingleObject(SkypeMsgReceived, maxwait);
- if (receivers>1) InterlockedDecrement ((long *)&receivers); // receivers--;
- if (receivers>1) {LOG (("SkypeRcvMsg: %d receivers still waiting", receivers));}
-
- } while(dwWaitStat == WAIT_OBJECT_0 && !MirandaShuttingDown);
- InterlockedDecrement ((long *)&receivers);
- LOG(("<SkypeRcvMsg: (empty)"));
- return NULL;
-}
-
-/*
- Introduced in 0.0.0.17
-
- Issues a GET szWhat szWho szProperty and waits until the answer is received
- Returns the answer or NULL on failure
- BEWARE: Don't forget to free() return value!
-
- For example: SkypeGet("USER", dbv.pszVal, "FULLNAME");
-*/
-static char *__SkypeGet(char *szID, char *szWhat, char *szWho, char *szProperty) {
- char *str, *ptr;
- size_t len, len_id;
- time_t st = 0;
-
- st = *szID?0:SkypeTime(NULL);
- str=(char *)_alloca((len=strlen(szWhat)+strlen(szWho)+strlen(szProperty)+(*szWho?2:1)+(len_id=strlen(szID)))+5);
- sprintf(str, "%sGET %s%s%s %s", szID, szWhat, *szWho?" ":"", szWho, szProperty);
- if (__sendMsg(str)) return NULL;
- if (*szProperty) len++;
- if (*szID) {
- sprintf(str, "%s%s%s%s %s", szID, szWhat, *szWho?" ":"", szWho, szProperty);
- ptr = SkypeRcvTime(str, st, INFINITE);
- } else ptr = SkypeRcvTime(str+4, st, INFINITE);
- if (ptr && strncmp (ptr+len_id, "ERROR", 5)) memmove(ptr, ptr+len, strlen(ptr)-len+1);
- LOG(("SkypeGet - Request %s -> Answer %s", str, ptr));
- return ptr;
-}
-
-char *SkypeGetID(char *szWhat, char *szWho, char *szProperty) {
- char szID[16]={0};
- static DWORD dwId = 0;
-
- if (protocol>=4 || bIsImoproxy) sprintf (szID, "#G%d ", dwId++);
- return __SkypeGet (szID, szWhat, szWho, szProperty);
-}
-
-char *SkypeGet(char *szWhat, char *szWho, char *szProperty) {
- return __SkypeGet ("", szWhat, szWho, szProperty);
-}
-
-#ifdef _UNICODE
-WCHAR *SkypeGetW(char *szWhat, WCHAR *szWho, char *szProperty) {
- char *ptszWho = (char*)make_utf8_string(szWho);
- char *pRet = SkypeGet (szWhat, ptszWho, szProperty);
- free (ptszWho);
- if (pRet) {
- WCHAR *ptr = make_unicode_string((const unsigned char*)pRet);
- free (pRet);
- return ptr;
- }
- return NULL;
-}
-#endif
-
-char *SkypeGetErr(char *szWhat, char *szWho, char *szProperty) {
- char *ret = SkypeGet(szWhat, szWho, szProperty);
- if (ret && !strncmp(ret, "ERROR", 5)) {
- free (ret);
- return NULL;
- }
- return ret;
-}
-
-#ifdef _UNICODE
-WCHAR *SkypeGetErrW(char *szWhat, TCHAR *szWho, char *szProperty) {
- WCHAR *ret = SkypeGetW(szWhat, szWho, szProperty);
- if (ret && !_tcsncmp(ret, _T("ERROR"), 5)) {
- free (ret);
- return NULL;
- }
- return ret;
-}
-#endif
-
-
-/* SkypeGetProfile
- *
- * Issues a SET PROFILE szProperty szValue and waits until the answer is received
- * Returns the answer or NULL on failure
- * BEWARE: Don't forget to free() return value!
- *
- * For example: SkypeGetProfile("FULLNAME", "Tweety");
-*/
-char *SkypeGetProfile(char *szProperty) {
- return SkypeGet ("PROFILE", "", szProperty);
-}
-
-/* SkypeSetProfile
- *
- *
-*/
-int SkypeSetProfile(char *szProperty, char *szValue) {
- return SkypeSend("SET PROFILE %s %s", szProperty, szValue);
-}
-
-/* SkypeMsgCollectGarbage
- *
- * Purpose: Runs the garbage collector on the Skype Message-Queue to throw out old
- * messages which may unnecessarily eat up memory.
- * Params : age - Time in seconds. Messages older than this value will be
- * thrown out.
- * Returns: 0 - No messages were thrown out
- * >0 - n messages were thrown out
- */
-int SkypeMsgCollectGarbage(time_t age) {
- return MsgQ_CollectGarbage(&SkypeMsgs, age);
-}
-
-
-/* SkypeCall
- *
- * Purpose: Give a Skype call to the given User in wParam
- * or hangs up existing call
- * (hangUp is moved over to SkypeCallHangup)
- * Params : wParam - Handle to the User to be called
- * lParam - Can be NULL
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeCall(WPARAM wParam, LPARAM lParam) {
- DBVARIANT dbv;
- char *msg=0;
- int res;
-
- if (!DBGetContactSettingString((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
- res = -1; // no direct return, because dbv needs to be freed
- } else {
- if (DBGetContactSettingString((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1;
- msg=(char *)malloc(strlen(dbv.pszVal)+6);
- strcpy(msg, "CALL ");
- strcat(msg, dbv.pszVal);
- res=SkypeSend(msg);
- }
- DBFreeVariant(&dbv);
- free(msg);
- return res;
-}
-
-/* SkypeCallHangup
- *
- * Prupose: Hangs up the existing call to the given User
- * in wParam.
- *
- * Params : wParam - Handle to the User to be called
- * lParam - Can be NULL
- *
- * Returns: 0 - Success
- * -1 - Failure
- *
- */
-INT_PTR SkypeCallHangup(WPARAM wParam, LPARAM lParam)
-{
- DBVARIANT dbv;
- char *msg=0;
- int res = -1;
-
- if (!DBGetContactSettingString((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
- msg=(char *)malloc(strlen(dbv.pszVal)+21);
- sprintf(msg, "SET %s STATUS FINISHED", dbv.pszVal);
- //sprintf(msg, "ALTER CALL %s HANGUP", dbv.pszVal);
- res=SkypeSend(msg);
-#if _DEBUG
- DBDeleteContactSetting((HANDLE)wParam, SKYPE_PROTONAME, "CallId");
-#endif
- //} else {
- // if (DBGetContactSetting((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1;
- // msg=(char *)malloc(strlen(dbv.pszVal)+6);
- // strcpy(msg, "CALL ");
- // strcat(msg, dbv.pszVal);
- // res=SkypeSend(msg);
- }
- DBFreeVariant(&dbv);
- free(msg);
- return res;
-}
-
-/* FixNumber
- *
- * Purpose: Eliminates all non-numeric chars from the given phonenumber
- * Params : p - Pointer to the buffer with the number
- */
-static void FixNumber(char *p) {
- unsigned int i;
-
- for (i=0;i<=strlen(p);i++)
- if ((p[i]<'0' || p[i]>'9'))
- if (p[i]) {
- memmove(p+i, p+i+1, strlen(p+i));
- i--;
- } else break;
-}
-
-
-/* DialDlgProc
- *
- * Purpose: Dialog procedure for the Dial-Dialog
- */
-static BOOL CALLBACK DialDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
- static HANDLE hContact;
- static unsigned int entries=0;
- BOOL TempAdded=FALSE;
- char number[64], *msg, *ptr=NULL;
-
- switch (uMsg){
- case WM_INITDIALOG:
- hContact=(HANDLE)lParam;
- Utils_RestoreWindowPosition(hwndDlg, NULL, SKYPE_PROTONAME, "DIALdlg");
- TranslateDialogDefault(hwndDlg);
-
- if (lParam) {
- DBVARIANT dbv;
- BOOL bDialNow=TRUE;
-
- if (!DBGetContactSetting(hContact,"UserInfo","MyPhone1",&dbv)) {
- int j;
- char idstr[16];
-
- // Multiple phone numbers, select one
- bDialNow=FALSE;
- DBFreeVariant(&dbv);
- for(j=0;;j++) {
- sprintf(idstr,"MyPhone%d",j);
- if(DBGetContactSettingString(hContact,"UserInfo",idstr,&dbv)) break;
- FixNumber(dbv.pszVal+1); // Leave + alone
- SendDlgItemMessage(hwndDlg,IDC_NUMBER,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- }
- if (DBGetContactSettingString(hContact,SKYPE_PROTONAME,"SkypeOutNr",&dbv)) {
- DBGetContactSettingString(hContact,"UserInfo","MyPhone0",&dbv);
- FixNumber(dbv.pszVal+1);
- }
- SetDlgItemTextA(hwndDlg, IDC_NUMBER, dbv.pszVal);
- DBFreeVariant(&dbv);
- if (bDialNow) PostMessage(hwndDlg, WM_COMMAND, IDDIAL, 0);
- } else {
- DBVARIANT dbv;
- char number[64];
-
- for (entries=0;entries<MAX_ENTRIES;entries++) {
- sprintf(number, "LastNumber%d", entries);
- if (!DBGetContactSettingTString(NULL, SKYPE_PROTONAME, number, &dbv)) {
- SendDlgItemMessage(hwndDlg,IDC_NUMBER,CB_ADDSTRING,0,(LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
- } else break ;
- }
- }
- SetFocus(GetDlgItem(hwndDlg, IDC_NUMBER));
- return TRUE;
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDDIAL:
- EnableWindow(GetDlgItem(hwndDlg, IDDIAL), FALSE);
- GetDlgItemTextA(hwndDlg, IDC_NUMBER, number, sizeof(number));
- if (!strncmp(number, "00", 2)) {
- memmove(number, number+1, sizeof(number)-1);
- number[0]='+';
- number[sizeof(number)]=0;
- }
- if (!hContact) {
- if (!(hContact=add_contact(number, PALF_TEMPORARY))) {
- DestroyWindow(hwndDlg);
- break;
- }
- DBDeleteContactSetting(hContact, "CList", "Hidden");
- DBWriteContactSettingWord(hContact, SKYPE_PROTONAME, "Status", (WORD)SkypeStatusToMiranda("SKYPEOUT"));
- if (SendDlgItemMessage(hwndDlg,IDC_NUMBER,CB_FINDSTRING,0,(LPARAM)number)==CB_ERR) {
- int i;
- char buf[64];
- DBVARIANT dbv;
-
- if (entries>MAX_ENTRIES) entries=MAX_ENTRIES;
- for (i=entries;i>0;i--) {
- sprintf(buf, "LastNumber%d", i-1);
- if (!DBGetContactSettingString(NULL, SKYPE_PROTONAME, buf, &dbv)) {
- sprintf(buf, "LastNumber%d", i);
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, buf, dbv.pszVal);
- DBFreeVariant(&dbv);
- } else break;
- }
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "LastNumber0", number);
- }
- TempAdded=TRUE;
- }
- if (!DBWriteContactSettingString(hContact, SKYPE_PROTONAME, "SkypeOutNr", number)) {
- msg=(char *)malloc(strlen(number)+6);
- strcpy(msg, "CALL ");
- strcat(msg, number);
- if (SkypeSend(msg) || (ptr=SkypeRcv("ERROR", 500))) {
- DBDeleteContactSetting(hContact, SKYPE_PROTONAME, "SkypeOutNr");
- if (ptr) {
- OUTPUTA(ptr);
- free(ptr);
- }
- if (TempAdded) CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
- }
- free(msg);
- }
- case IDCANCEL:
- DestroyWindow(hwndDlg);
- break;
- }
- break;
- case WM_DESTROY:
- Utils_SaveWindowPosition(hwndDlg, NULL, SKYPE_PROTONAME, "DIALdlg");
- if (httbButton) CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)httbButton, TTBST_RELEASED);
- break;
- }
- return FALSE;
-}
-
-/* CallstatDlgProc
- *
- * Purpose: Dialog procedure for the CallStatus Dialog
- */
-static BOOL CALLBACK CallstatDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
- static int selected;
- static DBVARIANT dbv, dbv2={0};
-
- switch (uMsg){
- case WM_INITDIALOG:
- {
- HANDLE hContact;
- char *szProto;
-
- if (!DBGetContactSettingString((HANDLE)lParam, SKYPE_PROTONAME, "CallId", &dbv)) {
-
- // Check, if another call is in progress
- for (hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact=(HANDLE)CallService( MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
- szProto = (char*)CallService( MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0 );
- if (szProto!=NULL && !strcmp(szProto, SKYPE_PROTONAME) && hContact!=(HANDLE)lParam &&
- DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 0 &&
- !DBGetContactSettingString(hContact, SKYPE_PROTONAME, "CallId", &dbv2))
- {
- if (DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "OnHold", 0)) {
- DBFreeVariant(&dbv2);
- continue;
- } else break;
- }
- }
-
- if (dbv2.pszVal)
- {
- char buf[256], buf2[256];
- char *szOtherCaller=(char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0);
-
- Utils_RestoreWindowPosition(hwndDlg, NULL, SKYPE_PROTONAME, "CALLSTATdlg");
- TranslateDialogDefault(hwndDlg);
- SendMessage(hwndDlg, WM_COMMAND, IDC_JOIN, 0);
-
- GetWindowTextA(hwndDlg, buf, sizeof(buf));
- _snprintf(buf2, sizeof(buf), buf, CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)lParam,0));
- SetWindowTextA(hwndDlg, buf2);
-
- GetDlgItemTextA(hwndDlg, IDC_JOIN, buf, sizeof(buf));
- _snprintf(buf2, sizeof(buf), buf, szOtherCaller);
- SetDlgItemTextA(hwndDlg, IDC_JOIN, buf2);
-
- GetDlgItemTextA(hwndDlg, IDC_HOLD, buf, sizeof(buf));
- _snprintf(buf2, sizeof(buf), buf, szOtherCaller);
- SetDlgItemTextA(hwndDlg, IDC_HOLD, buf2);
-
- return TRUE;
- }
-
- // No other call in progress, no need for this Dlg., just answer the call
- SkypeSend("SET %s STATUS INPROGRESS", dbv.pszVal);
- testfor ("ERROR", 200);
- DBFreeVariant(&dbv);
- }
- DestroyWindow(hwndDlg);
- break;
- }
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_JOIN:
- case IDC_HOLD:
- case IDC_HANGUP:
- CheckRadioButton(hwndDlg, IDC_JOIN, IDC_HANGUP, (selected=LOWORD(wParam)));
- break;
- case IDOK:
- {
- char *szIdCall2;
-
- switch (selected) {
- case IDC_JOIN:
- if (szIdCall2=strchr(dbv2.pszVal, ' '))
- SkypeSend("SET %s JOIN_CONFERENCE%s", dbv.pszVal, szIdCall2);
- break;
- case IDC_HOLD:
- SkypeSend("SET %s STATUS ONHOLD", dbv2.pszVal);
- SkypeSend("SET %s STATUS INPROGRESS", dbv.pszVal);
- break;
- case IDC_HANGUP:
- SkypeSend("SET %s STATUS FINISHED", dbv.pszVal);
- break;
- }
-
- DBFreeVariant(&dbv);
- DBFreeVariant(&dbv2);
- DestroyWindow(hwndDlg);
- break;
- }
- }
- break;
- case WM_DESTROY:
- Utils_SaveWindowPosition(hwndDlg, NULL, SKYPE_PROTONAME, "CALLSTATdlg");
- break;
- }
- return FALSE;
-}
-
-
-/* SkypeOutCallErrorCheck
- *
- * Purpose: Checks, if an error has occured after call and
- * if so, hangs up the call
- * This procedure is a seperate thread to not block the core
- * while waiting for "ERROR"
- * Params : szCallId - ID of the call
- */
-void SkypeOutCallErrorCheck(char *szCallId) {
- if (testfor("ERROR", 500)) EndCallThread(szCallId);
-}
-
-/* SkypeOutCall
- *
- * Purpose: Give a SkypeOut call to the given User in wParam
- * or hangs up existing call
- * The user's record is searched for Phone-number entries.
- * If there is more than 1 entry, the Dial-Dialog is shown
- * Params : wParam - Handle to the User to be called
- * If NULL, the dial-dialog is shown
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeOutCall(WPARAM wParam, LPARAM lParam) {
- DBVARIANT dbv;
- int res = -1;
-
- if (wParam && !DBGetContactSettingString((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv)) {
- res=SkypeSend("SET %s STATUS FINISHED", dbv.pszVal);
- forkthread(( pThreadFunc )SkypeOutCallErrorCheck, 0, _strdup(dbv.pszVal));
- DBFreeVariant(&dbv);
- } else if (!CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_DIAL), NULL, (DLGPROC)DialDlgProc, (LPARAM)wParam)) return -1;
- return res;
-}
-
-/* SkypeHoldCall
- *
- * Purpose: Put the call to the User given in wParam on Hold or Resumes it
- * Params : wParam - Handle to the User
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeHoldCall(WPARAM wParam, LPARAM lParam) {
- DBVARIANT dbv;
- int retval;
-
- LOG(("SkypeHoldCall started"));
- if (!wParam || DBGetContactSettingString((HANDLE)wParam, SKYPE_PROTONAME, "CallId", &dbv))
- return -1;
- retval = SkypeSend ("SET %s STATUS %s", dbv.pszVal,
- DBGetContactSettingByte((HANDLE)wParam, SKYPE_PROTONAME, "OnHold", 0)?"INPROGRESS":"ONHOLD");
- DBFreeVariant(&dbv);
- return retval;
-}
-
-/* SkypeAnswerCall
- *
- * Purpose: Answer a Skype-call when a user double-clicks on
- * The incoming-call-Symbol. Works for both, Skype and SkypeOut-calls
- * Params : wParam - Not used
- * lParam - CLISTEVENT*
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeAnswerCall(WPARAM wParam, LPARAM lParam) {
-
- LOG(("SkypeAnswerCall started"));
- CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CALLSTAT), NULL, (DLGPROC)CallstatDlgProc, (LPARAM)((CLISTEVENT*)lParam)->hContact);
- return 0;
-}
-/* SkypeSetNick
- *
- * Purpose: Set Full Name in profile
- * Params : wParam=0
- * lParam=(LPARAM)(const char*)Nick text
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeSetNick(WPARAM wParam, LPARAM lParam) {
- int retval = -1;
- char *Nick = NULL;
-
- if (wParam & SMNN_UNICODE)
- {
- DBWriteContactSettingWString(0, SKYPE_PROTONAME, "Nick", (WCHAR*)lParam);
- if (AttachStatus == SKYPECONTROLAPI_ATTACH_SUCCESS &&
- !(Nick = (char*)make_utf8_string((WCHAR*)lParam))) return -1;
- }
- else
- {
- DBWriteContactSettingString(0, SKYPE_PROTONAME, "Nick", (char*)lParam);
- if(AttachStatus == SKYPECONTROLAPI_ATTACH_SUCCESS &&
- utf8_encode((const char *)lParam, &Nick) == -1 ) return -1;
- }
- if(AttachStatus == SKYPECONTROLAPI_ATTACH_SUCCESS)
- retval = SkypeSend("SET PROFILE FULLNAME %s", Nick);
- if (Nick) free (Nick);
-
- return retval;
-
-}
-/* SkypeSetAwayMessage
- *
- * Purpose: Set Mood message in profile
- * Params : wParam=status mode
- * lParam=(LPARAM)(const char*)message text
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeSetAwayMessage(WPARAM wParam, LPARAM lParam) {
- int retval = -1;
- char *Mood = NULL;
-
- if (!lParam) lParam=(LPARAM)"";
- if(utf8_encode((const char *)lParam, &Mood) == -1 ) return -1;
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "MoodText", (const char *)lParam);
-
- if(AttachStatus == SKYPECONTROLAPI_ATTACH_SUCCESS)
- retval = SkypeSend("SET PROFILE MOOD_TEXT %s", Mood);
- free (Mood);
-
- return retval;
-}
-INT_PTR SkypeSetAwayMessageW(WPARAM wParam, LPARAM lParam) {
- int retval = -1;
- char *Mood = NULL;
-
- if (!lParam) lParam=(LPARAM)"";
- if (!(Mood = (char*)make_utf8_string((WCHAR*)lParam))) return -1;
- DBWriteContactSettingWString(NULL, SKYPE_PROTONAME, "MoodText", (WCHAR*)lParam);
-
- if(AttachStatus == SKYPECONTROLAPI_ATTACH_SUCCESS)
- retval = SkypeSend("SET PROFILE MOOD_TEXT %s", Mood);
- free (Mood);
-
- return retval;
-}
-
-/* SkypeSetAvatar
- *
- * Purpose: Set user avatar in profile
- * Params : wParam=0
- * lParam=(LPARAM)(const char*)filename
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeSetAvatar(WPARAM wParam, LPARAM lParam) {
- char *filename = (char *) lParam, *ext;
- char AvatarFile[MAX_PATH+1], OldAvatarFile[1024];
- char *ptr = NULL;
- int ret;
- char command[500];
- DBVARIANT dbv = {0};
- BOOL hasOldAvatar = (DBGetContactSettingString(NULL, SKYPE_PROTONAME, "AvatarFile", &dbv) == 0 && dbv.type == DBVT_ASCIIZ);
- size_t len;
-
- if (AttachStatus != SKYPECONTROLAPI_ATTACH_SUCCESS)
- return -3;
-
- if (filename == NULL)
- return -1;
- len = strlen(filename);
- if (len < 4)
- return -1;
-
- ext = &filename[len-4];
- if (_stricmp(ext, ".jpg")==0 || _stricmp(ext-1, ".jpeg")==0)
- ext = "jpg";
- else if (_stricmp(ext, ".png")==0)
- ext = "png";
- else
- return -2;
-
- FoldersGetCustomPath(hProtocolAvatarsFolder, AvatarFile, sizeof(AvatarFile), DefaultAvatarsFolder);
- mir_snprintf(AvatarFile, sizeof(AvatarFile), "%s\\%s avatar.%s", AvatarFile, SKYPE_PROTONAME, ext);
-
- // Backup old file
- if (hasOldAvatar)
- {
- strncpy(OldAvatarFile, dbv.pszVal, sizeof(OldAvatarFile)-4);
- OldAvatarFile[sizeof(OldAvatarFile)-5] = '\0';
- strcat(OldAvatarFile, "_old");
- DeleteFileA(OldAvatarFile);
- if (!MoveFileA(dbv.pszVal, OldAvatarFile))
- {
- DBFreeVariant(&dbv);
- return -3;
- }
- }
-
- // Copy new file
- if (!CopyFileA(filename, AvatarFile, FALSE))
- {
- if (hasOldAvatar)
- {
- MoveFileA(OldAvatarFile, dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- return -3;
- }
-
- // Try to set with skype
- mir_snprintf(command, sizeof(command), "SET AVATAR 1 %s", AvatarFile);
- if (SkypeSend(command) || (ptr = SkypeRcv(command+4, INFINITE)) == NULL || !strncmp(ptr, "ERROR", 5))
- {
- DeleteFileA(AvatarFile);
-
- if (hasOldAvatar)
- MoveFileA(OldAvatarFile, dbv.pszVal);
-
- ret = -4;
- }
- else
- {
- if (hasOldAvatar)
- DeleteFileA(OldAvatarFile);
-
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "AvatarFile", AvatarFile);
-
- ret = 0;
- }
-
- if (ptr != NULL)
- free(ptr);
-
- if (hasOldAvatar)
- DBFreeVariant(&dbv);
-
- return ret;
-}
-
-
-/* SkypeSendFile
- *
- * Purpose: Opens the Skype-dialog to send a file
- * Params : wParam - Handle to the User
- * lParam - Not used
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeSendFile(WPARAM wParam, LPARAM lParam) {
- DBVARIANT dbv;
- int retval;
-
- if (!wParam || DBGetContactSettingString((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
- return -1;
- retval=SkypeSend("OPEN FILETRANSFER %s", dbv.pszVal);
- DBFreeVariant(&dbv);
- return retval;
-}
-
-/* SkypeChatCreate
- *
- * Purpose: Creates a groupchat with the user
- * Params : wParam - Handle to the User
- * lParam - Not used
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeChatCreate(WPARAM wParam, LPARAM lParam) {
- DBVARIANT dbv;
- HANDLE hContact=(HANDLE)wParam;
- char *ptr, *ptr2;
-
- if (!hContact || DBGetContactSettingString(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
- return -1;
- // Flush old messages
- while (testfor("\0CHAT \0 STATUS \0", 0));
- if (SkypeSend("CHAT CREATE %s", dbv.pszVal) || !(ptr=SkypeRcv ("\0CHAT \0 STATUS \0", INFINITE)))
- {
- DBFreeVariant(&dbv);
- return -1;
- }
- DBFreeVariant(&dbv);
- if (ptr2=strstr (ptr, "STATUS")) {
- *(ptr2-1)=0;
- ChatStart (ptr+5, FALSE);
- }
- free(ptr);
- return 0;
-}
-
-/* SkypeAdduserDlg
- *
- * Purpose: Show Skype's Add user Dialog
- */
-INT_PTR SkypeAdduserDlg(WPARAM wParam, LPARAM lParam) {
- SkypeSend("OPEN ADDAFRIEND");
- return 0;
-}
-
-/* SkypeFlush
- *
- * Purpose: Flush the Skype Message-List
- */
-void SkypeFlush(void) {
- char *ptr;
-
- while ((ptr=SkypeRcv(NULL, 0))!=NULL) free(ptr);
-}
-
-/* SkypeStatusToMiranda
- *
- * Purpose: Converts the specified Skype-Status mode to the corresponding Miranda-Status mode
- * Params : s - Skype Status
- * Returns: The correct Status
- * 0 - Nothing found
- */
-int SkypeStatusToMiranda(char *s) {
- int i;
- if (!strcmp("SKYPEOUT", s)) return DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "SkypeOutStatusMode", ID_STATUS_ONTHEPHONE);
- for(i=0; status_codes[i].szStat; i++)
- if (!strcmp(status_codes[i].szStat, s))
- return status_codes[i].id;
- return 0;
-}
-
-/* MirandaStatusToSkype
- *
- * Purpose: Converts the specified Miranda-Status mode to the corresponding Skype-Status mode
- * Params : id - Miranda Status
- * Returns: The correct Status
- * NULL - Nothing found
- */
-char *MirandaStatusToSkype(int id) {
- int i;
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "NoSkype3Stats", 0)) {
- switch (id)
- {
- case ID_STATUS_NA: return "AWAY";
- case ID_STATUS_FREECHAT: return "ONLINE";
- }
- }
- for(i=0; status_codes[i].szStat; i++)
- if (status_codes[i].id==id)
- return status_codes[i].szStat;
- return NULL;
-}
-
-/* GetSkypeErrorMsg
- *
- * Purpose: Get a human-readable Error-Message for the supplied Skype Error-Message
- * Params : str - Skype Error-Message string
- * Returns: Human-readable Error Message or NULL, if nothing was found
- * Warning: Don't forget to free() return value
- */
-char *GetSkypeErrorMsg(char *str) {
- char *pos, *reason, *msg;
-
- LOG (("GetSkypeErrorMsg received error: %s", str));
- if (!strncmp(str, "ERROR", 5)) {
- reason=_strdup(str);
- return reason;
- }
- if ((pos=strstr(str, "FAILURE")) ) {
- switch(atoi(pos+14)) {
- case MISC_ERROR: msg="Misc. Error"; break;
- case USER_NOT_FOUND: msg="User does not exist, check username"; break;
- case USER_NOT_ONLINE: msg="Trying to send IM to an user, who is not online"; break;
- case USER_BLOCKED: msg="IM blocked by recipient"; break;
- case TYPE_UNSUPPORTED: msg="Type unsupported"; break;
- case SENDER_NOT_FRIEND: msg="Sending IM message to user, who has not added you to friendslist and has chosen 'only people in my friendslist can start IM'"; break;
- case SENDER_NOT_AUTHORIZED: msg="Sending IM message to user, who has not authorized you and has chosen 'only people whom I have authorized can start IM'"; break;
- default: msg="Unknown error";
- }
- reason=(char *)malloc(strlen(pos)+strlen(msg)+3);
- sprintf (reason, "%s: %s", pos, msg);
- return reason;
- }
- return NULL;
-}
-
-/* testfor
- *
- * Purpose: Wait, until the given Message-Fragment is received from Skype within
- * the given amount of time
- * Params : see SkypeRcv
- * Returns: TRUE - Message was received within the given amount of time
- * FALSE- nope, sorry
- */
-BOOL testfor(char *what, DWORD maxwait) {
- char *res;
-
- if ((res=SkypeRcv(what, maxwait))==NULL) return FALSE;
- free(res);
- return TRUE;
-}
-
-char SendSkypeproxyCommand(char command) {
- int length=0;
- char reply=0;
- BOOL res;
-
- res = send(ClientSocket, (char *)&length, sizeof(length), 0)==SOCKET_ERROR
- || send(ClientSocket, (char *)&command, sizeof(command), 0)==SOCKET_ERROR
- || recv(ClientSocket, (char *)&reply, sizeof(reply), 0)==SOCKET_ERROR;
- if (res)
- return -1;
- else
- return reply;
-}
-
-/* ConnectToSkypeAPI
- *
- * Purpose: Establish a connection to the Skype API
- * Params : path - Path to the Skype application
- * iStart - Need to start skype for status change.
- * 1 = Normal start if Skype not running
- * 2 = Forced startp code execution no matter what
- * Returns: 0 - Connecting succeeded
- * -1 - Something went wrong
- */
-int ConnectToSkypeAPI(char *path, int iStart) {
- static int iRet = -1; // last request result
- static volatile long newRequest = TRUE;
-
- InterlockedExchange(&newRequest, TRUE); // place new request
- EnterCriticalSection(&ConnectMutex); // Prevent reentrance
- if (iRet == -1 || newRequest)
- {
- iRet = _ConnectToSkypeAPI(path, iStart);
- InterlockedExchange(&newRequest, FALSE); // every thread which is waiting for connect mutex will get our result as well.. but subsequent calls will set this value to true and call _Connect again
- }
- LeaveCriticalSection(&ConnectMutex);
- return iRet;
-}
-
-void TranslateMirandaRelativePathToAbsolute(LPCSTR cszPath, LPSTR szAbsolutePath, BOOL fQuoteSpaces) {
- *szAbsolutePath = 0;
- CallService (MS_UTILS_PATHTOABSOLUTE, (WPARAM)(*cszPath ? cszPath : ".\\"), (LPARAM)szAbsolutePath);
- if(fQuoteSpaces && strchr((LPCSTR)szAbsolutePath, ' ')){
- memmove (szAbsolutePath+1, szAbsolutePath, strlen(szAbsolutePath)+1);
- *szAbsolutePath='"';
- strcat (szAbsolutePath, "\"");
- }
-
- TRACEA(szAbsolutePath);
-}
-
-static INT64 my_spawnv(const char *cmdname, const char *const *argv, PROCESS_INFORMATION *pi)
-{
- INT64 i, iLen=0;
- char *CommandLine;
- STARTUPINFOA si={0};
- BOOL bRet;
-
- memset (pi, 0, sizeof(PROCESS_INFORMATION));
- for (i=0; argv[i]; i++) iLen+=strlen(argv[i])+1;
- if (!(CommandLine = calloc(1, iLen))) return -1;
- for (i=0; argv[i]; i++) {
- if (i) strcat (CommandLine, " ");
- strcat (CommandLine, argv[i]);
- }
- si.cb = sizeof(si);
-
- bRet = CreateProcessA( cmdname,CommandLine,NULL,NULL,FALSE,0,NULL,NULL,&si,pi);
- free(CommandLine);
- if (!bRet) return -1;
- return (INT64)pi->hProcess;
-}
-
-static int _ConnectToSkypeAPI(char *path, int iStart) {
- BOOL SkypeLaunched=FALSE;
- BOOL UseCustomCommand = DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseCustomCommand", 0);
- int counter=0, i, j, maxattempts=DBGetContactSettingWord(NULL, SKYPE_PROTONAME, "ConnectionAttempts", 10);
- char *args[7], *pFree = NULL;
- char *SkypeOptions[]={"/notray", "/nosplash", "/minimized", "/removable", "/datapath:", "/secondary"};
- const int SkypeDefaults[]={0, 1, 1, 0, 0};
-
- char szAbsolutePath[MAX_PATH];
-
- LOG(("ConnectToSkypeAPI started."));
- if (UseSockets)
- {
- SOCKADDR_IN service;
- DBVARIANT dbv;
- long inet;
- struct hostent *hp;
-
- LOG(("ConnectToSkypeAPI: Connecting to Skype2socket socket..."));
- if ((ClientSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP))==INVALID_SOCKET) return -1;
-
- if (!DBGetContactSettingString(NULL, SKYPE_PROTONAME, "Host", &dbv)) {
- if ((inet=inet_addr(dbv.pszVal))==-1) {
- if (hp=gethostbyname(dbv.pszVal))
- memcpy(&inet, hp->h_addr, sizeof(inet));
- else {
- OUTPUT(_T("Cannot resolve host!"));
- DBFreeVariant(&dbv);
- return -1;
- }
- }
- DBFreeVariant(&dbv);
- } else {
- OUTPUT(_T("Cannot find valid host to connect to."));
- return -1;
- }
-
- service.sin_family = AF_INET;
- service.sin_addr.s_addr = inet;
- service.sin_port = htons((unsigned short)DBGetContactSettingWord(NULL, SKYPE_PROTONAME, "Port", 1401));
-
- if ( connect( ClientSocket, (SOCKADDR*) &service, sizeof(service) ) == SOCKET_ERROR) return -1;
-
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "RequiresPassword", 0) && !DBGetContactSettingString(NULL, SKYPE_PROTONAME, "Password", &dbv))
- {
- char reply=0;
-
- CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal)+1, (LPARAM)dbv.pszVal);
- if ((reply=SendSkypeproxyCommand(AUTHENTICATE))==-1)
- {
- DBFreeVariant(&dbv);
- return -1;
- }
- if (!reply) {
- OUTPUT(_T("Authentication is not supported/needed for this Skypeproxy server. It will be disabled."));
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "RequiresPassword", 0);
- } else {
- unsigned int length=(unsigned int)strlen(dbv.pszVal);
- BOOL res;
- res = send(ClientSocket, (char *)&length, sizeof(length), 0)==SOCKET_ERROR
- || send(ClientSocket, dbv.pszVal, length, 0)==SOCKET_ERROR
- || recv(ClientSocket, (char *)&reply, sizeof(reply), 0)==SOCKET_ERROR;
- if (res)
- {
- DBFreeVariant(&dbv);
- return -1;
- }
- if (!reply)
- {
- OUTPUT(_T("Authentication failed for this server, connection was not successful. Verify that your password is correct!"));
- DBFreeVariant(&dbv);
- return -1;
- }
- }
- DBFreeVariant(&dbv);
- }
- else
- {
- char reply=0;
-
- if ((reply=SendSkypeproxyCommand(CAPABILITIES))==-1) return -1;
- if (reply&USE_AUTHENTICATION) {
- OUTPUT(_T("The server you specified requires authentication, but you have not supplied a password for it. Check the Skype plugin settings and try again."));
- return -1;
- }
- }
-
-
- if (!rcvThreadRunning)
- if(_beginthread(( pThreadFunc )rcvThread, 0, NULL)==-1) return -1;
-
- AttachStatus=SKYPECONTROLAPI_ATTACH_SUCCESS;
- return 0;
- }
-
- if (pszProxyCallout)
- {
- if (SkypeSend("SET USERSTATUS ONLINE")==-1)
- {
- AttachStatus=SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE;
- return -1;
- }
- for ( ;; ) {
- char *ptr = SkypeRcv ("CONNSTATUS", INFINITE);
- if (!ptr)
- {
- AttachStatus=SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE;
- return -1;
- }
-
- if (strcmp (ptr+11, "CONNECTING"))
- {
- free (ptr);
- break;
- }
- free (ptr);
- }
-
- AttachStatus=SKYPECONTROLAPI_ATTACH_SUCCESS;
- return 0;
- }
-
- do
- {
- int retval;
- /* To initiate communication, Client should broadcast windows message
- ('SkypeControlAPIDiscover') to all windows in the system, specifying its own
- window handle in wParam parameter.
- */
- if (iStart != 2 || counter)
- {
- LOG(("ConnectToSkypeAPI sending discover message.. hWnd=%08X", (long)g_hWnd));
- retval=SendMessageTimeout(HWND_BROADCAST, ControlAPIDiscover, (WPARAM)g_hWnd, 0, SMTO_ABORTIFHUNG, 3000, NULL);
- LOG(("ConnectToSkypeAPI sent discover message returning %d", retval));
- }
-
- /* In response, Skype responds with
- message 'SkypeControlAPIAttach' to the handle specified, and indicates
- connection status
- SkypeReady is set if there is an answer by Skype other than API_AVAILABLE.
- If there is no answer after 3 seconds, launch Skype as it's propably
- not running.
- */
- if (iStart == 2 || (WaitForSingleObject(SkypeReady, 3000)==WAIT_TIMEOUT && AttachStatus!=SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION))
- {
- if (iStart != 2 && g_hWnd==NULL)
- {
- LOG(("ConnectToSkypeAPI: hWnd of SkypeDispatchWindow not yet set.."));
- continue;
- }
- if ((iStart == 2 || !SkypeLaunched) && (path || UseCustomCommand))
- {
- static PROCESS_INFORMATION pi={0};
- DWORD dwExitStatus = 0;
-
- if ((!pi.hProcess || !GetExitCodeProcess(pi.hProcess, &dwExitStatus) || dwExitStatus != STILL_ACTIVE) &&
- (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "StartSkype", 1) || iStart))
- {
- LOG(("ConnectToSkypeAPI Starting Skype, as it's not running"));
-
- j=1;
- for (i=0; i<sizeof(SkypeOptions)/sizeof(SkypeOptions[0]); i++)
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, SkypeOptions[i]+1, SkypeDefaults[i])) {
- DBVARIANT dbv;
-
- switch (i)
- {
- case 4:
- if(!DBGetContactSettingString(NULL,SKYPE_PROTONAME,"datapath",&dbv))
- {
- INT64 paramSize;
- TranslateMirandaRelativePathToAbsolute(dbv.pszVal, szAbsolutePath, TRUE);
- paramSize = strlen(SkypeOptions[i]) + strlen(szAbsolutePath);
- pFree = args[j] = malloc(paramSize + 1);
- sprintf(args[j],"%s%s",SkypeOptions[i],szAbsolutePath);
- DBFreeVariant(&dbv);
- }
- break;
- case 2:
- args[j++]="/legacylogin";
- default:
- args[j]=SkypeOptions[i];
- break;
- }
- LOG(("Using Skype parameter: %s", args[j]));
- //MessageBox(NULL,"Using Skype parameter: ",args[j],0);
- j++;
- }
- args[j]=NULL;
-
- if(UseCustomCommand)
- {
- DBVARIANT dbv;
-
- if(!DBGetContactSettingString(NULL,SKYPE_PROTONAME,"CommandLine",&dbv))
- {
- TranslateMirandaRelativePathToAbsolute(dbv.pszVal, szAbsolutePath, FALSE);
- args[0] = (LPSTR)szAbsolutePath;
- LOG(("ConnectToSkypeAPI: Launch skype using command line"));
- if (!*szAbsolutePath || my_spawnv(szAbsolutePath, args, &pi) == -1) {
- LOG(("ConnectToSkypeAPI: Failed to launch skype!"));
- } else {
- WaitForInputIdle((HANDLE)pi.hProcess, 5000);
- setUserNamePassword(pi.dwProcessId);
- }
- DBFreeVariant(&dbv);
- }
- }
- else
- {
- args[0]=path;
- LOG(("ConnectToSkypeAPI: Launch skype"));
- /*for(int i=0;i<j;i++)
- {
- if(args[i] != NULL)
- LOG("ConnectToSkypeAPI", args[i]);
- }*/
-
- // if there is no skype installed and no custom command line, then exit .. else it crashes
- if (args[0] == NULL || strlen(args[0])==0)
- {
- return -1;
- }
- if (my_spawnv(path, args, &pi) != -1) {
- WaitForInputIdle((HANDLE)pi.hProcess, 5000);
- setUserNamePassword(pi.dwProcessId);
- }
- }
- if (pFree) free(pFree);
- }
- ResetEvent(SkypeReady);
- SkypeLaunched=TRUE;
- LOG(("ConnectToSkypeAPI: Skype process started."));
- // Skype launching iniciated, keep sending Discover messages until it responds.
- continue;
- }
- else
- {
- LOG(("ConnectToSkypeAPI: Check if Skype was launchable.."));
- if (DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "StartSkype", 1) && !(path || UseCustomCommand)) return -1;
- LOG(("Trying to attach: #%d", counter));
- counter++;
- if (counter>=maxattempts && AttachStatus==-1)
- {
- int oldstatus=SkypeStatus;
- InterlockedExchange((long *)&SkypeStatus, (int)ID_STATUS_OFFLINE);
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, SkypeStatus);
- OUTPUT(_T("ERROR: Skype not running / too old / working!"));
- return -1;
- }
- }
- }
- LOG(("Attachstatus %d", AttachStatus));
- } while (AttachStatus==SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE || AttachStatus==SKYPECONTROLAPI_ATTACH_API_AVAILABLE || AttachStatus==-1);
-
- while (AttachStatus==SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION) Sleep(1000);
- LOG(("Attachstatus %d", AttachStatus));
- if (AttachStatus!=SKYPECONTROLAPI_ATTACH_SUCCESS) {
- int oldstatus;
-
- switch(AttachStatus) {
- case SKYPECONTROLAPI_ATTACH_REFUSED:
- OUTPUT(_T("Skype refused the connection :("));
- break;
- case SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE:
- OUTPUT(_T("The Skype API is not available"));
- break;
- default:
- LOG(("ERROR: AttachStatus: %d", AttachStatus));
- OUTPUT(_T("Wheee, Skype won't let me use the API. :("));
- }
- oldstatus=SkypeStatus;
- InterlockedExchange((long *)&SkypeStatus, (int)ID_STATUS_OFFLINE);
- ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) oldstatus, SkypeStatus);
- return -1;
- }
-
- return 0;
-}
-
-/* CloseSkypeAPI
- * Purpose: Closes existing api connection
- * Params: path - Path to the Skype application; could be NULL when using proxy
- * Returns: always 0
- */
-int CloseSkypeAPI(char *skypePath)
-{
- char szAbsolutePath[MAX_PATH];
-
- logoff_contacts(TRUE);
- if (UseSockets)
- {
- if (ClientSocket != INVALID_SOCKET)
- {
- closesocket(ClientSocket);
- ClientSocket = INVALID_SOCKET;
- }
- }
- else {
- if (!pszProxyCallout)
- {
- if (AttachStatus!=-1)
- {
- // it was crashing when the skype-network-proxy is used (imo2sproxy for imo.im) and skype-path is empty
- // now, with the "UseSockets" check and the skypePath[0] != 0 check its fixed
- if (skypePath != NULL && skypePath[0] != 0) {
- TranslateMirandaRelativePathToAbsolute(skypePath, szAbsolutePath, FALSE);
- _spawnl(_P_NOWAIT, szAbsolutePath, szAbsolutePath, "/SHUTDOWN", NULL);
- }
- }
- }
- }
- SkypeInitialized=FALSE;
- ResetEvent(SkypeReady);
- AttachStatus=-1;
- if (g_hWnd) KillTimer (g_hWnd, 1);
- return 0;
-}
-/* ConnectToSkypeAPI
- *
- * Purpose: Establish a connection to the Skype API
- * Params : path - Path to the Skype application
- * Returns: 0 - Connecting succeeded
- * -1 - Something went wrong
- */
-//int __connectAPI(char *path) {
-// int retval;
-//
-// EnterCriticalSection(&ConnectMutex);
-// if (AttachStatus!=-1) {
-// LeaveCriticalSection(&ConnectMutex);
-// return -1;
-// }
-// InterlockedExchange((long *)&SkypeStatus, ID_STATUS_CONNECTING);
-// ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) ID_STATUS_OFFLINE, SkypeStatus);
-// retval=__connectAPI(path);
-// if (retval==-1) {
-// logoff_contacts();
-// InterlockedExchange((long *)&SkypeStatus, ID_STATUS_OFFLINE);
-// ProtoBroadcastAck(SKYPE_PROTONAME, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE) ID_STATUS_CONNECTING, SkypeStatus);
-// }
-// LeaveCriticalSection(&ConnectMutex);
-// return retval;
-//}
diff --git a/plugins/!NotAdopted/Skype/skypeapi.h b/plugins/!NotAdopted/Skype/skypeapi.h deleted file mode 100644 index fa4f5139a1..0000000000 --- a/plugins/!NotAdopted/Skype/skypeapi.h +++ /dev/null @@ -1,69 +0,0 @@ -// Skype API defines
-#define SKYPECONTROLAPI_ATTACH_SUCCESS 0
-#define SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION 1
-#define SKYPECONTROLAPI_ATTACH_REFUSED 2
-#define SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE 3
-#define SKYPECONTROLAPI_ATTACH_API_AVAILABLE 0x8001
-
-#define MISC_ERROR 1
-#define USER_NOT_FOUND 2
-#define USER_NOT_ONLINE 3
-#define USER_BLOCKED 4
-#define TYPE_UNSUPPORTED 5
-#define SENDER_NOT_FRIEND 6
-#define SENDER_NOT_AUTHORIZED 7
-
-#define MAX_ENTRIES 128 // Max. 128 number-Entries in Dial-dlg.
-
-typedef struct {
- int id;
- char *szStat;
-} status_map;
-
-// Prototypes
-int SkypeMsgInit(void);
-int SkypeMsgAdd(char *msg);
-void SkypeMsgCleanup(void);
-char *SkypeMsgGet(void);
-int SkypeSend(char*, ...);
-char *SkypeRcv(char *what, DWORD maxwait);
-char *SkypeRcvTime(char *what, time_t st, DWORD maxwait);
-char *SkypeRcvMsg(char *what, time_t st, HANDLE hContact, DWORD maxwait);
-INT_PTR SkypeCall(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeCallHangup(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeOutCall(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeHup(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeHoldCall(WPARAM wParam, LPARAM lParam);
-void SkypeFlush(void);
-int SkypeStatusToMiranda(char *s);
-char *MirandaStatusToSkype(int id);
-char *GetSkypeErrorMsg(char *str);
-BOOL testfor(char *what, DWORD maxwait);
-int ConnectToSkypeAPI(char *path, BOOL bStart);
-int CloseSkypeAPI(char *skypePath);
-INT_PTR SkypeAdduserDlg(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeAnswerCall(WPARAM wParam, LPARAM lParam);
-int SkypeMsgCollectGarbage(time_t age);
-INT_PTR SkypeSendFile(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeSetAvatar(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeSetAwayMessage(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeSetAwayMessageW(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeSetNick(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeChatCreate(WPARAM wParam, LPARAM lParam);
-int SkypeSetProfile(char *szProperty, char *szValue);
-char *SkypeGet(char *szWhat, char *szWho, char *szProperty);
-char *SkypeGetID(char *szWhat, char *szWho, char *szProperty);
-char *SkypeGetErr(char *szWhat, char *szWho, char *szProperty);
-#ifdef _UNICODE
-WCHAR *SkypeGetW(char *szWhat, WCHAR *szWho, char *szProperty);
-WCHAR *SkypeGetErrW(char *szWhat, TCHAR *szWho, char *szProperty);
-#define SkypeGetT SkypeGetW
-#define SkypeGetErrT SkypeGetErrW
-#else
-#define SkypeGetT SkypeGet
-#define SkypeGetErrT SkypeGetErr
-#endif
-char *SkypeGetProfile(char *szProperty);
-void SetUserNamePassword();
-INT_PTR SkypeAdduserDlg(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeReceivedAPIMessage(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/!NotAdopted/Skype/skypeopt.c b/plugins/!NotAdopted/Skype/skypeopt.c deleted file mode 100755 index 5c2795549b..0000000000 --- a/plugins/!NotAdopted/Skype/skypeopt.c +++ /dev/null @@ -1,969 +0,0 @@ -#include "skype.h"
-#include "skypeopt.h"
-#include "pthread.h"
-#include "gchat.h"
-#include "skypeprofile.h"
-#if(WINVER >= 0x0500)
-#include "uxtheme.h"
-#define HAVE_UXTHEMES
-#endif
-
-#ifdef SKYPE_AUTO_DETECTION
-#include "ezxml/ezxml.c"
-#endif
-
-#ifdef UNICODE
-#include "utf8.h"
-#endif
-
-#pragma warning (disable: 4706) // assignment within conditional expression
-
-// VC6 SDK defines
-#ifndef BIF_SHAREABLE
-#define BIF_SHAREABLE 0x8000 // sharable resources displayed (remote shares, requires BIF_USENEWUI)
-#endif
-#ifndef BIF_NEWDIALOGSTYLE
-#define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with the ability to resize
-#endif // Caller needs to call OleInitialize() before using this API
-#ifndef BIF_NONEWFOLDERBUTTON
-#define BIF_NONEWFOLDERBUTTON 0x0200 // Do not add the "New Folder" button to the dialog. Only applicable with BIF_NEWDIALOGSTYLE.
-#endif
-
-
-extern HINSTANCE hInst;
-extern PLUGININFOEX pluginInfo;
-extern char protocol, g_szProtoName[];
-extern BOOL SkypeInitialized, bProtocolSet, bIsImoproxy;
-extern DWORD mirandaVersion;
-
-BOOL showPopup, showPopupErr, popupWindowColor, popupWindowColorErr;
-unsigned int popupBackColor, popupBackColorErr;
-unsigned int popupTextColor, popupTextColorErr;
-int popupTimeSec, popupTimeSecErr;
-POPUPDATAT InCallPopup;
-POPUPDATAT ErrorPopup;
-
-static SkypeProfile myProfile;
-static HBITMAP hAvatar = NULL;
-
-extern BOOL PopupServiceExists;
-extern BOOL (WINAPI *MyEnableThemeDialogTexture)(HANDLE, DWORD);
-
-int RegisterOptions(WPARAM wParam, LPARAM lParam) {
- OPTIONSDIALOGPAGE odp;
-
- UNREFERENCED_PARAMETER(lParam);
-
- ZeroMemory(&odp, sizeof(odp));
- odp.cbSize = sizeof(odp);
- odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.pszGroup = "Network";
- odp.pszTitle = SKYPE_PROTONAME;
- odp.pfnDlgProc = OptionsDlgProc;
- odp.flags = ODPF_BOLDGROUPS;
- Options_AddPage(wParam, &odp);
-
- if(PopupServiceExists)
- {
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP);
- odp.pszGroup = "Popups";
- odp.pfnDlgProc = OptPopupDlgProc;
- Options_AddPage(wParam, &odp);
- }
-
- return 0;
-}
-
-INT_PTR CALLBACK OptPopupDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- static RECT r;
-
- switch ( msg )
- {
- case WM_INITDIALOG:
- TranslateDialogDefault( hwnd );
- // Message Popup
- popupTimeSec = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupTimeSec", 4);
- popupTextColor = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupTextColor", GetSysColor(COLOR_WINDOWTEXT));
- popupBackColor = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupBackColor", GetSysColor(COLOR_BTNFACE));
- popupWindowColor = DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "popupWindowColor", FALSE);
- showPopup = DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "showPopup", TRUE);
- // ERROR Message Popup
- popupTimeSecErr = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupTimeSecErr", 4);
- popupTextColorErr = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupTextColorErr", GetSysColor(COLOR_WINDOWTEXT));
- popupBackColorErr = DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "popupBackColorErr", GetSysColor(COLOR_BTNFACE));
- popupWindowColorErr = DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "popupWindowColorErr", FALSE);
- showPopupErr = DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "showPopupErr", TRUE);
-
- EnableWindow(GetDlgItem(hwnd,IDC_USEWINCOLORS),showPopup);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPBACKCOLOR),showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPBACKCOLOR),showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPTEXTCOLOR),showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPTEXTCOLOR),showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPTIME),showPopup);
- EnableWindow(GetDlgItem(hwnd,IDC_PREVIEW),showPopup);
- EnableWindow(GetDlgItem(hwnd,IDC_USEWINCOLORSERR),showPopupErr);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPBACKCOLORERR),showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPBACKCOLORERR),showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPTEXTCOLORERR),showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPTEXTCOLORERR),showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPTIMEERR),showPopupErr);
- EnableWindow(GetDlgItem(hwnd,IDC_PREVIEWERR),showPopupErr);
- CheckDlgButton(hwnd, IDC_POPUPINCOMING, (WPARAM) showPopup);
- CheckDlgButton(hwnd, IDC_USEWINCOLORS, (WPARAM) popupWindowColor);
- CheckDlgButton(hwnd, IDC_POPUPERROR, (WPARAM) showPopupErr);
- CheckDlgButton(hwnd, IDC_USEWINCOLORSERR, (WPARAM) popupWindowColorErr);
- SendDlgItemMessage(hwnd, IDC_POPUPTIME, EM_SETLIMITTEXT, 3, 0L);
- SetDlgItemInt(hwnd, IDC_POPUPTIME, popupTimeSec,FALSE);
- SendDlgItemMessage(hwnd, IDC_POPUPTIMEERR, EM_SETLIMITTEXT, 3, 0L);
- SetDlgItemInt(hwnd, IDC_POPUPTIMEERR, popupTimeSecErr,FALSE);
- SendDlgItemMessage(hwnd, IDC_POPUPBACKCOLOR, CPM_SETCOLOUR,0, popupBackColor);
- SendDlgItemMessage(hwnd, IDC_POPUPBACKCOLOR, CPM_SETDEFAULTCOLOUR, 0, GetSysColor(COLOR_BTNFACE));
- SendDlgItemMessage(hwnd, IDC_POPUPTEXTCOLOR, CPM_SETCOLOUR,0, popupTextColor);
- SendDlgItemMessage(hwnd, IDC_POPUPTEXTCOLOR, CPM_SETDEFAULTCOLOUR, 0, GetSysColor(COLOR_WINDOWTEXT));
- SendDlgItemMessage(hwnd, IDC_POPUPBACKCOLORERR, CPM_SETCOLOUR,0, popupBackColorErr);
- SendDlgItemMessage(hwnd, IDC_POPUPBACKCOLORERR, CPM_SETDEFAULTCOLOUR, 0, GetSysColor(COLOR_BTNFACE));
- SendDlgItemMessage(hwnd, IDC_POPUPTEXTCOLORERR, CPM_SETCOLOUR,0, popupTextColorErr);
- SendDlgItemMessage(hwnd, IDC_POPUPTEXTCOLORERR, CPM_SETDEFAULTCOLOUR, 0, GetSysColor(COLOR_WINDOWTEXT));
-
-
- return TRUE;
- break;
-
- case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom)
- {
- case 0:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- DBWriteContactSettingDword(NULL, SKYPE_PROTONAME, "popupBackColor", popupBackColor);
- DBWriteContactSettingDword(NULL, SKYPE_PROTONAME, "popupTextColor", popupTextColor);
- DBWriteContactSettingDword(NULL, SKYPE_PROTONAME, "popupTimeSec", popupTimeSec);
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "popupWindowColor", (BYTE)popupWindowColor);
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "showPopup", (BYTE)showPopup);
- DBWriteContactSettingDword(NULL, SKYPE_PROTONAME, "popupBackColorErr", popupBackColorErr);
- DBWriteContactSettingDword(NULL, SKYPE_PROTONAME, "popupTextColorErr", popupTextColorErr);
- DBWriteContactSettingDword(NULL, SKYPE_PROTONAME, "popupTimeSecErr", popupTimeSecErr);
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "popupWindowColorErr", (BYTE)popupWindowColorErr);
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "showPopupErr", (BYTE)showPopupErr);
- break;
- }
- }
- break;
-
-
-
- case WM_COMMAND:
- switch( LOWORD( wParam ))
- {
- case IDC_PREVIEW:
- {
- HANDLE hContact;
- TCHAR * lpzContactName;
-
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST,0,0);
- lpzContactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR);
- InCallPopup.lchContact = hContact;
- InCallPopup.lchIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALL));
- InCallPopup.colorBack = ! popupWindowColor ? popupBackColor : GetSysColor(COLOR_BTNFACE);
- InCallPopup.colorText = ! popupWindowColor ? popupTextColor : GetSysColor(COLOR_WINDOWTEXT);
- InCallPopup.iSeconds = popupTimeSec;
- InCallPopup.PluginData = (void *)1;
-
- lstrcpy(InCallPopup.lptzText, TranslateT("Incoming Skype Call"));
-
- lstrcpy(InCallPopup.lptzContactName, lpzContactName);
-
- CallService(MS_POPUP_ADDPOPUPT,(WPARAM)&InCallPopup,0);
-
-
- break;
- }
- case IDC_PREVIEWERR:
- ErrorPopup.lchContact = NULL;
- ErrorPopup.lchIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_CALL));
- ErrorPopup.colorBack = ! popupWindowColorErr ? popupBackColorErr : GetSysColor(COLOR_BTNFACE);
- ErrorPopup.colorText = ! popupWindowColorErr ? popupTextColorErr : GetSysColor(COLOR_WINDOWTEXT);
- ErrorPopup.iSeconds = popupTimeSecErr;
- ErrorPopup.PluginData = (void *)1;
-
- lstrcpy(ErrorPopup.lptzText, TranslateT("Preview Error Message"));
-
- lstrcpy(ErrorPopup.lptzContactName, _T("Error Message"));
-
-
- CallService(MS_POPUP_ADDPOPUPT,(WPARAM)&ErrorPopup,0);
-
- break;
-
- case IDC_POPUPTIME:
- case IDC_POPUPTIMEERR:
- {
- BOOL Translated;
- popupTimeSec = GetDlgItemInt(hwnd,IDC_POPUPTIME,&Translated,FALSE);
- popupTimeSecErr = GetDlgItemInt(hwnd,IDC_POPUPTIMEERR,&Translated,FALSE);
- SendMessage(GetParent(hwnd),PSM_CHANGED,0,0);
- break;
- }
- case IDC_POPUPTEXTCOLOR:
- case IDC_POPUPBACKCOLOR:
- case IDC_POPUPTEXTCOLORERR:
- case IDC_POPUPBACKCOLORERR:
- popupBackColor = SendDlgItemMessage(hwnd,IDC_POPUPBACKCOLOR,CPM_GETCOLOUR,0,0);
- popupTextColor = SendDlgItemMessage(hwnd,IDC_POPUPTEXTCOLOR,CPM_GETCOLOUR,0,0);
- popupBackColorErr = SendDlgItemMessage(hwnd,IDC_POPUPBACKCOLORERR,CPM_GETCOLOUR,0,0);
- popupTextColorErr = SendDlgItemMessage(hwnd,IDC_POPUPTEXTCOLORERR,CPM_GETCOLOUR,0,0);
- SendMessage(GetParent(hwnd),PSM_CHANGED,0,0);
- break;
- case IDC_USEWINCOLORS:
- popupWindowColor = (IsDlgButtonChecked(hwnd,IDC_USEWINCOLORS)==BST_CHECKED);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPBACKCOLOR), showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPBACKCOLOR), showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPTEXTCOLOR), showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPTEXTCOLOR), showPopup && ! popupWindowColor);
- SendMessage(GetParent(hwnd),PSM_CHANGED,0,0);
- break;
- case IDC_POPUPINCOMING:
- showPopup = (IsDlgButtonChecked(hwnd,IDC_POPUPINCOMING)==BST_CHECKED);
- EnableWindow(GetDlgItem(hwnd,IDC_USEWINCOLORS),showPopup);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPBACKCOLOR),showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPBACKCOLOR),showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPTEXTCOLOR),showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPTEXTCOLOR),showPopup && ! popupWindowColor);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPTIME),showPopup);
- EnableWindow(GetDlgItem(hwnd,IDC_PREVIEW),showPopup);
- SendMessage(GetParent(hwnd),PSM_CHANGED,0,0);
- break;
- case IDC_USEWINCOLORSERR:
- popupWindowColorErr = (IsDlgButtonChecked(hwnd,IDC_USEWINCOLORSERR)==BST_CHECKED);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPBACKCOLORERR), showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPBACKCOLORERR), showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPTEXTCOLORERR), showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPTEXTCOLORERR), showPopupErr && ! popupWindowColorErr);
- SendMessage(GetParent(hwnd),PSM_CHANGED,0,0);
- break;
- case IDC_POPUPERROR:
- showPopupErr = (IsDlgButtonChecked(hwnd,IDC_POPUPERROR)==BST_CHECKED);
- EnableWindow(GetDlgItem(hwnd,IDC_USEWINCOLORSERR),showPopupErr);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPBACKCOLORERR),showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPBACKCOLORERR),showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPTEXTCOLORERR),showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_STATIC_POPUPTEXTCOLORERR),showPopupErr && ! popupWindowColorErr);
- EnableWindow(GetDlgItem(hwnd,IDC_POPUPTIMEERR),showPopupErr);
- EnableWindow(GetDlgItem(hwnd,IDC_PREVIEWERR),showPopupErr);
- SendMessage(GetParent(hwnd),PSM_CHANGED,0,0);
- break;
- }
-
- break;
-
- case WM_DESTROY:
- break;
- }
-
- return 0;
-}
-
-INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- static int iInit = TRUE;
-
- UNREFERENCED_PARAMETER(wParam);
-
- switch(msg)
- {
- case WM_INITDIALOG:
- {
- TCITEM tci;
- RECT rcClient;
- GetClientRect(hwnd, &rcClient);
-
- iInit = TRUE;
- tci.mask = TCIF_PARAM|TCIF_TEXT;
- tci.lParam = (LPARAM)CreateDialog(hInst,MAKEINTRESOURCE(IDD_OPT_DEFAULT), hwnd, OptionsDefaultDlgProc);
- tci.pszText = TranslateT("Skype default");
- TabCtrl_InsertItem(GetDlgItem(hwnd, IDC_OPTIONSTAB), 0, &tci);
- MoveWindow((HWND)tci.lParam,1,28,rcClient.right-5,rcClient.bottom-31,1);
-#ifdef HAVE_UXTHEMES
- if(MyEnableThemeDialogTexture)
- MyEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
-#endif
-
- tci.lParam = (LPARAM)CreateDialog(hInst,MAKEINTRESOURCE(IDD_OPT_ADVANCED),hwnd,OptionsAdvancedDlgProc);
- tci.pszText = TranslateT("Skype advanced");
- TabCtrl_InsertItem(GetDlgItem(hwnd, IDC_OPTIONSTAB), 1, &tci);
- MoveWindow((HWND)tci.lParam,1,28,rcClient.right-5,rcClient.bottom-31,1);
- ShowWindow((HWND)tci.lParam, SW_HIDE);
-#ifdef HAVE_UXTHEMES
- if(MyEnableThemeDialogTexture)
- MyEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
-#endif
-
- tci.lParam = (LPARAM)CreateDialog(hInst,MAKEINTRESOURCE(IDD_OPT_PROXY),hwnd,OptionsProxyDlgProc);
- tci.pszText = TranslateT("Skype proxy");
- TabCtrl_InsertItem(GetDlgItem(hwnd, IDC_OPTIONSTAB), 2, &tci);
- MoveWindow((HWND)tci.lParam,1,28,rcClient.right-5,rcClient.bottom-31,1);
- ShowWindow((HWND)tci.lParam, SW_HIDE);
-#ifdef HAVE_UXTHEMES
- if(MyEnableThemeDialogTexture)
- MyEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
-#endif
-
- iInit = FALSE;
- return FALSE;
- }
-
- case PSM_CHANGED: // used so tabs dont have to call SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
- if(!iInit)
- SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0);
- break;
- case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- TCITEM tci;
- int i,count;
- tci.mask = TCIF_PARAM;
- count = TabCtrl_GetItemCount(GetDlgItem(hwnd,IDC_OPTIONSTAB));
- for (i=0;i<count;i++)
- {
- TabCtrl_GetItem(GetDlgItem(hwnd,IDC_OPTIONSTAB),i,&tci);
- SendMessage((HWND)tci.lParam,WM_NOTIFY,0,lParam);
- }
- }
- break;
- }
- break;
- case IDC_OPTIONSTAB:
- switch (((LPNMHDR)lParam)->code)
- {
- case TCN_SELCHANGING:
- {
- TCITEM tci;
- tci.mask = TCIF_PARAM;
- TabCtrl_GetItem(GetDlgItem(hwnd,IDC_OPTIONSTAB),TabCtrl_GetCurSel(GetDlgItem(hwnd,IDC_OPTIONSTAB)),&tci);
- ShowWindow((HWND)tci.lParam,SW_HIDE);
- }
- break;
- case TCN_SELCHANGE:
- {
- TCITEM tci;
- tci.mask = TCIF_PARAM;
- TabCtrl_GetItem(GetDlgItem(hwnd,IDC_OPTIONSTAB),TabCtrl_GetCurSel(GetDlgItem(hwnd,IDC_OPTIONSTAB)),&tci);
- ShowWindow((HWND)tci.lParam,SW_SHOW);
- }
- break;
- }
- break;
-
- }
- break;
- }
- return FALSE;
-}
-
-INT_PTR CALLBACK OptionsProxyDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
- const int Skype2SocketControls[]={ IDC_STATIC_HOST, IDC_HOST, IDC_STATIC_PORT, IDC_PORT, IDC_REQPASS, IDC_PASSWORD, IDC_STATIC_RESTART };
- static BOOL initDlg=FALSE;
- DBVARIANT dbv;
- int i;
-
- switch (uMsg){
- case WM_INITDIALOG:
- initDlg=TRUE;
- TranslateDialogDefault(hwndDlg);
- if (!DBGetContactSettingString(NULL, SKYPE_PROTONAME, "Host", &dbv)) {
- SetDlgItemTextA(hwndDlg, IDC_HOST, dbv.pszVal);
- DBFreeVariant(&dbv);
- } else SetDlgItemText(hwndDlg, IDC_HOST, _T("localhost"));
- SendDlgItemMessage(hwndDlg, IDC_PORT, EM_SETLIMITTEXT, 5, 0L);
- SetDlgItemInt(hwndDlg, IDC_PORT, DBGetContactSettingWord(NULL, SKYPE_PROTONAME, "Port", 1401), FALSE);
- CheckDlgButton(hwndDlg, IDC_REQPASS, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "RequiresPassword", 0));
- CheckDlgButton(hwndDlg, IDC_USES2S, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseSkype2Socket", 0));
- if (!DBGetContactSettingString(NULL, SKYPE_PROTONAME, "Password", &dbv)) {
- CallService(MS_DB_CRYPT_DECODESTRING, strlen(dbv.pszVal)+1, (LPARAM)dbv.pszVal);
- SetDlgItemTextA(hwndDlg, IDC_PASSWORD, dbv.pszVal);
- DBFreeVariant(&dbv);
- }
- SendMessage(hwndDlg, WM_COMMAND, IDC_USES2S, 0);
- SendMessage(hwndDlg, WM_COMMAND, IDC_REQPASS, 0);
- initDlg=FALSE;
- return TRUE;
- case WM_NOTIFY: {
- NMHDR* nmhdr = (NMHDR*)lParam;
-
- switch (nmhdr->code){
- case PSN_APPLY:
- case PSN_KILLACTIVE:
- {
- char buf[1024];
- GetDlgItemTextA(hwndDlg, IDC_HOST, buf, sizeof(buf));
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "Host", buf);
- DBWriteContactSettingWord(NULL, SKYPE_PROTONAME, "Port", (unsigned short)GetDlgItemInt(hwndDlg, IDC_PORT, NULL, FALSE));
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "RequiresPassword", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_REQPASS), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "UseSkype2Socket", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_USES2S), BM_GETCHECK,0,0)));
- ZeroMemory(buf, sizeof(buf));
- GetDlgItemTextA(hwndDlg, IDC_PASSWORD, buf, sizeof(buf));
- CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(buf), (LPARAM)buf);
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "Password", buf);
- return TRUE;
- }
- }
- break;
- }
- case WM_COMMAND: {
- switch (LOWORD(wParam)) {
- case IDC_USES2S:
- for (i=0; i<sizeof(Skype2SocketControls)/sizeof(Skype2SocketControls[0]); i++) EnableWindow(GetDlgItem(hwndDlg, Skype2SocketControls[i]), SendMessage(GetDlgItem(hwndDlg, LOWORD(wParam)), BM_GETCHECK,0,0));
- if (SendMessage(GetDlgItem(hwndDlg, LOWORD(wParam)), BM_GETCHECK,0,0)) SendMessage(hwndDlg, WM_COMMAND, IDC_REQPASS, 0);
- break;
- case IDC_REQPASS:
- EnableWindow(GetDlgItem(hwndDlg, IDC_PASSWORD), SendMessage(GetDlgItem(hwndDlg, LOWORD(wParam)), BM_GETCHECK,0,0));
- break;
-
- }
- if (!initDlg) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- return 0;
-}
-
-INT_PTR CALLBACK OptionsAdvancedDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
- static BOOL initDlg=FALSE;
- static int statusModes[]={ID_STATUS_OFFLINE,ID_STATUS_ONLINE,ID_STATUS_AWAY,ID_STATUS_NA,ID_STATUS_OCCUPIED,ID_STATUS_DND,ID_STATUS_FREECHAT,ID_STATUS_INVISIBLE,ID_STATUS_OUTTOLUNCH,ID_STATUS_ONTHEPHONE};
- int i, j;
-
- switch (uMsg){
- case WM_INITDIALOG:
- initDlg=TRUE;
-
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_ENABLEMENU, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "EnableMenu", 1));
- CheckDlgButton(hwndDlg, IDC_NOERRORS, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "SuppressErrors", 0));
- CheckDlgButton(hwndDlg, IDC_KEEPSTATE, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "KeepState", 0));
- CheckDlgButton(hwndDlg, IDC_TIMEZONE, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseTimeZonePatch", 0));
- CheckDlgButton(hwndDlg, IDC_IGNTZ, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "IgnoreTimeZones", 0));
- CheckDlgButton(hwndDlg, IDC_SHOWDEFAULTAVATAR, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "ShowDefaultSkypeAvatar", 0));
- CheckDlgButton(hwndDlg, IDC_SUPPRESSCALLSUMMARYMESSAGE, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "SuppressCallSummaryMessage", 1));
- CheckDlgButton(hwndDlg, IDC_NOSKYPE3STATS, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "NoSkype3Stats", 0));
- CheckDlgButton(hwndDlg, IDC_SHOWFULLNAME, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "ShowFullname", 1));
-
- if (ServiceExists(MS_GC_NEWSESSION) && (!bProtocolSet || protocol>=5)) {
- CheckDlgButton(hwndDlg, IDC_GROUPCHAT, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseGroupchat", 0));
- CheckDlgButton(hwndDlg, IDC_GROUPCHATREAD, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "MarkGroupchatRead", 0));
- } else {
- EnableWindow(GetDlgItem(hwndDlg, IDC_GROUPCHAT), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_GROUPCHATREAD), FALSE);
- }
-
-#ifdef USEPOPUP
- if (ServiceExists(MS_POPUP_ADDPOPUP))
- CheckDlgButton(hwndDlg, IDC_USEPOPUP, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UsePopup", 0));
- else
-#endif
- EnableWindow(GetDlgItem(hwndDlg, IDC_USEPOPUP), FALSE);
-
- j=DBGetContactSettingDword(NULL, SKYPE_PROTONAME, "SkypeOutStatusMode", ID_STATUS_ONTHEPHONE);
- for(i=0;i<sizeof(statusModes)/sizeof(statusModes[0]);i++) {
- int k;
-
- k=SendDlgItemMessage(hwndDlg,IDC_SKYPEOUTSTAT,CB_ADDSTRING,0,(LPARAM)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,statusModes[i], GSMDF_TCHAR));
- SendDlgItemMessage(hwndDlg,IDC_SKYPEOUTSTAT,CB_SETITEMDATA,k,statusModes[i]);
- if (statusModes[i]==j) SendDlgItemMessage(hwndDlg,IDC_SKYPEOUTSTAT,CB_SETCURSEL,i,0);
- }
- initDlg=FALSE;
- return TRUE;
-
- case WM_NOTIFY: {
- NMHDR* nmhdr = (NMHDR*)lParam;
-
- switch (nmhdr->code){
- case PSN_APPLY:
- case PSN_KILLACTIVE:
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "EnableMenu", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_ENABLEMENU), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "UsePopup", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_USEPOPUP), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "UseGroupchat", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_GROUPCHAT), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "MarkGroupchatRead", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_GROUPCHATREAD), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "SuppressErrors", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_NOERRORS), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "KeepState", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_KEEPSTATE), BM_GETCHECK,0,0)));
- DBWriteContactSettingDword(NULL, SKYPE_PROTONAME, "SkypeOutStatusMode", SendDlgItemMessage(hwndDlg,IDC_SKYPEOUTSTAT,CB_GETITEMDATA,SendDlgItemMessage(hwndDlg,IDC_SKYPEOUTSTAT,CB_GETCURSEL,0,0),0));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "UseTimeZonePatch", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_TIMEZONE), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "IgnoreTimeZones", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_IGNTZ), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "ShowDefaultSkypeAvatar", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_SHOWDEFAULTAVATAR), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "SuppressCallSummaryMessage", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_SUPPRESSCALLSUMMARYMESSAGE), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "NoSkype3Stats", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_NOSKYPE3STATS), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "ShowFullname", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_SHOWFULLNAME), BM_GETCHECK,0,0)));
- return TRUE;
- }
- break;
- }
- case WM_COMMAND: {
- switch (LOWORD(wParam)) {
- case IDC_CLEANUP:
- forkthread(( pThreadFunc )CleanupNicknames, 0, NULL);
- break;
- }
- if (!initDlg) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- return 0;
-}
-
-static int CALLBACK BrowseCallbackProc(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
-{
- UNREFERENCED_PARAMETER(lParam);
-
- switch (uMsg)
- {
- case BFFM_INITIALIZED:
- {
- // Set initial directory.
-#ifdef UNICODE
- wchar_t* wszInitFolder = make_unicode_string((const unsigned char*)lpData);
- SendMessage(hWnd, BFFM_SETSELECTION, TRUE, (LPARAM)wszInitFolder);
- free(wszInitFolder);
-#else
- SendMessage(hWnd, BFFM_SETSELECTION, TRUE, lpData);
-#endif
- break;
- }
- }
- return 0;
-}
-
-INT_PTR CALLBACK OptionsDefaultDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
- static BOOL initDlg=FALSE;
- static int skypeLaunchControls[]={IDC_NOSPLASH,IDC_MINIMIZED,IDC_NOTRAY,IDC_REMOVEABLE,IDC_SECONDARY,IDC_DATAPATHO,IDC_CUSTOMCOMMAND,IDC_STATIC_PATHINFO};
-
- switch (uMsg){
- case WM_INITDIALOG:
- {
- DBVARIANT dbv;
- BOOL startSkype;
- int i;
-
- initDlg=TRUE;
- TranslateDialogDefault(hwndDlg);
-
- startSkype=DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "StartSkype", 1);
-
- CheckDlgButton(hwndDlg, IDC_STARTSKYPE, (BYTE)startSkype);
- CheckDlgButton(hwndDlg, IDC_NOSPLASH, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "nosplash", 1));
- CheckDlgButton(hwndDlg, IDC_MINIMIZED, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "minimized", 1));
- CheckDlgButton(hwndDlg, IDC_NOTRAY, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "notray", 0));
- CheckDlgButton(hwndDlg, IDC_REMOVEABLE, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "removable", 0));
- CheckDlgButton(hwndDlg, IDC_SECONDARY, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "secondary", 0));
- CheckDlgButton(hwndDlg, IDC_DATAPATHO, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "datapath:", 0));
- CheckDlgButton(hwndDlg, IDC_SHUTDOWN, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "Shutdown", 0));
- CheckDlgButton(hwndDlg, IDC_UNLOADOFFLINE, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UnloadOnOffline", 0));
-
- CheckDlgButton(hwndDlg, IDC_CUSTOMCOMMAND, (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "UseCustomCommand", 0));
- SendDlgItemMessage(hwndDlg, IDC_COMMANDLINE, EM_SETLIMITTEXT, MAX_PATH-1, 0L);
- if(!DBGetContactSettingString(NULL,SKYPE_PROTONAME,"CommandLine",&dbv))
- {
- SetWindowTextA(GetDlgItem(hwndDlg, IDC_COMMANDLINE), dbv.pszVal);
- DBFreeVariant(&dbv);
- }
-
- SendDlgItemMessage(hwndDlg, IDC_DATAPATH, EM_SETLIMITTEXT, MAX_PATH-1, 0L);
- if(!DBGetContactSettingString(NULL,SKYPE_PROTONAME,"datapath",&dbv))
- {
- SetWindowTextA(GetDlgItem(hwndDlg, IDC_DATAPATH), dbv.pszVal);
- DBFreeVariant(&dbv);
- }
-
- for(i=0; i < sizeof(skypeLaunchControls)/sizeof(skypeLaunchControls[0]); i++)
- EnableWindow(GetDlgItem(hwndDlg, skypeLaunchControls[i]), startSkype);
-
- EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSECMDL), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0));
- EnableWindow(GetDlgItem(hwndDlg, IDC_COMMANDLINE), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0));
-
- EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSEDP), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0));
- EnableWindow(GetDlgItem(hwndDlg, IDC_DATAPATH), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0));
-
- // LoginUserName
- if(!DBGetContactSettingWString(NULL,SKYPE_PROTONAME,"LoginUserName",&dbv))
- {
- SetWindowTextW(GetDlgItem(hwndDlg, IDC_USERNAME), dbv.pwszVal);
- DBFreeVariant(&dbv);
- }
-
- // LoginPassword
- if(!DBGetContactSettingWString(NULL,SKYPE_PROTONAME,"LoginPassword",&dbv))
- {
- SetWindowTextW(GetDlgItem(hwndDlg, IDC_PASSWORD), dbv.pwszVal);
- DBFreeVariant(&dbv);
- }
-
- SendDlgItemMessage(hwndDlg, IDC_CONNATTEMPTS, EM_SETLIMITTEXT, 3, 0L);
- SetDlgItemInt (hwndDlg, IDC_CONNATTEMPTS, DBGetContactSettingWord(NULL, SKYPE_PROTONAME, "ConnectionAttempts", 10), FALSE);
- SendMessage(hwndDlg, WM_COMMAND, IDC_STARTSKYPE, 0);
- initDlg=FALSE;
- return TRUE;
- }
- case WM_NOTIFY: {
- NMHDR* nmhdr = (NMHDR*)lParam;
-
- switch (nmhdr->code){
- case PSN_APPLY:
- case PSN_KILLACTIVE:
- {
- char text[500];
- WCHAR wtext[500];
- char szRelativePath[MAX_PATH];
-
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "StartSkype", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_STARTSKYPE), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "nosplash", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_NOSPLASH), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "minimized", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_MINIMIZED), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "notray", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_NOTRAY), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "Shutdown", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_SHUTDOWN), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "UnloadOnOffline", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_UNLOADOFFLINE), BM_GETCHECK,0,0)));
- DBWriteContactSettingWord (NULL, SKYPE_PROTONAME, "ConnectionAttempts", (unsigned short)GetDlgItemInt(hwndDlg, IDC_CONNATTEMPTS, NULL, FALSE));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "UseCustomCommand", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "datapath:", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "removable", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_REMOVEABLE), BM_GETCHECK,0,0)));
- DBWriteContactSettingByte (NULL, SKYPE_PROTONAME, "secondary", (BYTE)(SendMessage(GetDlgItem(hwndDlg, IDC_SECONDARY), BM_GETCHECK,0,0)));
-
- GetDlgItemTextA(hwndDlg,IDC_COMMANDLINE,text,sizeof(text));
- strncpy(szRelativePath, text, sizeof(szRelativePath)-1);
- CallService (MS_UTILS_PATHTORELATIVE, (WPARAM)text, (LPARAM)szRelativePath);
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "CommandLine", szRelativePath);
-
- GetDlgItemTextA(hwndDlg,IDC_DATAPATH,text,sizeof(text));
- strncpy(szRelativePath, text, sizeof(szRelativePath)-1);
- CallService (MS_UTILS_PATHTORELATIVE, (WPARAM)text, (LPARAM)szRelativePath);
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "datapath", szRelativePath);
-
- // LoginUserName
- GetDlgItemTextW(hwndDlg,IDC_USERNAME,wtext,sizeof(wtext)/sizeof(WCHAR));
- DBWriteContactSettingWString(NULL, SKYPE_PROTONAME, "LoginUserName", wtext);
-
- // LoginPassword
- GetDlgItemTextW(hwndDlg,IDC_PASSWORD,wtext,sizeof(wtext)/sizeof(WCHAR));
- DBWriteContactSettingWString(NULL, SKYPE_PROTONAME, "LoginPassword", wtext);
-
- return TRUE;
- }
- }
- break;
- }
- case WM_COMMAND: {
- switch (LOWORD(wParam)) {
- BOOL startSkype;
- int i;
- case IDC_STARTSKYPE:
- startSkype=SendMessage(GetDlgItem(hwndDlg, IDC_STARTSKYPE), BM_GETCHECK,0,0);
-
- for(i=0; i < sizeof(skypeLaunchControls)/sizeof(skypeLaunchControls[0]); i++)
- EnableWindow(GetDlgItem(hwndDlg, skypeLaunchControls[i]), startSkype);
-
- EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSECMDL), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0));
- EnableWindow(GetDlgItem(hwndDlg, IDC_COMMANDLINE), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0));
-
- EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSEDP), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0));
- EnableWindow(GetDlgItem(hwndDlg, IDC_DATAPATH), startSkype && SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0));
- break;
- case IDC_CLEANUP:
- forkthread(( pThreadFunc )CleanupNicknames, 0, NULL);
- break;
- case IDC_DATAPATHO:
- EnableWindow(GetDlgItem(hwndDlg, IDC_DATAPATH), SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0));
- EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSEDP), SendMessage(GetDlgItem(hwndDlg, IDC_DATAPATHO), BM_GETCHECK,0,0));
- break;
- case IDC_CUSTOMCOMMAND:
- EnableWindow(GetDlgItem(hwndDlg, IDC_COMMANDLINE), SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0));
- EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSECMDL), SendMessage(GetDlgItem(hwndDlg, IDC_CUSTOMCOMMAND), BM_GETCHECK,0,0));
- break;
- case IDC_BROWSECMDL:
- {
- OPENFILENAMEA ofn={0};
- BOOL gofnResult;
- char szFileName[MAX_PATH];
- char szAbsolutePath[MAX_PATH];
-
- ofn.lStructSize=sizeof(ofn);
- ofn.hwndOwner=hwndDlg;
- ofn.lpstrFilter="Executable files (*.exe)\0*.exe\0All files (*.*)\0*.*\0";
- ofn.nMaxFile=sizeof(szFileName);
- ofn.lpstrDefExt="exe";
- ofn.lpstrFile=szFileName;
- ofn.Flags=OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_ENABLESIZING;
-
- GetDlgItemTextA(hwndDlg,IDC_COMMANDLINE,szFileName,sizeof(szFileName));
- TranslateMirandaRelativePathToAbsolute(szFileName, szAbsolutePath, FALSE);
- strcpy (szFileName, szAbsolutePath);
-
- if (!(gofnResult = GetOpenFileNameA(&ofn)) && CommDlgExtendedError() == FNERR_INVALIDFILENAME){
- strcpy(szFileName, ".\\Skype.exe");
- TranslateMirandaRelativePathToAbsolute(szFileName, szAbsolutePath, FALSE);
- strcpy (szFileName, szAbsolutePath);
- gofnResult = GetOpenFileNameA(&ofn);
- }
-
- if(gofnResult)
- SetWindowTextA(GetDlgItem(hwndDlg, IDC_COMMANDLINE), szFileName);
-
- break;
- }
- case IDC_BROWSEDP:
- {
- BROWSEINFOA bi={0};
- LPITEMIDLIST pidl;
- char szFileName[MAX_PATH];
- char szAbsolutePath[MAX_PATH];
-
- GetDlgItemTextA (hwndDlg, IDC_DATAPATH, szFileName, MAX_PATH);
-
- TranslateMirandaRelativePathToAbsolute(szFileName, szAbsolutePath, FALSE);
- bi.hwndOwner = hwndDlg;
- bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_SHAREABLE | BIF_NEWDIALOGSTYLE | BIF_NONEWFOLDERBUTTON;
- bi.lpfn = BrowseCallbackProc;
- bi.lParam = (LPARAM)szAbsolutePath;
-
- if ( (pidl = SHBrowseForFolderA (&bi)) ) {
- if (SHGetPathFromIDListA (pidl, szFileName))
- SetDlgItemTextA (hwndDlg, IDC_DATAPATH, szFileName);
- CoTaskMemFree (pidl);
- }
- break;
- }
-
-#ifdef SKYPE_AUTO_DETECTION
- case IDC_AUTODETECTION:
- DoAutoDetect(hwndDlg);
- break;
-#endif
- }
- if (!initDlg) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- }
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-// OnDetailsInit - initializes user info dialog pages.
-
-int OnDetailsInit( WPARAM wParam, LPARAM lParam )
-{
- OPTIONSDIALOGPAGE odp = {0};
- HANDLE hContact = ( HANDLE )lParam;
-
- odp.cbSize = sizeof(odp);
- odp.hIcon = NULL;
- odp.hInstance = hInst;
-
- if ( hContact == NULL ) {
-
- char szTitle[256];
-
- if (mirandaVersion < PLUGIN_MAKE_VERSION(0, 7, 0, 27) && !bIsImoproxy)
- {
- mir_snprintf( szTitle, sizeof( szTitle ), "%s %s", SKYPE_PROTONAME, Translate( "Avatar" ));
-
- odp.pfnDlgProc = AvatarDlgProc;
- odp.position = 1900000000;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_SETAVATAR);
- odp.pszTitle = szTitle;
- UserInfo_AddPage(wParam, &odp);
- }
-
- mir_snprintf( szTitle, sizeof( szTitle ), "%s %s", SKYPE_PROTONAME, Translate( "Details" ));
-
- odp.pfnDlgProc = DetailsDlgProc;
- odp.position = 1900000000;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_SETDETAILS);
- odp.pszTitle = szTitle;
- UserInfo_AddPage(wParam, &odp);
- }
-
- return 0;
-}
-
-/*AvatarDlgProc
-*
-* For setting the skype avatar
-*
-*/
-INT_PTR CALLBACK AvatarDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- static RECT r;
-
- UNREFERENCED_PARAMETER(lParam);
-
- switch ( msg ) {
- case WM_INITDIALOG:
- TranslateDialogDefault( hwndDlg );
-
- hAvatar = NULL;
- if(ServiceExists(MS_AV_GETMYAVATAR)){
- struct avatarCacheEntry *ace = (struct avatarCacheEntry *)CallService(MS_AV_GETMYAVATAR, 0,(LPARAM) SKYPE_PROTONAME);
- if (ace!=NULL) {
- hAvatar = ( HBITMAP )CallService( MS_UTILS_LOADBITMAP, 0, ( LPARAM )ace->szFilename);
- if ( hAvatar != NULL )
- SendDlgItemMessage(hwndDlg, IDC_AVATAR, STM_SETIMAGE, IMAGE_BITMAP, (WPARAM)hAvatar );
- }
- }
-
-
-
- return TRUE;
-
- case WM_COMMAND:
- if ( HIWORD( wParam ) == BN_CLICKED ) {
- switch( LOWORD( wParam )) {
- case IDC_SETAVATAR:
- {
- char szFileName[ MAX_PATH ];
- if ( EnterBitmapFileName( szFileName ) != ERROR_SUCCESS )
- return FALSE;
-
- hAvatar = ( HBITMAP )CallService( MS_UTILS_LOADBITMAP, 0, ( LPARAM )szFileName);
- if ( hAvatar != NULL ){
- SendDlgItemMessage(hwndDlg, IDC_AVATAR, STM_SETIMAGE, IMAGE_BITMAP, (WPARAM)hAvatar );
- CallService(SKYPE_SETAVATAR, 0, ( LPARAM )szFileName);
- }
- break;
- }
- case IDC_DELETEAVATAR:
- if ( hAvatar != NULL ) {
- DeleteObject( hAvatar );
- hAvatar = NULL;
- CallService(SKYPE_SETAVATAR, 0, 0);
- }
- DBDeleteContactSetting( NULL, SKYPE_PROTONAME, "AvatarFile" );
- InvalidateRect( hwndDlg, NULL, TRUE );
- break;
- } }
- break;
-
- case WM_DESTROY:
- if ( hAvatar != NULL )
- DeleteObject( hAvatar );
- break;
- }
-
- return 0;
-}
-
-/*DetailsDlgProc
-*
-* For setting the skype infos
-*
-*/
-INT_PTR CALLBACK DetailsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- static int sexM = 0,sexF = 0, sex;
-
- UNREFERENCED_PARAMETER(lParam);
-
- switch ( msg ) {
- case WM_INITDIALOG:
- TranslateDialogDefault( hwndDlg );
-
- ZeroMemory (&myProfile, sizeof(myProfile));
- SkypeProfile_Load(&myProfile);
- if(SkypeInitialized)
- SkypeProfile_LoadFromSkype(&myProfile);
-
- SendDlgItemMessage(hwndDlg,IDC_SEX,CB_ADDSTRING,0,(LPARAM)_T(""));
- sexM = SendDlgItemMessage(hwndDlg,IDC_SEX,CB_ADDSTRING,0,(LPARAM)TranslateT("MALE"));
- sexF = SendDlgItemMessage(hwndDlg,IDC_SEX,CB_ADDSTRING,0,(LPARAM)TranslateT("FEMALE"));
-
- switch(myProfile.Sex) {
- case 0x4D: SendDlgItemMessage(hwndDlg,IDC_SEX,CB_SETCURSEL, sexM, 0); break;
- case 0x46: SendDlgItemMessage(hwndDlg,IDC_SEX,CB_SETCURSEL, sexF, 0); break;
- }
-
- SetDlgItemText(hwndDlg, IDC_FULLNAME, myProfile.FullName);
- SetDlgItemTextA(hwndDlg, IDC_HOMEPAGE, myProfile.HomePage);
- SetDlgItemTextA(hwndDlg, IDC_HOMEPHONE, myProfile.HomePhone);
- SetDlgItemTextA(hwndDlg, IDC_OFFICEPHONE, myProfile.OfficePhone);
- SetDlgItemText(hwndDlg, IDC_CITY, myProfile.City);
- SetDlgItemText(hwndDlg, IDC_PROVINCE, myProfile.Province);
- DateTime_SetSystemtime (GetDlgItem (hwndDlg, IDC_BIRTHDAY), GDT_VALID, &myProfile.Birthday);
- return TRUE;
-
- case WM_COMMAND:
- if ( HIWORD( wParam ) == BN_CLICKED ) {
- switch( LOWORD( wParam )) {
- case IDC_SAVEDETAILS:
- GetDlgItemText(hwndDlg,IDC_FULLNAME,myProfile.FullName,sizeof(myProfile.FullName)/sizeof(TCHAR));
- GetDlgItemTextA(hwndDlg,IDC_HOMEPAGE,myProfile.HomePage,sizeof(myProfile.HomePage)/sizeof(TCHAR));
- GetDlgItemTextA(hwndDlg,IDC_HOMEPHONE,myProfile.HomePhone,sizeof(myProfile.HomePhone)/sizeof(TCHAR));
- GetDlgItemTextA(hwndDlg,IDC_OFFICEPHONE,myProfile.OfficePhone,sizeof(myProfile.OfficePhone)/sizeof(TCHAR));
- GetDlgItemText(hwndDlg,IDC_CITY,myProfile.City,sizeof(myProfile.City)/sizeof(TCHAR));
- GetDlgItemText(hwndDlg,IDC_PROVINCE,myProfile.Province,sizeof(myProfile.Province)/sizeof(TCHAR));
- sex = SendMessage(GetDlgItem(hwndDlg,IDC_SEX),CB_GETCURSEL,0,0);
-
- myProfile.Sex = 0;
- if(sex == sexF) myProfile.Sex = 0x46; else
- if(sex == sexM) myProfile.Sex = 0x4D;
- DateTime_GetSystemtime (GetDlgItem (hwndDlg, IDC_BIRTHDAY), &myProfile.Birthday);
-
- SkypeProfile_Save(&myProfile);
- if(SkypeInitialized)
- SkypeProfile_SaveToSkype(&myProfile);
- break;
- }
- }
- break;
-
- case WM_DESTROY:
- if ( hAvatar != NULL )
- DeleteObject( hAvatar );
- break;
- }
-
- return 0;
-}
-
-#ifdef SKYPE_AUTO_DETECTION
-/**
- * DoAutoDetect
- * @param dlg The default option dialog handle
- */
-void DoAutoDetect(HWND dlg)
-{
- char basePath[MAX_PATH];
- char fileName[MAX_PATH];
- char tmpUser[255];
- ezxml_t f1, acc;
-
- if (FAILED(SHGetFolderPath(dlg,CSIDL_APPDATA,NULL,0,basePath)))
- {
- OUTPUT("Error in retrieving appdata path!");
- return;
- }
-
- strcat(basePath,"\\Skype\\");
- sprintf (fileName, "%s\\shared.xml", basePath);
-
- if (f1 = ezxml_parse_file(fileName))
- {
- if (acc = ezxml_get(f1, "Lib", 0, "Account", 0, "Default", -1))
- {
- if (GetWindowTextA(GetDlgItem(dlg,IDC_USERNAME),tmpUser,sizeof(tmpUser)))
- SetWindowTextA(GetDlgItem(dlg,IDC_USERNAME),acc->txt);
- /* Can't find this stuff in current Skype verions??
- sprintf (fileName, "%s\\%s\\config.xml", basePath, acc->txt);
- if ((acc = ezxml_get(f1, "UI", 0, "Messages", 0, "OpenWindowInCompactMode", -1)) && *acc->txt!='0')
- {
- ezxml_set_txt (acc, "0");
- // ezXML doesn't supprot saving yet
- }
- */
- }
- ezxml_free(f1);
- }
- else
- {
- OUTPUT("Failed to open skypes configuration files!");
- return;
- }
-}
-#endif
diff --git a/plugins/!NotAdopted/Skype/skypeopt.h b/plugins/!NotAdopted/Skype/skypeopt.h deleted file mode 100644 index 23aa7a5212..0000000000 --- a/plugins/!NotAdopted/Skype/skypeopt.h +++ /dev/null @@ -1,49 +0,0 @@ -/*
- * RegisterOptions
- *
- * This function tells Miranda to add the configuration section of this plugin in
- * the Options-dialog.
- */
-int RegisterOptions(WPARAM wParam, LPARAM lParam);
-/*
- * OptionsDlgProc
- *
- * This callback function is called, when the options dialog in Miranda is shown
- * The function contains all necessary stuff to process the options in the dialog
- * and store them in the database, when changed, and fill out the settings-dialog
- * correctly according to the current settings
- */
-INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-
-INT_PTR CALLBACK OptionsDefaultDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK OptionsAdvancedDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK OptionsProxyDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-INT_PTR CALLBACK OptPopupDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
-
-/*
-* Procedure to call when the option page is asked
-*
-*/
-int OnDetailsInit( WPARAM wParam, LPARAM lParam );
-
-/*
-* Dialog to change avatar in user details.
-*
-*
-*/
-INT_PTR CALLBACK AvatarDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
-/*
-* Dialog to change infos in user details.
-*
-*
-*/
-INT_PTR CALLBACK DetailsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
-/*
- * Helper functions
- *
- */
-void DoAutoDetect(HWND dlg);
-
-;
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/skypeprofile.c b/plugins/!NotAdopted/Skype/skypeprofile.c deleted file mode 100644 index 3bf3c0b955..0000000000 --- a/plugins/!NotAdopted/Skype/skypeprofile.c +++ /dev/null @@ -1,145 +0,0 @@ -#pragma warning (disable: 4706) // assignment within conditional expression
-
-#include "skypeprofile.h"
-#include "skypeapi.h"
-#include "utf8.h"
-
-extern char g_szProtoName[];
-
-void SkypeProfile_Save(SkypeProfile *pstProf)
-{
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "Gender", pstProf->Sex);
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "HomePhone", pstProf->HomePhone);
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "OfficePhone", pstProf->OfficePhone);
- DBWriteContactSettingString(NULL, SKYPE_PROTONAME, "HomePage", pstProf->HomePage);
- DBWriteContactSettingTString(NULL, SKYPE_PROTONAME, "Nick", pstProf->FullName);
- DBWriteContactSettingTString(NULL, SKYPE_PROTONAME, "City", pstProf->City);
- DBWriteContactSettingTString(NULL, SKYPE_PROTONAME, "Province", pstProf->Province);
- DBWriteContactSettingWord(NULL, SKYPE_PROTONAME, "BirthYear", (WORD)pstProf->Birthday.wYear);
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "BirthMonth", (BYTE)pstProf->Birthday.wMonth);
- DBWriteContactSettingByte(NULL, SKYPE_PROTONAME, "BirthDay", (BYTE)pstProf->Birthday.wDay);
-}
-
-void SkypeProfile_Load(SkypeProfile *pstProf)
-{
- DBVARIANT dbv;
-
- pstProf->Sex = (BYTE)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "Gender", 0);
- pstProf->Birthday.wYear = (WORD)DBGetContactSettingWord(NULL, SKYPE_PROTONAME, "BirthYear", 1900);
- pstProf->Birthday.wMonth = (WORD)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "BirthMonth", 01);
- pstProf->Birthday.wDay = (WORD)DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "BirthDay", 01);
- if(!DBGetContactSettingTString(NULL,SKYPE_PROTONAME,"Nick",&dbv))
- {
- _tcsncpy (pstProf->FullName, dbv.ptszVal, sizeof(pstProf->FullName)/sizeof(TCHAR));
- DBFreeVariant(&dbv);
- }
- if(!DBGetContactSettingString(NULL,SKYPE_PROTONAME,"HomePage",&dbv))
- {
- strncpy (pstProf->HomePage, dbv.pszVal, sizeof(pstProf->HomePage));
- DBFreeVariant(&dbv);
- }
- if(!DBGetContactSettingTString(NULL,SKYPE_PROTONAME,"Province",&dbv))
- {
- _tcsncpy (pstProf->Province, dbv.ptszVal, sizeof(pstProf->Province)/sizeof(TCHAR));
- DBFreeVariant(&dbv);
- }
- if(!DBGetContactSettingTString(NULL,SKYPE_PROTONAME,"City",&dbv))
- {
- _tcsncpy (pstProf->City, dbv.ptszVal, sizeof(pstProf->City)/sizeof(TCHAR));
- DBFreeVariant(&dbv);
- }
- if(!DBGetContactSettingString(NULL,SKYPE_PROTONAME,"OfficePhone",&dbv))
- {
- strncpy (pstProf->OfficePhone, dbv.pszVal, sizeof(pstProf->OfficePhone));
- DBFreeVariant(&dbv);
- }
- if(!DBGetContactSettingString(NULL,SKYPE_PROTONAME,"HomePhone",&dbv))
- {
- strncpy (pstProf->HomePhone, dbv.pszVal, sizeof(pstProf->HomePhone));
- DBFreeVariant(&dbv);
- }
-}
-
-static void LoadSaveSkype(SkypeProfile *pstProf, BOOL bSet)
-{
-#pragma warning (push)
-#pragma warning (disable: 4204) // nonstandard extension used : non-constant aggregate initializer
-#define ENTRY(x,y) {x, pstProf->y, sizeof(pstProf->y)/sizeof(pstProf->y[0]), sizeof(pstProf->y[0])}
- const struct {
- char *pszSetting;
- LPVOID lpDest;
- int iSize;
- char cType;
- } astSettings[] = {
- ENTRY("FULLNAME", FullName),
- ENTRY("PHONE_HOME", HomePhone),
- ENTRY("PHONE_OFFICE", OfficePhone),
- ENTRY("HOMEPAGE", HomePage),
- ENTRY("CITY", City),
- ENTRY("PROVINCE", Province)
- };
-#pragma warning (pop)
-#undef ENTRY
- char *ptr;
- int i;
-
- if (bSet) {
- char *pBuf, szBirthday[16];
- for (i=0; i<sizeof(astSettings)/sizeof(astSettings[0]); i++) {
- if ((astSettings[i].cType == sizeof(char) && utf8_encode((const char*)astSettings[i].lpDest, &pBuf) != -1) ||
- (astSettings[i].cType == sizeof(WCHAR) && (pBuf = (char*)make_utf8_string((const WCHAR*)astSettings[i].lpDest)))) {
- SkypeSetProfile (astSettings[i].pszSetting, pBuf);
- free (pBuf);
- }
- }
- switch (pstProf->Sex)
- {
- case 0x4D: SkypeSetProfile ("SEX", "MALE"); break;
- case 0x46: SkypeSetProfile ("SEX", "FEMALE"); break;
- }
- sprintf (szBirthday, "%04d%02d%02d", pstProf->Birthday.wYear, pstProf->Birthday.wMonth, pstProf->Birthday.wDay);
- SkypeSetProfile ("BIRTHDAY", szBirthday);
- } else {
- for (i=0; i<sizeof(astSettings)/sizeof(astSettings[0]); i++) {
- if (ptr=SkypeGetProfile(astSettings[i].pszSetting)) {
- if (astSettings[i].cType == sizeof(char)) {
- char *pBuf;
- if (utf8_decode (ptr, &pBuf) != -1) {
- strncpy ((char*)astSettings[i].lpDest, pBuf, astSettings[i].iSize);
- free (pBuf);
- }
- } else {
- WCHAR *pBuf;
- if (pBuf = make_unicode_string((const unsigned char*)ptr)) {
- wcsncpy ((WCHAR*)astSettings[i].lpDest, pBuf, astSettings[i].iSize);
- free (pBuf);
- }
- }
- free (ptr);
- }
- }
- if (ptr=SkypeGetProfile("SEX"))
- {
- if (!_stricmp(ptr, "MALE")) pstProf->Sex=0x4D; else
- if (!_stricmp(ptr, "FEMALE")) pstProf->Sex=0x46;
- free (ptr);
- }
- if (ptr=SkypeGetProfile("BIRTHDAY"))
- {
- if (*ptr != '0')
- sscanf(ptr, "%04hd%02hd%02hd", &pstProf->Birthday.wYear, &pstProf->Birthday.wMonth,
- &pstProf->Birthday.wDay);
- free(ptr);
- }
- }
-}
-
-void SkypeProfile_LoadFromSkype(SkypeProfile *pstProf)
-{
- LoadSaveSkype (pstProf, FALSE);
-}
-
-void SkypeProfile_SaveToSkype(SkypeProfile *pstProf)
-{
- LoadSaveSkype (pstProf, TRUE);
-}
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/skypeprofile.h b/plugins/!NotAdopted/Skype/skypeprofile.h deleted file mode 100644 index 60531128d1..0000000000 --- a/plugins/!NotAdopted/Skype/skypeprofile.h +++ /dev/null @@ -1,33 +0,0 @@ -// System includes
-#include <stdio.h>
-#include <windows.h>
-#include <commctrl.h>
-#include <process.h>
-#include <time.h>
-#include "resource.h"
-#include "skype.h"
-
-#pragma warning (push)
-#pragma warning (disable: 4100) // unreferenced formal parameter
-// Miranda database access
-#include "../../include/newpluginapi.h"
-#include "../../include/m_database.h"
-#pragma warning (pop)
-
-typedef struct
-{
- TCHAR FullName[256];
- char HomePhone[256];
- char OfficePhone[256];
- char HomePage[256];
- TCHAR City[256];
- TCHAR Province[256];
- BYTE Sex;
- SYSTEMTIME Birthday;
-} SkypeProfile;
-
-void SkypeProfile_Load(SkypeProfile *pstProf);
-void SkypeProfile_Save(SkypeProfile *pstProf);
-void SkypeProfile_Free(SkypeProfile *pstProf);
-void SkypeProfile_LoadFromSkype(SkypeProfile *pstProf);
-void SkypeProfile_SaveToSkype(SkypeProfile *pstProf);
diff --git a/plugins/!NotAdopted/Skype/skypeproxy.h b/plugins/!NotAdopted/Skype/skypeproxy.h deleted file mode 100644 index 8e1490803e..0000000000 --- a/plugins/!NotAdopted/Skype/skypeproxy.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Commands for command mode of Skype proxy */
-
-#define AUTHENTICATE 0x01
-#define CAPABILITIES 0x02
-
-/* Capabilities flags of Skypeproxy */
-#define USE_AUTHENTICATION 0x01
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/skypeproxy/skypeproxy.c b/plugins/!NotAdopted/Skype/skypeproxy/skypeproxy.c deleted file mode 100644 index fff9c1b916..0000000000 --- a/plugins/!NotAdopted/Skype/skypeproxy/skypeproxy.c +++ /dev/null @@ -1,651 +0,0 @@ -/*
-
-Purpose
-=======
-This program opens a connection on a local TCP/IP port and sends/
-receives Skype-API calls on it so that you can remote-control
-Skype over a network.
-Note, that there are currently NO SECURITY mechanisms, so don't
-use this over an untrusted network!
-
-Author
-======
-This program was written by leecher in 2005 (mailto:leecher@dose.0wnz.at)
-Please give feedback at http://forum.skype.com/viewtopic.php?t=16187
-
-Protocol
-========
-Basic protocol structure
-------------------------
-Sender and receiver have the same protocol:
-
- [(UINT)Length of message][(char[])Message]
-
-The Length is so that you can malloc() enough space for the data buffer
-to receive the next message.
-
-A special case is, if the [Length of message] is 0. In this case the
-client tells the server that he wants to switch to command mode.
-
-Command mode
-------------
-The server expects
-
- [(char)Command]
-
-next. Currently the following commands are supported:
-
- CAPABILITIES - returns the Server's capabilities
- AUTHENTICATE - Starts the authentification process
-
-CAPABILITIES
-------------
-The server returns
-
- [(char)Capabilities]
-
-where this currently can be the following:
-
- USE_AUTHENTICATION - The server supports and requires authentication
-
-AUTHENTICATE
-------------
-The server returns
-
- [(char)0x01]
-
-if authentication is supported AND needed (skypeproxy started with -k switch) or
-
- [(char)0x00]
-
-if this is not the case.
-If 0x01 was returned the server next expects a normal message
-(see "Basic protocol structure) containing the password.
-If the authentication was successful, the server replies with
-
- [(char)0x01]
-
-otherwise with
-
- [(char)0x00]
-
-PLEASE NOTE THAT THE AUTHENTICATION CURRENTLY IS PLAIN TEXT. SO DON'T
-USE THIS PROGRAM OVER AN UNTRUSTED NETWORK, OTHERWISE THERE MAY BE THE
-POSSIBILITY THAT SOMEONE SNIFFS YOUR PASSWORD!
-
-Code example
-------------
-
-SOCKET MySocket;
-
-int SendPacket(char *szSkypeMessage) {
- unsigned int length=strlen(szSkypeMsg);
-
- if (send(MySocket, (char *)&length, sizeof(length), 0)==SOCKET_ERROR ||
- send(MySocket, szSkypeMsg, length, 0)==SOCKET_ERROR)
- return -1;
- return 0;
-}
-
-// don't forget to free() the return value on my Heap!!
-char *ReceivePacket(void) {
- unsigned int lenght, received;
- char *buf;
-
- if ((received=recv(MySocket, (char *)&length, sizeof(length), 0))==SOCKET_ERROR ||
- received==0)
- return NULL;
- if (!(buf=calloc(1, length+1))) return NULL;
- if (recv(MySocket, buf, length, 0)==SOCKET_ERROR) {
- free(buf);
- return NULL;
- }
- return buf;
-}
-
-
-License
-=======
-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.
-
-History
-========
-V1.0alpha - First preview release
-V1.0 - Implemented killing & restarting Skype process when it dies
- - BUGFIX: SendMessage() is a blocking call, if Skype hangs our app hangs too -> Fixed
- - Added command line parsing.
- - Renamed from Skype2Socket to skypeproxy
- - Added authentication feature.
-*/
-
-#include <stdio.h>
-#include <process.h>
-#include <windows.h>
-#include <signal.h>
-#include "skypeproxy.h"
-
-UINT ControlAPIAttach, ControlAPIDiscover;
-HWND hSkypeWnd=NULL, hWnd;
-HANDLE SkypeReady, ServerThreadBye;
-LONG AttachStatus=-1;
-int exitcode=EXIT_SUCCESS;
-char skype_path[MAX_PATH], *password=NULL;
-BYTE WatchDog=1;
-BOOL WatchDogRunning=FALSE, Authenticated=FALSE;
-SOCKET ListenSocket, AcceptSocket;
-
-
-void bail_out(int i) {
- OUTPUT("Got termination signal, bailing out.");
- if (i==1) exitcode=EXIT_FAILURE;
- PostMessage(hWnd, WM_QUIT, 0, 0);
-}
-
-BOOL CALLBACK TerminateAppEnum( HWND hwnd, LPARAM lParam ) {
- DWORD dwID ;
-
- GetWindowThreadProcessId(hwnd, &dwID) ;
- if(dwID == (DWORD)lParam)
- PostMessage(hwnd, WM_CLOSE, 0, 0) ; // May you be so kind to quit, please?
-
- return TRUE ;
-}
-
-/* ConnectToSkypeAPI
- *
- * Purpose: Establish a connection to the Skype API
- * Params : ForceRestart - Kill Skype if it's running before restarting
- * Returns: 0 - Connecting succeeded
- * -1 - Something went wrong
- */
-void ConnectToSkypeAPI(void *ForceRestart) {
- BOOL SkypeLaunched=FALSE;
- int counter=0, i, j;
- char *args[5];
- char *SkypeOptions[]={"/notray", "/nosplash", "/minimized"};
- char *szFuncName="ConnectToSkypeAPI";
-
- ResetEvent(SkypeReady);
- AttachStatus=-1;
- if ((BOOL)ForceRestart) {
- HANDLE hProc;
- DWORD dwPID=0;
-
- if (!hSkypeWnd) {
- OUTPUT("I can't kill Skype, as I don't even have its window handle!");
- return;
- }
- GetWindowThreadProcessId(hSkypeWnd, &dwPID);
- LOG(("%s: Shutting down Skype as it was not behaving the way it should...", szFuncName));
- if (hProc = OpenProcess(SYNCHRONIZE|PROCESS_TERMINATE, FALSE, dwPID)) {
-
- // Try to shutdown Skype the nice way by asking it to close
- EnumWindows((WNDENUMPROC)TerminateAppEnum, (LPARAM) dwPID);
-
- if(WaitForSingleObject(hProc, 10000)!=WAIT_OBJECT_0) {
- // Try it the hard way by killing it
- LOG(("%s: I tried it the nice way, but you were not listening! Now DIIIIEEE!", szFuncName));
- if (!TerminateProcess(hProc,0)) {
- OUTPUT("Argh, process refused to die, it's too mighty for me, I've given up");
- CloseHandle(hProc);
- return;
- }
- LOG(("%s: Process killed! >:)", szFuncName));
- }
- CloseHandle(hProc);
- }
- }
- do {
- /* To initiate communication, Client should broadcast windows message
- ('SkypeControlAPIDiscover') to all windows in the system, specifying its own
- window handle in wParam parameter.
- */
- LOG(("%s: Sending discover message..", szFuncName));
- SendMessageTimeout(HWND_BROADCAST, ControlAPIDiscover, (WPARAM)hWnd, 0, SMTO_ABORTIFHUNG, 3000, NULL);
- LOG(("%s: Discover message sent, waiting for Skype to become ready..", szFuncName));
-
- /* In response, Skype responds with
- message 'SkypeControlAPIAttach' to the handle specified, and indicates
- connection status
- SkypeReady is set if there is an answer by Skype other than API_AVAILABLE.
- If there is no answer after 3 seconds, launch Skype as it's propably
- not running.
- */
- if (WaitForSingleObject(SkypeReady, 3000)==WAIT_TIMEOUT &&
- AttachStatus!=SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION)
- {
- if (hWnd==NULL) {
- LOG(("%s: hWnd of SkypeDispatchWindow not yet set..", szFuncName));
- continue;
- }
- if (!SkypeLaunched && skype_path) {
- LOG(("%s: Starting Skype, as it's not running", szFuncName));
- args[0]=skype_path;
- j=1;
- for (i=0; i<3; i++) {
- args[j]=SkypeOptions[i];
- LOG(("%s: Using Skype parameter: ", szFuncName, args[j]));
- j++;
- }
- args[j]=NULL;
- _spawnv(_P_NOWAIT, skype_path, args);
- ResetEvent(SkypeReady);
- SkypeLaunched=TRUE;
- LOG(("%s: Skype process started.", szFuncName));
- // Skype launching iniciated, keep sending Discover messages until it responds.
- continue;
- } else {
- LOG(("%s: Check if Skype was launchable..", szFuncName));
- if (!skype_path) {
- OUTPUT("There was no correct path for Skype application");
- bail_out(1);
- return;
- }
- LOG("%s: Trying to attach: #%d", szFuncName, counter));
- counter++;
- if (counter==5) {
- OUTPUT("ERROR: Skype not running / too old / working!");
- bail_out(1);
- return;
- }
- }
- }
- LOG(("%s: Attachstatus %d", szFuncName, AttachStatus));
- } while (AttachStatus==SKYPECONTROLAPI_ATTACH_API_AVAILABLE || AttachStatus==-1);
-
- while (AttachStatus==SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION) Sleep(1000);
- LOG(("%s: Attachstatus %d", szFuncName, AttachStatus));
- if (AttachStatus!=SKYPECONTROLAPI_ATTACH_SUCCESS) {
- switch(AttachStatus) {
- case SKYPECONTROLAPI_ATTACH_REFUSED:
- OUTPUT("Skype refused the connection :(");
- break;
- case SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE:
- OUTPUT("The Skype API is not available");
- break;
- default:
- LOG(("%s: ERROR: AttachStatus: %d", szFuncName, AttachStatus));
- OUTPUT("Wheee, Skype won't let me use the API. :(");
- }
- bail_out(1);
- return;
- }
- OUTPUT("Attached to Skype successfully.");
- if (!WatchDogRunning)
- if (_beginthread(WatchDogTimer, 0, NULL)==-1) {
- OUTPUT("Cannot start Watchdog.");
- bail_out(1);
- }
- return;
-}
-
-void SkypeSend(char *szMsg) {
- COPYDATASTRUCT CopyData;
- int count=0;
-
- if (!hSkypeWnd) {
- LOG(("SkypeSend: DAMN! No Skype window handle! :("));
- return;
- }
- if (strcmp(szMsg, "PING")) {LOG(("> %s", szMsg));}
- CopyData.dwData=0;
- CopyData.lpData=szMsg;
- CopyData.cbData=strlen(szMsg)+1;
- while (!SendMessageTimeout(hSkypeWnd, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&CopyData, SMTO_ABORTIFHUNG, 3000, NULL)) {
- count++;
- LOG(("SkypeSend: failed, try #%d", count));
- if (count==5) {
- OUTPUT("Sending message to Skype failed too often.");
- OUTPUT("Skype may have died unexpectedly, I will try to restart it.");
- ConnectToSkypeAPI((void *)TRUE);
- OUTPUT("Restart complete. Trying to deliver message one more time.");
- if (!SendMessageTimeout(hSkypeWnd, WM_COPYDATA, (WPARAM)hWnd, (LPARAM)&CopyData, SMTO_ABORTIFHUNG, 3000, NULL)) {
- OUTPUT("It still failed. Skype seems to be completely f*cked up. I've given up. Bye..");
- bail_out(1);
- break;
- } else {
- OUTPUT("Now it worked! :)");
- break;
- }
- }
- Sleep(1000);
- }
-}
-
-void ServerThread(char *dummy) {
- unsigned int length, received;
- char *buf, command, reply;
-
- LOG(("ServerThread started"));
- AcceptSocket=INVALID_SOCKET;
- while( AcceptSocket == INVALID_SOCKET) {
- if ((AcceptSocket = accept( ListenSocket, NULL, NULL ))==INVALID_SOCKET) {
- LOG(("ServerThread: Byebye..."));
- SetEvent(ServerThreadBye);
- bail_out(1);
- return;
- }
- OUTPUT("Connection by client");
- while(1) {
- if ((received=recv(AcceptSocket, (char *)&length, sizeof(length), 0))==SOCKET_ERROR ||
- received==0)
- {
- OUTPUT("Connection was closed by client. See ya soon! :)");
- break;
- }
- // Command mode
- if (length==0) {
- reply=0;
- if (recv(AcceptSocket, (char *)&command, 1, 0)==SOCKET_ERROR) {
- OUTPUT("Connection to client was lost.");
- break;
- }
-#ifdef USE_AUTHENTICATION
- if (command==AUTHENTICATE)
- if (password) reply=0x01; // Ok, go ahead
- else command=0;
-#endif
- if (command==CAPABILITIES)
- reply=password?USE_AUTHENTICATION:0;
-
- if (send(AcceptSocket, (char *)&reply, 1, 0)==SOCKET_ERROR) {
- OUTPUT("Connection to client was lost.");
- break;
- }
- continue;
- }
- // Normal Skype API-call
- if (!(buf=calloc(1, length+1))) {
- OUTPUT("Out of memory error while allocating buffer space.");
- break;
- }
- if (recv(AcceptSocket, buf, length, 0)==SOCKET_ERROR) {
- OUTPUT("Connection to client was lost.");
- free(buf);
- break;
- }
- switch (command) {
-#ifdef USE_AUTHENTICATION
- case 0x01: // Compare hash
- if (password && !strcmp(password, buf)) Authenticated=TRUE;
- else Authenticated=FALSE;
- if (Authenticated) {
- OUTPUT("User authenticated succesfully.");
- reply=1;
- } else {
- OUTPUT("User authentication failed!! (Intruder?)");
- reply=0;
- }
- if (send(AcceptSocket, (char *)&reply, 1, 0)==SOCKET_ERROR) {
- OUTPUT("Connection to client was lost.");
- break;
- }
- command=0;
- break;
-#endif
- default:
-#ifdef USE_AUTHENTICATION
- if (password && !Authenticated) break;
-#endif
- SkypeSend(buf);
- }
- command=0;
- free(buf);
- }
- AcceptSocket=INVALID_SOCKET;
-#ifdef USE_AUTHENTICATION
- Authenticated=FALSE;
-#endif
- }
-}
-
-
-void WatchDogTimer(char *dummy) {
- LOG(("WatchDogTimer started"));
- WatchDogRunning=TRUE;
- while (1) {
- Sleep(PING_INTERVAL);
- if (!WatchDog) {
- OUTPUT("Ouch.. It seems that Skype has died unexpectedly. Trying to restart.");
- ConnectToSkypeAPI((void *)TRUE);
- }
- WatchDog=0;
- SkypeSend("PING");
- }
-}
-
-LONG APIENTRY WndProc(HWND hWnd, UINT message, UINT wParam, LONG lParam)
-{
- PCOPYDATASTRUCT CopyData;
- char *szSkypeMsg=NULL;
-
- switch (message)
- {
- case WM_COPYDATA:
-// LOG("WM_COPYDATA", "start");
- if(hSkypeWnd==(HWND)wParam) {
- CopyData=(PCOPYDATASTRUCT)lParam;
- szSkypeMsg=strdup(CopyData->lpData);
- ReplyMessage(1);
- if (!strcmp(szSkypeMsg, "PONG")) {
- WatchDog=1;
- break;
- } // Hide PING-PONG
- LOG(("< %s", szSkypeMsg));
- if (!strcmp(szSkypeMsg, "USERSTATUS LOGGEDOUT")) {
- OUTPUT("Skype shut down gracefully. I'll leave too, bye.. :)");
- bail_out(1);
- }
-#ifdef USE_AUTHENTICATION
- if (password && !Authenticated) break;
-#endif
- if (AcceptSocket!=INVALID_SOCKET) {
- unsigned int length=strlen(szSkypeMsg);
-
- if (send(AcceptSocket, (char *)&length, sizeof(length), 0)==SOCKET_ERROR ||
- send(AcceptSocket, szSkypeMsg, length, 0)==SOCKET_ERROR)
- OUTPUT("Cannot send to client :(");
- }
- }
- break;
-
- case WM_DESTROY:
- PostQuitMessage(0);
- break;
-
- default:
- if(message==ControlAPIAttach) {
- // Skype responds with Attach to the discover-message
- AttachStatus=lParam;
- if (AttachStatus==SKYPECONTROLAPI_ATTACH_SUCCESS)
- hSkypeWnd=(HWND)wParam; // Skype gave us the communication window handle
- if (AttachStatus!=SKYPECONTROLAPI_ATTACH_API_AVAILABLE)
- SetEvent(SkypeReady);
- break;
- }
- return (DefWindowProc(hWnd, message, wParam, lParam));
- }
-// LOG("WM_COPYDATA", "exit");
- if (szSkypeMsg) free(szSkypeMsg);
- return 1;
-}
-
-
-void TellError(DWORD err) {
- LPVOID lpMsgBuf;
-
- FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL);
- MessageBox( NULL, lpMsgBuf, "GetLastError", MB_OK|MB_ICONINFORMATION );
- LocalFree( lpMsgBuf );
- return;
-}
-
-int main(int argc, char *argv[]) {
- DWORD Buffsize;
- HKEY MyKey;
- BOOL SkypeInstalled=TRUE;
- MSG Message;
- WNDCLASS WndClass;
- SOCKADDR_IN service;
- WSADATA wsaData;
- int ExitCode=STILL_ACTIVE;
- unsigned short BindPort=1401;
- char BindIP[16]="0.0.0.0";
-
- printf("Skypeproxy V1.0, by leecher 2005 <leecher@dose.0wnz.at>\n\n");
-
- if (argc>1) {
- int i;
-
- if (!stricmp(argv[1], "-h") || !stricmp(argv[1], "--help") || !stricmp(argv[1], "/?")) {
- printf("Usage: %s [-i BindIP] [-p BindPort]", argv[0]);
-#ifdef USE_AUTHENTICATION
- printf(" [-k Password]");
-#endif
- printf("\n\n");
- return EXIT_SUCCESS;
- }
- for (i=0;i<argc;i++) {
- if (!stricmp(argv[i], "-i") && argc>i+1)
- strncpy(BindIP, argv[i+1], sizeof(BindIP));
- if (!stricmp(argv[i], "-p") && argc>i+1)
- if (!(BindPort=atoi(argv[i+1]))) {
- OUTPUT("ERROR: Cannot convert port to int. bye..");
- return EXIT_FAILURE;
- }
-#ifdef USE_AUTHENTICATION
- if (!stricmp(argv[i], "-k") && argc>i+1)
- password=strdup(argv[i+1]);
-#endif
- }
- }
-
- if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software\\Skype\\Phone", 0, KEY_READ, &MyKey)!=ERROR_SUCCESS ||
- RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Skype\\Phone", 0, KEY_READ, &MyKey)!=ERROR_SUCCESS)
- SkypeInstalled=FALSE;
- Buffsize=sizeof(skype_path);
- if (SkypeInstalled==FALSE ||
- RegQueryValueEx(MyKey, "SkypePath", NULL, NULL, skype_path, &Buffsize)!=ERROR_SUCCESS) {
- OUTPUT("Skype was not found on this machine :(");
- RegCloseKey(MyKey);
- skype_path[0]=0;
- return EXIT_FAILURE;
- }
- RegCloseKey(MyKey);
-
- if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) {
- OUTPUT("Error at loading windows sockets.");
- return EXIT_FAILURE;
- }
-
- if ((ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {
- printf("* Error at creating socket(): Error %d", WSAGetLastError());
- return EXIT_FAILURE;
- }
-
- service.sin_family = AF_INET;
- service.sin_addr.s_addr = inet_addr(BindIP);
- service.sin_port = htons(BindPort);
-
- printf("* Binding to interface %s, Port %d..", BindIP, BindPort);
- if (bind( ListenSocket, (SOCKADDR*) &service, sizeof(service)) == SOCKET_ERROR ||
- listen( ListenSocket, 1 ) == SOCKET_ERROR)
- {
- OUTPUT("Failed.");
- closesocket(ListenSocket);
- return EXIT_FAILURE;
- }
- printf("OK\n");
-
-
- if (!(ControlAPIAttach=RegisterWindowMessage("SkypeControlAPIAttach")) ||
- !(ControlAPIDiscover=RegisterWindowMessage("SkypeControlAPIDiscover"))) {
- OUTPUT("Cannot register Windows message.");
- closesocket(ListenSocket);
- return EXIT_FAILURE;
- }
-
- // Create window class
- hSkypeWnd=NULL;
- WndClass.style = CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS;
- WndClass.lpfnWndProc = (WNDPROC)WndProc;
- WndClass.cbClsExtra = 0;
- WndClass.cbWndExtra = 0;
- WndClass.hInstance = NULL;
- WndClass.hIcon = NULL;
- WndClass.hCursor = NULL;
- WndClass.hbrBackground = NULL;
- WndClass.lpszMenuName = NULL;
- WndClass.lpszClassName = "SkypeApiDispatchWindow";
- RegisterClass(&WndClass);
- // Do not check the retval of RegisterClass, because on non-unicode
- // win98 it will fail, as it is a stub that returns false() there
-
- // Create main window
- hWnd=CreateWindowEx( WS_EX_APPWINDOW|WS_EX_WINDOWEDGE,
- "SkypeApiDispatchWindow", "", WS_BORDER|WS_SYSMENU|WS_MINIMIZEBOX,
- CW_USEDEFAULT, CW_USEDEFAULT, 128, 128, NULL, 0, (HINSTANCE)WndClass.hInstance, 0);
-
- if (!hWnd) {
- OUTPUT("Cannot create window.");
- TellError(GetLastError());
- closesocket(ListenSocket);
- CloseHandle(WndClass.hInstance);
- return EXIT_FAILURE;
- }
- ShowWindow(hWnd, 0);
- UpdateWindow(hWnd);
-
- if (!(SkypeReady=CreateEvent(NULL, TRUE, FALSE, NULL)) ||
- !(ServerThreadBye=CreateEvent(NULL, TRUE, FALSE, NULL))) {
- OUTPUT("Unable to create Mutex!");
- closesocket(ListenSocket);
- CloseHandle(WndClass.hInstance);
- return EXIT_FAILURE;
- }
-
- if (_beginthread(ConnectToSkypeAPI, 0, (void *)FALSE)==-1 ||
- _beginthread(ServerThread, 0, NULL)==-1) {
- OUTPUT("Cannot create thread. Bye..");
- closesocket(ListenSocket);
- CloseHandle(WndClass.hInstance);
- CloseHandle(SkypeReady);
- return EXIT_FAILURE;
- }
-
- signal(SIGINT, &bail_out);
- LOG(("Startup: Messagepump started.\nPress CTRL+C to terminate\n"));
-
- while (GetMessage(&Message, hWnd, 0, 0))
- {
- TranslateMessage(&Message);
- DispatchMessage(&Message);
- }
-
- LOG(("Shutdown: Messagepump stopped"));
-
- if (password) free(password);
- if (AcceptSocket != INVALID_SOCKET) closesocket(AcceptSocket);
- closesocket(ListenSocket);
- LOG(("Shutdown: Waiting for serverthread to quit..."));
- if (WaitForSingleObject(ServerThreadBye, 3000)==WAIT_TIMEOUT)
- {OUTPUT("Serverthread didn't terminate correctly, shutting down anyway...");}
- else
- {LOG(("ServerThread terminated"));}
- CloseHandle(WndClass.hInstance);
- CloseHandle(SkypeReady);
- return exitcode;
-}
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/skypeproxy/skypeproxy.h b/plugins/!NotAdopted/Skype/skypeproxy/skypeproxy.h deleted file mode 100644 index 8ce122990b..0000000000 --- a/plugins/!NotAdopted/Skype/skypeproxy/skypeproxy.h +++ /dev/null @@ -1,36 +0,0 @@ -/*** Skype API ***/
-//Messages
-#define SKYPECONTROLAPI_ATTACH_SUCCESS 0
-#define SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION 1
-#define SKYPECONTROLAPI_ATTACH_REFUSED 2
-#define SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE 3
-#define SKYPECONTROLAPI_ATTACH_API_AVAILABLE 0x8001
-
-// Errors
-#define MISC_ERROR 1
-#define USER_NOT_FOUND 2
-#define USER_NOT_ONLINE 3
-#define USER_BLOCKED 4
-#define TYPE_UNSUPPORTED 5
-#define SENDER_NOT_FRIEND 6
-#define SENDER_NOT_AUTHORIZED 7
-
-
-/*** Debugging macros ***/
-#define OUTPUT(a) printf("* %s\n", a);
-#define LOG(a, b) printf("- %s: %s\n", a, b);
-#define LOGL(a, b) printf("- %s: %d\n", a, b);
-
-/*** Program settings ***/
-#define PING_INTERVAL 10000 // Ping every 10000 msec to see if Skype is still available
-#define USE_AUTHENTICATION 0x01 // Program supports authentication -> Comment to disable!
-
-/*** Commands ***/
-#define AUTHENTICATE 0x01
-#define CAPABILITIES 0x02
-
-/*** Sockets ***/
-#pragma comment(lib, "ws2_32")
-
-/*** Prototypes ***/
-void WatchDogTimer(char *);
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/skypesvc.c b/plugins/!NotAdopted/Skype/skypesvc.c deleted file mode 100755 index bada953bbf..0000000000 --- a/plugins/!NotAdopted/Skype/skypesvc.c +++ /dev/null @@ -1,188 +0,0 @@ -#define __SKYPESVC_C__
-#include "skype.h"
-#include "skypesvc.h"
-#include "skypeapi.h"
-#include "skypeopt.h"
-#include "contacts.h"
-#include "m_toptoolbar.h"
-
-// Exports
-SKYPE_SVCNAMES g_svcNames;
-
-//From skype.c
-extern char protocol, g_szProtoName[];
-extern HINSTANCE hInst;
-extern DWORD mirandaVersion;
-static HANDLE m_hPrebuildCMenu=NULL, m_hStatusHookContact=NULL, m_hContactDeleted=NULL,
- m_hHookModulesLoaded=NULL, m_hHookOkToExit=NULL, m_hOptHook=NULL, m_hHookMirandaExit=NULL,
- m_hTTBModuleLoadedHook = NULL, m_hHookOnUserInfoInit = NULL;
-
-void CreateProtoService(const char* szService, MIRANDASERVICE svc)
-{
- char str[MAXMODULELABELLENGTH];
- _snprintf(str, sizeof(str), "%s%s", SKYPE_PROTONAME, szService);
- CreateServiceFunction(str, svc);
-}
-
-#define CreateServiceName(srvce) _snprintf (g_svcNames.##srvce, sizeof(g_svcNames.##srvce), "%s/"#srvce, SKYPE_PROTONAME);
-
-void CreateServices(void)
-{
- CreateServiceName(ChatNew);
- CreateServiceName(SetAvatar);
- CreateServiceName(SendFile);
- CreateServiceName(HoldCall);
- CreateServiceName(AnswerCall);
- CreateServiceName(ImportHistory);
- CreateServiceName(AddUser);
- CreateServiceName(SkypeOutCallUser);
- CreateServiceName(CallHangupUser);
- CreateServiceName(CallUser);
-
- CreateServiceFunction(SKYPE_CALL, SkypeCall);
- CreateServiceFunction(SKYPE_CALLHANGUP, SkypeCallHangup);
- CreateServiceFunction(SKYPEOUT_CALL, SkypeOutCall);
- CreateServiceFunction(SKYPE_HOLDCALL, SkypeHoldCall);
- CreateServiceFunction(SKYPE_ADDUSER, SkypeAdduserDlg);
- CreateServiceFunction(SKYPE_IMPORTHISTORY, ImportHistory);
- CreateServiceFunction(SKYPE_ANSWERCALL, SkypeAnswerCall);
- CreateServiceFunction(SKYPE_SENDFILE, SkypeSendFile);
- CreateServiceFunction(SKYPE_SETAVATAR, SkypeSetAvatar);
-
- CreateProtoService(PS_GETCAPS, SkypeGetCaps);
- CreateProtoService(PS_GETNAME, SkypeGetName);
- CreateProtoService(PS_LOADICON, SkypeLoadIcon);
- CreateProtoService(PS_SETSTATUS, SkypeSetStatus);
- CreateProtoService(PS_GETSTATUS, SkypeGetStatus);
- CreateProtoService(PS_ADDTOLIST, SkypeAddToList);
- CreateProtoService(PS_ADDTOLISTBYEVENT, SkypeAddToListByEvent);
- CreateProtoService(PS_BASICSEARCH, SkypeBasicSearch);
-
- CreateProtoService(PSS_GETINFO, SkypeGetInfo);
- CreateProtoService(PSS_MESSAGE, SkypeSendMessage);
- CreateProtoService(PSR_MESSAGE, SkypeRecvMessage);
- CreateProtoService(PSS_USERISTYPING, SkypeUserIsTyping);
- CreateProtoService(PSS_AUTHREQUEST, SkypeSendAuthRequest);
- CreateProtoService(PSR_AUTH, SkypeRecvAuth);
- CreateProtoService(PS_AUTHALLOW, SkypeAuthAllow);
- CreateProtoService(PS_AUTHDENY, SkypeAuthDeny);
-
- CreateProtoService(PS_GETAVATARINFO, SkypeGetAvatarInfo);
- CreateProtoService(PS_GETAVATARCAPS, SkypeGetAvatarCaps);
- CreateProtoService(PS_GETMYAVATAR, SkypeGetAvatar);
- CreateProtoService(PS_SETMYAVATAR, SkypeSetAvatar);
-
- CreateProtoService(PS_SETAWAYMSG, SkypeSetAwayMessage);
- CreateProtoService(PS_SETAWAYMSGW, SkypeSetAwayMessageW);
- CreateProtoService(PSS_GETAWAYMSG, SkypeGetAwayMessage);
- CreateProtoService(PS_SETMYNICKNAME, SkypeSetNick);
-
- CreateProtoService(PSS_SKYPEAPIMSG, SkypeReceivedAPIMessage);
- CreateProtoService(SKYPE_REGPROXY, SkypeRegisterProxy);
-}
-
-void HookEvents(void)
-{
- m_hPrebuildCMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
-
- //HookEvent(ME_CLIST_DOUBLECLICKED, ClistDblClick);
- m_hOptHook = HookEvent(ME_OPT_INITIALISE, RegisterOptions);
- m_hStatusHookContact = HookEvent(ME_DB_CONTACT_ADDED,HookContactAdded);
- m_hContactDeleted = HookEvent( ME_DB_CONTACT_DELETED, HookContactDeleted );
- m_hHookModulesLoaded = HookEvent( ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- m_hHookMirandaExit = HookEvent(ME_SYSTEM_OKTOEXIT, MirandaExit);
- m_hHookOkToExit = HookEvent(ME_SYSTEM_PRESHUTDOWN, OkToExit);
-}
-
-void HookEventsLoaded(void)
-{
- // We cannot check for the TTB-service before this event gets fired... :-/
- m_hTTBModuleLoadedHook = HookEvent(ME_TTB_MODULELOADED, CreateTopToolbarButton);
- m_hHookOnUserInfoInit = HookEvent( ME_USERINFO_INITIALISE, OnDetailsInit );
-}
-
-void UnhookEvents(void)
-{
- UnhookEvent(m_hOptHook);
- UnhookEvent(m_hTTBModuleLoadedHook);
- UnhookEvent(m_hHookOnUserInfoInit);
- UnhookEvent(m_hStatusHookContact);
- UnhookEvent(m_hContactDeleted);
- UnhookEvent(m_hHookModulesLoaded);
- UnhookEvent(m_hPrebuildCMenu);
- UnhookEvent(m_hHookOkToExit);
- UnhookEvent(m_hHookMirandaExit);
- //UnhookEvent(ClistDblClick);
-}
-
-INT_PTR SkypeGetCaps(WPARAM wParam, LPARAM lParam) {
- int ret = 0;
-
- UNREFERENCED_PARAMETER(lParam);
-
- switch (wParam) {
- case PFLAGNUM_1:
- ret = PF1_BASICSEARCH | PF1_IM | PF1_MODEMSG; // | PF1_AUTHREQ;
- if (protocol>=5) ret |= PF1_ADDSEARCHRES;
- break;
-
- case PFLAGNUM_2:
- ret = PF2_ONLINE | PF2_SHORTAWAY | PF2_INVISIBLE | PF2_HEAVYDND;
-#ifdef MAPDND
- ret |= PF2_LIGHTDND | PF2_HEAVYDND;
-#endif
- if (!DBGetContactSettingByte(NULL, SKYPE_PROTONAME, "NoSkype3Stats", 0))
- ret |= PF2_LONGAWAY | PF2_FREECHAT;
- break;
-
- case PFLAGNUM_3:
- ret = PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_LONGAWAY | PF2_LIGHTDND | PF2_HEAVYDND | PF2_FREECHAT | PF2_OUTTOLUNCH | PF2_ONTHEPHONE | PF2_IDLE;
- break;
-
- case PFLAGNUM_4:
- ret = PF4_FORCEAUTH | PF4_FORCEADDED | PF4_AVATARS | PF4_SUPPORTTYPING /* Not really, but libgaim compat. */;
- if (mirandaVersion >= 0x070000) ret |= PF4_IMSENDUTF;
- break;
- case PFLAG_UNIQUEIDTEXT:
- ret = (INT_PTR) "NAME";
- break;
- case PFLAG_UNIQUEIDSETTING:
- ret = (INT_PTR) SKYPE_NAME;
- break;
- }
- return ret;
-
-}
-
-INT_PTR SkypeGetName(WPARAM wParam, LPARAM lParam)
-{
- if (lParam)
- {
- strncpy((char *)lParam, SKYPE_PROTONAME, wParam);
- return 0; // Success
- }
- return 1; // Failure
-}
-
-
-INT_PTR SkypeLoadIcon(WPARAM wParam,LPARAM lParam)
-{
- UINT id;
-
- UNREFERENCED_PARAMETER(lParam);
-
- switch(wParam&0xFFFF) {
- case PLI_PROTOCOL: id=IDI_SKYPE; break; // IDI_MAIN is the main icon for the protocol
- default: return NULL;
- }
- return (INT_PTR)LoadImage(hInst,MAKEINTRESOURCE(id),IMAGE_ICON,GetSystemMetrics(wParam&PLIF_SMALL?SM_CXSMICON:SM_CXICON),GetSystemMetrics(wParam&PLIF_SMALL?SM_CYSMICON:SM_CYICON),0);
-}
-
-INT_PTR SkypeGetAvatar(WPARAM wParam,LPARAM lParam)
-{ DBVARIANT dbv;
- if (!DBGetContactSettingString(NULL,SKYPE_PROTONAME, "AvatarFile", &dbv)){
- lstrcpynA((char*)wParam, dbv.pszVal, (int)lParam);
- DBFreeVariant(&dbv);
- }
- return 0;
-}
diff --git a/plugins/!NotAdopted/Skype/skypesvc.h b/plugins/!NotAdopted/Skype/skypesvc.h deleted file mode 100644 index 74c8cd37bf..0000000000 --- a/plugins/!NotAdopted/Skype/skypesvc.h +++ /dev/null @@ -1,24 +0,0 @@ -#include <stdio.h>
-#include <windows.h>
-#include <commctrl.h>
-#include <process.h>
-#include <time.h>
-#include "resource.h"
-
-void CreateProtoService(const char* szService, MIRANDASERVICE svc);
-void HookEvents(void);
-void HookEventsLoaded(void);
-void UnhookEvents(void);
-void CreateServices(void);
-INT_PTR SkypeLoadIcon(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeGetName(WPARAM wParam, LPARAM lParam);
-INT_PTR SkypeGetCaps(WPARAM wParam, LPARAM lParam);
-/* SkypeGetAvatar
- *
- * Purpose: Return the avatar file name
- * Params : wParam=0
- * lParam=0
- * Returns: 0 - Success
- * -1 - Failure
- */
-INT_PTR SkypeGetAvatar(WPARAM wParam,LPARAM lParam);
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/utf8.c b/plugins/!NotAdopted/Skype/utf8.c deleted file mode 100755 index 063e973444..0000000000 --- a/plugins/!NotAdopted/Skype/utf8.c +++ /dev/null @@ -1,334 +0,0 @@ -/*
- * Copyright (C) 2001 Peter Harris <peter.harris@hummingbird.com>
- * Copyright (C) 2001 Edmund Grimley Evans <edmundo@rano.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; 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
- */
-
-/*
- * Convert a string between UTF-8 and the locale's charset.
- */
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "utf8.h"
-
-#ifdef _WIN32
-
- /* Thanks to Peter Harris <peter.harris@hummingbird.com> for this win32
- * code.
- */
-
-#include <stdio.h>
-#include <windows.h>
-
-unsigned char *make_utf8_string(const wchar_t *unicode)
-{
- int size = 0, index = 0, out_index = 0;
- unsigned char *out;
- unsigned short c;
-
- /* first calculate the size of the target string */
- c = unicode[index++];
- while(c) {
- if(c < 0x0080) {
- size += 1;
- } else if(c < 0x0800) {
- size += 2;
- } else {
- size += 3;
- }
- c = unicode[index++];
- }
-
- out = (unsigned char *) malloc(size + 1);
- if (out == NULL)
- return NULL;
- index = 0;
-
- c = unicode[index++];
- while(c)
- {
- if(c < 0x080) {
- out[out_index++] = (unsigned char)c;
- } else if(c < 0x800) {
- #pragma warning (suppress: 4244) // conversion from 'int' to 'unsigned char', possible loss of data
- out[out_index++] = 0xc0 | (c >> 6);
- out[out_index++] = 0x80 | (c & 0x3f);
- } else {
- out[out_index++] = 0xe0 | (c >> 12);
- out[out_index++] = 0x80 | ((c >> 6) & 0x3f);
- out[out_index++] = 0x80 | (c & 0x3f);
- }
- c = unicode[index++];
- }
- out[out_index] = 0x00;
-
- return out;
-}
-
-wchar_t *make_unicode_string(const unsigned char *utf8)
-{
- int size = 0, index = 0, out_index = 0;
- wchar_t *out;
- unsigned char c;
-
- /* first calculate the size of the target string */
- c = utf8[index++];
- while(c) {
- if((c & 0x80) == 0) {
- index += 0;
- } else if((c & 0xe0) == 0xe0) {
- index += 2;
- } else {
- index += 1;
- }
- size += 1;
- c = utf8[index++];
- }
-
- out = (wchar_t *) malloc((size + 1) * sizeof(wchar_t));
- if (out == NULL)
- return NULL;
- index = 0;
-
- c = utf8[index++];
- while(c)
- {
- if((c & 0x80) == 0) {
- out[out_index++] = c;
- } else if((c & 0xe0) == 0xe0) {
- out[out_index] = (c & 0x1F) << 12;
- c = utf8[index++];
- out[out_index] |= (c & 0x3F) << 6;
- c = utf8[index++];
- out[out_index++] |= (c & 0x3F);
- } else {
- out[out_index] = (c & 0x3F) << 6;
- c = utf8[index++];
- out[out_index++] |= (c & 0x3F);
- }
- c = utf8[index++];
- }
- out[out_index] = 0;
-
- return out;
-}
-
-int utf8_encode(const char *from, char **to)
-{
- wchar_t *unicode;
- INT64 wchars, err;
-
- wchars = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, from, strlen(from), NULL, 0);
-
- if(wchars == 0)
- {
-// fprintf(stderr, "Unicode translation error %d\n"), GetLastError();
- return -1;
- }
-
- unicode = (wchar_t *) calloc(wchars + 1, sizeof(unsigned short));
- if(unicode == NULL)
- {
-// fprintf(stderr, "Out of memory processing string to UTF8\n");
- return -1;
- }
-
- err = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, from, strlen(from), unicode, wchars);
- if(err != wchars)
- {
- free(unicode);
-// fprintf(stderr, "Unicode translation error %d\n"), GetLastError();
- return -1;
- }
-
- /* On NT-based windows systems, we could use WideCharToMultiByte(), but
- * MS doesn't actually have a consistent API across win32.
- */
- *to = (char *) make_utf8_string(unicode);
-
- free(unicode);
- return 0;
-}
-
-int utf8_decode(const char *from, char **to)
-{
- wchar_t *unicode;
- int chars, err;
-// LPCPINFO lpCPInfo;
-
- /* On NT-based windows systems, we could use MultiByteToWideChar(CP_UTF8), but
- * MS doesn't actually have a consistent API across win32.
- */
- unicode = make_unicode_string( (const unsigned char *)from);
- if(unicode == NULL)
- {
- fprintf(stderr, "Out of memory processing string from UTF8 to UNICODE16\n");
- return -1;
- }
-
- //if(GetCPInfo(CP_ACP,lpCPInfo))
- {
-
- chars = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, unicode, -1, NULL, 0, NULL, NULL);
- }
- /*else
- {
- chars = WideCharToMultiByte(GetConsoleCP(), WC_COMPOSITECHECK, unicode, -1, NULL, 0, NULL, NULL);
- }*/
-
- if(chars == 0)
- {
- fprintf(stderr, "Unicode translation error %ld\n", GetLastError());
- free(unicode);
- return -1;
- }
-
- *to = (char *) calloc(chars + 1, sizeof(unsigned char));
- if(*to == NULL)
- {
- fprintf(stderr, "Out of memory processing string to local charset\n");
- free(unicode);
- return -1;
- }
-
- //err = WideCharToMultiByte(GetConsoleCP(), WC_COMPOSITECHECK, unicode, -1, *to, chars, NULL, NULL);
- err = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, unicode, -1, *to, chars, NULL, NULL);
- if(err != chars)
- {
- fprintf(stderr, "Unicode translation error %ld\n", GetLastError());
- free(unicode);
- free(*to);
- *to = NULL;
- return -1;
- }
-
- free(unicode);
- return 0;
-}
-
-#ifndef _UNICODE
-char *make_tchar_string(const unsigned char *utf8) {
- char *ret;
- if (utf8_decode((const char*)utf8, &ret)==-1) return NULL;
- return ret;
-}
-#endif
-
-#else /* End win32. Rest is for real operating systems */
-
-
-#ifdef HAVE_LANGINFO_CODESET
-#include <langinfo.h>
-#endif
-
-int iconvert(const char *fromcode, const char *tocode,
- const char *from, size_t fromlen,
- char **to, size_t *tolen);
-
-static char *current_charset = "BIG-5"; /* means "US-ASCII" */
-
-void convert_set_charset(const char *charset)
-{
-
- if (!charset)
- charset = getenv("CHARSET");
-
-#ifdef HAVE_LANGINFO_CODESET
- if (!charset)
- charset = nl_langinfo(CODESET);
-#endif
-
- free(current_charset);
- current_charset = 0;
- if (charset && *charset)
- current_charset = _strdup(charset);
-}
-
-static int convert_buffer(const char *fromcode, const char *tocode,
- const char *from, size_t fromlen,
- char **to, size_t *tolen)
-{
- int ret = -1;
-
-#ifdef HAVE_ICONV
- ret = iconvert(fromcode, tocode, from, fromlen, to, tolen);
- if (ret != -1)
- return ret;
-#endif
-
-#ifndef HAVE_ICONV /* should be ifdef USE_CHARSET_CONVERT */
- ret = charset_convert(fromcode, tocode, from, fromlen, to, tolen);
- if (ret != -1)
- return ret;
-#endif
-
- return ret;
-}
-
-static int convert_string(const char *fromcode, const char *tocode,
- const char *from, char **to, char replace)
-{
- int ret;
- size_t fromlen;
- char *s;
-
- fromlen = lstrlen(from);
- ret = convert_buffer(fromcode, tocode, from, fromlen, to, 0);
- if (ret == -2)
- return -1;
- if (ret != -1)
- return ret;
-
- s = malloc(fromlen + 1);
- if (!s)
- return -1;
- lstrcpy(s, from);
- *to = s;
- for (; *s; s++)
- if (*s & ~0x7f)
- *s = replace;
- return 3;
-}
-
-int utf8_encode(const char *from, char **to)
-{
- char *charset;
-
- if (!current_charset)
- convert_set_charset(0);
- charset = current_charset ? current_charset : "US-ASCII";
- return convert_string(charset, "UTF-8", from, to, '#');
-}
-
-int utf8_decode(const char *from, char **to)
-{
- char *charset;
-
- if(*from == 0) {
- *to = malloc(1);
- **to = 0;
- return 1;
- }
-
- if (!current_charset)
- convert_set_charset(0);
- charset = current_charset ? current_charset : "US-ASCII";
- return convert_string("UTF-8", charset, from, to, '?');
-}
-
-#endif
diff --git a/plugins/!NotAdopted/Skype/utf8.h b/plugins/!NotAdopted/Skype/utf8.h deleted file mode 100644 index 70c533deca..0000000000 --- a/plugins/!NotAdopted/Skype/utf8.h +++ /dev/null @@ -1,47 +0,0 @@ -/*
- * Convert a string between UTF-8 and the locale's charset.
- * Invalid bytes are replaced by '#', and characters that are
- * not available in the target encoding are replaced by '?'.
- *
- * If the locale's charset is not set explicitly then it is
- * obtained using nl_langinfo(CODESET), where available, the
- * environment variable CHARSET, or assumed to be US-ASCII.
- *
- * Return value of conversion functions:
- *
- * -1 : memory allocation failed
- * 0 : data was converted exactly
- * 1 : valid data was converted approximately (using '?')
- * 2 : input was invalid (but still converted, using '#')
- * 3 : unknown encoding (but still converted, using '?')
- */
-
-#ifndef __UTF8_H
-#define __UTF8_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void convert_set_charset(const char *charset);
-
-int utf8_encode(const char *from, char **to);
-int utf8_decode(const char *from, char **to);
-wchar_t *make_unicode_string(const unsigned char *utf8);
-unsigned char *make_utf8_string(const wchar_t *unicode);
-#ifdef _UNICODE
-#define make_tchar_string make_unicode_string
-// Helpers for strings that only can contain 7bit chars to not make unneccessary memory allocation
-#define make_nonutf_tchar_string(x) make_tchar_string(x)
-#define free_nonutf_tchar_string(x) if(x) free(x);
-#else
-char *make_tchar_string(const unsigned char *utf8);
-#define make_nonutf_tchar_string(x) (char*)x
-#define free_nonutf_tchar_string(x)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __UTF8_H */
diff --git a/plugins/!NotAdopted/Skype/util.c b/plugins/!NotAdopted/Skype/util.c deleted file mode 100644 index ce5ad9c756..0000000000 --- a/plugins/!NotAdopted/Skype/util.c +++ /dev/null @@ -1,57 +0,0 @@ -#include <stdlib.h>
-
-char * __cdecl strtok_r (
- char * string,
- const char * control,
- char **nextoken
- )
-{
- unsigned char *str;
- const unsigned char *ctrl = (const unsigned char*)control;
-
- unsigned char map[32];
- int count;
-
- /* Clear control map */
- for (count = 0; count < 32; count++)
- map[count] = 0;
-
- /* Set bits in delimiter table */
- do {
- map[*ctrl >> 3] |= (1 << (*ctrl & 7));
- } while (*ctrl++);
-
- /* Initialize str. If string is NULL, set str to the saved
- * pointer (i.e., continue breaking tokens out of the string
- * from the last strtok call) */
- if (string)
- str = (unsigned char*)string;
- else
- str = (unsigned char*)(*nextoken);
-
- /* Find beginning of token (skip over leading delimiters). Note that
- * there is no token iff this loop sets str to point to the terminal
- * null (*str == '\0') */
- while ( (map[*str >> 3] & (1 << (*str & 7))) && *str )
- str++;
-
- string = (char*)str;
-
- /* Find the end of the token. If it is not the end of the string,
- * put a null there. */
- for ( ; *str ; str++ )
- if ( map[*str >> 3] & (1 << (*str & 7)) ) {
- *str++ = '\0';
- break;
- }
-
- /* Update nextoken (or the corresponding field in the per-thread data
- * structure */
- *nextoken = (char*)str;
-
- /* Determine if a token has been found. */
- if ( string == (char*)str )
- return NULL;
- else
- return string;
-}
diff --git a/plugins/!NotAdopted/Skype/util.h b/plugins/!NotAdopted/Skype/util.h deleted file mode 100644 index 181f5d1878..0000000000 --- a/plugins/!NotAdopted/Skype/util.h +++ /dev/null @@ -1,7 +0,0 @@ -char * __cdecl strtok_r (
- char * string,
- const char * control,
- char **nextoken
- );
-
-void TranslateMirandaRelativePathToAbsolute(LPCSTR cszPath, LPSTR szAbsolutePath, BOOL fQuoteSpaces);
diff --git a/plugins/!NotAdopted/Skype/voiceservice.c b/plugins/!NotAdopted/Skype/voiceservice.c deleted file mode 100755 index b47f07692c..0000000000 --- a/plugins/!NotAdopted/Skype/voiceservice.c +++ /dev/null @@ -1,156 +0,0 @@ -#include "skype.h"
-#include "skypeapi.h"
-#include "skypesvc.h"
-#include "voiceservice.h"
-#include <m_voiceservice.h>
-
-#pragma warning (push)
-#pragma warning (disable: 4100) // unreferenced formal parameter
-#include <m_utils.h>
-#pragma warning (pop)
-
-HANDLE hVoiceNotify = NULL;
-BOOL has_voice_service = FALSE;
-
-extern char g_szProtoName[];
-
-
-BOOL HasVoiceService()
-{
- return has_voice_service;
-}
-
-void NofifyVoiceService(HANDLE hContact, char *callId, int state)
-{
- VOICE_CALL vc = {0};
- vc.cbSize = sizeof(vc);
- vc.szModule = SKYPE_PROTONAME;
- vc.id = callId;
- vc.flags = VOICE_CALL_CONTACT;
- vc.state = state;
- vc.hContact = hContact;
- NotifyEventHooks(hVoiceNotify, (WPARAM) &vc, 0);
-}
-
-static INT_PTR VoiceGetInfo(WPARAM wParam, LPARAM lParam)
-{
- UNREFERENCED_PARAMETER(wParam);
- UNREFERENCED_PARAMETER(lParam);
-
- return VOICE_SUPPORTED | VOICE_CALL_CONTACT | VOICE_CAN_HOLD;
-}
-
-static HANDLE FindContactByCallId(char *callId)
-{
- HANDLE hContact;
- int iCmpRes;
- for (hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- hContact != NULL;
- hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
- {
- char *szProto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
-
- DBVARIANT dbv;
- if (szProto != NULL
- && !strcmp(szProto, SKYPE_PROTONAME)
- && DBGetContactSettingByte(hContact, SKYPE_PROTONAME, "ChatRoom", 0) == 0
- && !DBGetContactSettingString(hContact, SKYPE_PROTONAME, "CallId", &dbv))
- {
- iCmpRes = strcmp(callId, dbv.pszVal);
- DBFreeVariant(&dbv);
- if (iCmpRes == 0) return hContact;
- }
- }
-
- return NULL;
-}
-
-static INT_PTR VoiceCall(WPARAM wParam, LPARAM lParam)
-{
- DBVARIANT dbv;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (!wParam) return -1;
-
- if (DBGetContactSettingString((HANDLE)wParam, SKYPE_PROTONAME, SKYPE_NAME, &dbv))
- return -1;
-
- SkypeSend("CALL %s", dbv.pszVal);
- DBFreeVariant (&dbv);
-
- return 0;
-}
-
-static INT_PTR VoiceAnswer(WPARAM wParam, LPARAM lParam)
-{
- char *callId = (char *) wParam;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (!wParam) return -1;
-
- if (FindContactByCallId(callId) == NULL)
- return -1;
-
- SkypeSend("SET %s STATUS INPROGRESS", callId);
- testfor("ERROR", 200);
-
- return 0;
-}
-
-static INT_PTR VoiceDrop(WPARAM wParam, LPARAM lParam)
-{
- char *callId = (char *) wParam;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (!wParam) return -1;
-
- if (FindContactByCallId(callId) == NULL)
- return -1;
-
- SkypeSend("SET %s STATUS FINISHED", callId);
-
- return 0;
-}
-
-static INT_PTR VoiceHold(WPARAM wParam, LPARAM lParam)
-{
- char *callId = (char *) wParam;
-
- UNREFERENCED_PARAMETER(lParam);
-
- if (!wParam) return -1;
-
- if (FindContactByCallId(callId) == NULL)
- return -1;
-
- SkypeSend("SET %s STATUS ONHOLD", callId);
-
- return 0;
-}
-
-void VoiceServiceInit()
-{
- // leecher, 26.03.2011: Did this ever work in the old versions??
- char szEvent[MAXMODULELABELLENGTH];
-
- _snprintf (szEvent, sizeof(szEvent), "%s%s", SKYPE_PROTONAME, PE_VOICE_CALL_STATE);
- hVoiceNotify = CreateHookableEvent( szEvent );
- CreateProtoService( PS_VOICE_GETINFO, VoiceGetInfo );
- CreateProtoService( PS_VOICE_CALL, VoiceCall );
- CreateProtoService( PS_VOICE_ANSWERCALL, VoiceAnswer );
- CreateProtoService( PS_VOICE_DROPCALL, VoiceDrop );
- CreateProtoService( PS_VOICE_HOLDCALL, VoiceHold );
-}
-
-void VoiceServiceExit()
-{
- DestroyHookableEvent(hVoiceNotify);
-}
-
-void VoiceServiceModulesLoaded()
-{
- has_voice_service = ServiceExists(MS_VOICESERVICE_REGISTER);
-}
\ No newline at end of file diff --git a/plugins/!NotAdopted/Skype/voiceservice.h b/plugins/!NotAdopted/Skype/voiceservice.h deleted file mode 100755 index 0ffbd6d9ca..0000000000 --- a/plugins/!NotAdopted/Skype/voiceservice.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _VOICESERVICE_H_
-#define _VOICESERVICE_H_
-
-#pragma warning (push)
-#pragma warning (disable: 4201) // nonstandard extension used : nameless struct/union
-#include <m_voice.h>
-#pragma warning (pop)
-
-BOOL HasVoiceService();
-void VoiceServiceInit();
-void VoiceServiceExit();
-void VoiceServiceModulesLoaded();
-void NofifyVoiceService(HANDLE hContact, char *callId, int state) ;
-
-
-
-#endif // _VOICESERVICE_H_
-
|