Mix username and user since slack sucks

This commit is contained in:
cws 2017-01-05 10:04:44 -05:00
parent 1874f43e6c
commit 38a321f231
1 changed files with 6 additions and 1 deletions

View File

@ -185,6 +185,11 @@ func (s *Slack) buildMessage(m slackMessage) msg.Message {
text = text[3:] text = text[3:]
} }
u := s.getUser(m.User)
if m.Username != "" {
u = m.Username
}
// I think it's horseshit that I have to do this // I think it's horseshit that I have to do this
ts := strings.Split(m.Ts, ".") ts := strings.Split(m.Ts, ".")
sec, _ := strconv.ParseInt(ts[0], 10, 64) sec, _ := strconv.ParseInt(ts[0], 10, 64)
@ -194,7 +199,7 @@ func (s *Slack) buildMessage(m slackMessage) msg.Message {
return msg.Message{ return msg.Message{
User: &user.User{ User: &user.User{
ID: m.User, ID: m.User,
Name: m.Username, Name: u,
}, },
Body: text, Body: text,
Raw: m.Text, Raw: m.Text,