summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/WhatsApp/src/connection.cpp')
-rw-r--r--protocols/WhatsApp/src/connection.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/protocols/WhatsApp/src/connection.cpp b/protocols/WhatsApp/src/connection.cpp
index 76c2808d12..2b87830046 100644
--- a/protocols/WhatsApp/src/connection.cpp
+++ b/protocols/WhatsApp/src/connection.cpp
@@ -143,6 +143,7 @@ void WhatsAppProto::stayConnectedLoop(void*)
CODE_BLOCK_TRY
+ std::string password = ptrA((char*)mir_base64_decode(pass.c_str(),0));
BYTE UseSSL = db_get_b(NULL, this->ModuleName(), WHATSAPP_KEY_SSL, 0);
if (UseSSL) {
this->conn = new WASocketConnection("c.whatsapp.net", 443);
@@ -150,14 +151,14 @@ void WhatsAppProto::stayConnectedLoop(void*)
connection = new WAConnection(&this->connMutex, this, this);
login = new WALogin(connection, new BinTreeNodeReader(connection, conn, WAConnection::dictionary, WAConnection::DICTIONARY_LEN),
new BinTreeNodeWriter(connection, conn, WAConnection::dictionary, WAConnection::DICTIONARY_LEN, &writerMutex),
- "s.whatsapp.net", this->phoneNumber, std::string(ACCOUNT_RESOURCE) +"-443", base64_decode(pass), nick);
+ "s.whatsapp.net", this->phoneNumber, std::string(ACCOUNT_RESOURCE) +"-443", password, nick);
} else {
this->conn = new WASocketConnection("c.whatsapp.net", 5222);
connection = new WAConnection(&this->connMutex, this, this);
login = new WALogin(connection, new BinTreeNodeReader(connection, conn, WAConnection::dictionary, WAConnection::DICTIONARY_LEN),
new BinTreeNodeWriter(connection, conn, WAConnection::dictionary, WAConnection::DICTIONARY_LEN, &writerMutex),
- "s.whatsapp.net", this->phoneNumber, std::string(ACCOUNT_RESOURCE) +"-5222", base64_decode(pass), nick);
+ "s.whatsapp.net", this->phoneNumber, std::string(ACCOUNT_RESOURCE) +"-5222", password, nick);
}
std::vector<unsigned char>* nextChallenge = login->login(*this->challenge);