diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-01 18:44:27 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-01 18:44:27 +0000 |
commit | 1c0ee54dedd808a106ca64edd249598def1c9ed3 (patch) | |
tree | c9d7886c50aa4dbeed72e60c979229d23cec9ab1 /protocols/SkypeWeb | |
parent | c77bc8ad3240272d3c784aa79b153b3d1cab726d (diff) |
SkypeWeb: More fixes & optimization
git-svn-id: http://svn.miranda-ng.org/main/trunk@14783 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/resource.h | 1 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_db.cpp | 13 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_dialogs.cpp | 3 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_events.cpp | 74 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_history_sync.cpp | 31 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_icons.cpp | 1 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_login.cpp | 5 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_messages.cpp | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_network.cpp | 6 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_poll_processing.cpp | 18 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 14 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 13 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_search.cpp | 10 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_timers.cpp | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_utils.cpp | 2 |
16 files changed, 100 insertions, 101 deletions
diff --git a/protocols/SkypeWeb/src/resource.h b/protocols/SkypeWeb/src/resource.h index cf253ef0ef..40a04e3b8e 100644 --- a/protocols/SkypeWeb/src/resource.h +++ b/protocols/SkypeWeb/src/resource.h @@ -27,7 +27,6 @@ #define IDC_CONTACT 1032
#define IDC_MESASUREAD 1033
#define IDC_PLACE 1034
-#define IDC_CHECK1 1035
#define IDC_USEHOST 1035
// Next default values for new objects
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 522e844232..2bb553f785 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -337,7 +337,7 @@ void CSkypeProto::OnChatEvent(const JSONNode &node) RemoveChatContact(_A2T(szConversationName), target, target, true, initiator);
}
- else if (messageType.c_str() == "ThreadActivity/TopicUpdate")
+ else if (messageType == "ThreadActivity/TopicUpdate")
{
//content=<topicupdate><eventtime>1429532702130</eventtime><initiator>8:user</initiator><value>test topic</value></topicupdate>
ptrA xinitiator, value;
diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp index 1d730d4296..a449070524 100644 --- a/protocols/SkypeWeb/src/skype_db.cpp +++ b/protocols/SkypeWeb/src/skype_db.cpp @@ -109,7 +109,7 @@ MEVENT CSkypeProto::AppendDBEvent(MCONTACT hContact, MEVENT hEvent, const char * << JSONNode("text", szContent);
jEdits << jEdit;
- jMsg << jEdits;
+ jMsg << jEdits;
}
@@ -119,12 +119,13 @@ MEVENT CSkypeProto::AppendDBEvent(MCONTACT hContact, MEVENT hEvent, const char * MEVENT CSkypeProto::AddEventToDb(MCONTACT hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob)
{
- DBEVENTINFO dbei = { sizeof(dbei) };
- dbei.szModule = this->m_szModuleName;
+ DBEVENTINFO dbei;
+ dbei.cbSize = sizeof(dbei);
+ dbei.szModule = m_szModuleName;
dbei.timestamp = timestamp;
dbei.eventType = type;
- dbei.cbBlob = cbBlob;
- dbei.pBlob = pBlob;
- dbei.flags = flags;
+ dbei.cbBlob = cbBlob;
+ dbei.pBlob = pBlob;
+ dbei.flags = flags;
return db_event_add(hContact, &dbei);
}
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_dialogs.cpp b/protocols/SkypeWeb/src/skype_dialogs.cpp index 9cf2c4f2ec..6df224fe80 100644 --- a/protocols/SkypeWeb/src/skype_dialogs.cpp +++ b/protocols/SkypeWeb/src/skype_dialogs.cpp @@ -64,8 +64,7 @@ CSkypeGCCreateDlg::CSkypeGCCreateDlg(CSkypeProto *proto) : }
CSkypeGCCreateDlg::~CSkypeGCCreateDlg()
{
- for (int i = 0; i < m_ContactsList.getCount(); i++)
- mir_free(m_ContactsList[i]);
+ CSkypeProto::FreeCharList(m_ContactsList);
m_ContactsList.destroy();
}
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp index 26c3853b89..58095bb8ee 100644 --- a/protocols/SkypeWeb/src/skype_events.cpp +++ b/protocols/SkypeWeb/src/skype_events.cpp @@ -16,25 +16,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "stdafx.h"
+#define INVALID_DATA Translate("Invalid data!")
INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
{
DBEVENTGETTEXT *pEvent = (DBEVENTGETTEXT *)lParam;
- INT_PTR nRetVal = 0;
+ CMStringA szText;
- ptrA pszText;
-
switch (pEvent->dbei->eventType)
{
case SKYPE_DB_EVENT_TYPE_EDITED_MESSAGE:
{
- CMStringA text;
+
JSONNode jMsg = JSONNode::parse((char*)pEvent->dbei->pBlob);
if (jMsg)
{
JSONNode &jOriginalMsg = jMsg["original_message"];
- text.AppendFormat(Translate("Original message:\n\t%s\n"), jOriginalMsg["text"].as_string().c_str());
+ szText.AppendFormat(Translate("Original message:\n\t%s\n"), mir_utf8decodeA(jOriginalMsg["text"].as_string().c_str()));
JSONNode &jEdits = jMsg["edits"];
for (auto it = jEdits.begin(); it != jEdits.end(); ++it)
{
@@ -44,22 +43,19 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam) char szTime[MAX_PATH];
strftime(szTime, sizeof(szTime), "%X %x", localtime(&time));
- text.AppendFormat(Translate("Edited at %s:\n\t%s\n"), szTime, jEdit["text"].as_string().c_str());
+ szText.AppendFormat(Translate("Edited at %s:\n\t%s\n"), szTime, mir_utf8decodeA(jEdit["text"].as_string().c_str()));
}
}
else
{
- text = mir_utf8encode(Translate("Invalid data!"));
+ szText = INVALID_DATA;
}
-
- pszText = mir_utf8decodeA(text);
break;
}
case SKYPE_DB_EVENT_TYPE_CALL_INFO:
{
- CMStringA text;
HXML xml = xmlParseString(ptrT(mir_utf8decodeT((char*)pEvent->dbei->pBlob)), 0, _T("partlist"));
if (xml != NULL)
{
@@ -72,9 +68,19 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam) if (xmlPart != NULL)
{
HXML xmlName = xmlGetChildByPath(xmlPart, _T("name"), 0);
+ HXML xmlDuration = xmlGetChildByPath(xmlPart, _T("duration"), 0);
+ time_t callDuration = 0;
+ if (xmlDuration != NULL)
+ {
+ callDuration = _ttol(ptrT((TCHAR*)xmlGetText(xmlDuration)));
+ xmlDestroyNode(xmlDuration);
+ }
if (xmlName != NULL)
{
- text.AppendFormat(Translate("%s %s this call.\n"), _T2A(xmlGetText(xmlName)), bType ? Translate("enters") : Translate("leaves"));
+ char szTime[MAX_PATH];
+ strftime(szTime, sizeof(szTime), "%X", gmtime(&callDuration));
+
+ szText.AppendFormat(Translate("%s %s this call (%s).\n"), _T2A(xmlGetText(xmlName)), bType ? Translate("enters") : Translate("leaves"), szTime);
xmlDestroyNode(xmlName);
}
xmlDestroyNode(xmlPart);
@@ -82,27 +88,29 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam) }
xmlDestroyNode(xml);
}
- pszText = mir_strdup(text);
+ else
+ {
+ szText = INVALID_DATA;
+ }
break;
}
case SKYPE_DB_EVENT_TYPE_FILETRANSFER_INFO:
{
- CMStringA text;
HXML xml = xmlParseString(ptrT(mir_utf8decodeT((char*)pEvent->dbei->pBlob)), 0, _T("files"));
if (xml != NULL)
{
for (int i = 0; i < xmlGetChildCount(xml); i++)
{
- size_t fileSize = 0;
+ long fileSize = 0;
HXML xmlNode = xmlGetNthChild(xml, _T("file"), i);
if (xmlNode != NULL)
{
- fileSize = _ttoi(ptrT((TCHAR*)xmlGetAttrValue(xmlNode, _T("size"))));
+ fileSize = _ttol(ptrT((TCHAR*)xmlGetAttrValue(xmlNode, _T("size"))));
ptrA fileName(mir_utf8encodeT(ptrT((TCHAR*)xmlGetText(xmlNode))));
if (fileName != NULL)
{
CMStringA msg(FORMAT, Translate("File transfer:\n\tFile name: %s\n\tSize: %d bytes"), fileName, fileSize);
- text.AppendFormat("%s\n", msg);
+ szText.AppendFormat("%s\n", msg);
}
xmlDestroyNode(xmlNode);
@@ -110,35 +118,40 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam) }
xmlDestroyNode(xml);
}
- pszText = mir_strdup(text);
+ else
+ {
+ szText = INVALID_DATA;
+ }
break;
}
case SKYPE_DB_EVENT_TYPE_URIOBJ:
{
- CMStringA text;
HXML xml = xmlParseString(ptrT(mir_utf8decodeT((char*)pEvent->dbei->pBlob)), 0, _T("URIObject"));
if (xml != NULL)
{
- text.Append(_T2A(xmlGetText(xml)));
+ szText.Append(_T2A(xmlGetText(xml)));
xmlDestroyNode(xml);
}
- pszText = mir_strdup(text);
+ else
+ {
+ szText = INVALID_DATA;
+ }
break;
}
case SKYPE_DB_EVENT_TYPE_INCOMING_CALL:
{
- pszText = mir_strdup(Translate("Incoming call"));
+ szText = Translate("Incoming call");
break;
}
case SKYPE_DB_EVENT_TYPE_UNKNOWN:
{
- pszText = mir_strdup(CMStringA(FORMAT, Translate("Unknown event, please send this text for developer: \"%s\""), mir_utf8decodeA((char*)pEvent->dbei->pBlob)));
+ szText.Format(Translate("Unknown event, please send this text for developer: \"%s\""), mir_utf8decodeA((char*)pEvent->dbei->pBlob));
break;
}
default:
{
- pszText = mir_strdup((char*)pEvent->dbei->pBlob);
+ szText = (char*)pEvent->dbei->pBlob;
}
}
@@ -146,22 +159,21 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam) {
case DBVT_TCHAR:
{
- nRetVal = (INT_PTR)mir_a2t(pszText);
- break;
+ return (INT_PTR)mir_a2t(szText);
}
case DBVT_ASCIIZ:
{
- nRetVal = (INT_PTR)mir_strdup(pszText);
- break;
+ return (INT_PTR)szText.Detach();
}
case DBVT_UTF8:
{
- nRetVal = (INT_PTR)mir_utf8encode(pszText);
- break;
+ return (INT_PTR)mir_utf8encode(szText);
+ }
+ default:
+ {
+ return NULL;
}
}
-
- return nRetVal;
}
INT_PTR CSkypeProto::EventGetIcon(WPARAM wParam, LPARAM lParam)
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp index 8f582ae7a5..8d818cf29c 100644 --- a/protocols/SkypeWeb/src/skype_history_sync.cpp +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -101,8 +101,10 @@ void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response) else if (conversationLink.find("/19:") != -1)
{
CMStringA chatname(UrlToSkypename(conversationLink.c_str()));
- if (!mir_strcmpi(messageType.c_str(), "Text") || !mir_strcmpi(messageType.c_str(), "RichText"))
+ if (messageType == "Text" || messageType == "RichText")
+ {
AddMessageToChat(_A2T(chatname), _A2T(skypename), content.c_str(), emoteOffset != NULL, emoteOffset, timestamp, true);
+ }
}
}
}
@@ -135,22 +137,23 @@ void CSkypeProto::OnSyncHistory(const NETLIBHTTPREQUEST *response) {
const JSONNode &conversation = conversations.at(i);
const JSONNode &lastMessage = conversation["lastMessage"];
- if (!lastMessage)
- continue;
-
- std::string conversationLink = lastMessage["conversationLink"].as_string();
- time_t composeTime(IsoToUnixTime(lastMessage["composetime"].as_string().c_str()));
-
- if (conversationLink.find("/8:") != -1)
+ if (lastMessage)
{
- CMStringA skypename(UrlToSkypename(conversationLink.c_str()));
- MCONTACT hContact = FindContact(skypename);
- if (hContact == NULL)
- continue;
+ std::string strConversationLink = lastMessage["conversationLink"].as_string();
- if (db_get_dw(hContact, m_szModuleName, "LastMsgTime", 0) < composeTime)
+ if (strConversationLink.find("/8:") != -1)
{
- PushRequest(new GetHistoryRequest(m_szRegToken, skypename, 100, false, 0, m_szServer), &CSkypeProto::OnGetServerHistory);
+ CMStringA szSkypename = UrlToSkypename(strConversationLink.c_str());
+ time_t composeTime(IsoToUnixTime(lastMessage["composetime"].as_string().c_str()));
+
+ MCONTACT hContact = FindContact(szSkypename);
+ if (hContact != NULL)
+ {
+ if (db_get_dw(hContact, m_szModuleName, "LastMsgTime", 0) < composeTime)
+ {
+ PushRequest(new GetHistoryRequest(m_szRegToken, szSkypename, 100, false, 0, m_szServer), &CSkypeProto::OnGetServerHistory);
+ }
+ }
}
}
}
diff --git a/protocols/SkypeWeb/src/skype_icons.cpp b/protocols/SkypeWeb/src/skype_icons.cpp index 0a521aabd5..228c7876a8 100644 --- a/protocols/SkypeWeb/src/skype_icons.cpp +++ b/protocols/SkypeWeb/src/skype_icons.cpp @@ -29,6 +29,7 @@ IconInfo CSkypeProto::Icons[] = { LPGENT("Error icon"), "error", IDI_ERRORICON },
{ LPGENT("Action icon"), "me_action", IDI_ACTION_ME }
};
+
void CSkypeProto::InitIcons()
{
TCHAR szFile[MAX_PATH];
diff --git a/protocols/SkypeWeb/src/skype_login.cpp b/protocols/SkypeWeb/src/skype_login.cpp index ae2df823d9..da844ae286 100644 --- a/protocols/SkypeWeb/src/skype_login.cpp +++ b/protocols/SkypeWeb/src/skype_login.cpp @@ -251,10 +251,9 @@ void CSkypeProto::OnCapabilitiesSended(const NETLIBHTTPREQUEST *response) skypenames.insert(getStringA(hContact, SKYPE_SETTINGS_ID));
}
SendRequest(new CreateContactsSubscriptionRequest(m_szRegToken, skypenames, m_szServer));
- for (int i = 0; i < skypenames.getCount(); i++)
- mir_free(skypenames[i]);
- skypenames.destroy();
+ FreeCharList(skypenames);
+ skypenames.destroy();
m_hPollingThread = ForkThreadEx(&CSkypeProto::PollingThread, 0, NULL);
diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index 874f156f48..9cf8e3c27b 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -206,8 +206,8 @@ void CSkypeProto::OnPrivateMessageEvent(const JSONNode &node) AddDbEvent(SKYPE_DB_EVENT_TYPE_URIOBJ, hContact, timestamp, DBEF_UTF, strContent.c_str(), szMessageId);
}
//else if (messageType == "Event/SkypeVideoMessage") {}
- //else if (!mir_strcmpi(messageType.c_str(), "RichText/Contacts")) {}
- //else if (!mir_strcmpi(messageType.c_str(), "RichText/Location")) {}
+ //else if (messageType.c_str() == "RichText/Contacts") {}
+ //else if (messageType.c_str() == "RichText/Location") {}
else
{
AddDbEvent(SKYPE_DB_EVENT_TYPE_UNKNOWN, hContact, timestamp, DBEF_UTF, strContent.c_str(), szMessageId);
diff --git a/protocols/SkypeWeb/src/skype_network.cpp b/protocols/SkypeWeb/src/skype_network.cpp index 75fa95adfe..e211ddcfc0 100644 --- a/protocols/SkypeWeb/src/skype_network.cpp +++ b/protocols/SkypeWeb/src/skype_network.cpp @@ -19,12 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. void CSkypeProto::InitNetwork()
{
- wchar_t name[128];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
- NETLIBUSER nlu = { 0 };
+ NETLIBUSER nlu;
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
- nlu.ptszDescriptiveName = name;
+ nlu.ptszDescriptiveName = CMString(FORMAT, TranslateT("%s connection"), m_tszUserName).GetBuffer();
nlu.szSettingsModule = m_szModuleName;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
}
diff --git a/protocols/SkypeWeb/src/skype_poll_processing.cpp b/protocols/SkypeWeb/src/skype_poll_processing.cpp index b586e67eab..06390a3a62 100644 --- a/protocols/SkypeWeb/src/skype_poll_processing.cpp +++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp @@ -29,8 +29,6 @@ void CSkypeProto::ProcessEndpointPresenceRes(const JSONNode &node) if (hContact == NULL)
return;
- //"publicInfo":{"capabilities":"","typ":"11","skypeNameVersion":"0/7.1.0.105//","nodeInfo":"","version":"24"}
- //"privateInfo": {"epname": "Skype"}
const JSONNode &publicInfo = node["publicInfo"];
const JSONNode &privateInfo = node["privateInfo"];
CMStringA MirVer = "";
@@ -107,16 +105,7 @@ void CSkypeProto::ProcessUserPresenceRes(const JSONNode &node) std::string selfLink = node["selfLink"].as_string();
std::string status = node["status"].as_string();
- CMStringA skypename;
-
- if (selfLink.find("/8:") != std::string::npos)
- {
- skypename = UrlToSkypename(selfLink.c_str());
- }
- else if (selfLink.find("/1:") != std::string::npos)
- {
- skypename = UrlToSkypename(selfLink.c_str());
- }
+ CMStringA skypename = UrlToSkypename(selfLink.c_str());
if (!skypename.IsEmpty())
{
@@ -127,8 +116,9 @@ void CSkypeProto::ProcessUserPresenceRes(const JSONNode &node) m_iDesiredStatus = iNewStatus;
m_iStatus = iNewStatus;
if (old_status != iNewStatus)
+ {
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, iNewStatus);
- return;
+ }
}
else
{
@@ -141,7 +131,7 @@ void CSkypeProto::ProcessUserPresenceRes(const JSONNode &node) void CSkypeProto::ProcessNewMessageRes(const JSONNode &node)
{
- debugLogA("CSkypeProto::ProcessNewMessageRes");
+ debugLogA(__FUNCTION__);
std::string conversationLink = node["conversationLink"].as_string();
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index 14cf94dffd..037b1a3c66 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -49,7 +49,7 @@ CSkypeProto::CSkypeProto(const char* protoName, const TCHAR* userName) : m_hTrouterEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- SkypeSetTimer(this);
+ SkypeSetTimer();
}
CSkypeProto::~CSkypeProto()
@@ -64,7 +64,7 @@ CSkypeProto::~CSkypeProto() if (m_hCallEvent && Accounts.getCount() == 0) DestroyHookableEvent(m_hCallEvent);
- SkypeUnsetTimer(this);
+ SkypeUnsetTimer();
}
DWORD_PTR CSkypeProto::GetCaps(int type, MCONTACT)
@@ -203,6 +203,8 @@ int CSkypeProto::SetStatus(int iNewStatus) break;
}
+ mir_cslock lck(m_StatusLock);
+
debugLogA(__FUNCTION__ ": changing status from %i to %i", m_iStatus, iNewStatus);
int old_status = m_iStatus;
@@ -212,10 +214,8 @@ int CSkypeProto::SetStatus(int iNewStatus) {
// logout
isTerminated = true;
- if (m_pollingConnection)
- CallService(MS_NETLIB_SHUTDOWN, (WPARAM)m_pollingConnection, 0);
- if (m_TrouterConnection)
- CallService(MS_NETLIB_SHUTDOWN, (WPARAM)m_TrouterConnection, 0);
+ requestQueue->Stop();
+ ShutdownConnections();
if (m_iStatus > ID_STATUS_CONNECTING + 1)
{
@@ -224,7 +224,7 @@ int CSkypeProto::SetStatus(int iNewStatus) delSetting("endpointId");
delSetting("expires");
}
- requestQueue->Stop();
+
CloseDialogs();
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)m_iStatus, ID_STATUS_OFFLINE);
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 01f3ec57bf..b3c2344ebb 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -38,7 +38,7 @@ public: virtual MCONTACT __cdecl AddToList(int flags, PROTOSEARCHRESULT* psr);
virtual MCONTACT __cdecl AddToListByEvent(int flags, int iContact, MEVENT hDbEvent);
- virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage);
+ virtual int __cdecl AuthRequest(MCONTACT hContact, const TCHAR* szMessage);
virtual int __cdecl Authorize(MEVENT hDbEvent);
virtual int __cdecl AuthDeny(MEVENT hDbEvent, const TCHAR* szReason);
virtual int __cdecl AuthRecv(MCONTACT hContact, PROTORECVEVENT*);
@@ -117,6 +117,7 @@ private: mir_cs m_InviteDialogsLock;
mir_cs m_GCCreateDialogsLock;
mir_cs messageSyncLock;
+ mir_cs m_StatusLock;
static mir_cs accountsLock;
static mir_cs timerLock;
@@ -275,13 +276,9 @@ private: INT_PTR __cdecl OnLeaveChatRoom(WPARAM hContact, LPARAM);
void StartChatRoom(const TCHAR *tid, const TCHAR *tname);
-
void OnLoadChats(const NETLIBHTTPREQUEST *response);
-
void OnGetChatInfo(const NETLIBHTTPREQUEST *response, void *p);
-
-
void OnChatEvent(const JSONNode &node);
void OnSendChatMessage(const TCHAR *chat_id, const TCHAR * tszMessage);
char *GetChatUsers(const TCHAR *chat_id);
@@ -305,7 +302,7 @@ private: void ProcessThreadUpdateRes(const JSONNode &node);
// utils
- void CSkypeProto::FreeCharList(LIST<char> lst);
+ static void CSkypeProto::FreeCharList(LIST<char> lst);
__forceinline bool IsOnline()
{ return (m_iStatus > ID_STATUS_OFFLINE && m_hPollingThread);
@@ -335,8 +332,8 @@ private: CMStringA GetServerFromUrl(const char *url);
//---Timers
- void CALLBACK SkypeUnsetTimer(void*);
- void CALLBACK SkypeSetTimer(void*);
+ void CALLBACK SkypeUnsetTimer();
+ void CALLBACK SkypeSetTimer();
void ProcessTimer();
static void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD);
//---/
diff --git a/protocols/SkypeWeb/src/skype_search.cpp b/protocols/SkypeWeb/src/skype_search.cpp index 3343dd5f2d..a5f25d5247 100644 --- a/protocols/SkypeWeb/src/skype_search.cpp +++ b/protocols/SkypeWeb/src/skype_search.cpp @@ -26,11 +26,11 @@ HANDLE CSkypeProto::SearchBasic(const TCHAR* id) void CSkypeProto::SearchBasicThread(void* id)
{
debugLogA("CSkypeProto::OnSearchBasicThread");
- if (!IsOnline())
- return;
-
- ptrA string(mir_urlEncode(T2Utf((TCHAR *)id)));
- SendRequest(new GetSearchRequest(m_szTokenSecret, string), &CSkypeProto::OnSearch);
+ if (IsOnline())
+ {
+ ptrA szString(mir_urlEncode(T2Utf((TCHAR*)id)));
+ SendRequest(new GetSearchRequest(m_szTokenSecret, szString), &CSkypeProto::OnSearch);
+ }
}
void CSkypeProto::OnSearch(const NETLIBHTTPREQUEST *response)
diff --git a/protocols/SkypeWeb/src/skype_timers.cpp b/protocols/SkypeWeb/src/skype_timers.cpp index cd25a8165e..34a2ff5c50 100644 --- a/protocols/SkypeWeb/src/skype_timers.cpp +++ b/protocols/SkypeWeb/src/skype_timers.cpp @@ -40,14 +40,14 @@ void CALLBACK CSkypeProto::TimerProc(HWND, UINT, UINT_PTR, DWORD) }
}
-void CSkypeProto::SkypeSetTimer(void*)
+void CSkypeProto::SkypeSetTimer()
{
mir_cslock lck(timerLock);
if (!m_timer)
m_timer = SetTimer(NULL, 0, 600000, TimerProc);
}
-void CSkypeProto::SkypeUnsetTimer(void*)
+void CSkypeProto::SkypeUnsetTimer()
{
mir_cslock lck(timerLock);
if (m_timer && Accounts.getCount() == 0)
diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp index e1bb16f064..ae45138d40 100644 --- a/protocols/SkypeWeb/src/skype_utils.cpp +++ b/protocols/SkypeWeb/src/skype_utils.cpp @@ -592,7 +592,7 @@ INT_PTR CSkypeProto::ParseSkypeUriService(WPARAM, LPARAM lParam) {
return 1;
}
- return 1; /* parse failed */
+ return 1;
}
INT_PTR CSkypeProto::GlobalParseSkypeUriService(WPARAM wParam, LPARAM lParam)
|