01-07-2020, 12:20 AM
The OnListGroups event is fired in response to a LIST command with no parameters. You need to write out the individual groups in the format used by the LIST ACTIVE command, eg:
Or:
Code:
procedure TForm1.IdNNTPServer1ListGroups(AContext: TIdContext);
begin
with AContext.Connection.IOHandler do
begin
WriteLnRFC('group1 <high> <low> <status>');
WriteLnRFC('group2 <high> <low> <status>');
WriteLnRFC('group3 <high> <low> <status>');
// and so on ...
end;
end;
Or:
Code:
procedure TForm1.IdNNTPServer1ListGroups(AContext: TIdContext);
var
List: TStringList;
begin
List := TStringList.Create;
try
List.Add('group1 <high> <low> <status>');
List.Add('group2 <high> <low> <status>');
List.Add('group3 <high> <low> <status>');
// and so on ...
// using AWriteTerminator=False because TIdNNTPServer sends a list
// terminator after the OnListGroups event handler exits...
AContext.Connection.IOHandler.WriteRFCStrings(List, False);
finally
List.Free;
end;
end;