summaryrefslogtreecommitdiff
path: root/protocols/MRA
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-10-10 07:46:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-10-10 07:46:53 +0000
commitf90be5cdeec5875d1022e1ef35f5b101bd76ac84 (patch)
tree59e5e8bf3b6a87dbee148bd63f841a8a62daac5f /protocols/MRA
parented10055737300c07e485eb22b27ccf92ffadab7c (diff)
service call replaced with the direct function call
git-svn-id: http://svn.miranda-ng.org/main/trunk@1857 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA')
-rw-r--r--protocols/MRA/MraProto.cpp4
-rw-r--r--protocols/MRA/Mra_functions.cpp4
-rw-r--r--protocols/MRA/Mra_proto.cpp4
-rw-r--r--protocols/MRA/Mra_svcs.cpp12
4 files changed, 12 insertions, 12 deletions
diff --git a/protocols/MRA/MraProto.cpp b/protocols/MRA/MraProto.cpp
index 1cddb8425f..f1b826767c 100644
--- a/protocols/MRA/MraProto.cpp
+++ b/protocols/MRA/MraProto.cpp
@@ -119,7 +119,7 @@ int CMraProto::OnModulesLoaded(WPARAM, LPARAM)
HookEvent(ME_WAT_NEWSTATUS, &CMraProto::MraMusicChanged);
// всех в offline // тк unsaved values сохраняются их нужно инициализировать
- for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); hContact != NULL; hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (HANDLE hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, NULL, 0, NULL, 0, NULL, 0);
// unsaved values
@@ -628,7 +628,7 @@ int CMraProto::SetStatus(int iNewStatus)
// всех в offline, только если мы бывали подключены
if (dwOldStatusMode > ID_STATUS_OFFLINE) {
// функция сама проверяет принадлежность контакта к MRA
- for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (HANDLE hContact = db_find_first();hContact != NULL;hContact = db_find_next(hContact))
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -1, 0, 0, ID_STATUS_OFFLINE, NULL, 0, NULL, 0, NULL, 0);
}
Netlib_CloseHandle(hConnection);
diff --git a/protocols/MRA/Mra_functions.cpp b/protocols/MRA/Mra_functions.cpp
index b5bd00ff8c..7083da1b8d 100644
--- a/protocols/MRA/Mra_functions.cpp
+++ b/protocols/MRA/Mra_functions.cpp
@@ -571,7 +571,7 @@ HANDLE CMraProto::MraHContactFromEmail(LPSTR lpszEMail, size_t dwEMailSize, BOOL
if (dwEMailSize == -1) dwEMailSize = lstrlenA(lpszEMail);
//check not already on list
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first();hContact != NULL;hContact = db_find_next(hContact))
{
if (IsContactMra(hContact))
if (mraGetStaticStringA(hContact, "e-mail", szEMailLocal, SIZEOF(szEMailLocal), &dwEMailLocalSize))
@@ -601,7 +601,7 @@ HANDLE CMraProto::MraHContactFromEmail(LPSTR lpszEMail, size_t dwEMailSize, BOOL
if (CallServiceSync(MS_GC_NEWSESSION, NULL, (LPARAM)&gcw) == 0)
{
BOOL bChatAdded = FALSE;
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0))
+ for (hContact = db_find_first();hContact != NULL;hContact = db_find_next(hContact))
{
if (IsContactMra(hContact))
if (mraGetStaticStringA(hContact, "ChatRoomID", szEMailLocal, SIZEOF(szEMailLocal), &dwEMailLocalSize))
diff --git a/protocols/MRA/Mra_proto.cpp b/protocols/MRA/Mra_proto.cpp
index e1fd7d2e4b..0e6753fb7d 100644
--- a/protocols/MRA/Mra_proto.cpp
+++ b/protocols/MRA/Mra_proto.cpp
@@ -1516,7 +1516,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd
dwAuthMessageSize = lstrlenW(wszAuthMessage);
}
- for (hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
+ for (hContact = db_find_first();hContact != NULL;hContact = db_find_next(hContact)) {
if (GetContactBasicInfoW(hContact, &dwID, NULL, NULL, NULL, NULL, szEMail, SIZEOF(szEMail), &dwEMailSize, NULL, 0, NULL, NULL, 0, NULL) == NO_ERROR)
if (dwID == -1) {
if (IsEMailChatAgent(szEMail, dwEMailSize)) {// чат: ещё раз запросим авторизацию, пометим как видимый в списке, постоянный
@@ -1544,7 +1544,7 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd
}
else { // контакт лист почемуто не получили
// всех в offline и id в нестандарт
- for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);hContact != NULL;hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
+ for (HANDLE hContact = db_find_first();hContact != NULL;hContact = db_find_next(hContact)) {
SetContactBasicInfoW(hContact, SCBIFSI_LOCK_CHANGES_EVENTS, (SCBIF_ID|SCBIF_GROUP_ID|SCBIF_SERVER_FLAG|SCBIF_STATUS), -1, -2, 0, 0, ID_STATUS_OFFLINE, NULL, 0, NULL, 0, NULL, 0);
// request user info from server
MraUpdateContactInfo(hContact);
diff --git a/protocols/MRA/Mra_svcs.cpp b/protocols/MRA/Mra_svcs.cpp
index 16d69d0dc9..28c761a5c4 100644
--- a/protocols/MRA/Mra_svcs.cpp
+++ b/protocols/MRA/Mra_svcs.cpp
@@ -225,9 +225,9 @@ INT_PTR CMraProto::MraWebSearch(WPARAM wParam, LPARAM lParam)
INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam)
{
if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_UPD_ALL_USERS_INFO_STR), MB_YESNO | MB_ICONQUESTION) == IDYES ) {
- for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ for (HANDLE hContact = db_find_first();
hContact != NULL;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
+ hContact = db_find_next(hContact)) {
size_t dwEMailSize;
CHAR szEMail[MAX_EMAIL_LEN];
if ( IsContactMra(hContact))
@@ -241,9 +241,9 @@ INT_PTR CMraProto::MraUpdateAllUsersInfo(WPARAM wParam, LPARAM lParam)
INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam)
{
if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_CHK_USERS_AVATARS_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
- for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ for (HANDLE hContact = db_find_first();
hContact != NULL;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
+ hContact = db_find_next(hContact)) {
size_t dwEMailSize;
CHAR szEMail[MAX_EMAIL_LEN];
@@ -259,9 +259,9 @@ INT_PTR CMraProto::MraCheckUpdatesUsersAvt(WPARAM wParam, LPARAM lParam)
INT_PTR CMraProto::MraRequestAuthForAll(WPARAM wParam, LPARAM lParam)
{
if ( MessageBox(NULL, TranslateT("Are you sure?"), TranslateW(MRA_REQ_AUTH_FOR_ALL_STR), MB_YESNO | MB_ICONQUESTION) == IDYES) {
- for (HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ for (HANDLE hContact = db_find_first();
hContact != NULL;
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0)) {
+ hContact = db_find_next(hContact)) {
DWORD dwContactSeverFlags;
if (GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwContactSeverFlags, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL) == NO_ERROR)
if (dwContactSeverFlags&CONTACT_INTFLAG_NOT_AUTHORIZED && dwContactSeverFlags != -1)