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