diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-30 17:32:39 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-30 17:32:39 +0000 |
commit | 109877a3c75cb290c55755dcfc88794d2453669d (patch) | |
tree | 3ede8b9170b2fc3f6f35dc2cea6742d44b19d631 /protocols/MSN | |
parent | fee8d991bdf4a59b563d1b92165ea0ed2f7bacb8 (diff) |
MS_DB_EVENT_* services remained, but their calls removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@4255 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN')
-rw-r--r-- | protocols/MSN/src/msn_commands.cpp | 2 | ||||
-rw-r--r-- | protocols/MSN/src/msn_lists.cpp | 38 | ||||
-rw-r--r-- | protocols/MSN/src/msn_proto.cpp | 23 |
3 files changed, 22 insertions, 41 deletions
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index e3da3c541b..c86c1779f8 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -523,7 +523,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para dbei.timestamp = time(NULL);
dbei.cbBlob = (unsigned)strlen(msgBody) + 1;
dbei.pBlob = (PBYTE)msgBody;
- CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei);
+ db_event_add(hContact, &dbei);
}
}
}
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp index 97f632a870..bf23f84ce2 100644 --- a/protocols/MSN/src/msn_lists.cpp +++ b/protocols/MSN/src/msn_lists.cpp @@ -265,59 +265,46 @@ void CMsnProto::Lists_Populate(void) void CMsnProto::MSN_CleanupLists(void)
{
-// EnterCriticalSection(&csLists);
- for (int i=contList.getCount(); i--;)
- {
+ for (int i=contList.getCount(); i--;) {
MsnContact& p = contList[i];
+ if (p.list & LIST_FL)
+ MSN_SetContactDb(p.hContact, p.email);
- if (p.list & LIST_FL) MSN_SetContactDb(p.hContact, p.email);
-
- if (p.list & LIST_PL)
- {
+ if (p.list & LIST_PL) {
if (p.list & (LIST_AL | LIST_BL))
MSN_AddUser(NULL, p.email, p.netId, LIST_PL + LIST_REMOVE);
else
MSN_AddAuthRequest(p.email, p.nick, p.invite);
}
-// if (p.list == LIST_RL)
-// MSN_AddAuthRequest(p.email, NULL, p.invite);
-
- if (p.hContact && !(p.list & (LIST_LL | LIST_FL | LIST_PL)) && p.list != LIST_RL)
- {
- int count = CallService(MS_DB_EVENT_GETCOUNT, (WPARAM)p.hContact, 0);
- if (count)
- {
+ if (p.hContact && !(p.list & (LIST_LL | LIST_FL | LIST_PL)) && p.list != LIST_RL) {
+ int count = db_event_count(p.hContact);
+ if (count) {
TCHAR text[256];
- TCHAR* sze = mir_a2t(p.email);
+ TCHAR *sze = mir_a2t(p.email);
mir_sntprintf(text, SIZEOF(text), TranslateT("Contact %s has been removed from the server.\nWould you like to keep it as \"Local Only\" contact to preserve history?"), sze);
mir_free(sze);
TCHAR title[128];
mir_sntprintf(title, SIZEOF(title), TranslateT("%s protocol"), m_tszUserName);
- if (MessageBox(NULL, text, title, MB_YESNO | MB_ICONQUESTION | MB_SETFOREGROUND) == IDYES)
- {
+ if (MessageBox(NULL, text, title, MB_YESNO | MB_ICONQUESTION | MB_SETFOREGROUND) == IDYES) {
MSN_AddUser(p.hContact, p.email, 0, LIST_LL);
setByte(p.hContact, "LocalList", 1);
continue;
}
}
- if (!(p.list & (LIST_LL | LIST_FL)))
- {
+ if (!(p.list & (LIST_LL | LIST_FL))) {
CallService(MS_DB_CONTACT_DELETE, (WPARAM)p.hContact, 0);
p.hContact = NULL;
}
-
}
- if (p.list & (LIST_LL | LIST_FL) && p.hContact)
- {
+ if (p.list & (LIST_LL | LIST_FL) && p.hContact) {
TCHAR path[MAX_PATH];
MSN_GetCustomSmileyFileName(p.hContact, path, SIZEOF(path), "", 0);
- if (path[0])
- {
+ if (path[0]) {
SMADD_CONT cont;
cont.cbSize = sizeof(SMADD_CONT);
cont.hContact = p.hContact;
@@ -328,7 +315,6 @@ void CMsnProto::MSN_CleanupLists(void) }
}
}
-// LeaveCriticalSection(&csLists);
}
void CMsnProto::MSN_CreateContList(void)
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index c1ed5e4f56..8df8e48531 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -282,13 +282,12 @@ HANDLE __cdecl CMsnProto::AddToList(int flags, PROTOSEARCHRESULT* psr) HANDLE __cdecl CMsnProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent)
{
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(dbei);
- if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == (DWORD)(-1))
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
return NULL;
dbei.pBlob=(PBYTE) alloca(dbei.cbBlob);
- if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei)) return NULL;
+ if (db_event_get(hDbEvent, &dbei)) return NULL;
if (strcmp(dbei.szModule, m_szModuleName)) return NULL;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return NULL;
@@ -353,14 +352,12 @@ int CMsnProto::Authorize(HANDLE hDbEvent) if (!msnLoggedIn)
return 1;
- DBEVENTINFO dbei = { 0 };
- dbei.cbSize = sizeof(dbei);
-
- if ((int)(dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == -1)
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
return 1;
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
- if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei))
+ if (db_event_get(hDbEvent, &dbei))
return 1;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
@@ -393,14 +390,12 @@ int CMsnProto::AuthDeny(HANDLE hDbEvent, const TCHAR* szReason) if (!msnLoggedIn)
return 1;
- DBEVENTINFO dbei = { 0 };
- dbei.cbSize = sizeof(dbei);
-
- if ((int)(dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == -1)
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == -1)
return 1;
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
- if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei))
+ if (db_event_get(hDbEvent, &dbei))
return 1;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST)
|