summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_events.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2013-05-10 17:11:05 +0000
committerAlexander Lantsev <aunsane@gmail.com>2013-05-10 17:11:05 +0000
commit9403f94a71782e106d29f1ca2df5aa682ea3f746 (patch)
tree8a7ee36aa1f57295209f50f9044c679a248a9fab /protocols/Skype/src/skype_events.cpp
parentb94dc989d9eba4bcbf255421b84d1803cbfd0bc1 (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_events.cpp')
-rw-r--r--protocols/Skype/src/skype_events.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/protocols/Skype/src/skype_events.cpp b/protocols/Skype/src/skype_events.cpp
index d0af5aea8c..a89729a46f 100644
--- a/protocols/Skype/src/skype_events.cpp
+++ b/protocols/Skype/src/skype_events.cpp
@@ -201,6 +201,67 @@ int __cdecl CSkypeProto::OnTabSRMMButtonPressed(WPARAM wParam, LPARAM lParam)
return 1;
}
+void CSkypeProto::OnChatMessageReceived(CConversation::Ref &conversation, CMessage::Ref &message)
+{
+ SEString data;
+
+ uint timestamp;
+ message->GetPropTimestamp(timestamp);
+
+ message->GetPropBodyXml(data);
+ char *text = CSkypeProto::RemoveHtml(data);
+
+ message->GetPropAuthor(data);
+ mir_ptr<wchar_t> sid( ::mir_utf8decodeW(data));
+
+ conversation->GetPropIdentity(data);
+ mir_ptr<wchar_t> cid( ::mir_utf8decodeW(data));
+
+ CMessage::TYPE messageType;
+ message->GetPropType(messageType);
+
+ //this->SendChatMessage(cid, sid, mir_ptr<wchar_t>(::mir_utf8decodeW(text)));
+ this->RaiseChatEvent(
+ cid,
+ sid,
+ messageType == CMessage::POSTED_TEXT ? /*GC_EVENT_MESSAGE */ 0x0040 : /*GC_EVENT_ACTION */ 0x0200,
+ /*GCEF_ADDTOLOG*/ 0x0001,
+ 0,
+ NULL,
+ mir_ptr<wchar_t>(::mir_utf8decodeW(text)));
+}
+
+void CSkypeProto::OnChatMessageSent(CConversation::Ref &conversation, CMessage::Ref &message)
+{
+ SEString data;
+
+ uint timestamp;
+ message->GetPropTimestamp(timestamp);
+
+ message->GetPropBodyXml(data);
+ char *text = CSkypeProto::RemoveHtml(data);
+
+ conversation->GetPropIdentity(data);
+ mir_ptr<wchar_t> cid( ::mir_utf8decodeW(data));
+
+ mir_ptr<wchar_t> nick( ::db_get_wsa(NULL, this->m_szModuleName, "Nick"));
+ if (::wcsicmp(nick, L"") == 0)
+ nick = ::db_get_wsa(NULL, this->m_szModuleName, SKYPE_SETTINGS_LOGIN);
+
+ CMessage::TYPE messageType;
+ message->GetPropType(messageType);
+
+ //this->SendChatMessage(cid, nick, mir_ptr<wchar_t>(::mir_utf8decodeW(text)));
+ this->RaiseChatEvent(
+ cid,
+ nick,
+ messageType == CMessage::POSTED_TEXT ? /*GC_EVENT_MESSAGE */ 0x0040 : /*GC_EVENT_ACTION */ 0x0200,
+ /*GCEF_ADDTOLOG*/ 0x0001,
+ 0,
+ NULL,
+ mir_ptr<wchar_t>(::mir_utf8decodeW(text)));
+}
+
void CSkypeProto::OnChatEvent(CConversation::Ref &conversation, CMessage::Ref &message)
{
CMessage::TYPE messageType;