Exemplo n.º 1
0
func AddMessages(sessionId string, messages element.Messages) {
	activeMessages := getMessageFromSession(sessionId)
	activeMessages = append(activeMessages, messages...)

	//set back session messages
	session.SetSessionMessages(sessionId, activeMessages)
}
Exemplo n.º 2
0
//Creates message views from valid messages
func ProcessMessages(sessionId string, dom *element.DOM) *element.DOM {
	messages := getMessageFromSession(sessionId)
	messages = cleanupMessages(messages)

	for _, m := range messages {
		view := newMessageView(m)
		dom = element.Add(dom, view)
	}
	reduceExpire(messages)
	session.SetSessionMessages(sessionId, messages)

	return dom
}