diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-07 13:32:34 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-07 13:32:34 +0000 |
commit | 4056ab703967ccbba528aebc93802f732ae13884 (patch) | |
tree | 3dc1984ed3fa17e48260ad9921f2377179a3c65c | |
parent | 4e67bd6db63fbd628fb3db7ad73b784b7a2a0036 (diff) |
SkypeWeb: Chats support part 1.1.
git-svn-id: http://svn.miranda-ng.org/main/trunk@12651 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | protocols/SkypeWeb/src/skype_chats.cpp | 11 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_poll_processing.cpp | 5 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.cpp | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 2 |
4 files changed, 17 insertions, 5 deletions
diff --git a/protocols/SkypeWeb/src/skype_chats.cpp b/protocols/SkypeWeb/src/skype_chats.cpp index ff3cbc607f..db3f37e8f2 100644 --- a/protocols/SkypeWeb/src/skype_chats.cpp +++ b/protocols/SkypeWeb/src/skype_chats.cpp @@ -24,4 +24,15 @@ MCONTACT CSkypeProto::AddChatRoom(const char *chatname) setByte(hContact, "ChatRoom", 1);
}
return hContact;
+}
+
+void CSkypeProto::SetChatStatus(MCONTACT hContact, int iStatus)
+{
+ ptrT tszChatID(getTStringA(hContact, "ChatID"));
+ if (tszChatID == NULL)
+ return;
+
+ GCDEST gcd = { m_szModuleName, tszChatID, GC_EVENT_CONTROL };
+ GCEVENT gce = { sizeof(gce), &gcd };
+ CallServiceSync(MS_GC_EVENT, (iStatus == ID_STATUS_OFFLINE) ? SESSION_OFFLINE : SESSION_ONLINE, (LPARAM)&gce);
}
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_poll_processing.cpp b/protocols/SkypeWeb/src/skype_poll_processing.cpp index 376e366eae..cdf2457813 100644 --- a/protocols/SkypeWeb/src/skype_poll_processing.cpp +++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp @@ -86,9 +86,8 @@ void CSkypeProto::ProcessNewMessageRes(JSONNODE *node) {
ptrA chatname(ChatUrlToName(conversationLink));
ptrA topic(mir_t2a(ptrT(json_as_string(json_get(node, "threadtopic")))));
- if (GetContact(chatname) == NULL)
- AddChatRoom(chatname);
-
+ MCONTACT chatContact = AddChatRoom(chatname);
+ SetChatStatus(chatContact, ID_STATUS_ONLINE);
if (!mir_strcmpi(messageType, "Text") || !mir_strcmpi(messageType, "RichText"))
{
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index 6434ec4b90..f9e43ba97c 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -49,7 +49,7 @@ DWORD_PTR CSkypeProto::GetCaps(int type, MCONTACT) switch (type)
{
case PFLAGNUM_1:
- return PF1_IM | PF1_AUTHREQ;
+ return PF1_IM | PF1_AUTHREQ | PF1_CHAT;
case PFLAGNUM_2:
return PF2_ONLINE | PF2_INVISIBLE | PF2_SHORTAWAY | PF2_HEAVYDND;
case PFLAGNUM_3:
@@ -162,8 +162,10 @@ int CSkypeProto::SetStatus(int iNewStatus) {
// logout
isTerminated = true;
+
//if (m_pollingConnection)
// CallService(MS_NETLIB_SHUTDOWN, (WPARAM)m_pollingConnection, 0);
+
LogoutRequest *logoutRequest = new LogoutRequest();
if (!cookies.empty())
{
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 426b40706b..fc2c55f1b3 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -206,7 +206,7 @@ private: //chats
MCONTACT AddChatRoom(const char *chatname);
-
+ void SetChatStatus(MCONTACT hContact, int iStatus);
//polling
void __cdecl ParsePollData(JSONNODE *data);
void __cdecl PollingThread(void*);
|