diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2012-12-16 13:16:42 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2012-12-16 13:16:42 +0000 |
commit | 2ae148d3b9040ab734642ea0bc798bede8a06dfa (patch) | |
tree | 83b34145df1307627ac3d3bb9156e17383f81687 /protocols/Skype/src/skype_proto.cpp | |
parent | a3b6e54b51ddf79756a0916740988182637c0cc0 (diff) |
- refactored message receiving
git-svn-id: http://svn.miranda-ng.org/main/trunk@2751 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_proto.cpp')
-rw-r--r-- | protocols/Skype/src/skype_proto.cpp | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index 5d2d8b0bba..f325c549a0 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -345,14 +345,18 @@ int __cdecl CSkypeProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPA void __cdecl CSkypeProto::SignInAsync(void*)
{
- g_skype->GetConversationList(g_skype->inbox, CConversation::INBOX_CONVERSATIONS);
+ /*g_skype->GetConversationList(g_skype->inbox, CConversation::INBOX_CONVERSATIONS);
fetch(g_skype->inbox);
g_skype->SetOnConversationAddedCallback(
(CSkype::OnConversationAdded)&CSkypeProto::OnConversationAdded,
this);
for (uint i = 0 ; i < g_skype->inbox.size(); i++)
g_skype->inbox[i]->SetOnMessageReceivedCallback(
- (CConversation::OnMessageReceived)&CSkypeProto::OnOnMessageReceived,
+ (CConversation::OnMessageReceived)&CSkypeProto::OnMessageReceived,
+ this);*/
+
+ g_skype->SetOnMessageReceivedCallback(
+ (CSkype::OnMessageReceived)&CSkypeProto::OnMessageReceived,
this);
this->SetStatus(this->m_iDesiredStatus);
@@ -403,13 +407,27 @@ void CSkypeProto::RequestPassword() LPARAM(this));
}
-void CSkypeProto::OnOnMessageReceived(const char *sid, const char *text)
+void CSkypeProto::OnMessageReceived(CMessage::Ref message)
{
- this->RaiseMessageReceivedEvent(time(NULL), sid, sid, text);
+ SEIntList propIds;
+ SEIntDict propValues;
+ propIds.append(CMessage::P_AUTHOR);
+ propIds.append(CMessage::P_AUTHOR_DISPLAYNAME);
+ propIds.append(CMessage::P_BODY_XML);
+ propValues = message->GetProps(propIds);
+
+ uint timestamp;
+ message->GetPropTimestamp(timestamp);
+
+ this->RaiseMessageReceivedEvent(
+ (DWORD)timestamp,
+ (const char*)propValues[0],
+ (const char*)propValues[1],
+ (const char*)propValues[2]);
}
void CSkypeProto::OnConversationAdded(CConversation::Ref conversation)
{
- conversation->SetOnMessageReceivedCallback(
- (CConversation::OnMessageReceived)&CSkypeProto::OnOnMessageReceived, this);
+ //conversation->SetOnMessageReceivedCallback(
+ // (CConversation::OnMessageReceived)&CSkypeProto::OnMessageReceived, this);
}
\ No newline at end of file |