diff options
Diffstat (limited to 'protocols/WhatsApp/src/connection.cpp')
-rw-r--r-- | protocols/WhatsApp/src/connection.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/protocols/WhatsApp/src/connection.cpp b/protocols/WhatsApp/src/connection.cpp index 2acc8a89fa..8c1f16c456 100644 --- a/protocols/WhatsApp/src/connection.cpp +++ b/protocols/WhatsApp/src/connection.cpp @@ -118,13 +118,10 @@ void WhatsAppProto::stayConnectedLoop(void*) portNumber = 5222, resource += "-5222";
this->conn = new WASocketConnection("c.whatsapp.net", portNumber);
- this->connection = new WAConnection(&this->connMutex, this, this);
-
- this->connection->domain = "s.whatsapp.net";
- this->connection->user = this->phoneNumber;
- this->connection->resource = resource;
+ this->connection = new WAConnection(this->phoneNumber, resource, &this->connMutex, this, this);
+ this->connection->init(&writerMutex, this->conn);
{
- WALogin login(connection, new BinTreeNodeReader(connection, conn), new BinTreeNodeWriter(connection, conn, &writerMutex), password);
+ WALogin login(connection, password);
std::vector<unsigned char>* nextChallenge = login.login(*this->challenge);
delete this->challenge;
|