PR_ASSERT(PR_FALSE);
NS_ASSERTION(0, "todo - need new way of doing");
nsNNTPNewsgroupList::GetRangeOfArtsToDownload(                                              /*nsINNTPHost* host,                                                const char* group_name,*/                                              PRInt32 first_possible,                                              PRInt32 last_possible,                                              PRInt32 maxextra,                                              PRInt32* first,                                              PRInt32* last,                                              PRInt32 *status){	PRBool emptyGroup_p = PR_FALSE;	PR_ASSERT(first && last);	if (!first || !last) return NS_MSG_FAILURE;	*first = 0;	*last = 0;#ifdef HAVE_PANES	if (m_pane != NULL && !m_finishingXover && !m_startedUpdate)	{		m_startedUpdate = TRUE;		m_pane->StartingUpdate(MSG_NotifyNone, 0, 0);	}#endif	if (!m_newsDB)	{		nsresult err;		if ((err = GetDatabase(GetURL(), &m_newsDB)) != NS_OK) {            return err;        }		else {			nsresult rv = NS_OK;			rv = m_newsDB->GetMsgKeySet(&m_set);            if (NS_FAILED(rv) || !m_set) {                return rv;            }            			m_set->SetLastMember(last_possible);	// make sure highwater mark is valid.			nsIDBFolderInfo *newsGroupInfo = nsnull;			rv = m_newsDB->GetDBFolderInfo(&newsGroupInfo);			if (NS_SUCCEEDED(rv) && newsGroupInfo)			{				nsString knownArtsString;                nsMsgKey mark;				newsGroupInfo->GetKnownArtsSet(knownArtsString);                                rv = newsGroupInfo->GetHighWater(&mark);                if (NS_FAILED(rv)) {                    return rv;                }				if (last_possible < mark)					newsGroupInfo->SetHighWater(last_possible, TRUE);				if (m_knownArts.set) {					delete m_knownArts.set;				}				m_knownArts.set = nsMsgKeySet::Create(nsAutoCString(knownArtsString));			}			else			{					if (m_knownArts.set) {					delete m_knownArts.set;				}				m_knownArts.set = nsMsgKeySet::Create();                nsMsgKey low, high;                rv = m_newsDB->GetLowWaterArticleNum(&low);                if (NS_FAILED(rv)) return rv;                rv = m_newsDB->GetHighWaterArticleNum(&high);                if (NS_FAILED(rv)) return rv;                				m_knownArts.set->AddRange(low,high);            }#ifdef HAVE_PANES			m_pane->StartingUpdate(MSG_NotifyNone, 0, 0);			m_newsDB->ExpireUpTo(first_possible, m_pane->GetContext());			m_pane->EndingUpdate(MSG_NotifyNone, 0, 0);#endif /* HAVE_PANES */			if (m_knownArts.set->IsMember(last_possible))	// will this be progress pane?			{#ifdef HAVE_PANES				char *noNewMsgs = XP_GetString(MK_NO_NEW_DISC_MSGS);				MWContext *context = m_pane->GetContext();				MSG_Pane* parentpane = m_pane->GetParentPane();				// send progress to parent pane, if any, because progress pane is going down.				if (parentpane)					context = parentpane->GetContext();				FE_Progress (context, noNewMsgs);#endif /* HAVE_PANES */			}		}	}    	if (maxextra <= 0 || last_possible < first_possible || last_possible < 1) 	{		emptyGroup_p = TRUE;	}    // this is just a temporary hack. these used to be parameters    // to this function, but then we were mutually dependant between this    // class and nsNNTPHost    nsINNTPHost *host=m_knownArts.host;    const char* group_name = m_knownArts.group_name;    if (m_knownArts.host != host ||	  m_knownArts.group_name == NULL ||	  PL_strcmp(m_knownArts.group_name, group_name) != 0 ||	  !m_knownArts.set) 	{	/* We're displaying some other group.  Clear out that display, and set up	   everything to return the proper first chunk. */    		PR_ASSERT(PR_FALSE);	// ### dmb todo - need nwo way of doing this            if (emptyGroup_p) {                if (status) *status=0;                return NS_OK;            }	}	else	{        if (emptyGroup_p) {            if (status) *status=0;            return NS_OK;        }	}	m_knownArts.first_possible = first_possible;	m_knownArts.last_possible = last_possible;	/* Determine if we only want to get just new articles or more messages.	If there are new articles at the end we haven't seen, we always want to get those first.  	Otherwise, we get the newest articles we haven't gotten, if we're getting more. 	My thought for now is that opening a newsgroup should only try to get new articles.	Selecting "More Messages" will first try to get unseen messages, then old messages. */	if (m_getOldMessages || !m_knownArts.set->IsMember(last_possible)) 	{#ifdef HAVE_PANES		PRBool notifyMaxExceededOn = (m_pane && !m_finishingXover && m_pane->GetPrefs() && m_pane->GetPrefs()->GetNewsNotifyOn());#else        PRBool notifyMaxExceededOn = PR_FALSE;#endif		// if the preference to notify when downloading more than x headers is not on,		// and we're downloading new headers, set maxextra to a very large number.		if (!m_getOldMessages && !notifyMaxExceededOn)			maxextra = 0x7FFFFFFFL;        int result =            m_knownArts.set->LastMissingRange(first_possible, last_possible,                                              first, last);		if (result < 0) {            if (status) *status=result;			return NS_ERROR_NOT_INITIALIZED;        }		if (*first > 0 && *last - *first >= maxextra) 		{			if (!m_getOldMessages && !m_promptedAlready && notifyMaxExceededOn)			{                PRBool download = PR_FALSE;#ifdef HAVE_PANES				nsINNTPNewsgroup *newsFolder = m_pane->GetMaster()->FindNewsFolder(m_host, m_groupName, PR_FALSE);				download = FE_NewsDownloadPrompt(m_pane->GetContext(),													*last - *first + 1,													&m_downloadAll, newsFolder);#endif				if (download)				{					m_maxArticles = 0;#ifdef HAVE_PREFS					PREF_GetIntPref("news.max_articles", &m_maxArticles);#endif                    net_NewsChunkSize = m_maxArticles;					maxextra = m_maxArticles;					if (!m_downloadAll)					{						PRBool markOldRead = PR_FALSE;#ifdef HAVE_PREFS						PREF_GetBoolPref("news.mark_old_read", &markOldRead);#endif						if (markOldRead && m_set)							m_set->AddRange(*first, *last - maxextra); 						*first = *last - maxextra + 1;					}				}				else					*first = *last = 0;				m_promptedAlready = TRUE;			}			else if (m_promptedAlready && !m_downloadAll)				*first = *last - m_maxArticles + 1;			else if (!m_downloadAll)				*first = *last - maxextra + 1;		}	}#if defined(DEBUG_bienvenu) || defined(DEBUG_sspitzer)	printf("GetRangeOfArtsToDownload(first possible = %ld, last possible = %ld, first = %ld, last = %ld maxextra = %ld\n",first_possible, last_possible, *first, *last, maxextra);#endif	m_firstMsgToDownload = *first;	m_lastMsgToDownload = *last;    if (status) *status=0;	return NS_OK;}