// Messages fetches a list of saved messages. Use this to get a nice message to print to
// the user on a login page or registration page in case something happened
// (username taken, invalid credentials, successful logout, etc).
320491
func (a Authorizer) Messages(rw http.ResponseWriter, req *http.Request) []string {
	session, _ := a.cookiejar.Get(req, "messages")
	flashes := session.Flashes()
	session.Save(req, rw)
	var messages []string
	for _, val := range flashes {
		messages = append(messages, val.(string))
	}
	return messages
}
671213
func (m *Table) FieldsAsMessages() []Message {
	msgs := make([]Message, len(m.Fields))
	for i, f := range m.Fields {
		msgs[i] = f
	}
	return msgs
}
900780
func Message(level string, msg string) {
	body := buildBody(level, msg)
	data := body["data"].(map[string]interface{})
	data["body"] = messageBody(msg)

	push(body)
}
1055602
func (msg Message) Bytes() []byte {
	b := [][]byte{
		ToBytes(msg.Address),
		msg.Typetags(),
	}
	for _, a := range msg.Arguments {
		b = append(b, a.Bytes())
	}
	return bytes.Join(b, []byte{})
}
455621
func readMessages(r io.Reader, p []byte) error {
	for len(p) > 0 {
		n, err := r.Read(p)
		p = p[n:]
		if err != nil {
			return err
		}
	}
	return nil
}
494444
func (r Dns_Secondary) GetErrorMessages() (resp []datatypes.Dns_Message, err error) {
	err = r.Session.DoRequest("SoftLayer_Dns_Secondary", "getErrorMessages", nil, &r.Options, &resp)
	return
}
277077
func (ds *DummyStatus) PrintMsg(msg message) {
	if !globalJSON {
		console.Println(msg.String())
	} else {
		console.Println(msg.JSON())
	}
}
604122
func Msg(logger log.Logger, message string, keyvals ...interface{}) error {
	prepended := structure.CopyPrepend(keyvals, structure.MessageKey, message)
	return logger.Log(prepended...)
}
424311
func printMsg(msg message) {
	if !globalJSON {
		console.Println(msg.String())
	} else {
		console.Println(msg.JSON())
	}
}
471325
func (u uiErr) Msg(m string, args ...interface{}) uiErr {
	return uiErr{
		msg:    fmt.Sprintf(m, args...),
		detail: u.detail,
		action: u.action,
		help:   u.help,
	}
}
1324169
func (e Errors) Error() string {
	messages := []string{}
	for _, err := range e {
		messages = append(messages, err.Message())
	}
	return strings.Join(messages, "\n")
}
1300402
func Message(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "message", Listener: listener}
}
502986
func GetRoomMessages(room int) ([]*ChatMessage, error) {
	var messages []*ChatMessage

	err := db.DB.Model(&ChatMessage{}).Where("room = ?", room).Order("created_at").Find(&messages).Error

	return messages, err
}
1353238
func (r *Renderer) WithMessages(bundle soymsg.Bundle) *Renderer {
	r.msgs = bundle
	return r
}
158482
func Messages(
	bot reddit.Bot,
	kill <-chan bool,
	errs chan<- error,
) (
	<-chan *reddit.Message,
	error,
) {
	onlyMessages := make(chan *reddit.Message)

	messages, err := inboxStream(bot, kill, errs, "inbox")
	go func() {
		for m := range messages {
			if !m.WasComment {
				onlyMessages <- m
			}
		}
	}()

	return onlyMessages, err
}
584149
func (client *Client) GetNumberReplyMessages(date string) *GetNumberMessagesCall {
	return &GetNumberMessagesCall{
		c:            client,
		date:         date,
		deliveryType: DeliveryTypeReply,
	}
}
574378
func (cli *Client) Messages(roomID, from, to string, dir rune, limit int) (resp *RespMessages, err error) {
	query := map[string]string{
		"from": from,
		"dir":  string(dir),
	}
	if to != "" {
		query["to"] = to
	}
	if limit != 0 {
		query["limit"] = strconv.Itoa(limit)
	}

	urlPath := cli.BuildURLWithQuery([]string{"rooms", roomID, "messages"}, query)
	_, err = cli.MakeRequest("GET", urlPath, nil, &resp)
	return
}