diff options
Diffstat (limited to 'plugins/MirandaNGHistoryToDB')
-rw-r--r-- | plugins/MirandaNGHistoryToDB/Contacts.pas | 6 | ||||
-rw-r--r-- | plugins/MirandaNGHistoryToDB/Database.pas | 31 | ||||
-rw-r--r-- | plugins/MirandaNGHistoryToDB/Menu.pas | 4 | ||||
-rw-r--r-- | plugins/MirandaNGHistoryToDB/MsgExport.pas | 4 |
4 files changed, 10 insertions, 35 deletions
diff --git a/plugins/MirandaNGHistoryToDB/Contacts.pas b/plugins/MirandaNGHistoryToDB/Contacts.pas index 8d95b5f3bc..6ecb7f7eec 100644 --- a/plugins/MirandaNGHistoryToDB/Contacts.pas +++ b/plugins/MirandaNGHistoryToDB/Contacts.pas @@ -110,7 +110,6 @@ function GetContactID(hContact: THandle; Proto: AnsiString = ''; Contact: Boolea var
uid: PAnsiChar;
dbv: TDBVARIANT;
- cgs: TDBCONTACTGETSETTING;
tmp: String;
begin
Result := '';
@@ -121,11 +120,8 @@ begin uid := PAnsiChar(CallProtoService(PAnsiChar(Proto), PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0));
if (Cardinal(uid) <> CALLSERVICE_NOTFOUND) and (uid <> nil) then
begin
- cgs.szModule := PAnsiChar(Proto);
- cgs.szSetting := uid;
- cgs.pValue := @dbv;
try
- if CallService(MS_DB_CONTACT_GETSETTING, hContact, LPARAM(@cgs)) = 0 then
+ if db_get(hContact, PAnsiChar(Proto), uid, @dbv) = 0 then
begin
case dbv._type of
DBVT_BYTE:
diff --git a/plugins/MirandaNGHistoryToDB/Database.pas b/plugins/MirandaNGHistoryToDB/Database.pas index ba58a7295a..2b5e03b647 100644 --- a/plugins/MirandaNGHistoryToDB/Database.pas +++ b/plugins/MirandaNGHistoryToDB/Database.pas @@ -101,12 +101,8 @@ end; function DBExists(const hContact: THandle; const Module, Param: AnsiString): Boolean;
var
dbv: TDBVARIANT;
- cgs: TDBCONTACTGETSETTING;
begin
- cgs.szModule := PAnsiChar(Module);
- cgs.szSetting := PAnsiChar(Param);
- cgs.pValue := @dbv;
- Result := (CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) = 0);
+ Result := (db_get(hContact, PAnsiChar(Module), PAnsiChar(Param), @dbv) = 0);
if Result then
DBFreeVariant(@dbv);
end;
@@ -118,15 +114,10 @@ end; function GetDBBlob(const hContact: THandle; const Module,Param: AnsiString; var Value: Pointer; var Size: Integer): Boolean;
var
- cgs: TDBContactGetSetting;
dbv: TDBVARIANT;
begin
Result := False;
- ZeroMemory(@cgs,SizeOf(cgs));
- cgs.szModule := PAnsiChar(Module);
- cgs.szSetting := PAnsiChar(Param);
- cgs.pValue := @dbv;
- if CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) <> 0 then exit;
+ if db_get(hContact, PAnsiChar(Module), PAnsiChar(Param), @dbv) <> 0 then exit;
Size := dbv.cpbVal;
Value := nil;
if dbv.cpbVal = 0 then exit;
@@ -183,15 +174,11 @@ end; function GetDBInt(const hContact: THandle; const Module,Param: AnsiString; Default: Integer): Integer;
var
- cws:TDBCONTACTGETSETTING;
dbv:TDBVariant;
begin
dbv._type := DBVT_DWORD;
dbv.dVal:=Default;
- cws.szModule:=PAnsiChar(Module);
- cws.szSetting:=PAnsiChar(Param);
- cws.pValue:=@dbv;
- if CallService(MS_DB_CONTACT_GETSETTING,hContact,LPARAM(@cws))<>0 then
+ if db_get(hContact, PAnsiChar(Module), PAnsiChar(Param), @dbv)<>0 then
Result:=default
else
Result:=dbv.dval;
@@ -210,13 +197,9 @@ end; function DBGetContactSettingString(hContact: THandle; const szModule: PAnsiChar; const szSetting: PAnsiChar; ErrorValue: PAnsiChar): AnsiString;
var
dbv: TDBVARIANT;
- cgs: TDBCONTACTGETSETTING;
tmp: WideString;
begin
- cgs.szModule := szModule;
- cgs.szSetting := szSetting;
- cgs.pValue := @dbv;
- if CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) <> 0 then
+ if db_get(hContact, szModule, szSetting, @dbv) <> 0 then
Result := ErrorValue
else begin
case dbv._type of
@@ -247,12 +230,8 @@ end; function DBGetContactSettingWideString(hContact: THandle; const szModule: PAnsiChar; const szSetting: PAnsiChar; ErrorValue: PWideChar): WideString;
var
dbv: TDBVARIANT;
- cgs: TDBCONTACTGETSETTING;
begin
- cgs.szModule := szModule;
- cgs.szSetting := szSetting;
- cgs.pValue := @dbv;
- if CallService(MS_DB_CONTACT_GETSETTING, hContact, lParam(@cgs)) <> 0 then
+ if db_get(hContact, szModule, szSetting, @dbv) <> 0 then
Result := ErrorValue
else begin
case dbv._type of
diff --git a/plugins/MirandaNGHistoryToDB/Menu.pas b/plugins/MirandaNGHistoryToDB/Menu.pas index 15d51a11b7..b2218747b5 100644 --- a/plugins/MirandaNGHistoryToDB/Menu.pas +++ b/plugins/MirandaNGHistoryToDB/Menu.pas @@ -170,7 +170,7 @@ var AccountName: ^PPROTOACCOUNT;
begin
// Получаем список контактов
- hContact := CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact := db_find_first();
while hContact <> 0 do
begin
ContactProto := GetContactProto(hContact);
@@ -183,7 +183,7 @@ begin ContactID := TranslateW('Unknown Contact');
if not ((MatchStrings(LowerCase(ContactProto), 'skype*')) or (ContactID = TranslateW('Unknown Contact')) or MatchStrings(LowerCase(ContactProto), 'metacontacts*')) then
WriteInLog(ProfilePath, Format('%s;%s;%s;%d', [ContactID, ContactName, GroupName, StrContactProtoToInt(ContactProto)]), 3);
- hContact := CallService(MS_DB_CONTACT_FINDNEXT, hContact, 0);
+ hContact := db_find_next(hContact);
end;
AccountCount := 0;
// Выгружаем список протоколов в файл ProtoList.csv
diff --git a/plugins/MirandaNGHistoryToDB/MsgExport.pas b/plugins/MirandaNGHistoryToDB/MsgExport.pas index e36e3b1c8a..a409a01091 100644 --- a/plugins/MirandaNGHistoryToDB/MsgExport.pas +++ b/plugins/MirandaNGHistoryToDB/MsgExport.pas @@ -93,7 +93,7 @@ begin IMExportWizard.ActivePage := Page1;
StartExport := False;
// Получаем список контактов
- hContact := CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ hContact := db_find_first();
ContactList.Columns[0].MaxWidth := 190;
ContactList.Columns[1].MaxWidth := 90;
ContactList.Columns[2].MaxWidth := 140;
@@ -126,7 +126,7 @@ begin ListItem.Checked := False
else
ListItem.Checked := True;}
- hContact := CallService(MS_DB_CONTACT_FINDNEXT, hContact, 0);
+ hContact := db_find_next(hContact);
end;
ContactList.Items.EndUpdate;
end;
|