summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_messages.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2013-05-13 18:30:05 +0000
committerAlexander Lantsev <aunsane@gmail.com>2013-05-13 18:30:05 +0000
commit2a1e6f05aa9fcc4dfe642bd42aeb175e3958d4b3 (patch)
tree1f0195caf23d086ecae10fc75b11fa61d85e9a66 /protocols/Skype/src/skype_messages.cpp
parent59651e97603936fc7179864506caa1818e260c76 (diff)
Merged revision(s) from branches/unsane/skype_test:
- CSkypeProto is derived of Skype class now - chat events moved to skype_chat.cpp - fixed chat message timestamp - fixed #331, #332 git-svn-id: http://svn.miranda-ng.org/main/trunk@4644 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_messages.cpp')
-rw-r--r--protocols/Skype/src/skype_messages.cpp40
1 files changed, 32 insertions, 8 deletions
diff --git a/protocols/Skype/src/skype_messages.cpp b/protocols/Skype/src/skype_messages.cpp
index ced5ab8647..356224f5fd 100644
--- a/protocols/Skype/src/skype_messages.cpp
+++ b/protocols/Skype/src/skype_messages.cpp
@@ -33,7 +33,7 @@ int CSkypeProto::OnMessagePreCreate(WPARAM, LPARAM lParam)
return 1;
}
-void CSkypeProto::OnMessageReceived(CConversation::Ref &conversation, CMessage::Ref &message)
+void CSkypeProto::OnMessageReceived(const ConversationRef &conversation, const MessageRef &message)
{
SEString data;
@@ -52,7 +52,7 @@ void CSkypeProto::OnMessageReceived(CConversation::Ref &conversation, CMessage::
message->GetPropAuthor(data);
CContact::Ref author;
- g_skype->GetContact(data, author);
+ this->GetContact(data, author);
HANDLE hContact = this->AddContact(author);
this->UserIsTyping(hContact, PROTOTYPE_SELFTYPING_OFF);
@@ -75,7 +75,7 @@ void CSkypeProto::OnMessageReceived(CConversation::Ref &conversation, CMessage::
/////////////////////////////////////////////////////////////////////////////////////////
-void CSkypeProto::OnMessageSent(CConversation::Ref &conversation, CMessage::Ref &message)
+void CSkypeProto::OnMessageSent(const ConversationRef &conversation, const MessageRef &message)
{
SEString data;
@@ -99,7 +99,7 @@ void CSkypeProto::OnMessageSent(CConversation::Ref &conversation, CMessage::Ref
participants[0]->GetPropIdentity(data);
CContact::Ref receiver;
- g_skype->GetContact(data, receiver);
+ this->GetContact(data, receiver);
HANDLE hContact = this->AddContact(receiver);
this->SendBroadcast(
@@ -119,7 +119,7 @@ void CSkypeProto::OnMessageSent(CConversation::Ref &conversation, CMessage::Ref
status == CMessage::UNCONSUMED_NORMAL);
}
-void CSkypeProto::OnMessageEvent(CConversation::Ref conversation, CMessage::Ref message)
+void CSkypeProto::OnMessageEvent(const ConversationRef &conversation, const MessageRef &message)
{
CMessage::TYPE messageType;
message->GetPropType(messageType);
@@ -141,8 +141,31 @@ void CSkypeProto::OnMessageEvent(CConversation::Ref conversation, CMessage::Ref
case CMessage::STARTED_LIVESESSION:
{
- conversation->LeaveLiveSession();
+ uint timestamp;
+ message->GetPropTimestamp(timestamp);
+
+ SEString identity;
+ message->GetPropAuthor(identity);
+
+ CContact::Ref author;
+ this->GetContact(identity, author);
+
+ HANDLE hContact = this->AddContact(author);
+
+ char *message = ::mir_utf8encode(::Translate("Incoming call received"));
+
+ this->AddDBEvent(
+ hContact,
+ SKYPE_DB_EVENT_TYPE_CALL,
+ timestamp,
+ DBEF_UTF,
+ (DWORD)::strlen(message) + 1,
+ (PBYTE)message);
+ }
+ break;
+ case CMessage::ENDED_LIVESESSION:
+ {
uint timestamp;
message->GetPropTimestamp(timestamp);
@@ -150,11 +173,11 @@ void CSkypeProto::OnMessageEvent(CConversation::Ref conversation, CMessage::Ref
message->GetPropAuthor(identity);
CContact::Ref author;
- g_skype->GetContact(identity, author);
+ this->GetContact(identity, author);
HANDLE hContact = this->AddContact(author);
- char *message = ::mir_utf8encode(::Translate("Incoming call"));
+ char *message = ::mir_utf8encode(::Translate("Incoming call finished"));
this->AddDBEvent(
hContact,
@@ -164,5 +187,6 @@ void CSkypeProto::OnMessageEvent(CConversation::Ref conversation, CMessage::Ref
(DWORD)::strlen(message) + 1,
(PBYTE)message);
}
+ break;
}
} \ No newline at end of file