diff options
author | George Hazan <george.hazan@gmail.com> | 2016-09-13 17:11:58 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-09-13 17:11:58 +0000 |
commit | f51995e13679a37851baef8e7f52f2d993cbc7c1 (patch) | |
tree | 25ccd03cf2dc4b897cc0dc6fcbe4cc78ddb122c7 /protocols/SkypeWeb | |
parent | fe1e8456d2488095f409a4f2d38b7251abdedccf (diff) |
mode old database junk to die
git-svn-id: http://svn.miranda-ng.org/main/trunk@17291 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_db.cpp | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_events.cpp | 60 |
2 files changed, 20 insertions, 42 deletions
diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp index 01486d0729..b13aa96617 100644 --- a/protocols/SkypeWeb/src/skype_db.cpp +++ b/protocols/SkypeWeb/src/skype_db.cpp @@ -164,7 +164,7 @@ void CSkypeProto::InitDBEvents() dbEventType.descr = Translate(cur.name);
dbEventType.flags |= cur.flags;
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+ DbEvent_RegisterType(&dbEventType);
dbEventType.flags &= (~cur.flags);
}
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp index cb9a8bf3bb..51c0d40137 100644 --- a/protocols/SkypeWeb/src/skype_events.cpp +++ b/protocols/SkypeWeb/src/skype_events.cpp @@ -18,19 +18,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "stdafx.h"
#define INVALID_DATA Translate("SkypeWeb error: Invalid data!")
-INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
+INT_PTR CSkypeProto::GetEventText(WPARAM pEvent, LPARAM datatype)
{
- DBEVENTGETTEXT *pEvent = (DBEVENTGETTEXT *)lParam;
+ DBEVENTINFO *dbei = (DBEVENTINFO *)pEvent;
CMStringA szText;
- BOOL bUseBB = db_get_b(NULL, pEvent->dbei->szModule, "UseBBCodes", 1);
- switch (pEvent->dbei->eventType)
+ BOOL bUseBB = db_get_b(NULL, dbei->szModule, "UseBBCodes", 1);
+ switch (dbei->eventType)
{
case SKYPE_DB_EVENT_TYPE_EDITED_MESSAGE:
{
- JSONNode jMsg = JSONNode::parse((char*)pEvent->dbei->pBlob);
+ JSONNode jMsg = JSONNode::parse((char*)dbei->pBlob);
if (jMsg)
{
JSONNode &jOriginalMsg = jMsg["original_message"];
@@ -57,7 +57,7 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam) case SKYPE_DB_EVENT_TYPE_CALL_INFO:
{
- HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)pEvent->dbei->pBlob)), 0, L"partlist");
+ HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)dbei->pBlob)), 0, L"partlist");
if (xml != NULL)
{
ptrA type(mir_u2a(xmlGetAttrValue(xml, L"type")));
@@ -106,7 +106,7 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam) }
case SKYPE_DB_EVENT_TYPE_FILETRANSFER_INFO:
{
- HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)pEvent->dbei->pBlob)), 0, L"files");
+ HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)dbei->pBlob)), 0, L"files");
if (xml != NULL)
{
for (int i = 0; i < xmlGetChildCount(xml); i++)
@@ -130,13 +130,14 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam) {
szText = INVALID_DATA;
}
- break;
}
+ break;
+
case SKYPE_DB_EVENT_TYPE_FILE:
case SKYPE_DB_EVENT_TYPE_MOJI:
case SKYPE_DB_EVENT_TYPE_URIOBJ:
{
- HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)pEvent->dbei->pBlob)), 0, L"URIObject");
+ HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)dbei->pBlob)), 0, L"URIObject");
if (xml != NULL)
{
//szText.Append(_T2A(xmlGetText(xml)));
@@ -151,45 +152,22 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam) {
szText = INVALID_DATA;
}
- break;
-
}
+ break;
case SKYPE_DB_EVENT_TYPE_INCOMING_CALL:
- {
- szText = Translate("Incoming call");
- break;
- }
+ szText = Translate("Incoming call");
+ break;
+
case SKYPE_DB_EVENT_TYPE_UNKNOWN:
- {
- szText.Format(Translate("Unknown event, please send this text for developer: \"%s\""), mir_utf8decodeA((char*)pEvent->dbei->pBlob));
- break;
- }
- default:
- {
- szText = ptrA(mir_utf8decodeA((char*)pEvent->dbei->pBlob));
- }
- }
+ szText.Format(Translate("Unknown event, please send this text for developer: \"%s\""), mir_utf8decodeA((char*)dbei->pBlob));
+ break;
- switch(pEvent->datatype)
- {
- case DBVT_WCHAR:
- {
- return (INT_PTR)mir_a2u(szText);
- }
- case DBVT_ASCIIZ:
- {
- return (INT_PTR)szText.Detach();
- }
- case DBVT_UTF8:
- {
- return (INT_PTR)mir_utf8encode(szText);
- }
default:
- {
- return NULL;
- }
+ szText = ptrA(mir_utf8decodeA((char*)dbei->pBlob));
}
+
+ return (datatype == DBVT_WCHAR) ? (INT_PTR)mir_a2u(szText) : (INT_PTR)szText.Detach();
}
INT_PTR CSkypeProto::EventGetIcon(WPARAM wParam, LPARAM lParam)
|