summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2015-07-10 11:18:07 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2015-07-10 11:18:07 +0000
commit92d9e370f525f0d8ce80e1168f946294c7916979 (patch)
tree9c61b0897fff7c5c037fcc9da996b33d45cc2ccf /protocols/SkypeWeb
parente330841281557201cad1b6c4291cdd9e66fac696 (diff)
SkypeWeb: Crashfix.
git-svn-id: http://svn.miranda-ng.org/main/trunk@14523 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r--protocols/SkypeWeb/src/skype_login.cpp8
-rw-r--r--protocols/SkypeWeb/src/skype_messages.cpp5
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp2
3 files changed, 10 insertions, 5 deletions
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp
index 2e7d99a311..dc9c678519 100644
--- a/protocols/SkypeWeb/src/skype_login.cpp
+++ b/protocols/SkypeWeb/src/skype_login.cpp
@@ -26,6 +26,12 @@ void CSkypeProto::Login()
requestQueue->Start();
int tokenExpires(getDword("TokenExpiresIn", 0));
ptrA login(getStringA(SKYPE_SETTINGS_ID));
+ ptrA password(getStringA(SKYPE_SETTINGS_PASSWORD));
+ if (login == NULL || password == NULL)
+ {
+ ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGIN_ERROR_UNKNOWN);
+ return;
+ }
HistorySynced = isTerminated = false;
if ((tokenExpires - 1800) > time(NULL))
OnLoginSuccess();
@@ -34,7 +40,7 @@ void CSkypeProto::Login()
if (strstr(login, "@"))
SendRequest(new LoginMSRequest(), &CSkypeProto::OnMSLoginFirst);
else
- SendRequest(new LoginOAuthRequest(login, ptrA(getStringA(SKYPE_SETTINGS_PASSWORD))), &CSkypeProto::OnLoginOAuth);
+ SendRequest(new LoginOAuthRequest(login, password), &CSkypeProto::OnLoginOAuth);
}
}
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp
index 019379379c..7d39add241 100644
--- a/protocols/SkypeWeb/src/skype_messages.cpp
+++ b/protocols/SkypeWeb/src/skype_messages.cpp
@@ -183,8 +183,7 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
DBEVENTINFO dbei = { sizeof(dbei) };
CMStringA msg;
dbei.cbBlob = db_event_getBlobSize(dbevent);
- mir_ptr<BYTE> blob((PBYTE)mir_alloc(dbei.cbBlob));
- dbei.pBlob = blob;
+ dbei.pBlob = mir_ptr<BYTE>((PBYTE)mir_alloc(dbei.cbBlob));
db_event_get(dbevent, &dbei);
@@ -265,7 +264,7 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node)
HXML xmlNode = xmlGetNthChild(xml, _T("file"), i);
if (xmlNode == NULL)
break;
- fileSize = atoi(_T2A(xmlGetAttrValue(xmlNode, _T("size"))));
+ fileSize = _ttoi(xmlGetAttrValue(xmlNode, _T("size")));
ptrA fileName(mir_utf8encodeT(xmlGetText(xmlNode)));
if (fileName == NULL || fileSize == NULL)
continue;
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index bf99dbe576..867dd99d7a 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -66,7 +66,7 @@ CSkypeProto::~CSkypeProto()
delete requestQueue;
Netlib_CloseHandle(m_hNetlibUser);
m_hNetlibUser = NULL;
-
+ CloseHandle(m_hTrouterEvent);
if (m_hCallHook)
DestroyHookableEvent(m_hCallHook);
if (m_hPopupClassCall)