/// <summary> /// return the item data for the first item that exists in the thread. /// typically this is used to find who is the creator of the email or forum thread /// </summary> /// <param name="thread">string data representing the thread</param> /// <param name="itemType">what is the itemType of the item</param> /// <returns></returns> private HtmlNode GetItemDataForFirstPost(string thread, int itemType = -1) { QArgs args = new QArgs(new QThreadStrCond(thread)); if (itemType != -1) args.AddCondition(new QItemTypeCond(itemType)); GeneralQuery query = new GeneralQuery(new QGeneralParams() { ResultData = QResultData.itemData, MaxCount = 1, IncludeAttachments = false, SortBy = QResultSorting.dateAsc }, args); string ret = MailData.MinerQuery(query); XmlDocument doc = new XmlDocument(); doc.LoadXml(ret); HtmlNode node = doc.DocumentNode.SelectSingleNode("//item"); if (node == null) return null; return node; }
private HtmlNode GetItemDataForBugDescription(string issueTrackerUrl, string bugId) { int bugTagId = GetTagIdForBugId(issueTrackerUrl, bugId); if (bugTagId == TagInfoBase.InvalidTagId) return null; QArgs args = new QArgs(new QTagIdCond(bugTagId)); args.AddCondition(new QItemTypeCond((int)ItemType.BugDescription)); // sort by itemIdAsc. in this way we will get the first item in the thread GeneralQuery query = new GeneralQuery(new QGeneralParams() { MaxCount = 1, SortBy = QResultSorting.itemIdAsc, IncludeAttachments = false }, args); string ret = MailData.MinerQuery(query); XmlDocument doc = new XmlDocument(); doc.LoadXml(ret); HtmlNode node = doc.DocumentNode.SelectSingleNode("//item"); if (node == null) return null; return node; }