diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 14:24:12 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 14:24:12 +0000 |
commit | 83310365c69bd40365ee0ae0e16c99c28e24cd0b (patch) | |
tree | 10ac18bfdc3fcf0fd62a5aba3ccb5dedffa2e410 /plugins/Utils.pas | |
parent | d68cd04d6f7b997692476b531bdc30f546a50efd (diff) |
- all static protocol services replaced with functions;
- m_protomod.h removed as useless
git-svn-id: http://svn.miranda-ng.org/main/trunk@14260 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Utils.pas')
-rw-r--r-- | plugins/Utils.pas/mircontacts.pas | 23 | ||||
-rw-r--r-- | plugins/Utils.pas/protocols.pas | 2 | ||||
-rw-r--r-- | plugins/Utils.pas/srvblock.pas | 2 |
3 files changed, 9 insertions, 18 deletions
diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas index 78c68501ee..15bb6d61a7 100644 --- a/plugins/Utils.pas/mircontacts.pas +++ b/plugins/Utils.pas/mircontacts.pas @@ -9,7 +9,6 @@ uses //----- Contact info -----
-function GetContactProtoAcc(hContact:TMCONTACT):PAnsiChar;
function GetContactProto(hContact: TMCONTACT): PAnsiChar; overload;
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: PAnsiChar): PAnsiChar; overload;
function GetContactDisplayName(hContact: TMCONTACT; Proto: PAnsiChar = nil; Contact: boolean = false): PWideChar;
@@ -63,27 +62,19 @@ uses //----- Contact info -----
-function GetContactProtoAcc(hContact:TMCONTACT):PAnsiChar;
-begin
- if ServiceExists(MS_PROTO_GETCONTACTBASEACCOUNT)<>0 then
- result:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEACCOUNT,hContact,0))
- else
- result:=PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO,hContact,0));
-end;
-
function GetContactProto(hContact: TMCONTACT): PAnsiChar;
{$IFDEF AllowInline}inline;{$ENDIF}
begin
- Result := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, hContact, 0));
+ Result := Proto_GetProtoName(hContact);
end;
function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: PAnsiChar): PAnsiChar;
begin
- Result := GetContactProto(hContact);
+ Result := Proto_GetProtoName(hContact);
if StrCmp(Result, META_PROTO)=0 then
begin
SubContact := CallService(MS_MC_GETMOSTONLINECONTACT, hContact, 0);
- SubProtocol := PAnsiChar(CallService(MS_PROTO_GETCONTACTBASEPROTO, SubContact, 0));
+ SubProtocol := Proto_GetProtoName(SubContact);
end
else
begin
@@ -246,7 +237,7 @@ begin begin
result:=0;
- p:=PPROTOACCOUNT(CallService(MS_PROTO_GETACCOUNT,0,lparam(@name)));
+ p:=Proto_GetAccount(@name);
if p=nil then
result:=-2 // deleted
else if (not p^.bIsEnabled) or p^.bDynDisabled then
@@ -371,7 +362,7 @@ var is_chat:boolean;
begin
result:=0;
- Proto:=GetContactProtoAcc(hContact);
+ Proto:=Proto_GetBaseAccountName(hContact);
if Proto<>nil then
begin
p:=StrCopyE(section,setting);
@@ -593,7 +584,7 @@ begin if lAccount then
begin
- acc:=GetContactProtoAcc(hContact);
+ acc:=Proto_GetBaseAccountName(hContact);
StrReplaceW(buf,'%account%',FastAnsiToWideBuf(acc,buf1));
end
else
@@ -602,7 +593,7 @@ begin if lUID then
begin
if acc=nil then
- acc:=GetContactProtoAcc(hContact);
+ acc:=Proto_GetBaseAccountName(hContact);
if IsChat(hContact) then
begin
p:=DBReadUnicode(hContact,acc,'ChatRoomID');
diff --git a/plugins/Utils.pas/protocols.pas b/plugins/Utils.pas/protocols.pas index e1e7f3786b..08b9221711 100644 --- a/plugins/Utils.pas/protocols.pas +++ b/plugins/Utils.pas/protocols.pas @@ -411,7 +411,7 @@ var p:pAnsichar;
// hContract:THANDLE;
begin
- CallService(MS_PROTO_ENUMACCOUNTS,wparam(@protoCount),lparam(@proto));
+ Proto_EnumAccounts(protoCount, proto);
mGetMem(protos,(protoCount+1)*SizeOf(tMyProto)); // 0 - default
NumProto:=0;
diff --git a/plugins/Utils.pas/srvblock.pas b/plugins/Utils.pas/srvblock.pas index 5ceb7a8fed..cf7b4125eb 100644 --- a/plugins/Utils.pas/srvblock.pas +++ b/plugins/Utils.pas/srvblock.pas @@ -562,7 +562,7 @@ begin if StrPos(buf,protostr)<>nil then
if CallService(MS_DB_CONTACT_IS,data.Parameter,0)<>0 then
- StrReplace(buf,protostr,GetContactProtoAcc(data.Parameter))
+ StrReplace(buf,protostr,Proto_GetBaseAccountName(data.Parameter))
else
Exit;
|