code: func (c *Client) Recv() (chat Chat, err error) {
  	for {
  		_, val, err := next(c.p)
  		if err != nil {
  			return Chat{}, err
  		}
  		switch val := val.(type) {
  		case *clientMessage:
  			return Chat{Remote: val.From, Type: val.Type, Text: val.Body}, nil
  		case *clientQuery:
  			var r Roster
  			for _, item := range val.Item {
  				r = append(r, Contact{item.Jid, item.Name, item.Group})
  			}
  			return Chat{Type: "roster", Roster: r}, nil
  		case *clientPresence:
  			pr := &Presence{Remote: val.From, Status: statusCode(val.Show), StatusMsg: val.Status, Priority: atoi(val.Priority)}
  			if val.Type == "unavailable" {
  				pr.Status = Unavailable
  			}
  			return Chat{Remote: val.From, Type: "presence", Presence: pr}, nil
  		default:
  			//log.Printf("ignoring %T", val)
  		}
  	}
  	panic("unreachable")
  }
docs: // Recv wait next token of chat.