From fe95e19dc7743834b53c82afcf04c233e40db8db Mon Sep 17 00:00:00 2001 From: Alexey Kulakov Date: Wed, 21 Nov 2012 19:42:22 +0000 Subject: xstatus api fixes mradio frame button fix api updates git-svn-id: http://svn.miranda-ng.org/main/trunk@2420 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Utils.pas/protocols.pas | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'plugins/Utils.pas/protocols.pas') diff --git a/plugins/Utils.pas/protocols.pas b/plugins/Utils.pas/protocols.pas index 8b585c39b4..842eb53e85 100644 --- a/plugins/Utils.pas/protocols.pas +++ b/plugins/Utils.pas/protocols.pas @@ -415,7 +415,6 @@ begin end; for i:=1 to protoCount do begin - // active and switched off (but not deleted) inc(NumProto); with protos^[NumProto] do begin @@ -424,7 +423,7 @@ begin enabled:=psf_all;//psf_enabled; status :=0; -// xstat :=-1; +// xstat :=-1; flag:=CallProtoService(name,PS_GETCAPS,PFLAGNUM_2,0); if (flag and PF2_ONLINE) <>0 then status:=status or psf_online; if (flag and PF2_INVISIBLE) <>0 then status:=status or psf_invisible; @@ -440,18 +439,19 @@ begin if ((flag and PF1_CHAT)<>0) or (DBReadByte(0,name,'CtcpChatAccept',13)<>13) or // IRC (DBReadByte(0,name,'Jud',13)<>13) then // Jabber -// flag:=CallProtoService(name,PS_GETCAPS,PFLAGNUM_1,0); -// if (flag and PF1_CHAT)<>0 then +// flag:=CallProtoService(name,PS_GETCAPS,PFLAGNUM_1,0); +// if (flag and PF1_CHAT)<>0 then status:=status or psf_chat; + p:=StrCopyE(buf,name); - StrCopy(p,PS_ICQ_GETCUSTOMSTATUS); + StrCopy(p,PS_GETCUSTOMSTATUSEX); if ServiceExists(buf)<>0 then status:=status or psf_icq; StrCopy(p,PS_SET_LISTENINGTO); if ServiceExists(buf)<>0 then status:=status or psf_tunes; - + end; inc(proto); end; @@ -519,7 +519,7 @@ end; function SetXStatus(proto:PAnsiChar;newstatus:integer; txt:pWideChar=nil;title:pWideChar=nil):integer; var - ics:TICQ_CUSTOM_STATUS; + ics:TCUSTOM_STATUS; begin result:=0; if IsXStatusSupported(uint_ptr(proto)) then @@ -544,23 +544,24 @@ begin szMessage.w:=txt; end; end; - result:=CallProtoService(proto,PS_ICQ_SETCUSTOMSTATUSEX,0,lparam(@ics)); + result:=CallProtoService(proto,PS_SETCUSTOMSTATUSEX,0,lparam(@ics)); end; end; function GetXStatus(proto:PAnsiChar;txt:pointer=nil;title:pointer=nil):integer; var +{ buf:array [0..127] of AnsiChar; pc:PAnsiChar; param:array [0..63] of AnsiChar; - -// ics:TICQ_CUSTOM_STATUS; -// i,j:integer; +} + ics:TCUSTOM_STATUS; + i,j:integer; begin result:=0; if IsXStatusSupported(uint_ptr(proto)) then begin -{ + with ics do begin cbSize:=SizeOf(ics); @@ -568,7 +569,7 @@ begin wParam:=@i; lParam:=@j; end; - CallProtoService(0,PS_ICQ_GETCUSTOMSTATUSEX,0,dword(@ics)); + CallProtoService(proto,PS_GETCUSTOMSTATUSEX,0,dword(@ics)); if title<>nil then mGetMem(title^,(i+1)*SizeOf(WideChar)); if txt<>nil then @@ -579,14 +580,14 @@ begin cbSize:=SizeOf(ics); flags:=CSSF_MASK_STATUS or CSSF_MASK_NAME or CSSF_MASK_MESSAGE or CSSF_UNICODE; status:=@result; - szName.w :=pdword(title)^; - szMessage.w:=pdword(txt)^; + szName.w :=pWideChar(title); + szMessage.w:=pWideChar(txt); end; - CallProtoService(0,PS_ICQ_GETCUSTOMSTATUSEX,0,dword(@ics)); -} + CallProtoService(proto,PS_GETCUSTOMSTATUSEX,0,dword(@ics)); +{ StrCopy(buf,proto); - StrCat (buf,PS_ICQ_GETCUSTOMSTATUS); + StrCat (buf,PS_GETCUSTOMSTATUS); result:=CallService(buf,0,0); if (txt<>nil) or (title<>nil) then begin @@ -603,7 +604,7 @@ begin StrCopy(pc,'Name'); pWideChar(title^):=DBReadUnicode(0,proto,param,nil); end; end; - +} end; end; -- cgit v1.2.3