summaryrefslogtreecommitdiff
path: root/plugins/Utils.pas
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-03 20:11:26 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-03 20:11:26 +0000
commite84b97a0622a26fe474ccd840dcadb320520601c (patch)
tree7c1725e6eddbb47d618c8574147dd998feb8ea52 /plugins/Utils.pas
parente82c4d5d574191f432716049218b4b7b5162ec38 (diff)
- new helpers for reading db strings into static buffers;
- MS_DB_CONTACT_GETSETTINGSTATIC died; - DBCONTACTGETSETTING is detouched from all services; - these service calls are rewritten using parameters git-svn-id: http://svn.miranda-ng.org/main/trunk@8035 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Utils.pas')
-rw-r--r--plugins/Utils.pas/mirutils.pas17
1 files changed, 4 insertions, 13 deletions
diff --git a/plugins/Utils.pas/mirutils.pas b/plugins/Utils.pas/mirutils.pas
index 120a827b17..e5e761b24b 100644
--- a/plugins/Utils.pas/mirutils.pas
+++ b/plugins/Utils.pas/mirutils.pas
@@ -691,25 +691,16 @@ end;
function IsContactActive(hContact:THANDLE;proto:pAnsiChar=nil):integer;
var
p:PPROTOACCOUNT;
- dbv :TDBVARIANT;
- dbcgs:TDBCONTACTGETSETTING;
name: array [0..31] of AnsiChar;
begin
- dbv._type :=DBVT_ASCIIZ;
- dbv.szVal.a:=@name;
- dbv.cchVal :=SizeOf(name);
- dbcgs.pValue :=@dbv;
- dbcgs.szModule :='Protocol';
- dbcgs.szSetting:='p';
-
- if CallService(MS_DB_CONTACT_GETSETTINGSTATIC,hContact,lparam(@dbcgs))=0 then
+ if db_get_static(hContact,'Protocol','p',@name,SizeOf(name))=0 then
begin
result:=0;
if ServiceExists(MS_PROTO_GETACCOUNT)<>0 then
begin
- p:=PPROTOACCOUNT(CallService(MS_PROTO_GETACCOUNT,0,lparam(dbv.szVal.a)));
+ p:=PPROTOACCOUNT(CallService(MS_PROTO_GETACCOUNT,0,lparam(@name)));
if p=nil then
result:=-2 // deleted
else if (p^.bIsEnabled=0) or p^.bDynDisabled then
@@ -717,7 +708,7 @@ begin
end
else
begin
- if CallService(MS_PROTO_ISPROTOCOLLOADED,0,lparam(dbv.szVal.a))=0 then
+ if CallService(MS_PROTO_ISPROTOCOLLOADED,0,lparam(@name))=0 then
result:=-1;
end;
@@ -735,7 +726,7 @@ begin
end;
end;
if proto<>nil then
- StrCopy(proto,dbv.szVal.a);
+ StrCopy(proto,@name);
end
else
begin