Reset message refersal

This commit is contained in:
erroneousboat 2016-10-11 09:33:56 +02:00
parent 33b36241a1
commit c6575ff5ad

View File

@ -154,7 +154,14 @@ func (s *SlackService) GetMessages(channel interface{}, count int) []string {
messages = append(messages, msg...) messages = append(messages, msg...)
} }
return messages // Reverse the order of the messages, we want the newest in
// the last place
var messagesReversed []string
for i := len(messages) - 1; i >= 0; i-- {
messagesReversed = append(messagesReversed, messages[i])
}
return messagesReversed
} }
// CreateMessage will create a string formatted message that can be rendered // CreateMessage will create a string formatted message that can be rendered
@ -220,14 +227,7 @@ func (s *SlackService) CreateMessage(message slack.Message) []string {
msgs = append(msgs, msg) msgs = append(msgs, msg)
// Reverse the order of the messages, we want the newest in return msgs
// the last place
var messagesReversed []string
for i := len(msgs) - 1; i >= 0; i-- {
messagesReversed = append(messagesReversed, msgs[i])
}
return messagesReversed
} }
func (s *SlackService) CreateMessageFromMessageEvent(message *slack.MessageEvent) []string { func (s *SlackService) CreateMessageFromMessageEvent(message *slack.MessageEvent) []string {
@ -287,14 +287,7 @@ func (s *SlackService) CreateMessageFromMessageEvent(message *slack.MessageEvent
msgs = append(msgs, msg) msgs = append(msgs, msg)
// Reverse the order of the messages, we want the newest in return msgs
// the last place
var messagesReversed []string
for i := len(msgs) - 1; i >= 0; i-- {
messagesReversed = append(messagesReversed, msgs[i])
}
return messagesReversed
} }
// createMessageFromAttachments will construct a array of string of the Field // createMessageFromAttachments will construct a array of string of the Field