summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-07 20:23:30 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-07 20:23:30 +0300
commit5811219420fdedef8941584ef70fec403d012e4e (patch)
tree2f5e90bbd69a6499923b6207e5c9df51588d0fb8
parentf60c78abfbd5f279b30de729046b805bba8e00b0 (diff)
Proto_GetAccount() for pascal plugins
-rw-r--r--include/delphi/m_protocols.inc3
-rw-r--r--plugins/Utils.pas/mircontacts.pas3
-rw-r--r--plugins/Utils.pas/protocols.pas2
-rw-r--r--plugins/Watrack/players/pl_mradio.pas2
-rw-r--r--plugins/Watrack/proto/proto.pas3
-rw-r--r--plugins/Watrack/status/i_status.inc2
6 files changed, 8 insertions, 7 deletions
diff --git a/include/delphi/m_protocols.inc b/include/delphi/m_protocols.inc
index 76796c06ed..713bbb031a 100644
--- a/include/delphi/m_protocols.inc
+++ b/include/delphi/m_protocols.inc
@@ -281,6 +281,9 @@ const
function Proto_GetAccount(proto:PAnsiChar) : PPROTOACCOUNT; stdcall; external AppDLL;
+// retrieves protocol status
+function Proto_GetStatus(proto:PAnsiChar) : int; stdcall; external AppDLL;
+
(*
__inline PROTOACCOUNT* ProtoGetAccount( const AnsiChar* accName )
{ return (PROTOACCOUNT* )CallService( MS_PROTO_GETACCOUNT, 0, (LPARAM)accName );
diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas
index 1ec228ce3e..1c3b614324 100644
--- a/plugins/Utils.pas/mircontacts.pas
+++ b/plugins/Utils.pas/mircontacts.pas
@@ -455,8 +455,7 @@ begin
begin
if not anystatus then
begin
- StrCat(pc,PS_GETSTATUS);
- anystatus:=(CallService(pc,0,0)<>ID_STATUS_OFFLINE);
+ anystatus:=(Proto_GetStatus(pc)<>ID_STATUS_OFFLINE);
end;
if anystatus then
begin
diff --git a/plugins/Utils.pas/protocols.pas b/plugins/Utils.pas/protocols.pas
index 97a972dbe0..8a76d794d0 100644
--- a/plugins/Utils.pas/protocols.pas
+++ b/plugins/Utils.pas/protocols.pas
@@ -184,7 +184,7 @@ end;
function GetProtoStatus(ProtoNum:uint_ptr):integer;
begin
ProtoNum:=FindProto(PAnsiChar(ProtoNum));
- result:=CallProtoService(protos^[ProtoNum].name,PS_GETSTATUS,0,0);
+ result:=Proto_GetStatus(protos^[ProtoNum].name);
end;
function GetProtoStatusNum(ProtoNum:uint_ptr):integer;
diff --git a/plugins/Watrack/players/pl_mradio.pas b/plugins/Watrack/players/pl_mradio.pas
index d282fc603e..7bd2a14d5c 100644
--- a/plugins/Watrack/players/pl_mradio.pas
+++ b/plugins/Watrack/players/pl_mradio.pas
@@ -101,7 +101,7 @@ end;
function Check(wnd:HWND;flags:integer):HWND;cdecl;
begin
- if CallProtoService(playername,PS_GETSTATUS,0,0)=ID_STATUS_ONLINE then
+ if Proto_GetStatus(playername)=ID_STATUS_ONLINE then
begin
result:=InitmRadio
end
diff --git a/plugins/Watrack/proto/proto.pas b/plugins/Watrack/proto/proto.pas
index d5a35157b1..33098c7f42 100644
--- a/plugins/Watrack/proto/proto.pas
+++ b/plugins/Watrack/proto/proto.pas
@@ -113,9 +113,8 @@ begin
begin
StrCopy(PAnsiChar(buf),Proto_GetProtoName(ccs^.hContact));
i:=DBReadWord(ccs^.hContact,PAnsiChar(buf),'ApparentMode');
- StrCat(PAnsiChar(buf),PS_GETSTATUS);
if (i=ID_STATUS_OFFLINE) or
- ((i=0) and (CallService(PAnsiChar(buf),0,0)=ID_STATUS_INVISIBLE)) then
+ ((i=0) and (Proto_GetStatus(PAnsiChar(buf))=ID_STATUS_INVISIBLE)) then
begin
result:=Proto_ChainRecv(wParam,ccs);
end
diff --git a/plugins/Watrack/status/i_status.inc b/plugins/Watrack/status/i_status.inc
index bbd8f2e1fa..934e69810b 100644
--- a/plugins/Watrack/status/i_status.inc
+++ b/plugins/Watrack/status/i_status.inc
@@ -82,7 +82,7 @@ begin
if (UseStatus<>BST_UNCHECKED) or (UseExtStatus<>BST_UNCHECKED) then
begin
- status:=CallProtoService(proto,PS_GETSTATUS,0,0);
+ status:=Proto_GetStatus(proto);
todo :=(SimpleMode<>BST_UNCHECKED) or IsOurStatus(mask,status);
end
else