Das Runterladen der Kontaktliste funktioniert über
ICQClient1.RequestContactList;
. Das Ergebnis sollte dann über das Ereignis
ICQClient1ServerListRecv eintrudeln. Hier der Demo-Code:
Delphi-Quellcode:
procedure TMainForm.ICQClient1ServerListRecv(Sender: TObject;
SrvContactList: TList);
var
i: Word;
UserInfo: TUINEntry;
ListItem: TListItem;
begin
if SrvContactList.Count > 0 then
for i := 0 to SrvContactList.Count - 1 do
begin
UserInfo := PUINEntry(SrvContactList.Items[i])^;
if UserInfo.CType = U_VISIBLE_LIST then
ICQClient1.VisibleList.Add(IntToStr(UserInfo.UIN))
else if UserInfo.CType = U_INVISIBLE_LIST then
ICQClient1.InvisibleList.Add(IntToStr(UserInfo.UIN))
else if UserInfo.CType = U_NORMAL then
begin
if ICQClient1.AddContact(UserInfo.UIN) then
begin
ListItem := ListView1.Items.Add;
ListItem.ImageIndex := ICON_OFFLINE;
ListItem.Caption := IntToStr(UserInfo.UIN);
end;
end;
end;
ICQClient1.DestroyUINList(SrvContactList);
end;
...
...