summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_proto.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2012-10-21 10:24:15 +0000
committerAlexander Lantsev <aunsane@gmail.com>2012-10-21 10:24:15 +0000
commit84fc6ba7d2399bfe5db16c044bace2642f9df8a6 (patch)
tree5db5b725fb3fbafe16b92f1895727bc77ddeea3c /protocols/Skype/src/skype_proto.cpp
parent68d9f580b716d6ba9103663f3fc1637f41e162fc (diff)
- added message receiving
git-svn-id: http://svn.miranda-ng.org/main/trunk@2011 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_proto.cpp')
-rw-r--r--protocols/Skype/src/skype_proto.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp
index 7c96753ce3..bfb8f90d80 100644
--- a/protocols/Skype/src/skype_proto.cpp
+++ b/protocols/Skype/src/skype_proto.cpp
@@ -222,7 +222,12 @@ HWND __cdecl CSkypeProto::CreateExtendedSearchUI( HWND owner ){ return 0; }
int __cdecl CSkypeProto::RecvContacts( HANDLE hContact, PROTORECVEVENT* ) { return 0; }
int __cdecl CSkypeProto::RecvFile( HANDLE hContact, PROTORECVFILET* ) { return 0; }
-int __cdecl CSkypeProto::RecvMsg( HANDLE hContact, PROTORECVEVENT* ) { return 0; }
+
+int __cdecl CSkypeProto::RecvMsg( HANDLE hContact, PROTORECVEVENT* pre)
+{
+ return ::Proto_RecvMessage(hContact, pre);
+}
+
int __cdecl CSkypeProto::RecvUrl( HANDLE hContact, PROTORECVEVENT* ) { return 0; }
int __cdecl CSkypeProto::SendContacts( HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList ) { return 0; }
@@ -319,6 +324,16 @@ void __cdecl CSkypeProto::SignInThread(void*)
}
else
{
+ g_skype->GetConversationList(g_skype->inbox, CConversation::INBOX_CONVERSATIONS);
+ fetch(g_skype->inbox);
+ g_skype->SetOnConversationAddedCallback(
+ (CSkype::OnConversationAdded)&CSkypeProto::OnConversationAdded, this);
+ for (int i = 0 ; i < g_skype->inbox.size(); i++)
+ {
+ g_skype->inbox[i]->SetOnMessageReceivedCallback(
+ (CConversation::OnMessageReceived)&CSkypeProto::OnOnMessageReceived, this);
+ }
+
this->SetStatus(this->m_iDesiredStatus);
this->ForkThread(&CSkypeProto::LoadContactList, this);
//this->LoadContactList(this);
@@ -371,4 +386,15 @@ void CSkypeProto::RequestPassword()
NULL,
CSkypeProto::SkypePasswordProc,
LPARAM(this));
+}
+
+void CSkypeProto::OnOnMessageReceived(const char *sid, const char *text)
+{
+ this->RaiseMessageReceivedEvent(time(NULL), sid, sid, text);
+}
+
+void CSkypeProto::OnConversationAdded(CConversation::Ref conversation)
+{
+ conversation->SetOnMessageReceivedCallback(
+ (CConversation::OnMessageReceived)&CSkypeProto::OnOnMessageReceived, this);
} \ No newline at end of file