diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2013-04-20 19:35:45 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2013-04-20 19:35:45 +0000 |
commit | 2973e11eefbc41935fdac9b6040bd0d360510e05 (patch) | |
tree | 1fb57c589636c8e994beba1449ef7fe11d6ce4d8 /protocols/Skype/src/skype_events.cpp | |
parent | 5b48d799fc3ebbf8bb0e9010f12954db24c91a32 (diff) |
refactoring continued
git-svn-id: http://svn.miranda-ng.org/main/trunk@4490 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_events.cpp')
-rw-r--r-- | protocols/Skype/src/skype_events.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp index 90ab1ff27b..87d491cbb5 100644 --- a/protocols/Skype/src/skype_events.cpp +++ b/protocols/Skype/src/skype_events.cpp @@ -46,6 +46,23 @@ int CSkypeProto::OnContactDeleted(WPARAM wParam, LPARAM lParam) return 0;
}
+int CSkypeProto::OnMessagePreCreate(WPARAM, LPARAM lParam)
+{
+ MessageWindowEvent *evt = (MessageWindowEvent *)lParam;
+
+ MessageRef message(evt->seq);
+
+ SEBinary guid;
+ if (message->GetPropGuid(guid))
+ {
+ evt->dbei->pBlob = (PBYTE)::mir_realloc(evt->dbei->pBlob, (evt->dbei->cbBlob + 32));
+ ::memcpy(&evt->dbei->pBlob[evt->dbei->cbBlob], guid.data(), 32);
+ evt->dbei->cbBlob += 32;
+ }
+
+ return 1;
+}
+
void CSkypeProto::OnMessageSended(CConversation::Ref conversation, CMessage::Ref message, CContact::Ref receiver)
{
SEString data;
@@ -70,15 +87,25 @@ void CSkypeProto::OnMessageSended(CConversation::Ref conversation, CMessage::Ref if (sstatus != CMessage::SENDING)
{
+ // todo: shit shit shit
this->SendBroadcast(
hContact,
ACKTYPE_MESSAGE,
sstatus == CMessage::FAILED_TO_SEND ? ACKRESULT_FAILED : ACKRESULT_SUCCESS,
(HANDLE)message->getOID(), 0);
+ this->SendBroadcast(
+ hContact,
+ ACKTYPE_MESSAGE,
+ sstatus == CMessage::FAILED_TO_SEND ? ACKRESULT_FAILED : ACKRESULT_SUCCESS,
+ (HANDLE)message->getOID(), 0);
+
+ SEBinary guid;
+ message->GetPropGuid(guid);
this->RaiseMessageSendedEvent(
hContact,
timestamp,
+ guid.data(),
text);
}
}
@@ -129,10 +156,13 @@ void CSkypeProto::OnMessageReceived(CConversation::Ref conversation, CMessage::R {
HANDLE hContact = this->AddContact(author);
- // fixme
+ SEBinary guid;
+ message->GetPropGuid(guid);
+
this->RaiseMessageReceivedEvent(
hContact,
timestamp,
+ guid.data(),
text,
status != CMessage::UNCONSUMED_NORMAL);
}
|