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/JabberG | |
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/JabberG')
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.cpp | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_rc.cpp | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_svc.cpp | 58 |
3 files changed, 27 insertions, 39 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 0ddbbee5fe..6922e35a59 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -242,11 +242,11 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM) dbEventType.module = m_szModuleName;
dbEventType.eventType = EVENTTYPE_JABBER_CHATSTATES;
dbEventType.descr = "Chat state notifications";
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+ DbEvent_RegisterType(&dbEventType);
dbEventType.eventType = EVENTTYPE_JABBER_PRESENCE;
dbEventType.descr = "Presence notifications";
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+ DbEvent_RegisterType(&dbEventType);
HookProtoEvent(ME_IDLE_CHANGED, &CJabberProto::OnIdleChanged);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 7255b5cc63..91774af02b 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -477,7 +477,7 @@ int CJabberProto::RcGetUnreadEventsCount() dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob + 1);
int nGetTextResult = db_event_get(hDbEvent, &dbei);
if (!nGetTextResult && dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT)) {
- wchar_t *szEventText = DbGetEventTextW(&dbei, CP_ACP);
+ wchar_t *szEventText = DbEvent_GetTextW(&dbei, CP_ACP);
if (szEventText) {
nEventsSent++;
mir_free(szEventText);
@@ -569,7 +569,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe if (dbei.eventType != EVENTTYPE_MESSAGE || (dbei.flags & (DBEF_READ | DBEF_SENT)))
continue;
- ptrW szEventText( DbGetEventTextW(&dbei, CP_ACP));
+ ptrW szEventText( DbEvent_GetTextW(&dbei, CP_ACP));
if (szEventText == NULL)
continue;
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 29b2cef6b5..9b9e75ff57 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -175,15 +175,15 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam) ////////////////////////////////////////////////////////////////////////////////////////
// JabberGetEventTextChatStates - retrieves a chat state description from an event
-INT_PTR __cdecl CJabberProto::OnGetEventTextChatStates(WPARAM, LPARAM lParam)
+INT_PTR __cdecl CJabberProto::OnGetEventTextChatStates(WPARAM pEvent, LPARAM datatype)
{
- DBEVENTGETTEXT *pdbEvent = (DBEVENTGETTEXT *)lParam;
- if (pdbEvent->dbei->cbBlob > 0) {
- if (pdbEvent->dbei->pBlob[0] == JABBER_DB_EVENT_CHATSTATES_GONE) {
- if (pdbEvent->datatype == DBVT_WCHAR)
+ DBEVENTINFO *dbei = (DBEVENTINFO *)pEvent;
+ if (dbei->cbBlob > 0) {
+ if (dbei->pBlob[0] == JABBER_DB_EVENT_CHATSTATES_GONE) {
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("closed chat session"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("closed chat session"));
+
+ return (INT_PTR)mir_strdup(Translate("closed chat session"));
}
}
@@ -193,52 +193,40 @@ INT_PTR __cdecl CJabberProto::OnGetEventTextChatStates(WPARAM, LPARAM lParam) ////////////////////////////////////////////////////////////////////////////////////////
// OnGetEventTextPresence - retrieves presence state description from an event
-INT_PTR __cdecl CJabberProto::OnGetEventTextPresence(WPARAM, LPARAM lParam)
+INT_PTR __cdecl CJabberProto::OnGetEventTextPresence(WPARAM pEvent, LPARAM datatype)
{
- DBEVENTGETTEXT *pdbEvent = (DBEVENTGETTEXT *)lParam;
- if (pdbEvent->dbei->cbBlob > 0) {
- switch (pdbEvent->dbei->pBlob[0]) {
+ DBEVENTINFO *dbei = (DBEVENTINFO *)pEvent;
+ if (dbei->cbBlob > 0) {
+ switch (dbei->pBlob[0]) {
case JABBER_DB_EVENT_PRESENCE_SUBSCRIBE:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("sent subscription request"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("sent subscription request"));
- break;
+ return (INT_PTR)mir_strdup(Translate("sent subscription request"));
case JABBER_DB_EVENT_PRESENCE_SUBSCRIBED:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("approved subscription request"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("approved subscription request"));
- break;
+ return (INT_PTR)mir_strdup(Translate("approved subscription request"));
case JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBE:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("declined subscription"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("declined subscription"));
- break;
+ return (INT_PTR)mir_strdup(Translate("declined subscription"));
case JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBED:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("declined subscription"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("declined subscription"));
- break;
+ return (INT_PTR)mir_strdup(Translate("declined subscription"));
case JABBER_DB_EVENT_PRESENCE_ERROR:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("sent error presence"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("sent error presence"));
- break;
+ return (INT_PTR)mir_strdup(Translate("sent error presence"));
default:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("sent unknown presence type"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("sent unknown presence type"));
- break;
+ return (INT_PTR)mir_strdup(Translate("sent unknown presence type"));
}
}
|