diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/SkypeWeb_12.vcxproj | 3 | ||||
-rw-r--r-- | protocols/SkypeWeb/SkypeWeb_12.vcxproj.filters | 9 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp (renamed from protocols/SkypeWeb/src/skype_chats.cpp) | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_contacts.cpp | 4 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_history_sync.cpp | 104 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_messages.cpp | 114 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_poll_processing.cpp | 55 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_profile.cpp | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 12 |
9 files changed, 188 insertions, 119 deletions
diff --git a/protocols/SkypeWeb/SkypeWeb_12.vcxproj b/protocols/SkypeWeb/SkypeWeb_12.vcxproj index b45e936b65..1e83a4d46c 100644 --- a/protocols/SkypeWeb/SkypeWeb_12.vcxproj +++ b/protocols/SkypeWeb/SkypeWeb_12.vcxproj @@ -228,10 +228,11 @@ <ClCompile Include="src\main.cpp" />
<ClCompile Include="src\request_queue.cpp" />
<ClCompile Include="src\skype_avatars.cpp" />
- <ClCompile Include="src\skype_chats.cpp" />
+ <ClCompile Include="src\skype_chatrooms.cpp" />
<ClCompile Include="src\skype_profile.cpp" />
<ClCompile Include="src\skype_request.cpp" />
<ClCompile Include="src\skype_search.cpp" />
+ <ClCompile Include="src\skype_history_sync.cpp" />
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
diff --git a/protocols/SkypeWeb/SkypeWeb_12.vcxproj.filters b/protocols/SkypeWeb/SkypeWeb_12.vcxproj.filters index c73f7c7a62..9a783bb244 100644 --- a/protocols/SkypeWeb/SkypeWeb_12.vcxproj.filters +++ b/protocols/SkypeWeb/SkypeWeb_12.vcxproj.filters @@ -134,15 +134,18 @@ <ClCompile Include="src\skype_avatars.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\skype_chats.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\skype_login.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\skype_search.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="src\skype_chatrooms.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="src\skype_history_sync.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\resource.rc">
diff --git a/protocols/SkypeWeb/src/skype_chats.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 32608e0228..ba6781e958 100644 --- a/protocols/SkypeWeb/src/skype_chats.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "common.h"
-MCONTACT CSkypeProto::GetChat(const char *skypename)
+MCONTACT CSkypeProto::FindChatRoom(const char *skypename)
{
MCONTACT hContact = NULL;
for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
@@ -31,7 +31,7 @@ MCONTACT CSkypeProto::GetChat(const char *skypename) MCONTACT CSkypeProto::AddChatRoom(const char *chatname)
{
- MCONTACT hContact = GetChat(chatname);
+ MCONTACT hContact = FindChatRoom(chatname);
if (!hContact)
{
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
diff --git a/protocols/SkypeWeb/src/skype_contacts.cpp b/protocols/SkypeWeb/src/skype_contacts.cpp index caa40839d0..46107461af 100644 --- a/protocols/SkypeWeb/src/skype_contacts.cpp +++ b/protocols/SkypeWeb/src/skype_contacts.cpp @@ -58,7 +58,7 @@ MCONTACT CSkypeProto::GetContactFromAuthEvent(MEVENT hEvent) return DbGetAuthEventContact(&dbei);
}
-MCONTACT CSkypeProto::GetContact(const char *skypename)
+MCONTACT CSkypeProto::FindContact(const char *skypename)
{
MCONTACT hContact = NULL;
for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName))
@@ -72,7 +72,7 @@ MCONTACT CSkypeProto::GetContact(const char *skypename) MCONTACT CSkypeProto::AddContact(const char *skypename, bool isTemporary)
{
- MCONTACT hContact = GetContact(skypename);
+ MCONTACT hContact = FindContact(skypename);
if (!hContact)
{
hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
diff --git a/protocols/SkypeWeb/src/skype_history_sync.cpp b/protocols/SkypeWeb/src/skype_history_sync.cpp new file mode 100644 index 0000000000..908c815db9 --- /dev/null +++ b/protocols/SkypeWeb/src/skype_history_sync.cpp @@ -0,0 +1,104 @@ +/*
+Copyright (c) 2015 Miranda NG project (http://miranda-ng.org)
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation version 2
+of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "common.h"
+
+/* HISTORY SYNC */
+
+void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
+{
+ if (response == NULL)
+ return;
+
+ JSONROOT root(response->pData);
+ if (root == NULL)
+ return;
+
+ JSONNODE *conversations = json_as_array(json_get(root, "messages"));
+ for (size_t i = 0; i < json_size(conversations); i++)
+ {
+ JSONNODE *message = json_at(conversations, i);
+
+ ptrA clientMsgId(mir_t2a(ptrT(json_as_string(json_get(message, "clientmessageid")))));
+ ptrA skypeEditedId(mir_t2a(ptrT(json_as_string(json_get(message, "skypeeditedid")))));
+ ptrA messageType(mir_t2a(ptrT(json_as_string(json_get(message, "messagetype")))));
+ ptrA from(mir_t2a(ptrT(json_as_string(json_get(message, "from")))));
+ ptrA content(mir_t2a(ptrT(json_as_string(json_get(message, "content")))));
+ ptrT composeTime(json_as_string(json_get(message, "composetime")));
+ ptrA conversationLink(mir_t2a(ptrT(json_as_string(json_get(message, "conversationLink")))));
+ time_t timestamp = IsoToUnixTime(composeTime);
+ if (conversationLink != NULL && strstr(conversationLink, "/8:"))
+ {
+ int emoteOffset = json_as_int(json_get(message, "skypeemoteoffset"));
+
+ int flags = DBEF_UTF | DBEF_READ;
+
+ ptrA skypename(ContactUrlToName(from));
+
+ bool isMe = IsMe(skypename);
+ if (isMe)
+ flags |= DBEF_SENT;
+
+ MCONTACT hContact = IsMe(skypename)
+ ? FindContact(ptrA(ContactUrlToName(conversationLink)))
+ : FindContact(skypename);
+
+ AddMessageToDb(hContact, timestamp, flags, clientMsgId, content, emoteOffset);
+ }
+ }
+}
+
+INT_PTR CSkypeProto::GetContactHistory(WPARAM hContact, LPARAM lParam)
+{
+ PushRequest(new GetHistoryRequest(ptrA(getStringA("registrationToken")), ptrA(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID)), ptrA(getStringA("Server"))), &CSkypeProto::OnGetServerHistory);
+ return 0;
+}
+
+void CSkypeProto::SyncHistory()
+{
+ PushRequest(new SyncHistoryFirstRequest(ptrA(getStringA("registrationToken")), ptrA(getStringA("Server"))), &CSkypeProto::OnSyncHistory);
+}
+
+void CSkypeProto::OnSyncHistory(const NETLIBHTTPREQUEST *response)
+{
+ if (response == NULL)
+ return;
+ JSONROOT root(response->pData);
+ if (root == NULL)
+ return;
+ JSONNODE *conversations = json_as_array(json_get(root, "conversations"));
+ for (size_t i = 0; i < json_size(conversations); i++)
+ {
+ JSONNODE *conversation = json_at(conversations, i);
+ JSONNODE *lastMessage = json_get(conversation, "lastMessage");
+ if (lastMessage == NULL)
+ continue;
+
+ char *clientMsgId = _T2A(json_as_string(json_get(lastMessage, "clientmessageid")));
+ char *conversationLink = _T2A(json_as_string(json_get(lastMessage, "conversationLink")));
+ time_t composeTime(IsoToUnixTime(ptrT(json_as_string(json_get(lastMessage, "conversationLink")))));
+
+ ptrA skypename(ContactUrlToName(conversationLink));
+ if (skypename == NULL)
+ continue;
+ MCONTACT hContact = FindContact(skypename);
+ if (hContact == NULL && !IsMe(skypename))
+ hContact = AddContact(skypename, true);
+ if (GetMessageFromDb(hContact, clientMsgId, composeTime) == NULL)
+ PushRequest(new GetHistoryRequest(ptrA(getStringA("registrationToken")), skypename, ptrA(getStringA("Server"))), &CSkypeProto::OnGetServerHistory);
+ }
+}
\ No newline at end of file diff --git a/protocols/SkypeWeb/src/skype_messages.cpp b/protocols/SkypeWeb/src/skype_messages.cpp index 25d2a701e1..dadb44be86 100644 --- a/protocols/SkypeWeb/src/skype_messages.cpp +++ b/protocols/SkypeWeb/src/skype_messages.cpp @@ -67,7 +67,7 @@ MEVENT CSkypeProto::AddMessageToDb(MCONTACT hContact, DWORD timestamp, DWORD fla int CSkypeProto::OnReceiveMessage(const char *messageId, const char *url, time_t timestamp, char *content, int emoteOffset, bool isRead)
{
ptrA skypename(ContactUrlToName(url));
- MCONTACT hContact = GetContact(skypename);
+ MCONTACT hContact = AddContact(skypename, true);
PROTORECVEVENT recv = { 0 };
recv.flags = PREF_UTF;
recv.timestamp = timestamp;
@@ -128,7 +128,7 @@ int CSkypeProto::OnSendMessage(MCONTACT hContact, int flags, const char *szMessa ptrA server(getStringA("Server"));
ptrA token(getStringA("registrationToken"));
- ptrA username(getStringA(hContact, SKYPE_SETTINGS_ID));
+ ptrA username(getStringA(hContact, "Skypename"));
debugLogA(__FUNCTION__ " clientmsgid = %d", param->hMessage);
@@ -156,7 +156,7 @@ void CSkypeProto::OnMessageSent(const NETLIBHTTPREQUEST *response, void *arg) JSONNODE *node = json_get(root, "errorCode");
error = _T2A(json_as_string(node));
}
- ptrT username(getTStringA(hContact, SKYPE_SETTINGS_ID));
+ ptrT username(getTStringA(hContact, "Skypename"));
debugLogA(__FUNCTION__": failed to send message for %s (%s)", username, error);
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_FAILED, hMessage, (LPARAM)error.GetBuffer());
return;
@@ -186,88 +186,46 @@ int CSkypeProto::OnPreCreateMessage(WPARAM, LPARAM lParam) return 0;
}
-/* HISTORY SYNC */
+/* MESSAGE EVENT */
-void CSkypeProto::OnGetServerHistory(const NETLIBHTTPREQUEST *response)
+void CSkypeProto::OnPrivateMessageEvent(JSONNODE *node)
{
- if (response == NULL)
- return;
+ ptrA clientMsgId(mir_t2a(ptrT(json_as_string(json_get(node, "clientmessageid")))));
+ //ptrA skypeEditedId(mir_t2a(ptrT(json_as_string(json_get(node, "skypeeditedid")))));
- JSONROOT root(response->pData);
- if (root == NULL)
- return;
+ ptrT composeTime(json_as_string(json_get(node, "composetime")));
+ time_t timestamp = IsoToUnixTime(composeTime);
- JSONNODE *conversations = json_as_array(json_get(root, "messages"));
- for (size_t i = 0; i < json_size(conversations); i++)
- {
- JSONNODE *message = json_at(conversations, i);
-
- ptrA clientMsgId(mir_t2a(ptrT(json_as_string(json_get(message, "clientmessageid")))));
- ptrA skypeEditedId(mir_t2a(ptrT(json_as_string(json_get(message, "skypeeditedid")))));
- ptrA messageType(mir_t2a(ptrT(json_as_string(json_get(message, "messagetype")))));
- ptrA from(mir_t2a(ptrT(json_as_string(json_get(message, "from")))));
- ptrA content(mir_t2a(ptrT(json_as_string(json_get(message, "content")))));
- ptrT composeTime(json_as_string(json_get(message, "composetime")));
- ptrA conversationLink(mir_t2a(ptrT(json_as_string(json_get(message, "conversationLink")))));
- time_t timestamp = IsoToUnixTime(composeTime);
- if (conversationLink != NULL && strstr(conversationLink, "/8:"))
- {
- int emoteOffset = json_as_int(json_get(message, "skypeemoteoffset"));
+ ptrA from(mir_t2a(ptrT(json_as_string(json_get(node, "from")))));
+ ptrA skypename(ContactUrlToName(from));
- int flags = DBEF_UTF | DBEF_READ;
+ ptrA content(mir_t2a(ptrT(json_as_string(json_get(node, "content")))));
+ int emoteOffset = json_as_int(json_get(node, "skypeemoteoffset"));
- ptrA skypename(ContactUrlToName(from));
-
- bool isMe = IsMe(skypename);
- if (isMe)
- flags |= DBEF_SENT;
-
- MCONTACT hContact = IsMe(skypename)
- ? GetContact(ptrA(ContactUrlToName(conversationLink)))
- : GetContact(skypename);
-
- AddMessageToDb(hContact, timestamp, flags, clientMsgId, content, emoteOffset);
- }
+ if (IsMe(skypename))
+ {
+ ptrA conversationLink(mir_t2a(ptrT(json_as_string(json_get(node, "conversationLink")))));
+ ptrA cSkypename(ContactUrlToName(conversationLink));
+
+ MCONTACT hContact = AddContact(cSkypename, true);
+ int hMessage = atoi(clientMsgId);
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)hMessage, 0);
+ debugLogA(__FUNCTION__" timestamp = %d clientmsgid = %s", timestamp, clientMsgId);
+ AddMessageToDb(hContact, timestamp, DBEF_UTF | DBEF_SENT, clientMsgId, &content[emoteOffset], emoteOffset);
}
-}
-
-INT_PTR CSkypeProto::GetContactHistory(WPARAM hContact, LPARAM lParam)
-{
- PushRequest(new GetHistoryRequest(ptrA(getStringA("registrationToken")), ptrA(db_get_sa(hContact, m_szModuleName, SKYPE_SETTINGS_ID)), ptrA(getStringA("Server"))), &CSkypeProto::OnGetServerHistory);
- return 0;
-}
-
-void CSkypeProto::SyncHistory()
-{
- PushRequest(new SyncHistoryFirstRequest(ptrA(getStringA("registrationToken")), ptrA(getStringA("Server"))), &CSkypeProto::OnSyncHistory);
-}
-
-void CSkypeProto::OnSyncHistory(const NETLIBHTTPREQUEST *response)
-{
- if (response == NULL)
- return;
- JSONROOT root(response->pData);
- if (root == NULL)
- return;
- JSONNODE *conversations = json_as_array(json_get(root, "conversations"));
- for (size_t i = 0; i < json_size(conversations); i++)
+ else
{
- JSONNODE *conversation = json_at(conversations, i);
- JSONNODE *lastMessage = json_get(conversation, "lastMessage");
- if (lastMessage == NULL)
- continue;
-
- char *clientMsgId = _T2A(json_as_string(json_get(lastMessage, "clientmessageid")));
- char *conversationLink = _T2A(json_as_string(json_get(lastMessage, "conversationLink")));
- time_t composeTime(IsoToUnixTime(ptrT(json_as_string(json_get(lastMessage, "conversationLink")))));
-
- ptrA skypename(ContactUrlToName(conversationLink));
- if (skypename == NULL)
- continue;
- MCONTACT hContact = GetContact(skypename);
- if (hContact == NULL && !IsMe(skypename))
- hContact = AddContact(skypename, true);
- if (GetMessageFromDb(hContact, clientMsgId, composeTime) == NULL)
- PushRequest(new GetHistoryRequest(ptrA(getStringA("registrationToken")), skypename, ptrA(getStringA("Server"))), &CSkypeProto::OnGetServerHistory);
+ ptrA messageType(mir_t2a(ptrT(json_as_string(json_get(node, "messagetype")))));
+
+ MCONTACT hContact = AddContact(skypename, true);
+ if (!mir_strcmpi(messageType, "Control/Typing"))
+ CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_INFINITE);
+ else if (!mir_strcmpi(messageType, "Control/ClearTyping"))
+ CallService(MS_PROTO_CONTACTISTYPING, hContact, PROTOTYPE_CONTACTTYPING_OFF);
+ else if (!mir_strcmpi(messageType, "Text") || !mir_strcmpi(messageType, "RichText"))
+ {
+ debugLogA(__FUNCTION__" timestamp = %d clientmsgid = %s", timestamp, clientMsgId);
+ OnReceiveMessage(clientMsgId, from, timestamp, content, emoteOffset);
+ }
}
}
\ 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 1e8c5d115f..7d59ab5a0e 100644 --- a/protocols/SkypeWeb/src/skype_poll_processing.cpp +++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp @@ -24,7 +24,7 @@ void CSkypeProto::ProcessEndpointPresenceRes(JSONNODE *node) ptrA skypename(ContactUrlToName(selfLink));
if (skypename == NULL)
return;
- MCONTACT hContact = GetContact(skypename);
+ MCONTACT hContact = FindContact(skypename);
//"publicInfo":{"capabilities":"","typ":"11","skypeNameVersion":"0/7.1.0.105//","nodeInfo":"","version":"24"}
JSONNODE *publicInfo = json_get(node, "publicInfo");
@@ -84,7 +84,7 @@ void CSkypeProto::ProcessUserPresenceRes(JSONNODE *node) }
return;
}
- MCONTACT hContact = GetContact(skypename);
+ MCONTACT hContact = FindContact(skypename);
SetContactStatus(hContact, SkypeToMirandaStatus(status));
}
@@ -99,6 +99,7 @@ void CSkypeProto::ProcessNewMessageRes(JSONNODE *node) ptrT composeTime(json_as_string(json_get(node, "composetime")));
ptrA conversationLink(mir_t2a(ptrT(json_as_string(json_get(node, "conversationLink")))));
time_t timestamp = IsoToUnixTime(composeTime);
+ int emoteOffset = json_as_int(json_get(node, "skypeemoteoffset"));
if (strstr(conversationLink, "/19:"))
{
ptrA chatname(ChatUrlToName(conversationLink));
@@ -129,39 +130,39 @@ void CSkypeProto::ProcessNewMessageRes(JSONNODE *node) }
else if (strstr(conversationLink, "/8:"))
{
+ OnPrivateMessageEvent(node);
ptrA skypename(ContactUrlToName(from));
- MCONTACT hContact = GetContact(skypename);
-
- if (hContact == NULL && !IsMe(skypename))
- hContact = AddContact(skypename, true);
-
- if (!mir_strcmpi(messageType, "Control/Typing"))
+
+ if (IsMe(skypename))
{
- CallService(MS_PROTO_CONTACTISTYPING, hContact, 5);
- }
- else if (!mir_strcmpi(messageType, "Control/ClearTyping"))
- {
- CallService(MS_PROTO_CONTACTISTYPING, hContact, 0);
+ MCONTACT hContact = FindContact(ptrA(ContactUrlToName(conversationLink)));
+ int hMessage = atoi(clientMsgId);
+ ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)hMessage, 0);
+ debugLogA(__FUNCTION__" timestamp = %d clientmsgid = %s", timestamp, clientMsgId);
+ AddMessageToDb(hContact, timestamp, DBEF_UTF | DBEF_SENT, clientMsgId, &content[emoteOffset], emoteOffset);
}
- else if (!mir_strcmpi(messageType, "Text") || !mir_strcmpi(messageType, "RichText"))
+ else
{
- int emoteOffset = json_as_int(json_get(node, "skypeemoteoffset"));
- if (IsMe(skypename))
+ MCONTACT hContact = AddContact(skypename, true);
+ if (!mir_strcmpi(messageType, "Control/Typing"))
+ CallService(MS_PROTO_CONTACTISTYPING, hContact, 5);
+ else if (!mir_strcmpi(messageType, "Control/ClearTyping"))
+ CallService(MS_PROTO_CONTACTISTYPING, hContact, 0);
+ else if (!mir_strcmpi(messageType, "Text") || !mir_strcmpi(messageType, "RichText"))
{
- hContact = GetContact(ptrA(ContactUrlToName(conversationLink)));
- int hMessage = atoi(clientMsgId);
- ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)hMessage, 0);
+
+ if (IsMe(skypename))
+ {
+
+ }
debugLogA(__FUNCTION__" timestamp = %d clientmsgid = %s", timestamp, clientMsgId);
- AddMessageToDb(hContact, timestamp, DBEF_UTF | DBEF_SENT, clientMsgId, &content[emoteOffset], emoteOffset);
- return;
+ OnReceiveMessage(clientMsgId, from, timestamp, content, emoteOffset);
}
- debugLogA(__FUNCTION__" timestamp = %d clientmsgid = %s", timestamp, clientMsgId);
- OnReceiveMessage(clientMsgId, from, timestamp, content, emoteOffset);
}
- else if (!mir_strcmpi(messageType, "Event/SkypeVideoMessage"))
+ /*else if (!mir_strcmpi(messageType, "Event/SkypeVideoMessage"))
{
return; //not supported
- }
+ }*/
}
}
@@ -185,7 +186,7 @@ void CSkypeProto::ProcessConversationUpdateRes(JSONNODE *node) if (!mir_strcmpi(type, "Message"))
{
ptrA skypename(ContactUrlToName(from));
- MCONTACT hContact = GetContact(skypename);
+ MCONTACT hContact = FindContact(skypename);
if (hContact == NULL && !IsMe(skypename))
hContact = AddContact(skypename, true);
@@ -203,7 +204,7 @@ void CSkypeProto::ProcessConversationUpdateRes(JSONNODE *node) int emoteOffset = json_as_int(json_get(node, "skypeemoteoffset"));
if (IsMe(skypename))
{
- hContact = GetContact(ptrA(ContactUrlToName(conversationLink)));
+ hContact = FindContact(ptrA(ContactUrlToName(conversationLink)));
int hMessage = atoi(clientMsgId);
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)hMessage, 0);
AddMessageToDb(hContact, timestamp, DBEF_UTF | DBEF_SENT, clientMsgId, &content[emoteOffset], emoteOffset);
diff --git a/protocols/SkypeWeb/src/skype_profile.cpp b/protocols/SkypeWeb/src/skype_profile.cpp index 7148e5a156..386ced8bcd 100644 --- a/protocols/SkypeWeb/src/skype_profile.cpp +++ b/protocols/SkypeWeb/src/skype_profile.cpp @@ -469,7 +469,7 @@ void CSkypeProto::LoadProfile(const NETLIBHTTPREQUEST *response) ptrA username(mir_t2a(ptrT(json_as_string(json_get(root, "username")))));
MCONTACT hContact = NULL;
if (!IsMe(username))
- hContact = GetContact(username);
+ hContact = FindContact(username);
UpdateProfileFirstName(root, hContact);
UpdateProfileLastName(root, hContact);
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 1c5492c4e4..74b9868ec4 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -194,10 +194,9 @@ private: void OnReceiveAvatar(const NETLIBHTTPREQUEST *response, void *arg);
void OnSentAvatar(const NETLIBHTTPREQUEST *response);
- void CSkypeProto::OnSearch(const NETLIBHTTPREQUEST *response);
-
- MCONTACT GetContact(const char *skypename);
+ void OnSearch(const NETLIBHTTPREQUEST *response);
+ MCONTACT FindContact(const char *skypename);
MCONTACT AddContact(const char *skypename, bool isTemporary = false);
MCONTACT GetContactFromAuthEvent(MEVENT hEvent);
@@ -224,13 +223,16 @@ private: int OnSendMessage(MCONTACT hContact, int flags, const char *message);
void OnMessageSent(const NETLIBHTTPREQUEST *response, void *arg);
int __cdecl OnPreCreateMessage(WPARAM, LPARAM lParam);
- //History sync
+
+ void OnPrivateMessageEvent(JSONNODE *node);
+
+ // sync
void OnGetServerHistory(const NETLIBHTTPREQUEST *response);
void SyncHistory();
void OnSyncHistory(const NETLIBHTTPREQUEST *response);
//chats
- MCONTACT GetChat(const char *skypename);
+ MCONTACT FindChatRoom(const char *skypename);
MCONTACT AddChatRoom(const char *chatname);
void SetChatStatus(MCONTACT hContact, int iStatus);
|