diff options
author | George Hazan <george.hazan@gmail.com> | 2016-02-09 09:37:04 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-02-09 09:37:04 +0000 |
commit | a2e3d77c3aa849f3dd29be0ef114f9ea7e126146 (patch) | |
tree | 49e4515e2a29d61db0975a2fca81f77556cae19a /protocols/WhatsApp/src | |
parent | b4cff17a1fb3c178b396c8f5d98d1cf03bc6ff4d (diff) |
unified project for WhatsApp
git-svn-id: http://svn.miranda-ng.org/main/trunk@16249 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src')
26 files changed, 29 insertions, 35 deletions
diff --git a/protocols/WhatsApp/src/WASocketConnection.cpp b/protocols/WhatsApp/src/WASocketConnection.cpp index 188bc023be..0de6be5884 100644 --- a/protocols/WhatsApp/src/WASocketConnection.cpp +++ b/protocols/WhatsApp/src/WASocketConnection.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
#include "WASocketConnection.h"
HANDLE WASocketConnection::hNetlibUser = NULL;
diff --git a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp index 0dfa824738..b3ed6aa3f5 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeReader.cpp @@ -5,7 +5,7 @@ * Author: Antonio
*/
-#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
#include "BinTreeNodeReader.h"
#include "WAException.h"
diff --git a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp index a0137e5180..19bf6a466f 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp @@ -5,7 +5,7 @@ * Author: Antonio
*/
-#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
#include "BinTreeNodeWriter.h"
#include "utilities.h"
diff --git a/protocols/WhatsApp/src/WhatsAPI++/ByteArray.cpp b/protocols/WhatsApp/src/WhatsAPI++/ByteArray.cpp index 5df55f97ab..8dbc044e67 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/ByteArray.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/ByteArray.cpp @@ -5,7 +5,7 @@ * Author: Antonio
*/
-#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
#include "ByteArray.h"
#include "WAException.h"
diff --git a/protocols/WhatsApp/src/WhatsAPI++/FMessage.cpp b/protocols/WhatsApp/src/WhatsAPI++/FMessage.cpp index 8f5fd2dcc9..8358560f99 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/FMessage.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/FMessage.cpp @@ -5,7 +5,7 @@ * Author: Antonio
*/
-#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
#include "utilities.h"
diff --git a/protocols/WhatsApp/src/WhatsAPI++/KeyStream.cpp b/protocols/WhatsApp/src/WhatsAPI++/KeyStream.cpp index c50e4cbbd1..563e5ac7f1 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/KeyStream.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/KeyStream.cpp @@ -5,7 +5,7 @@ * Author: Antonio
*/
-#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
#include "WALogin.h"
#include "ByteArray.h"
diff --git a/protocols/WhatsApp/src/WhatsAPI++/MediaUploader.cpp b/protocols/WhatsApp/src/WhatsAPI++/MediaUploader.cpp index 319ad02555..7d3d02b30d 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/MediaUploader.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/MediaUploader.cpp @@ -1,4 +1,4 @@ -#include "../common.h"
+#include "../stdafx.h"
#include "MediaUploader.h"
// TODO get rid of unneeded headers added by NETLIBHTTPREQUEST. it sould look like this:
@@ -74,11 +74,8 @@ namespace MediaUploader {
string filePath = message->media_url;
string to = message->key.remote_jid;
- long fileSize = message->media_size;
string extension = split(filePath, '.')[1];
- const BYTE *path = (const BYTE*)filePath.c_str();
-
uint8_t digest[16];
md5_string(filePath, digest);
char dest[33];
@@ -99,8 +96,6 @@ namespace MediaUploader hBAOS += "Content-Type: " + getMimeFromExtension(extension) + "\r\n\r\n";
string fBAOS = "\r\n--" + boundary + "--\r\n";
- long contentlength = sizeof(hBAOS) + sizeof(fBAOS) + fileSize;
-
return sendData(url, hBAOS, filePath, fBAOS);
}
diff --git a/protocols/WhatsApp/src/WhatsAPI++/PhoneNumber.cpp b/protocols/WhatsApp/src/WhatsAPI++/PhoneNumber.cpp index 966e7cd28c..dc5466321d 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/PhoneNumber.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/PhoneNumber.cpp @@ -3,7 +3,7 @@ *
*/
-#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
#include "PhoneNumber.h"
diff --git a/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp b/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp index 7ef362ef4b..2e04563fda 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/ProtocolTreeNode.cpp @@ -5,7 +5,7 @@ * Author: Antonio
*/
-#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
#include "WAException.h"
#include "ProtocolTreeNode.h"
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp index dd69603d7c..6b1336e6d7 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp @@ -5,7 +5,7 @@ * Author: Antonio
*/
-#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
#include "ProtocolTreeNode.h"
#include "utilities.h"
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp b/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp index 8e0c4a2983..957716e2b0 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp @@ -13,7 +13,7 @@ #include <map>
#include <stdlib.h>
-#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
using namespace Utilities;
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WARegister.cpp b/protocols/WhatsApp/src/WhatsAPI++/WARegister.cpp index 2f6754d45e..f7371c7fc8 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WARegister.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WARegister.cpp @@ -3,7 +3,7 @@ *
*/
-#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
#include "WARegister.h"
#include "PhoneNumber.h"
diff --git a/protocols/WhatsApp/src/WhatsAPI++/utilities.cpp b/protocols/WhatsApp/src/WhatsAPI++/utilities.cpp index bbffd4712a..9c56a0c7dd 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/utilities.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/utilities.cpp @@ -1,4 +1,4 @@ -#include "../common.h" // #TODO Remove Miranda-dependency
+#include "../stdafx.h" // #TODO Remove Miranda-dependency
#include "utilities.h"
#include "WAException.h"
@@ -166,7 +166,6 @@ string bytesToHex(unsigned char* bytes, int length) {
string ret(length * 2, ' ');
string::iterator p = ret.begin();
- int i = 0;
for (int c = 0; c < length; c++) {
int ub = bytes[c];
*p++ = forDigit(ub >> 4);
@@ -283,11 +282,9 @@ bool saveChallengeData(const std::vector<unsigned char>& data, const std::string std::string utf8_to_utf16(const std::string &utf8)
{
std::vector<unsigned long> unicode;
- size_t i = 0;
- while (i < utf8.size()) {
+ for (size_t i = 0; i < utf8.size();) {
unsigned long uni;
size_t todo;
- bool error = false;
unsigned char ch = utf8[i++];
if (ch <= 0x7F) {
uni = ch;
@@ -314,7 +311,7 @@ std::string utf8_to_utf16(const std::string &utf8) for (size_t j = 0; j < todo; ++j) {
if (i == utf8.size())
throw std::logic_error("not a UTF-8 string");
- unsigned char ch = utf8[i++];
+ ch = utf8[i++];
if (ch < 0x80 || ch > 0xBF)
throw std::logic_error("not a UTF-8 string");
uni <<= 6;
diff --git a/protocols/WhatsApp/src/avatars.cpp b/protocols/WhatsApp/src/avatars.cpp index 670d5acae7..9e6c24a6ac 100644 --- a/protocols/WhatsApp/src/avatars.cpp +++ b/protocols/WhatsApp/src/avatars.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
INT_PTR WhatsAppProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
{
diff --git a/protocols/WhatsApp/src/chat.cpp b/protocols/WhatsApp/src/chat.cpp index 7213760549..f816e40f1d 100644 --- a/protocols/WhatsApp/src/chat.cpp +++ b/protocols/WhatsApp/src/chat.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
static const TCHAR *sttStatuses[] = { LPGENT("Members"), LPGENT("Owners") };
diff --git a/protocols/WhatsApp/src/connection.cpp b/protocols/WhatsApp/src/connection.cpp index be64ed1b41..646a5b134f 100644 --- a/protocols/WhatsApp/src/connection.cpp +++ b/protocols/WhatsApp/src/connection.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
void WhatsAppProto::stayConnectedLoop(void*)
{
diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index e657c1d00d..baea533421 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
MCONTACT WhatsAppProto::AddToContactList(const std::string &jid, const char *new_name)
{
diff --git a/protocols/WhatsApp/src/dialogs.cpp b/protocols/WhatsApp/src/dialogs.cpp index 6bc7889e06..9d95acc5da 100644 --- a/protocols/WhatsApp/src/dialogs.cpp +++ b/protocols/WhatsApp/src/dialogs.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
#define szAskSendSms LPGEN("An SMS with registration code will be sent to your mobile phone.\nNotice that you are not able to use the real WhatsApp and this plugin simultaneously!\nContinue?")
#define szAskCall LPGEN("A call with registration code will be made to your mobile phone.\nNotice that you are not able to use the real WhatsApp and this plugin simultaneously!\nContinue?")
diff --git a/protocols/WhatsApp/src/main.cpp b/protocols/WhatsApp/src/main.cpp index 5d0697d998..20480c0332 100644 --- a/protocols/WhatsApp/src/main.cpp +++ b/protocols/WhatsApp/src/main.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
#include "version.h"
CLIST_INTERFACE *pcli;
diff --git a/protocols/WhatsApp/src/media.cpp b/protocols/WhatsApp/src/media.cpp index 1d127bafe8..7136a3862a 100644 --- a/protocols/WhatsApp/src/media.cpp +++ b/protocols/WhatsApp/src/media.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
HANDLE WhatsAppProto::SendFile(MCONTACT hContact, const TCHAR* desc, TCHAR **ppszFiles) {
if (!isOnline())
diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index c27d0e74fe..163144df5e 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
int WhatsAppProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT *pre)
{
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 75ff99c887..9cfa22ac8e 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
#include "WhatsAPI++\WARegister.h"
diff --git a/protocols/WhatsApp/src/stdafx.cpp b/protocols/WhatsApp/src/stdafx.cxx index 142f352f76..8d5b5b5857 100644 --- a/protocols/WhatsApp/src/stdafx.cpp +++ b/protocols/WhatsApp/src/stdafx.cxx @@ -2,7 +2,7 @@ // WhatsAPI++.pch ist der vorkompilierte Header.
// stdafx.obj enthält die vorkompilierten Typinformationen.
-#include "common.h"
+#include "stdafx.h"
// TODO: Auf zusätzliche Header verweisen, die in STDAFX.H
// und nicht in dieser Datei erforderlich sind.
diff --git a/protocols/WhatsApp/src/common.h b/protocols/WhatsApp/src/stdafx.h index abd76ecf13..9620bb10b7 100644 --- a/protocols/WhatsApp/src/common.h +++ b/protocols/WhatsApp/src/stdafx.h @@ -66,6 +66,8 @@ Copyright © 2013-14 Uli Hecht #include <m_json.h>
#include <m_gui.h>
+#include "..\..\libs\libaxolotl\src\axolotl.h"
+
#include "constants.h"
#include "utils.h"
#include "db.h"
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp index 9f743c4362..939def3d81 100644 --- a/protocols/WhatsApp/src/theme.cpp +++ b/protocols/WhatsApp/src/theme.cpp @@ -1,4 +1,4 @@ - #include "common.h"
+#include "stdafx.h"
extern OBJLIST<WhatsAppProto> g_Instances;
diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp index 946e581bbd..35f84bcc1e 100644 --- a/protocols/WhatsApp/src/utils.cpp +++ b/protocols/WhatsApp/src/utils.cpp @@ -1,4 +1,4 @@ -#include "common.h"
+#include "stdafx.h"
TCHAR* utils::removeA(TCHAR *str)
{
|