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/WhatsAPI++ | |
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/WhatsAPI++')
12 files changed, 14 insertions, 22 deletions
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;
|