From 368f94af7740623a97c2c51c1a7d1a3f15593f1d Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Tue, 23 Oct 2012 18:30:46 +0000 Subject: - fixed som errors - second approach to UserIsTyping git-svn-id: http://svn.miranda-ng.org/main/trunk@2062 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_proto.cpp | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'protocols/Skype/src/skype_proto.cpp') diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index c0d59c087e..3b6ee25f25 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -225,6 +225,7 @@ int __cdecl CSkypeProto::RecvFile( HANDLE hContact, PROTORECVFILET* ) { retur int __cdecl CSkypeProto::RecvMsg( HANDLE hContact, PROTORECVEVENT* pre) { + this->UserIsTyping(hContact, PROTOTYPE_SELFTYPING_OFF); return ::Proto_RecvMessage(hContact, pre); } @@ -313,15 +314,25 @@ int __cdecl CSkypeProto::SetAwayMsg( int m_iStatus, const TCHAR* msg ) { retu int __cdecl CSkypeProto::UserIsTyping( HANDLE hContact, int type ) { - // todo: rewrite - CConversation::Ref conversation; - g_skype->GetConversationByIdentity(::mir_u2a(this->GetSettingString(hContact, "sid")), conversation); - if (conversation) - { - Message::Ref message; - conversation->SetMyTextStatusTo(Participant::WRITING); + if (hContact && this->IsOnline() && this->m_iStatus != ID_STATUS_INVISIBLE) + { + CConversation::Ref conversation; + g_skype->GetConversationByIdentity(::mir_u2a(this->GetSettingString(hContact, "sid")), conversation); + if (conversation) + { + switch (type) + { + case PROTOTYPE_SELFTYPING_ON: + conversation->SetMyTextStatusTo(Participant::WRITING); + return 0; + + case PROTOTYPE_SELFTYPING_OFF: + conversation->SetMyTextStatusTo(Participant::READING); // mb TEXT_UNKNOWN? + return 0; + } + } } - return 0; + return 1; } int __cdecl CSkypeProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM lParam) -- cgit v1.2.3