Re: Send List groups with IdNNTPServer

Giganews Newsgroups
Subject: Re: Send List groups with IdNNTPServer
Posted by:  Remy Lebeau (TeamB) (no.spam@no.spam.com)
Date: Thu, 14 Jul 2005

"ARP" <alexandrepires20…@yahoo.com.br> wrote in message
news:B7247DDE6ED2E240alexandrepires20…@yahoo.com.br...

> How can I send the list groups to the client, inside of
> OnListGroups event ? I am utilizing Delphi 7 with Indy 10

Simply call WriteLn() for each group.  As per RFC 977:

  Each newsgroup is sent as a line of text in the following format:

      group last first p

  where <group> is the name of the newsgroup, <last> is the number of
  the last known article currently in that newsgroup, <first> is the
  number of the first article currently in the newsgroup, and <p> is
  either 'y' or 'n' indicating whether posting to this newsgroup is
  allowed ('y') or prohibited ('n').

So, you would have something like the following:

    procedure TForm1.IdNNTPServer1ListGroups(AContext: TIdContext);
    begin
        with AContext.Connection.IOHandler do
        begin
            WriteLn('group1 50 1 y');
            WriteLn('group2 100 1 y');
            // etc...
        end;
    end;

Gambit

Replies

In response to

Send List groups with IdNNTPServer posted by ARP on Thu, 14 Jul 2005