summaryrefslogtreecommitdiff
path: root/protocols/SkypeWeb/src/skype_proto.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-04-03 21:57:47 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-04-03 21:57:47 +0000
commit2b82b6fe83df09a31a60288871227b3ea97d39a5 (patch)
tree5cc35c182e7e5be1db2007e4886fa10d19075a21 /protocols/SkypeWeb/src/skype_proto.cpp
parent035b5186bba8c0cab7d349f849c5c1db7cad7e39 (diff)
SkypeWeb: cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@12597 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb/src/skype_proto.cpp')
-rw-r--r--protocols/SkypeWeb/src/skype_proto.cpp36
1 files changed, 1 insertions, 35 deletions
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp
index 61b8f2445a..3937a4e6c7 100644
--- a/protocols/SkypeWeb/src/skype_proto.cpp
+++ b/protocols/SkypeWeb/src/skype_proto.cpp
@@ -116,37 +116,7 @@ HANDLE CSkypeProto::SendFile(MCONTACT hContact, const PROTOCHAR *szDescription,
int CSkypeProto::SendMsg(MCONTACT hContact, int flags, const char *msg)
{
- UINT hMessage = InterlockedIncrement(&hMessageProcess);
-
- SendMessageParam *param = (SendMessageParam*)mir_calloc(sizeof(SendMessageParam));
- param->hContact = hContact;
- param->hMessage = (HANDLE)hMessage;
- param->msg = msg;
- param->flags = flags;
-
- ForkThread(&CSkypeProto::SendMsgThread, (void*)param);
-
- return hMessage;
-}
-
-void CSkypeProto::SendMsgThread(void *arg)
-{
- SendMessageParam *param = (SendMessageParam*)arg;
-
- if (!IsOnline())
- {
- ProtoBroadcastAck(param->hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, param->hMessage, (LPARAM)Translate("You cannot send messages when you are offline."));
- mir_free(param);
- return;
- }
-
- CMStringA message = (param->flags & PREF_UNICODE) ? ptrA(mir_utf8encode(param->msg)) : param->msg; // TODO: mir_utf8encode check taken from FacebookRM, is it needed? Usually we get PREF_UTF8 flag instead.
-
- ptrA token(getStringA("registrationToken"));
- ptrA username(getStringA(param->hContact, "Skypename"));
- PushRequest(
- new SendMsgRequest(token, username, message, getStringA("Server"))/*,
- &CSkypeProto::OnMessageSent*/);
+ return OnSendMessage(hContact, flags, msg);
}
int CSkypeProto::SendUrl(MCONTACT, int, const char*) { return 0; }
@@ -175,18 +145,14 @@ int CSkypeProto::SetStatus(int iNewStatus)
requestQueue->Stop();
if (!Miranda_Terminated())
- {
SetAllContactsStatus(ID_STATUS_OFFLINE);
- }
m_iStatus = m_iDesiredStatus = ID_STATUS_OFFLINE;
}
else
{
if (old_status == ID_STATUS_CONNECTING)
- {
return 0;
- }
else if (old_status == ID_STATUS_OFFLINE && m_iStatus == ID_STATUS_OFFLINE)
{
// login