summaryrefslogtreecommitdiff
path: root/protocols/WhatsAppWeb/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-10-06 19:12:14 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-10-06 19:12:14 +0300
commit9cd5d7e425fd66c9e5f4805f994adcff75858ae8 (patch)
tree23cf58a047db5b2a3af829206fd933a94f22bb71 /protocols/WhatsAppWeb/src
parentfc98d12131682de5aa3329283ae519d33e8fd439 (diff)
WhatsAppWeb: first version restored from deprecated
Diffstat (limited to 'protocols/WhatsAppWeb/src')
-rw-r--r--protocols/WhatsAppWeb/src/avatars.cpp74
-rw-r--r--protocols/WhatsAppWeb/src/db.h35
-rw-r--r--protocols/WhatsAppWeb/src/main.cpp50
-rw-r--r--protocols/WhatsAppWeb/src/proto.cpp228
-rw-r--r--protocols/WhatsAppWeb/src/proto.h93
-rw-r--r--protocols/WhatsAppWeb/src/resource.h43
-rw-r--r--protocols/WhatsAppWeb/src/stdafx.cxx8
-rw-r--r--protocols/WhatsAppWeb/src/stdafx.h47
-rw-r--r--protocols/WhatsAppWeb/src/version.h14
9 files changed, 592 insertions, 0 deletions
diff --git a/protocols/WhatsAppWeb/src/avatars.cpp b/protocols/WhatsAppWeb/src/avatars.cpp
new file mode 100644
index 0000000000..cacd251639
--- /dev/null
+++ b/protocols/WhatsAppWeb/src/avatars.cpp
@@ -0,0 +1,74 @@
+#include "stdafx.h"
+
+INT_PTR WhatsAppProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
+{
+ PROTO_AVATAR_INFORMATION *pai = (PROTO_AVATAR_INFORMATION*)lParam;
+
+ ptrA id(getStringA(pai->hContact, isChatRoom(pai->hContact) ? "ChatRoomID" : WHATSAPP_KEY_ID));
+ if (id == NULL)
+ return GAIR_NOAVATAR;
+
+ CMStringW tszFileName(GetAvatarFileName(pai->hContact));
+ wcsncpy_s(pai->filename, tszFileName.c_str(), _TRUNCATE);
+ pai->format = PA_FORMAT_JPEG;
+
+ ptrA szAvatarId(getStringA(pai->hContact, WHATSAPP_KEY_AVATAR_ID));
+ if (szAvatarId == NULL || (wParam & GAIF_FORCE) != 0)
+ if (pai->hContact != NULL && isOnline()) {
+ // m_pConnection->sendGetPicture(id, "image");
+ return GAIR_WAITFOR;
+ }
+
+ debugLogA("No avatar");
+ return GAIR_NOAVATAR;
+}
+
+INT_PTR WhatsAppProto::GetAvatarCaps(WPARAM wParam, LPARAM lParam)
+{
+ switch (wParam) {
+ case AF_PROPORTION:
+ return PIP_SQUARE;
+
+ case AF_FORMATSUPPORTED: // Jabber supports avatars of virtually all formats
+ return PA_FORMAT_JPEG;
+
+ case AF_ENABLED:
+ return TRUE;
+
+ case AF_MAXSIZE:
+ POINT *size = (POINT*)lParam;
+ if (size)
+ size->x = size->y = 640;
+ return 0;
+ }
+ return -1;
+}
+
+CMStringW WhatsAppProto::GetAvatarFileName(MCONTACT hContact)
+{
+ CMStringW result = m_tszAvatarFolder + L"\\";
+
+ CMStringA jid;
+ if (hContact != NULL) {
+ ptrA szId(getStringA(hContact, isChatRoom(hContact) ? "ChatRoomID" : WHATSAPP_KEY_ID));
+ if (szId == NULL)
+ return L"";
+
+ jid = szId;
+ }
+ else jid = m_szJid;
+
+ return result + _A2T(jid.c_str()) + L".jpg";
+}
+
+INT_PTR WhatsAppProto::GetMyAvatar(WPARAM wParam, LPARAM lParam)
+{
+ std::wstring tszOwnAvatar(m_tszAvatarFolder + L"\\myavatar.jpg");
+ wcsncpy_s((wchar_t*)wParam, lParam, tszOwnAvatar.c_str(), _TRUNCATE);
+ return 0;
+}
+
+INT_PTR WhatsAppProto::SetMyAvatar(WPARAM, LPARAM lParam)
+{
+ return 0;
+}
diff --git a/protocols/WhatsAppWeb/src/db.h b/protocols/WhatsAppWeb/src/db.h
new file mode 100644
index 0000000000..3c73fb18e7
--- /dev/null
+++ b/protocols/WhatsAppWeb/src/db.h
@@ -0,0 +1,35 @@
+#define MODULENAME "WhatsApp"
+
+// DB keys
+#define WHATSAPP_KEY_ID "ID"
+#define WHATSAPP_KEY_LOGIN "Login"
+#define WHATSAPP_KEY_CC "CountryCode"
+#define WHATSAPP_KEY_NICK "Nick"
+#define WHATSAPP_KEY_PASS "Password"
+#define WHATSAPP_KEY_IDX "DeviceID"
+#define WHATSAPP_KEY_MAP_STATUSES "MapStatuses"
+#define WHATSAPP_KEY_LOGGING_ENABLE "LoggingEnable"
+#define WHATSAPP_KEY_NAME "RealName"
+#define WHATSAPP_KEY_LAST_SEEN "LastSeen"
+#define WHATSAPP_KEY_LAST_SEEN_DENIED "LastSeenDenied"
+#define WHATSAPP_KEY_AVATAR_ID "AvatarId"
+#define WHATSAPP_KEY_SYSTRAY_NOTIFY "UseSystrayNotify"
+#define WHATSAPP_KEY_DEF_GROUP "DefaultGroup"
+#define WHATSAPP_KEY_REG_CODE "RegistrationCode"
+#define WHATSAPP_KEY_SSL "UseSSL"
+#define WHATSAPP_KEY_AUTORUNCHATS "AutoRunChats"
+#define WHATSAPP_KEY_USE_REMOTE_TIME "UseRemoteTime"
+
+#define WHATSAPP_KEY_EVENT_CLIENT_ENABLE "EventClientEnable"
+#define WHATSAPP_KEY_EVENT_OTHER_ENABLE "EventOtherEnable"
+
+#define WHATSAPP_KEY_EVENT_CLIENT_COLBACK "PopupClientColorBack"
+#define WHATSAPP_KEY_EVENT_CLIENT_COLTEXT "PopupClientColorText"
+#define WHATSAPP_KEY_EVENT_CLIENT_TIMEOUT "PopupClientTimeout"
+#define WHATSAPP_KEY_EVENT_CLIENT_DEFAULT "PopupClientColorDefault"
+
+#define WHATSAPP_KEY_EVENT_OTHER_COLBACK "PopupOtherColorBack"
+#define WHATSAPP_KEY_EVENT_OTHER_COLTEXT "PopupOtherColorText"
+#define WHATSAPP_KEY_EVENT_OTHER_TIMEOUT "PopupOtherTimeout"
+#define WHATSAPP_KEY_EVENT_OTHER_DEFAULT "PopupOtherColorDefault"
+
diff --git a/protocols/WhatsAppWeb/src/main.cpp b/protocols/WhatsAppWeb/src/main.cpp
new file mode 100644
index 0000000000..f414c61c19
--- /dev/null
+++ b/protocols/WhatsAppWeb/src/main.cpp
@@ -0,0 +1,50 @@
+#include "stdafx.h"
+#include "version.h"
+
+CMPlugin g_plugin;
+
+PLUGININFOEX pluginInfo = {
+ sizeof(PLUGININFOEX),
+ __PLUGIN_NAME,
+ PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
+ __DESCRIPTION,
+ __AUTHOR,
+ __AUTHOREMAIL,
+ __COPYRIGHT,
+ UNICODE_AWARE, //not transient
+ // {4f1ff7fa-4d75-44b9-93b0-2ced2e4f9e3e}
+ { 0x4f1ff7fa, 0x4d75, 0x44b9, { 0x93, 0xb0, 0x2c, 0xed, 0x2e, 0x4f, 0x9e, 0x3e } }
+
+};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Interface information
+
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
+
+/////////////////////////////////////////////////////////////////////////////
+
+CMPlugin::CMPlugin() :
+ ACCPROTOPLUGIN<WhatsAppProto>(MODULENAME, pluginInfo)
+{
+ SetUniqueId(WHATSAPP_KEY_ID);
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Load
+
+int CMPlugin::Load()
+{
+ // InitIcons();
+ // InitContactMenus();
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// Unload
+
+int CMPlugin::Unload()
+{
+ return 0;
+}
diff --git a/protocols/WhatsAppWeb/src/proto.cpp b/protocols/WhatsAppWeb/src/proto.cpp
new file mode 100644
index 0000000000..ac7a5b2bff
--- /dev/null
+++ b/protocols/WhatsAppWeb/src/proto.cpp
@@ -0,0 +1,228 @@
+#include "stdafx.h"
+
+struct SearchParam
+{
+ SearchParam(const wchar_t *_jid, LONG _id) :
+ jid(_jid), id(_id)
+ {}
+
+ std::wstring jid;
+ LONG id;
+};
+
+WhatsAppProto::WhatsAppProto(const char *proto_name, const wchar_t *username)
+ : PROTO<WhatsAppProto>(proto_name, username),
+ m_tszDefaultGroup(getWStringA(WHATSAPP_KEY_DEF_GROUP))
+{
+ db_set_resident(m_szModuleName, "StatusMsg");
+
+ // CreateProtoService(PS_CREATEACCMGRUI, &WhatsAppProto::SvcCreateAccMgrUI);
+
+ CreateProtoService(PS_GETAVATARINFO, &WhatsAppProto::GetAvatarInfo);
+ CreateProtoService(PS_GETAVATARCAPS, &WhatsAppProto::GetAvatarCaps);
+ CreateProtoService(PS_GETMYAVATAR, &WhatsAppProto::GetMyAvatar);
+ CreateProtoService(PS_SETMYAVATAR, &WhatsAppProto::SetMyAvatar);
+
+ // HookProtoEvent(ME_OPT_INITIALISE, &WhatsAppProto::OnOptionsInit);
+ // HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &WhatsAppProto::OnBuildStatusMenu);
+
+ // Create standard network connection
+ wchar_t descr[512];
+ mir_snwprintf(descr, TranslateT("%s server connection"), m_tszUserName);
+
+ NETLIBUSER nlu = {};
+ nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE;
+ nlu.szSettingsModule = m_szModuleName;
+ nlu.szDescriptiveName.w = descr;
+ m_hNetlibUser = Netlib_RegisterUser(&nlu);
+ if (m_hNetlibUser == nullptr) {
+ wchar_t error[200];
+ mir_snwprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
+ MessageBox(nullptr, error, L"Miranda NG", MB_OK | MB_ICONERROR);
+ }
+
+ m_tszAvatarFolder = CMStringW(VARSW(L"%miranda_avatarcache%")) + L"\\" + m_tszUserName;
+ DWORD dwAttributes = GetFileAttributes(m_tszAvatarFolder.c_str());
+ if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
+ CreateDirectoryTreeW(m_tszAvatarFolder.c_str());
+
+ if (m_tszDefaultGroup == NULL)
+ m_tszDefaultGroup = mir_wstrdup(L"WhatsApp");
+ Clist_GroupCreate(0, m_tszDefaultGroup);
+}
+
+WhatsAppProto::~WhatsAppProto()
+{
+}
+
+INT_PTR WhatsAppProto::GetCaps(int type, MCONTACT)
+{
+ switch (type) {
+ case PFLAGNUM_1:
+ return PF1_IM | PF1_FILESEND | PF1_CHAT | PF1_BASICSEARCH | PF1_ADDSEARCHRES | PF1_MODEMSGRECV;
+ case PFLAGNUM_2:
+ return PF2_ONLINE | PF2_INVISIBLE;
+ case PFLAGNUM_3:
+ return 0;
+ case PFLAGNUM_4:
+ return PF4_NOCUSTOMAUTH | PF4_NOAUTHDENYREASON | PF4_IMSENDOFFLINE | PF4_OFFLINEFILES | PF4_SUPPORTTYPING | PF4_AVATARS;
+ case PFLAGNUM_5:
+ return 0;
+ case PFLAG_UNIQUEIDTEXT:
+ return (DWORD_PTR)"WhatsApp ID";
+ }
+ return 0;
+}
+
+int WhatsAppProto::SetStatus(int new_status)
+{
+ if (m_iDesiredStatus == new_status)
+ return 0;
+
+ int oldStatus = m_iStatus;
+ debugLogA("===== Beginning SetStatus process");
+
+ // Routing statuses not supported by WhatsApp
+ switch (new_status) {
+ case ID_STATUS_INVISIBLE:
+ case ID_STATUS_OFFLINE:
+ m_iDesiredStatus = new_status;
+ break;
+
+ case ID_STATUS_ONLINE:
+ case ID_STATUS_FREECHAT:
+ m_iDesiredStatus = ID_STATUS_ONLINE;
+ break;
+
+ default:
+ m_iDesiredStatus = ID_STATUS_INVISIBLE;
+ break;
+ }
+
+ if (m_iDesiredStatus == ID_STATUS_OFFLINE) {
+ m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ }
+ else if (!IsStatusConnecting(m_iStatus)) {
+ m_iStatus = ID_STATUS_CONNECTING;
+ ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+ }
+ else ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)oldStatus, m_iStatus);
+
+ return 0;
+}
+
+MCONTACT WhatsAppProto::AddToList(int flags, PROTOSEARCHRESULT *psr)
+{
+ if (psr->id.w == nullptr)
+ return NULL;
+
+ std::string phone(T2Utf(psr->id.w));
+ std::string jid(phone + "@s.whatsapp.net");
+
+/* MCONTACT hContact = AddToContactList(jid, phone.c_str());
+ if (!(flags & PALF_TEMPORARY))
+ db_unset(hContact, "CList", "NotOnList");
+
+ return hContact;*/
+}
+
+int WhatsAppProto::SendMsg(MCONTACT hContact, int, const char *msg)
+{
+ ptrA jid(getStringA(hContact, "ID"));
+ if (jid == NULL)
+ return 0;
+
+ if (!isOnline()) {
+ debugLogA("No connection");
+ return 0;
+ }
+
+ return 0;
+}
+
+int WhatsAppProto::UserIsTyping(MCONTACT hContact, int type)
+{
+ if (hContact && isOnline()) {
+ ptrA jid(getStringA(hContact, WHATSAPP_KEY_ID));
+ if (jid && isOnline()) {
+ }
+ }
+
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void WhatsAppProto::SearchAckThread(void *targ)
+{
+ Sleep(100);
+
+ SearchParam *param = (SearchParam*)targ;
+ PROTOSEARCHRESULT psr = { 0 };
+ psr.cbSize = sizeof(psr);
+ psr.flags = PSR_UNICODE;
+ psr.nick.w = psr.firstName.w = psr.lastName.w = L"";
+ psr.id.w = (wchar_t*)param->jid.c_str();
+
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)param->id, (LPARAM)&psr);
+ ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)param->id, 0);
+
+ delete param;
+}
+
+HANDLE WhatsAppProto::SearchBasic(const wchar_t* id)
+{
+ if (isOffline())
+ return nullptr;
+
+ // fake - we always accept search
+ SearchParam *param = new SearchParam(id, -1);
+ ForkThread(&WhatsAppProto::SearchAckThread, param);
+ return (HANDLE)param->id;
+}
+
+//////////////////////////////////////////////////////////////////////////////
+// EVENTS
+
+int WhatsAppProto::OnUserInfo(WPARAM, LPARAM hContact)
+{
+/* ptrA jid(getStringA(hContact, WHATSAPP_KEY_ID));
+ if (jid && isOnline()) {
+ m_pConnection->sendGetPicture((char*)jid, "image");
+ m_pConnection->sendPresenceSubscriptionRequest((char*)jid);
+ }
+*/
+ return 0;
+}
+
+void WhatsAppProto::RequestFriendship(MCONTACT hContact)
+{
+ if (hContact == NULL || isOffline())
+ return;
+
+/* ptrA jid(getStringA(hContact, WHATSAPP_KEY_ID));
+ if (jid)
+ m_pConnection->sendPresenceSubscriptionRequest((char*)jid); */
+}
+
+LRESULT CALLBACK PopupDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch (message) {
+ case WM_COMMAND:
+ // After a click, destroy popup
+ PUDeletePopup(hwnd);
+ break;
+
+ case WM_CONTEXTMENU:
+ PUDeletePopup(hwnd);
+ break;
+
+ case UM_FREEPLUGINDATA:
+ // After close, free
+ mir_free(PUGetPluginData(hwnd));
+ return FALSE;
+ }
+
+ return DefWindowProc(hwnd, message, wParam, lParam);
+};
diff --git a/protocols/WhatsAppWeb/src/proto.h b/protocols/WhatsAppWeb/src/proto.h
new file mode 100644
index 0000000000..564a31eb2e
--- /dev/null
+++ b/protocols/WhatsAppWeb/src/proto.h
@@ -0,0 +1,93 @@
+#if !defined(PROTO_H)
+#define PROTO_H
+
+struct WAChatInfo
+{
+ WAChatInfo(wchar_t *_jid, wchar_t *_nick) :
+ tszJid(_jid), tszNick(_nick)
+ {
+ bActive = false;
+ }
+
+ ptrW tszJid, tszNick, tszOwner;
+ bool bActive;
+
+ MCONTACT hContact;
+};
+
+class WhatsAppProto : public PROTO<WhatsAppProto>
+{
+ ptrW m_tszDefaultGroup;
+
+ CMStringA m_szJid;
+ CMStringW m_tszAvatarFolder;
+
+ /// Avatars //////////////////////////////////////////////////////////////////////////
+ CMStringW GetAvatarFileName(MCONTACT hContact);
+
+ INT_PTR __cdecl GetAvatarInfo(WPARAM, LPARAM);
+ INT_PTR __cdecl GetAvatarCaps(WPARAM, LPARAM);
+ INT_PTR __cdecl GetMyAvatar(WPARAM, LPARAM);
+ INT_PTR __cdecl SetMyAvatar(WPARAM, LPARAM);
+
+public:
+ WhatsAppProto(const char *proto_name, const wchar_t *username);
+ ~WhatsAppProto();
+
+ inline bool isOnline() const
+ { return false;
+ }
+
+ inline bool isOffline() const
+ { return (m_iStatus == ID_STATUS_OFFLINE);
+ }
+
+ inline bool isInvisible() const
+ { return (m_iStatus == ID_STATUS_INVISIBLE);
+ }
+
+ // PROTO_INTERFACE ///////////////////////////////////////////////////////////////////
+
+ MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT *psr) override;
+ INT_PTR __cdecl GetCaps(int type, MCONTACT hContact = NULL) override;
+ HANDLE __cdecl SearchBasic(const wchar_t* id) override;
+ int __cdecl SendMsg(MCONTACT hContact, int flags, const char* msg) override;
+ int __cdecl SetStatus(int iNewStatus) override;
+ int __cdecl UserIsTyping(MCONTACT hContact, int type) override;
+
+ // Services //////////////////////////////////////////////////////////////////////////
+
+ INT_PTR __cdecl SvcCreateAccMgrUI(WPARAM, LPARAM);
+
+ // Events ////////////////////////////////////////////////////////////////////////////
+
+ int __cdecl OnOptionsInit(WPARAM, LPARAM);
+ int __cdecl OnUserInfo(WPARAM, LPARAM);
+ int __cdecl OnBuildStatusMenu(WPARAM, LPARAM);
+
+ // Worker Threads ////////////////////////////////////////////////////////////////////
+
+ void __cdecl stayConnectedLoop(void*);
+ void __cdecl sentinelLoop(void*);
+
+ // Processing Threads ////////////////////////////////////////////////////////////////
+
+ void __cdecl ProcessBuddyList(void*);
+ void __cdecl SearchAckThread(void*);
+
+ // Contacts handling /////////////////////////////////////////////////////////////////
+
+ void SetAllContactStatuses(int status, bool reset_client = false);
+ void UpdateStatusMsg(MCONTACT hContact);
+ void RequestFriendship(MCONTACT hContact);
+};
+
+struct CMPlugin : public ACCPROTOPLUGIN<WhatsAppProto>
+{
+ CMPlugin();
+
+ int Load() override;
+ int Unload() override;
+};
+
+#endif
diff --git a/protocols/WhatsAppWeb/src/resource.h b/protocols/WhatsAppWeb/src/resource.h
new file mode 100644
index 0000000000..67e976f3ca
--- /dev/null
+++ b/protocols/WhatsAppWeb/src/resource.h
@@ -0,0 +1,43 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by ..\res\whatsapp.rc
+//
+#define IDD_INPUTBOX 102
+#define IDR_REGISTERUTILITY 103
+#define IDD_ACCMGRUI 104
+#define IDD_GROUPCHAT_INVITE 105
+#define IDD_OPTIONS 106
+#define IDI_WHATSAPP 203
+#define IDI_ADD_GROUP 206
+#define IDI_RENAME_GROUP 208
+#define IDC_CLIST 1001
+#define IDC_NEWJID 1002
+#define IDC_LOGIN 1003
+#define IDC_PW 1004
+#define IDC_SSL 1005
+#define IDC_NICK 1006
+#define IDC_BUTTON_REQUEST_SMS_CODE 1007
+#define IDC_BUTTON_REGISTER 1008
+#define IDC_CC 1009
+#define IDC_VALUE 1010
+#define IDC_SSL2 1010
+#define IDC_CANCEL 1011
+#define IDC_OK 1012
+#define IDC_PW2 1013
+#define IDC_TEXT 1014
+#define IDC_INVITE 1015
+#define IDC_AUTORUN 1016
+#define IDC_DEFGROUP 1017
+#define IDC_REMOTE_TIME 1018
+#define IDC_BUTTON_REQUEST_VOICE_CODE 1019
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 107
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1020
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/protocols/WhatsAppWeb/src/stdafx.cxx b/protocols/WhatsAppWeb/src/stdafx.cxx
new file mode 100644
index 0000000000..115d277c7a
--- /dev/null
+++ b/protocols/WhatsAppWeb/src/stdafx.cxx
@@ -0,0 +1,8 @@
+// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet.
+// WhatsAPI++.pch ist der vorkompilierte Header.
+// stdafx.obj enthдlt die vorkompilierten Typinformationen.
+
+#include "stdafx.h"
+
+// TODO: Auf zusдtzliche Header verweisen, die in STDAFX.H
+// und nicht in dieser Datei erforderlich sind.
diff --git a/protocols/WhatsAppWeb/src/stdafx.h b/protocols/WhatsAppWeb/src/stdafx.h
new file mode 100644
index 0000000000..1f3834b9bc
--- /dev/null
+++ b/protocols/WhatsAppWeb/src/stdafx.h
@@ -0,0 +1,47 @@
+/*
+
+WhatsApp plugin for Miranda NG
+Copyright © 2013-14 Uli Hecht
+
+*/
+
+#pragma once
+
+//#pragma warning(push)
+//#pragma warning(disable:4312)
+#pragma warning(disable:4996)
+#pragma warning(disable:4290)
+
+#include <time.h>
+#include <windows.h>
+
+#include <newpluginapi.h>
+#include <m_avatars.h>
+#include <m_chat.h>
+#include <m_clist.h>
+#include <m_database.h>
+#include <m_history.h>
+#include <m_imgsrvc.h>
+#include <m_ignore.h>
+#include <m_langpack.h>
+#include <m_message.h>
+#include <m_netlib.h>
+#include <m_options.h>
+#include <m_popup.h>
+#include <m_protocols.h>
+#include <m_protosvc.h>
+#include <m_protoint.h>
+#include <m_skin.h>
+#include <m_string.h>
+#include <statusmodes.h>
+#include <m_userinfo.h>
+#include <m_icolib.h>
+#include <m_utils.h>
+#include <m_xml.h>
+#include <m_hotkeys.h>
+#include <m_folders.h>
+#include <m_json.h>
+#include <m_gui.h>
+
+#include "db.h"
+#include "proto.h"
diff --git a/protocols/WhatsAppWeb/src/version.h b/protocols/WhatsAppWeb/src/version.h
new file mode 100644
index 0000000000..2aa4528fd5
--- /dev/null
+++ b/protocols/WhatsAppWeb/src/version.h
@@ -0,0 +1,14 @@
+#define __MAJOR_VERSION 0
+#define __MINOR_VERSION 0
+#define __RELEASE_NUM 1
+#define __BUILD_NUM 1
+
+#include <stdver.h>
+
+#define __PLUGIN_NAME "WhatsAppWeb protocol"
+#define __FILENAME "WhatsApp.dll"
+#define __DESCRIPTION "WhatsApp Web protocol support for Miranda NG."
+#define __AUTHOR "George Hazan"
+#define __AUTHOREMAIL ""
+#define __AUTHORWEB "https://miranda-ng.org/p/WhatsApp/"
+#define __COPYRIGHT "© 2019 Miranda NG Team"