You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
752 lines
22 KiB
Plaintext
752 lines
22 KiB
Plaintext
{ ############################################################################ }
|
|
{ # # }
|
|
{ # RnQ Eye Plugin v. 1.45 # }
|
|
{ # # }
|
|
{ # Created by Mika'el © 2007 # }
|
|
{ # Modifications by CHERTS © 2011 # }
|
|
{ # Modifications by Mikanoshi © 2008-2014 # }
|
|
{ # # }
|
|
{ # Äàííûå èñõîäíèêè ìîãóò ìîäèôèöèðîâàòüñÿ è èñïîëüçîâàòüñÿ â ñâîèõ öåëÿõ # }
|
|
{ # â ñîîòâåòñòâèè ñ ëèöåíçèåé GPL v.2 # }
|
|
{ # # }
|
|
{ ############################################################################ }
|
|
|
|
library RnQEye;
|
|
|
|
uses
|
|
Types,
|
|
Classes,
|
|
Windows,
|
|
Messages,
|
|
plugin,
|
|
pluginutil,
|
|
SysUtils,
|
|
Forms,
|
|
IniFiles,
|
|
CallExec,
|
|
ExmplForm in 'ExmplForm.pas' {ExmplFrm} ,
|
|
Signal in 'Signal.pas' {SForm};
|
|
|
|
{$I NoRTTI.inc}
|
|
{$R RnQEye.res}
|
|
{$R 'icons.res' 'Icons\icons.rc'}
|
|
|
|
const
|
|
|
|
namepl = 'R&Q Eye ' + pluginversion;
|
|
{ Event strings }
|
|
STR_PE_AUTOMSG_REQ_GOT = '[%s] %s çàïðîñèë(à) Âàøå àâòîñîîáùåíèå';
|
|
STR_PE_XSTATUS_REQ_GOT = '[%s] %s çàïðîñèë(à) Âàø äîï. ñòàòóñ';
|
|
STR_PE_ADDEDYOU_GOT = '[%s] %s äîáàâèë(à) Âàñ ê ñåáå â êîíòàêòû';
|
|
STR_PE_AUTHREQ_GOT = '[%s] %s çàïðîñèë(à) Âàøó àâòîðèçàöèþ';
|
|
STR_PE_AUTH_GOT = '[%s] %s äàë(à) Âàì àâòîðèçàöèþ';
|
|
STR_PE_AUTHDENIED_GOT = '[%s] %s îòêàçàë(à) Âàì â àâòîðèçàöèè';
|
|
STR_PE_CONTACTS_GOT = '[%s] %s ïîñëàë(à) Âàì êîíòàêò(û)';
|
|
STR_PE_GCARD_GOT = '[%s] %s ïîñëàë(à) Âàì GreenCard';
|
|
STR_PE_WEBPAGER_GOT = '[%s] %s ïîñëàë(à) Âàì ñîîáùåíèå ñ ñàéòà icq.com';
|
|
STR_IS_INVISIBLE = '[%s] %s âîçìîæíî íåâèäèìûé';
|
|
STR_CL_STATUS_CHANGED = '[%s] %s ñìåíèë(à) ñòàòóñ ñ %s íà %s';
|
|
|
|
var
|
|
userPath, andrqPath, buffers, bufferslog: ansistring;
|
|
panelID: Integer;
|
|
chat_hwnd: Integer;
|
|
CurTime: STRING;
|
|
vApiVersion, currentUIN, bufferi, temp, uin_: Integer;
|
|
unnamed: boolean;
|
|
Delims: TCharSet = ['|'];
|
|
|
|
procedure WriteInLog(str: string);
|
|
var
|
|
path: widestring;
|
|
f: TextFile;
|
|
begin
|
|
path := RQ_GetUserPath + logname;
|
|
Assign(f, path);
|
|
if FileExists(path) then
|
|
begin
|
|
Append(f);
|
|
Writeln(f, str);
|
|
end
|
|
else
|
|
begin
|
|
Rewrite(f);
|
|
Writeln(f, str);
|
|
end;
|
|
CloseFile(f);
|
|
end;
|
|
|
|
procedure WriteInStatusLog(str: string);
|
|
var
|
|
path: widestring;
|
|
f: TextFile;
|
|
begin
|
|
path := RQ_GetUserPath + logstatus;
|
|
Assign(f, path);
|
|
if FileExists(path) then
|
|
begin
|
|
Append(f);
|
|
Writeln(f, str);
|
|
end
|
|
else
|
|
begin
|
|
Rewrite(f);
|
|
Writeln(f, str);
|
|
end;
|
|
CloseFile(f);
|
|
end;
|
|
|
|
function ByteToStatus(statusbyte: byte): string;
|
|
begin
|
|
case statusbyte of
|
|
PS_ONLINE:
|
|
result := '[Â ñåòè]';
|
|
PS_OCCUPIED:
|
|
result := '[Çàíÿò]';
|
|
PS_DND:
|
|
result := '[Íå áåñïîêîèòü]';
|
|
PS_NA:
|
|
result := '[Íåäîñòóïåí]';
|
|
PS_AWAY:
|
|
result := '[Óø¸ë]';
|
|
PS_F4C:
|
|
result := '[Ñâîáîäåí]';
|
|
PS_OFFLINE:
|
|
result := '[Îòêëþ÷åí]';
|
|
PS_UNKNOWN:
|
|
result := '[Íåèçâåñòåí]';
|
|
PS_EVIL:
|
|
result := '[Çëîé]';
|
|
PS_DEPRESSION:
|
|
result := '[Äåïðåññèÿ]';
|
|
end;
|
|
end;
|
|
|
|
procedure FillPicIndexMass(Index: byte);
|
|
begin
|
|
PicIndexMass[Length(PicIndexMass) - 1] := Index;
|
|
SetLength(PicIndexMass, Length(PicIndexMass) + 1);
|
|
end;
|
|
|
|
procedure LoadUINs;
|
|
var path: string;
|
|
begin
|
|
path := RQ_GetUserPath + uinsname;
|
|
if not assigned(lst) then
|
|
lst := TStringList.Create;
|
|
if FileExists(path) then
|
|
lst.LoadFromFile(path);
|
|
end;
|
|
|
|
procedure LoadINI;
|
|
var
|
|
path: widestring;
|
|
s, r: string;
|
|
i, intt: Integer;
|
|
ini: TIniFile;
|
|
evntsv: TStringList;
|
|
begin
|
|
path := RQ_GetUserPath + ininame;
|
|
if FileExists(path) then
|
|
begin
|
|
ini := TIniFile.Create(path);
|
|
|
|
r := ini.ReadString('Main', 'WriteLog', '0');
|
|
if r = '1' then
|
|
writelog := true
|
|
else
|
|
writelog := false;
|
|
|
|
r := ini.ReadString('Main', 'UnnamedOnly', '0');
|
|
if r = '1' then
|
|
EventsFromUnnamedOnly := true
|
|
else
|
|
EventsFromUnnamedOnly := false;
|
|
|
|
r := ini.ReadString('Main', 'Ani', '0');
|
|
if r = '1' then
|
|
AniEvents := true
|
|
else
|
|
AniEvents := false;
|
|
|
|
r := ini.ReadString('Main', 'LogOnOff', '0');
|
|
if r = '1' then
|
|
LogOnOff := true
|
|
else
|
|
LogOnOff := false;
|
|
|
|
r := ini.ReadString('Main', 'WriteStatus', '0');
|
|
if r = '1' then
|
|
WriteStatus := true
|
|
else
|
|
WriteStatus := false;
|
|
|
|
r := ini.ReadString('Main', 'CLviewWidth', '0');
|
|
if TryStrToInt(r, intt) then
|
|
ExmplFrm.CLview.width := intt;
|
|
|
|
r := ini.ReadString('Main', 'CLviewColumnWidth', '0');
|
|
if TryStrToInt(r, intt) then
|
|
ExmplFrm.CLview.Column[0].width := intt;
|
|
|
|
r := ini.ReadString('Main', 'Sort', '0');
|
|
if TryStrToInt(r, intt) then
|
|
begin
|
|
TotalSort := intt;
|
|
ExmplFrm.CLview.CustomSort(nil, 0);
|
|
end;
|
|
|
|
r := ini.ReadString('Main', 'TipPosition', '150');
|
|
ExmplFrm.UpDown1.Position := StrToInt(r);
|
|
|
|
r := ini.ReadString('Main', 'TipPos', '0');
|
|
if r = '1' then
|
|
TipPos := true
|
|
else
|
|
TipPos := false;
|
|
|
|
r := ini.ReadString('Main', 'TipDir', '0');
|
|
if r = '1' then
|
|
TipDir := true
|
|
else
|
|
TipDir := false;
|
|
|
|
r := ini.ReadString('Main', 'ClearOnStart', '0');
|
|
if r = '1' then
|
|
begin
|
|
ClearOnStart := true;
|
|
// Clear event section
|
|
ini.EraseSection('Events');
|
|
end
|
|
else
|
|
ClearOnStart := false;
|
|
|
|
r := ini.ReadString('Main', 'ShowEvent_PE_AUTOMSG_REQ_GOT', '1');
|
|
if r = '1' then
|
|
ShowEvent_PE_AUTOMSG_REQ_GOT := true
|
|
else
|
|
ShowEvent_PE_AUTOMSG_REQ_GOT := false;
|
|
|
|
r := ini.ReadString('Main', 'ShowEvent_PE_XSTATUS_REQ_GOT', '1');
|
|
if r = '1' then
|
|
ShowEvent_PE_XSTATUS_REQ_GOT := true
|
|
else
|
|
ShowEvent_PE_XSTATUS_REQ_GOT := false;
|
|
|
|
r := ini.ReadString('Main', 'ShowEvent_PE_ADDEDYOU_GOT', '1');
|
|
if r = '1' then
|
|
ShowEvent_PE_ADDEDYOU_GOT := true
|
|
else
|
|
ShowEvent_PE_ADDEDYOU_GOT := false;
|
|
|
|
r := ini.ReadString('Main', 'ShowEvent_PE_AUTHREQ_GOT', '1');
|
|
if r = '1' then
|
|
ShowEvent_PE_AUTHREQ_GOT := true
|
|
else
|
|
ShowEvent_PE_AUTHREQ_GOT := false;
|
|
|
|
r := ini.ReadString('Main', 'ShowEvent_PE_AUTH_GOT', '1');
|
|
if r = '1' then
|
|
ShowEvent_PE_AUTH_GOT := true
|
|
else
|
|
ShowEvent_PE_AUTH_GOT := false;
|
|
|
|
r := ini.ReadString('Main', 'ShowEvent_PE_AUTHDENIED_GOT', '1');
|
|
if r = '1' then
|
|
ShowEvent_PE_AUTHDENIED_GOT := true
|
|
else
|
|
ShowEvent_PE_AUTHDENIED_GOT := false;
|
|
|
|
r := ini.ReadString('Main', 'ShowEvent_PE_CONTACTS_GOT', '1');
|
|
if r = '1' then
|
|
ShowEvent_PE_CONTACTS_GOT := true
|
|
else
|
|
ShowEvent_PE_CONTACTS_GOT := false;
|
|
|
|
r := ini.ReadString('Main', 'ShowEvent_PE_GCARD_GOT', '1');
|
|
if r = '1' then
|
|
ShowEvent_PE_GCARD_GOT := true
|
|
else
|
|
ShowEvent_PE_GCARD_GOT := false;
|
|
|
|
r := ini.ReadString('Main', 'ShowEvent_PE_WEBPAGER_GOT', '1');
|
|
if r = '1' then
|
|
ShowEvent_PE_WEBPAGER_GOT := true
|
|
else
|
|
ShowEvent_PE_WEBPAGER_GOT := false;
|
|
|
|
r := ini.ReadString('Main', 'ShowEvent_CL_STATUS_CHANGED', '1');
|
|
if r = '1' then
|
|
ShowEvent_CL_STATUS_CHANGED := true
|
|
else
|
|
ShowEvent_CL_STATUS_CHANGED := false;
|
|
|
|
ExmplFrm.ListBox.Items.Clear;
|
|
evntsv := TStringList.Create;
|
|
ini.ReadSectionValues('Events', evntsv);
|
|
ExmplFrm.ListBox.Items.BeginUpdate;
|
|
with ExmplFrm do
|
|
for i := 0 to evntsv.Count - 1 do
|
|
if Length(evntsv[i]) >= 5 then
|
|
begin
|
|
s := ini.ReadString('Events', IntToStr(i), '');
|
|
FillPicIndexMass(StrToInt(ExtractWord(1, s, Delims)));
|
|
ListBox.Items.Add(ExtractWord(2, s, Delims));
|
|
end;
|
|
ExmplFrm.ListBox.Items.EndUpdate;
|
|
evntsv.free;
|
|
end
|
|
else
|
|
begin
|
|
ini := TIniFile.Create(path);
|
|
writelog := false;
|
|
EventsFromUnnamedOnly := false;
|
|
ini.WriteString('Main', 'WriteLog', '0');
|
|
ini.WriteString('Main', 'UnnamedOnly', '0');
|
|
ini.WriteString('Main', 'Ani', '0');
|
|
ini.WriteString('Main', 'LogOnOff', '0');
|
|
ini.WriteString('Main', 'WriteStatus', '0');
|
|
ini.WriteString('Main', 'CLviewWidth', '250');
|
|
ini.WriteString('Main', 'CLviewColumnWidth', '150');
|
|
ini.WriteString('Main', 'Sort', '1');
|
|
ini.WriteString('Main', 'TipPosition', '150');
|
|
ini.WriteString('Main', 'TipPos', '0');
|
|
ini.WriteString('Main', 'ClearOnStart', '0');
|
|
ini.WriteString('Main', 'ShowEvent_PE_AUTOMSG_REQ_GOT', '1');
|
|
ini.WriteString('Main', 'ShowEvent_PE_XSTATUS_REQ_GOT', '1');
|
|
ini.WriteString('Main', 'ShowEvent_PE_ADDEDYOU_GOT', '1');
|
|
ini.WriteString('Main', 'ShowEvent_PE_AUTH_GOT', '1');
|
|
ini.WriteString('Main', 'ShowEvent_PE_AUTHDENIED_GOT', '1');
|
|
ini.WriteString('Main', 'ShowEvent_PE_CONTACTS_GOT', '1');
|
|
ini.WriteString('Main', 'ShowEvent_PE_GCARD_GOT', '1');
|
|
ini.WriteString('Main', 'ShowEvent_PE_WEBPAGER_GOT', '1');
|
|
ini.WriteString('Main', 'ShowEvent_CL_STATUS_CHANGED', '1');
|
|
ShowEvent_PE_AUTOMSG_REQ_GOT := true;
|
|
ShowEvent_PE_XSTATUS_REQ_GOT := true;
|
|
ShowEvent_PE_ADDEDYOU_GOT := true;
|
|
ShowEvent_PE_AUTHREQ_GOT := true;
|
|
ShowEvent_PE_AUTH_GOT := true;
|
|
ShowEvent_PE_AUTHDENIED_GOT := true;
|
|
ShowEvent_PE_CONTACTS_GOT := true;
|
|
ShowEvent_PE_GCARD_GOT := true;
|
|
ShowEvent_PE_WEBPAGER_GOT := true;
|
|
ShowEvent_CL_STATUS_CHANGED := true;
|
|
end;
|
|
ini.free;
|
|
end;
|
|
|
|
procedure SaveINI;
|
|
|
|
var
|
|
path: widestring;
|
|
i: Integer;
|
|
ini: TIniFile;
|
|
begin
|
|
path := RQ_GetUserPath + ininame;
|
|
ini := TIniFile.Create(path);
|
|
ini.WriteString('Main', 'WriteLog', BoolToIntStr(writelog));
|
|
ini.WriteString('Main', 'UnnamedOnly', BoolToIntStr(EventsFromUnnamedOnly));
|
|
ini.WriteString('Main', 'Ani', BoolToIntStr(AniEvents));
|
|
ini.WriteString('Main', 'LogOnOff', BoolToIntStr(LogOnOff));
|
|
ini.WriteString('Main', 'WriteStatus', BoolToIntStr(WriteStatus));
|
|
ini.WriteString('Main', 'CLviewWidth', IntToStr(ExmplFrm.CLview.width));
|
|
ini.WriteString('Main', 'CLviewColumnWidth', IntToStr(ExmplFrm.CLview.Column[0].width));
|
|
ini.WriteString('Main', 'Sort', IntToStr(TotalSort));
|
|
ini.WriteString('Main', 'TipPosition', IntToStr(ExmplFrm.UpDown1.Position));
|
|
ini.WriteString('Main', 'TipPos', BoolToIntStr(TipPos));
|
|
ini.WriteString('Main', 'TipDir', BoolToIntStr(TipDir));
|
|
ini.WriteString('Main', 'ClearOnStart', BoolToIntStr(ClearOnStart));
|
|
ini.WriteString('Main', 'ShowEvent_PE_AUTOMSG_REQ_GOT', BoolToIntStr(ShowEvent_PE_AUTOMSG_REQ_GOT));
|
|
ini.WriteString('Main', 'ShowEvent_PE_XSTATUS_REQ_GOT', BoolToIntStr(ShowEvent_PE_XSTATUS_REQ_GOT));
|
|
ini.WriteString('Main', 'ShowEvent_PE_ADDEDYOU_GOT', BoolToIntStr(ShowEvent_PE_ADDEDYOU_GOT));
|
|
ini.WriteString('Main', 'ShowEvent_PE_AUTH_GOT', BoolToIntStr(ShowEvent_PE_AUTH_GOT));
|
|
ini.WriteString('Main', 'ShowEvent_PE_AUTHDENIED_GOT', BoolToIntStr(ShowEvent_PE_AUTHDENIED_GOT));
|
|
ini.WriteString('Main', 'ShowEvent_PE_CONTACTS_GOT', BoolToIntStr(ShowEvent_PE_CONTACTS_GOT));
|
|
ini.WriteString('Main', 'ShowEvent_PE_GCARD_GOT', BoolToIntStr(ShowEvent_PE_GCARD_GOT));
|
|
ini.WriteString('Main', 'ShowEvent_PE_WEBPAGER_GOT', BoolToIntStr(ShowEvent_PE_WEBPAGER_GOT));
|
|
ini.WriteString('Main', 'ShowEvent_CL_STATUS_CHANGED', BoolToIntStr(ShowEvent_CL_STATUS_CHANGED));
|
|
|
|
ini.EraseSection('Events');
|
|
if ExmplFrm <> nil then
|
|
with ExmplFrm do
|
|
for i := 0 to ListBox.Count - 1 do
|
|
ini.WriteString('Events', IntToStr(i), IntToStr(PicIndexMass[i]) + '|' + ListBox.Items[i]);
|
|
|
|
ini.free;
|
|
end;
|
|
|
|
procedure FillBuffers(data: pointer);
|
|
begin
|
|
bufferi := _int_at(data, 6); // UIN number
|
|
|
|
isOff := false;
|
|
if isCL(IntToStr(bufferi)) then
|
|
begin
|
|
info := RQ_GetContactInfo(bufferi);
|
|
if (info.Status = PS_OFFLINE) then // åñëè îôôëàéí
|
|
isOff := true;
|
|
end;
|
|
|
|
buffers := '';
|
|
buffers := RQ_GetDisplayedName(bufferi);
|
|
if not TryStrToInt(buffers, temp) then
|
|
begin
|
|
unnamed := false;
|
|
bufferslog := buffers + ' (' + IntToStr(bufferi) + ')';
|
|
buffers := buffers + ' (uin ' + IntToStr(bufferi) + ')';
|
|
end
|
|
else
|
|
begin
|
|
bufferslog := ' (' + IntToStr(bufferi) + ')';
|
|
buffers := ' (uin ' + IntToStr(bufferi) + ')';
|
|
unnamed := true;
|
|
end;
|
|
uin_ := bufferi;
|
|
CurTime := FormatDateTime('dd.mm.yy hh:mm:ss', RQ_GetTime);
|
|
end;
|
|
|
|
procedure AddEventInListBox(str: string);
|
|
begin
|
|
with ExmplFrm do
|
|
begin
|
|
ListBox.Items.Add(str);
|
|
SendMessage(ListBox.Handle, WM_VSCROLL, SB_LINEDOWN, 0);
|
|
ListBox.Selected[ListBox.ItemIndex + 1] := true;
|
|
if AniEvents then
|
|
if not Selectedtb then
|
|
if not MyTimerEnabled then
|
|
StartMyTimer;
|
|
end;
|
|
end;
|
|
|
|
procedure AddEvent(data: pointer; EIndex: byte; StringFormat: string);
|
|
begin
|
|
FillBuffers(data);
|
|
|
|
if isCL(IntToStr(uin_)) then
|
|
if EventsFromUnnamedOnly then
|
|
begin;
|
|
end
|
|
else
|
|
begin
|
|
if isOff then
|
|
begin
|
|
FillPicIndexMass(9);
|
|
AddEventInListBox(Format(STR_IS_INVISIBLE, [CurTime, buffers]));
|
|
if writelog then
|
|
WriteInLog(Format(STR_IS_INVISIBLE, [CurTime, bufferslog]));
|
|
end;
|
|
FillPicIndexMass(EIndex);
|
|
AddEventInListBox(Format(StringFormat, [CurTime, buffers]));
|
|
if writelog then
|
|
WriteInLog(Format(StringFormat, [CurTime, bufferslog]));
|
|
end
|
|
else
|
|
begin
|
|
if isOff then
|
|
begin
|
|
FillPicIndexMass(9);
|
|
AddEventInListBox(Format(STR_IS_INVISIBLE, [CurTime, buffers]));
|
|
if writelog then
|
|
WriteInLog(Format(STR_IS_INVISIBLE, [CurTime, bufferslog]));
|
|
end;
|
|
FillPicIndexMass(EIndex);
|
|
AddEventInListBox(Format(StringFormat, [CurTime, buffers]));
|
|
if writelog then
|
|
WriteInLog(Format('*' + StringFormat, [CurTime, bufferslog]));
|
|
end;
|
|
end;
|
|
|
|
function RQ_ADD_TAB_SHEET(tabCaption: string): Integer;
|
|
var
|
|
data: pointer;
|
|
res: Integer;
|
|
begin
|
|
data := callStr(ansichar(PM_CMD) + ansichar(PC_TAB_ADD) + _int(Integer(ExmplFrm.Handle)) + _int(Integer(ExmplFrm.Icon.Handle)) +
|
|
_istring(tabCaption));
|
|
res := _int_at(data, 4);
|
|
result := res;
|
|
end;
|
|
|
|
procedure OnButtonClick(Button: Integer);
|
|
var
|
|
id: Integer;
|
|
begin
|
|
id := RQ_ADD_TAB_SHEET(namepl);
|
|
if id <> -1 then
|
|
panelID := id;
|
|
// if MyTimerEnabled then
|
|
// begin
|
|
// StopMyTimer;
|
|
// ExmplFrm.LoadICONDefault
|
|
// end;
|
|
end;
|
|
|
|
function RQ_GET_CHAT_RECT: TRect;
|
|
var
|
|
data: pointer;
|
|
res: TIntegerDynArray;
|
|
begin
|
|
data := callStr(ansichar(PM_GET) + ansichar(PG_CHAT_XYZ));
|
|
res := _intlist_at(data, 5);
|
|
result.Top := res[0];
|
|
result.Left := res[1];
|
|
result.Right := res[2];
|
|
result.Bottom := res[3];
|
|
end;
|
|
|
|
function pluginFun(data: pointer): pointer; stdcall;
|
|
var
|
|
Handle: Integer;
|
|
r: TRect;
|
|
begin
|
|
result := NIL;
|
|
if (data = NIL) or (_int_at(data) = 0) then
|
|
Exit;
|
|
case _byte_at(data, 4) of
|
|
PM_EVENT:
|
|
case _byte_at(data, 5) of
|
|
PE_INITIALIZE:
|
|
begin
|
|
RQ__ParseInitString(data, callback, vApiVersion, andrqPath, userPath, currentUIN);
|
|
|
|
if RQ_GetRnQVersion < 1074 then
|
|
begin
|
|
MessageBox(0, PChar('Èçâèíèòå, íî R&Q Eye Plugin íå ìîæåò ðàáîòàòü ñ äàííîé âåðñèåé R&Q.' +
|
|
#13'Ïîæàëóéñòà, îáíîâèòå ïðîãðàììó è ñíèìèòå ãàëêó ñ ïëàãèíà RnQEye.dll '), PChar(PluginName), MB_ICONHAND);
|
|
Exit;
|
|
end;
|
|
|
|
ListOfForms := TStringList.Create;
|
|
|
|
if not assigned(ExmplFrm) then
|
|
ExmplFrm := TExmplFrm.Create(NIL);
|
|
if not assigned(SForm) then
|
|
SForm := TSForm.Create(application);
|
|
ShowWindow(application.Handle, SW_HIDE);
|
|
SetLength(PicIndexMass, 0);
|
|
SetLength(PicIndexMass, Length(PicIndexMass) + 1);
|
|
LoadINI;
|
|
LoadUINs;
|
|
wait := TStringList.Create;
|
|
|
|
if FileExists(RQ_GetUserPath + waitname) then
|
|
wait.LoadFromFile(RQ_GetUserPath + waitname);
|
|
|
|
data := callStr(ansichar(PM_GET) + ansichar(PG_WINDOW) + ansichar(PW_CHAT));
|
|
chat_hwnd := _int_at(data, 5);
|
|
if chat_hwnd <> 0 then // ïîëó÷èëè õýíäë îêíà ÷àòà
|
|
ExmplFrm.ParentWindow := chat_hwnd;
|
|
|
|
panelID := 0;
|
|
ba := RQ_CreateChatButton(@OnButtonClick, ExmplFrm.Icon.Handle, PluginName);
|
|
result := str2comm(ansichar(PM_DATA) + _istring(namepl) + _int(APIversion));
|
|
end;
|
|
|
|
PE_PREFERENCES:
|
|
begin
|
|
MessageBox(0, AboutText, namepl, 0);
|
|
end;
|
|
|
|
PE_FINALIZE:
|
|
begin
|
|
SaveINI;
|
|
if MyTimerEnabled then
|
|
StopMyTimer;
|
|
if ba <> 0 then
|
|
RQ_DeleteChatButton(ba);
|
|
if panelID <> 0 then
|
|
callStr(ansichar(PM_CMD) + ansichar(PC_TAB_DELETE) + _int(Integer(ExmplFrm.Handle)));
|
|
if ExmplFrm <> nil then
|
|
ExmplFrm.free;
|
|
if XSForm <> nil then
|
|
XSForm.free;
|
|
if SForm <> nil then
|
|
SForm.free;
|
|
if lst <> nil then
|
|
lst.free;
|
|
if wait <> nil then
|
|
wait.free;
|
|
if ListOfForms <> nil then
|
|
ListOfForms.free;
|
|
end;
|
|
|
|
PE_SELECTTAB:
|
|
begin
|
|
Handle := _int_at(data, 6);
|
|
r := RQ_GET_CHAT_RECT;
|
|
if ExmplFrm.Handle = Handle then
|
|
begin
|
|
ExmplFrm.BoundsRect := r;
|
|
ExmplFrm.Show;
|
|
SetWindowPos(ExmplFrm.Handle, hwnd_TopMost, ExmplFrm.Top, ExmplFrm.Left, ExmplFrm.width, ExmplFrm.Height,
|
|
swp_NoMove or swp_NoSize or swp_NoRedraw);
|
|
end;
|
|
|
|
Selectedtb := true;
|
|
opentb := true;
|
|
ExmplFrm.CLview.CustomSort(nil, 0);
|
|
|
|
if MyTimerEnabled then
|
|
begin
|
|
StopMyTimer;
|
|
ExmplFrm.LoadICONDefault
|
|
end;
|
|
end;
|
|
|
|
PE_DESELECTTAB:
|
|
begin
|
|
Handle := _int_at(data, 6);
|
|
if ExmplFrm.Handle = Handle then
|
|
begin
|
|
ExmplFrm.Hide;
|
|
end;
|
|
Selectedtb := false;
|
|
end;
|
|
|
|
PE_CLOSETAB:
|
|
begin
|
|
Handle := _int_at(data, 6);
|
|
if ExmplFrm.Handle = Handle then
|
|
begin
|
|
SaveBoolToINI;
|
|
ExmplFrm.Close;
|
|
panelID := 0;
|
|
end;
|
|
Selectedtb := false;
|
|
opentb := false;
|
|
end;
|
|
|
|
{ MIKAEL }
|
|
PE_AUTOMSG_REQ_GOT:
|
|
begin
|
|
if ShowEvent_PE_AUTOMSG_REQ_GOT then
|
|
begin
|
|
AddEvent(data, 0, STR_PE_AUTOMSG_REQ_GOT);
|
|
ExmplFrm.ListBox.Refresh;
|
|
SaveINI;
|
|
end;
|
|
end;
|
|
|
|
PE_XSTATUS_REQ_GOT:
|
|
begin
|
|
if ShowEvent_PE_XSTATUS_REQ_GOT then
|
|
begin
|
|
AddEvent(data, 1, STR_PE_XSTATUS_REQ_GOT);
|
|
ExmplFrm.ListBox.Refresh;
|
|
SaveINI;
|
|
end;
|
|
end;
|
|
|
|
PE_ADDEDYOU_GOT:
|
|
begin
|
|
if ShowEvent_PE_ADDEDYOU_GOT then
|
|
begin
|
|
AddEvent(data, 2, STR_PE_ADDEDYOU_GOT);
|
|
ExmplFrm.ListBox.Refresh;
|
|
SaveINI;
|
|
end;
|
|
end;
|
|
|
|
PE_AUTHREQ_GOT:
|
|
begin
|
|
if ShowEvent_PE_AUTHREQ_GOT then
|
|
begin
|
|
AddEvent(data, 3, STR_PE_AUTHREQ_GOT);
|
|
ExmplFrm.ListBox.Refresh;
|
|
SaveINI;
|
|
end;
|
|
end;
|
|
|
|
PE_AUTH_GOT:
|
|
begin
|
|
if ShowEvent_PE_AUTH_GOT then
|
|
begin
|
|
AddEvent(data, 4, STR_PE_AUTH_GOT);
|
|
ExmplFrm.ListBox.Refresh;
|
|
SaveINI;
|
|
end;
|
|
end;
|
|
|
|
PE_AUTHDENIED_GOT:
|
|
begin
|
|
if ShowEvent_PE_AUTHDENIED_GOT then
|
|
begin
|
|
AddEvent(data, 5, STR_PE_AUTHDENIED_GOT);
|
|
ExmplFrm.ListBox.Refresh;
|
|
SaveINI;
|
|
end;
|
|
end;
|
|
|
|
PE_CONTACTS_GOT:
|
|
begin
|
|
if ShowEvent_PE_CONTACTS_GOT then
|
|
begin
|
|
AddEvent(data, 6, STR_PE_CONTACTS_GOT);
|
|
ExmplFrm.ListBox.Refresh;
|
|
SaveINI;
|
|
end;
|
|
end;
|
|
|
|
PE_GCARD_GOT:
|
|
begin
|
|
if ShowEvent_PE_GCARD_GOT then
|
|
begin
|
|
AddEvent(data, 7, STR_PE_GCARD_GOT);
|
|
ExmplFrm.ListBox.Refresh;
|
|
SaveINI;
|
|
end;
|
|
end;
|
|
|
|
PE_WEBPAGER_GOT:
|
|
begin
|
|
if ShowEvent_PE_WEBPAGER_GOT then
|
|
begin
|
|
AddEvent(data, 8, STR_PE_WEBPAGER_GOT);
|
|
ExmplFrm.ListBox.Refresh;
|
|
SaveINI;
|
|
end;
|
|
end;
|
|
|
|
{ Mikanoshi }
|
|
PE_STATUS_CHANGED:
|
|
begin
|
|
if ShowEvent_CL_STATUS_CHANGED then
|
|
begin
|
|
FillBuffers(data);
|
|
if LogOnOff = true then
|
|
begin
|
|
if (lst.IndexOf(IntToStr(uin_)) >= 0) and (_byte_at(data, 11) <> _byte_at(data, 10)) then
|
|
begin
|
|
FillPicIndexMass(10);
|
|
AddEventInListBox(Format(STR_CL_STATUS_CHANGED, [CurTime, buffers, ByteToStatus(_byte_at(data, 11)),
|
|
ByteToStatus(_byte_at(data, 10))]));
|
|
|
|
if WriteStatus = true then
|
|
WriteInStatusLog(Format(STR_CL_STATUS_CHANGED, [CurTime, bufferslog, ByteToStatus(_byte_at(data, 11)),
|
|
ByteToStatus(_byte_at(data, 10))]));
|
|
|
|
ExmplFrm.ListBox.Refresh;
|
|
SaveINI;
|
|
end;
|
|
end;
|
|
|
|
if wait.IndexOf(IntToStr(uin_)) >= 0 then
|
|
if _byte_at(data, 11) = PS_OFFLINE then
|
|
begin
|
|
ExmplFrm.ShowWait(uin_);
|
|
// wait.Delete(wait.IndexOf(IntToStr(uin_)));
|
|
// wait.SaveToFile(RQ_GetUserPath + waitname);
|
|
// ExmplFrm.CLview.Repaint;
|
|
end;
|
|
end;
|
|
end;
|
|
end; // case
|
|
end; // case
|
|
end; // pluginFun
|
|
|
|
exports
|
|
pluginFun;
|
|
|
|
end.
|