diff options
author | George Hazan <george.hazan@gmail.com> | 2015-01-26 20:59:45 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-01-26 20:59:45 +0000 |
commit | e64e17858c88e0b8302a34cebc02be0019422947 (patch) | |
tree | be3c6510a0f7453c731286c5778547b00d469baa | |
parent | 0acc48076d8b2148d60d8a2532753c1eb06de276 (diff) |
minus another shitty new
git-svn-id: http://svn.miranda-ng.org/main/trunk@11920 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp | 8 | ||||
-rw-r--r-- | protocols/WhatsApp/src/WhatsAPI++/WALogin.h | 4 | ||||
-rw-r--r-- | protocols/WhatsApp/src/connection.cpp | 4 | ||||
-rw-r--r-- | protocols/WhatsApp/src/proto.cpp | 5 | ||||
-rw-r--r-- | protocols/WhatsApp/src/proto.h | 2 |
5 files changed, 8 insertions, 15 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp b/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp index dd29850885..c788fd3124 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp @@ -28,7 +28,7 @@ WALogin::WALogin(WAConnection* connection, const std::string& password) this->expire_date = 0L;
}
-std::vector<unsigned char>* WALogin::login(const std::vector<unsigned char>& authBlob)
+std::vector<unsigned char> WALogin::login(const std::vector<unsigned char>& authBlob)
{
m_pConnection->out->streamStart(m_pConnection->domain, m_pConnection->resource);
@@ -96,7 +96,7 @@ std::vector<unsigned char>* WALogin::getAuthBlob(const std::vector<unsigned char return list;
}
-std::vector<unsigned char>* WALogin::readFeaturesUntilChallengeOrSuccess()
+std::vector<unsigned char> WALogin::readFeaturesUntilChallengeOrSuccess()
{
while (ProtocolTreeNode *root = m_pConnection->in->nextTree()) {
#ifdef _DEBUG
@@ -117,10 +117,10 @@ std::vector<unsigned char>* WALogin::readFeaturesUntilChallengeOrSuccess() m_pConnection->logData("Send response");
std::vector<unsigned char> data = this->readSuccess();
m_pConnection->logData("Read success");
- return new std::vector<unsigned char>(data.begin(), data.end());
+ return std::vector<unsigned char>(data.begin(), data.end());
}
if (ProtocolTreeNode::tagEquals(root, "success")) {
- std::vector<unsigned char>* ret = new std::vector<unsigned char>(root->data->begin(), root->data->end());
+ std::vector<unsigned char> ret(root->data->begin(), root->data->end());
this->parseSuccessNode(root);
delete root;
return ret;
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WALogin.h b/protocols/WhatsApp/src/WhatsAPI++/WALogin.h index 05e654549e..1e4269b531 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WALogin.h +++ b/protocols/WhatsApp/src/WhatsAPI++/WALogin.h @@ -50,7 +50,7 @@ private: void sendResponse(const std::vector<unsigned char>& challengeData);
void sendFeatures();
void sendAuth(const std::vector<unsigned char>& nonce);
- std::vector<unsigned char>* readFeaturesUntilChallengeOrSuccess();
+ std::vector<unsigned char> readFeaturesUntilChallengeOrSuccess();
void parseSuccessNode(ProtocolTreeNode *node);
std::vector<unsigned char> readSuccess();
@@ -62,7 +62,7 @@ public: WALogin(WAConnection* connection, const std::string& password);
~WALogin();
- std::vector<unsigned char>* login(const std::vector<unsigned char>& blobLength);
+ std::vector<unsigned char> login(const std::vector<unsigned char> &blob);
};
#endif /* WALOGIN_H_ */
diff --git a/protocols/WhatsApp/src/connection.cpp b/protocols/WhatsApp/src/connection.cpp index d911bc31a4..c4ed44c7dd 100644 --- a/protocols/WhatsApp/src/connection.cpp +++ b/protocols/WhatsApp/src/connection.cpp @@ -90,9 +90,7 @@ void WhatsAppProto::stayConnectedLoop(void*) {
WALogin login(m_pConnection, password);
- std::vector<unsigned char> *nextChallenge = login.login(*this->challenge);
- delete this->challenge;
- this->challenge = nextChallenge;
+ m_Challenge = login.login(m_Challenge);
m_pConnection->setLogin(&login);
}
m_pConnection->nick = this->nick;
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index bf54fa6e5f..1a423cc0f8 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -15,8 +15,6 @@ struct SearchParam WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) :
PROTO<WhatsAppProto>(proto_name, username)
{
- this->challenge = new std::vector < unsigned char > ;
-
update_loop_lock_ = CreateEvent(NULL, false, false, NULL);
FMessage::generating_lock = new Mutex();
@@ -51,9 +49,6 @@ WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) : WhatsAppProto::~WhatsAppProto()
{
CloseHandle(update_loop_lock_);
-
- if (this->challenge != NULL)
- delete this->challenge;
}
int WhatsAppProto::OnModulesLoaded(WPARAM wParam, LPARAM lParam)
diff --git a/protocols/WhatsApp/src/proto.h b/protocols/WhatsApp/src/proto.h index 7293245831..622296cdd9 100644 --- a/protocols/WhatsApp/src/proto.h +++ b/protocols/WhatsApp/src/proto.h @@ -159,7 +159,7 @@ private: Mutex connMutex;
int lastPongTime;
- std::vector<unsigned char> *challenge;
+ std::vector<unsigned char> m_Challenge;
string phoneNumber;
string jid, nick;
std::map<string, MCONTACT> hContactByJid;
|