Skip to content

Commit

Permalink
Fixed so only original message with channel wide mentions are IRC NOT…
Browse files Browse the repository at this point in the history
…ICEs
  • Loading branch information
hloeung committed Mar 15, 2021
1 parent 767af48 commit a75d1b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bridge/mattermost/mattermost.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,7 @@ func (m *Mattermost) handleWsActionPost(rmsg *model.WebSocketEvent) {
return
}

replyMessage := ""
if data.ParentId != "" {
parentPost, resp := m.mc.Client.GetPost(data.ParentId, "")
if resp.Error != nil {
Expand All @@ -744,7 +745,7 @@ func (m *Mattermost) handleWsActionPost(rmsg *model.WebSocketEvent) {

if !m.v.GetBool("mattermost.hidereplies") {
parentMessage := maybeShorten(parentPost.Message, m.v.GetInt("mattermost.ShortenRepliesTo"), "@", m.v.GetBool("mattermost.unicode"))
data.Message = fmt.Sprintf("%s (re @%s: %s)", data.Message, parentGhost.Nick, parentMessage)
replyMessage = fmt.Sprintf(" (re @%s: %s)", parentGhost.Nick, parentMessage)
}
}
}
Expand Down Expand Up @@ -809,7 +810,7 @@ func (m *Mattermost) handleWsActionPost(rmsg *model.WebSocketEvent) {
return
}

msgs := strings.Split(data.Message, "\n")
msgs := strings.Split(data.Message+replyMessage, "\n")

channelType := ""
if t, ok := props["channel_type"].(string); ok {
Expand Down

0 comments on commit a75d1b6

Please sign in to comment.