diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2013-05-10 17:11:05 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2013-05-10 17:11:05 +0000 |
commit | 9403f94a71782e106d29f1ca2df5aa682ea3f746 (patch) | |
tree | 8a7ee36aa1f57295209f50f9044c679a248a9fab /protocols/Skype/src/skype_messages.cpp | |
parent | b94dc989d9eba4bcbf255421b84d1803cbfd0bc1 (diff) |
- added skype emote support (/me chat command)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4623 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_messages.cpp')
-rw-r--r-- | protocols/Skype/src/skype_messages.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/protocols/Skype/src/skype_messages.cpp b/protocols/Skype/src/skype_messages.cpp index 31b1b4d03d..64b29939e1 100644 --- a/protocols/Skype/src/skype_messages.cpp +++ b/protocols/Skype/src/skype_messages.cpp @@ -10,9 +10,24 @@ int CSkypeProto::OnMessagePreCreate(WPARAM, LPARAM lParam) SEBinary guid;
if (message->GetPropGuid(guid))
{
- evt->dbei->pBlob = (PBYTE)::mir_realloc(evt->dbei->pBlob, evt->dbei->cbBlob + guid.size());
- ::memcpy((char *)&evt->dbei->pBlob[evt->dbei->cbBlob], guid.data(), guid.size());
- evt->dbei->cbBlob += (DWORD)guid.size();
+ CMessage::TYPE messageType;
+ message->GetPropType(messageType);
+
+ if (messageType == CMessage::POSTED_TEXT)
+ {
+ evt->dbei->pBlob = (PBYTE)::mir_realloc(evt->dbei->pBlob, evt->dbei->cbBlob + guid.size());
+ ::memcpy((char *)&evt->dbei->pBlob[evt->dbei->cbBlob], guid.data(), guid.size());
+ evt->dbei->cbBlob += (DWORD)guid.size();
+ }
+ else if (messageType == CMessage::POSTED_EMOTE)
+ {
+ evt->dbei->pBlob = (PBYTE)::mir_realloc(evt->dbei->pBlob, evt->dbei->cbBlob + guid.size() - 4);
+ ::memcpy((char *)&evt->dbei->pBlob[0], (char *)&evt->dbei->pBlob[4], evt->dbei->cbBlob - 4);
+ ::memcpy((char *)&evt->dbei->pBlob[evt->dbei->cbBlob - 4], guid.data(), guid.size());
+ evt->dbei->cbBlob += (DWORD)guid.size() - 4;
+
+ evt->dbei->eventType = SKYPE_DB_EVENT_TYPE_EMOTE;
+ }
}
return 1;
|