/*
   Syntax
     STAT message-id
     STAT number
     STAT

   Responses

   First form (message-id specified)
     223 0|n message-id    Article exists
     430                   No article with that message-id

   Second form (article number specified)
     223 n message-id      Article exists
     412                   No newsgroup selected
     423                   No article with that number

   Third form (current article number used)
     223 n message-id      Article exists
     412                   No newsgroup selected
     420                   Current article number is invalid

   Parameters
     number        Requested article number
     n             Returned article number
     message-id    Article message-id

If a article number is passed, the server should set the "current article pointer" to it.
*/


Responses

First form (message-id specified)
223 0|n message-id    Article exists
430                   No article with that message-id

Second form (article number specified)
223 n message-id      Article exists
412                   No newsgroup selected
423                   No article with that number

Third form (current article number used)
223 n message-id      Article exists
412                   No newsgroup selected
420                   Current article number is invalid

Parameters
number        Requested article number
n             Returned article number
message-id    Article message-id

If a article number is passed, the server should set the "current article pointer" to it.
/ * Syntax STAT message - id STAT number STAT Responses First form ( message - id specified ) 223 0|n message - id Article exists 430 No article with that message - id Second form ( article number specified ) 223 n message - id Article exists 412 No newsgroup selected 423 No article with that number Third form ( current article number used ) 223 n message - id Article exists 412 No newsgroup selected 420 Current article number is invalid Parameters number Requested article number n Returned article number message - id Article message - id If a article number is passed the server should set the " current article pointer " to it . * /
func handleStat(args []string, s *session, c *textproto.Conn) error {
	article, err := s.getArticle(args)
	if err != nil {
		return err
	}
	if len(args)>0 {
		n,ok := articleIDOrNumber(args[0])
		if ok { s.number = n }
	}
	c.PrintfLine("223 1 %s", article.MessageID())
	return nil
}
func handleStat ( args [ ] string , s * session , c * textproto . Conn ) error { article , err := s . getArticle ( args ) if err != nil { return err } if len ( args ) > 0 { n , ok := articleIDOrNumber ( args [ 0 ] ) if ok { s . number = n } } c . PrintfLine ( " " , article . MessageID ( ) ) return nil }