protected static bool GetGroupByCurrentName(INntpConnection connection, NntpSession session, out INntpGroup group) { group = null; if (!session.Context.ContainsKey(typeof(INntpGroup))) { session.Connection.SendLine("412 No newsgroup selected"); return(false); } group = connection.GetGroup((string)session.Context[typeof(INntpGroup)]); if (group == null) { session.Connection.SendLine("412 No newsgroup selected"); return(false); } return(true); }
protected static bool GetGroupByName(INntpConnection connection, NntpSession session, string name, out INntpGroup group) { group = connection.GetGroup(name); if (group == null) { session.Connection.SendLine("411 No such newsgroup"); return(false); } session.Context[typeof(INntpGroup)] = name; session.Context[typeof(INntpArticle)] = group.Low; return(true); }