diff options
| author | George Hazan <george.hazan@gmail.com> | 2015-06-01 15:51:11 +0000 | 
|---|---|---|
| committer | George Hazan <george.hazan@gmail.com> | 2015-06-01 15:51:11 +0000 | 
| commit | 098b75ec924b6a52328e3803f5bf9e5f45835f5d (patch) | |
| tree | ffdc259bed2716dd2708ec684e4fb1f4e19007e3 | |
| parent | 865ed867c55b89e0b5d47820752ca3ce08246e0a (diff) | |
watrack to publish xStatuses correctly
git-svn-id: http://svn.miranda-ng.org/main/trunk@13958 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
| -rw-r--r-- | plugins/Utils.pas/protocols.pas | 26 | ||||
| -rw-r--r-- | plugins/Watrack/status/i_status.inc | 9 | 
2 files changed, 7 insertions, 28 deletions
| diff --git a/plugins/Utils.pas/protocols.pas b/plugins/Utils.pas/protocols.pas index bd59f16570..e1e7f3786b 100644 --- a/plugins/Utils.pas/protocols.pas +++ b/plugins/Utils.pas/protocols.pas @@ -29,7 +29,7 @@ procedure CheckStatusList(list:HWND;ProtoNum:uint_ptr);  function  CreateProtoList(deepscan:boolean=false):integer;
  procedure FreeProtoList;
 -function SetStatus(proto:PAnsiChar;status:integer;txt:PAnsiChar=pointer(-1)):integer;
 +function SetStatus(proto:PAnsiChar;status:integer;txt:PWideChar=pointer(-1)):integer;
  function SetXStatus(proto:PAnsiChar;newstatus:integer;
                      txt:PWideChar=nil;title:PWideChar=nil):integer;
  function GetXStatus(proto:PAnsiChar;txt:pointer=nil;title:pointer=nil):integer;
 @@ -495,33 +495,15 @@ begin    NumProto:=0;
  end;
 -function SetStatus(proto:PAnsiChar;status:integer;txt:PAnsiChar=pointer(-1)):integer;
 -//var  nas:TNAS_PROTOINFO;
 +function SetStatus(proto:PAnsiChar;status:integer;txt:PWideChar=pointer(-1)):integer;
  begin
    if status>0 then
      result:=CallProtoService(proto,PS_SETSTATUS,status,0)
    else
      result:=-1;
 -  if txt<>PAnsiChar(-1) then
 +  if txt<>PWideChar(-1) then
    begin
 -//    if ServiceExists(MS_NAS_SETSTATEA)=0 then
 -      result:=CallProtoService(proto,PS_SETAWAYMSG,abs(status),lparam(txt))
 -(*
 -    else
 -    begin
 -  {
 -      nas.Msg.w:=mmi.malloc((StrLenW(txt)+1)*SizeOf(WideChar));
 -      nas.Msg.w^:=#0;
 -      StrCopyW(nas.Msg.w,txt);
 -  }
 -      StrDup(nas.Msg.a,txt);
 -      nas.Flags  :=0;
 -      nas.cbSize :=SizeOf(nas);
 -      nas.szProto:=proto;
 -      nas.status :=abs(status){0};
 -      result:=CallService(MS_NAS_SETSTATEA,LPARAM(@nas),1);
 -    end;
 -*)
 +    result:=CallProtoService(proto,PS_SETAWAYMSG,abs(status),lparam(txt))
    end;
  end;
 diff --git a/plugins/Watrack/status/i_status.inc b/plugins/Watrack/status/i_status.inc index 0392a797ad..9bb071a785 100644 --- a/plugins/Watrack/status/i_status.inc +++ b/plugins/Watrack/status/i_status.inc @@ -127,12 +127,9 @@ begin              txt:=GetMacros(tmpl_stext,j);
            if uint_ptr(txt)<>uint_ptr(-1) then
            begin
 -            if (txt=nil) or (txt^=#0) then
 -              ls:=nil
 -            else
 -              WideToAnsi(txt,ls,UserCP);
 -            SetStatus(proto,-status,ls);
 -            mFreeMem(ls);
 +            if (txt<>nil) and (txt^=#0) then
 +              txt:=nil;
 +            SetStatus(proto,-status,txt);
              mFreeMem(txt);
            end;
          end;
 | 
