From e84b97a0622a26fe474ccd840dcadb320520601c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 3 Feb 2014 20:11:26 +0000 Subject: - 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 --- plugins/Utils.pas/mirutils.pas | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'plugins/Utils.pas') 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 -- cgit v1.2.3