Newsgroups : Borland : borland.public.delphi.internet.winsock : 2006 Jun : indy10.1.5 - idnntp problems

www.cryer.info
Managed Newsgroup Archive

indy10.1.5 - idnntp problems

Subject:indy10.1.5 - idnntp problems
Posted by:"Jacques" (jacques.no..@btinternet.com)
Date:Thu, 15 Jun 2006 10:48:07

I have the following questions:

1. Is there a way i can speed up the downloading of messages
programmatically? If not, is it possible to only download new messages?
Because having to download all the msgs takes along time. The news reader in
outlook downloads the same amount of articles in less time.

2. When i downloading messages only the first 2 or three replies are
retrieved even when there are like 6 replies, is there something wrong in
the way my code does the retrieving?:

IdNNTP1.Host := hostname;
        IdNNTP1.Connect;
        IdNNTP1.SelectGroup(groupname);
         msgcnt:=idnntp1.MsgCount;

       for MsgNum := IdNNTP1.MsgLow to IdNNTP1.MsgHigh  do

        begin

           if IdNNTP1.GetHeader(MsgNum, IdMessage1) then
           begin
           p:=p+1;
             StatusBar1.Panels[0].Text := Format('Downloading messages...%d
from total messages of %d', [p, msgcnt]);
            application.ProcessMessages;
             //A message without a references header is a parent, so add it
to the treeview as such...
            if idmessage1.References = '' then  begin
             midx:=idmessage1.MsgId;
             with list.Items.AddFirst(nil,
idmessage1.Subject+'-'+idmessage1.from.Name+ ' MsgNum: '+inttostr(Msgnum) )
do
      begin
           Selected:=true;
        end;
     end;

//Now, check if the parent has replies by comparing the msgid with the
'midx' variable, if matched add as child...

     if (idmessage1.References <> '') AND (idmessage1.References = midx)
then  begin
     list.Items.AddChildFirst(  list.Selected,
idmessage1.Subject+'-'+idmessage1.from.Name+ ' MsgNum:
'+inttostr(Msgnum) ).MakeVisible;
     end;
end; //header check
end; //for loop

3. How do i retrieve the body of a article? Because i've used getarticle()
to retrieve the entire article, but when i try to get the msg body using the
idMessage component, the text comes up empty. all other headers comes up ok:

procedure TForm1.listClick(Sender: TObject);
begin
//retrieve article details
idnntp1.GetArticle(1,idmessage1);
label1.Caption:=idmessage1.From.Name;
label2.Caption:=idmessage1.Subject;
label3.caption:=idmessage1.Recipients.EMailAddresses;
body.Lines.add(idmessage1.body.Text);
end;

Thanks

Replies:

www.cryer.info
Managed Newsgroup Archive