Skip to content

Commit

Permalink
Show file attachments on replay
Browse files Browse the repository at this point in the history
  • Loading branch information
hloeung committed Feb 14, 2021
1 parent 4a220d8 commit 4bef3f2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions mm-go-irckit/userbridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,10 @@ func (u *User) addUserToChannelWorker(channels <-chan *bridge.ChannelInfo, throt
}

for _, post := range strings.Split(p.Message, "\n") {
if post == "" {
continue
}

if showReplayHdr {
date := ts.Format("2006-01-02 15:04:05")
channame := brchannel.Name
Expand All @@ -637,6 +641,19 @@ func (u *User) addUserToChannelWorker(channels <-chan *bridge.ChannelInfo, throt
}
spoof(nick, replayMsg)
}

if len(p.FileIds) == 0 {
continue
}

for _, fname := range u.br.GetFileLinks(p.FileIds) {
fileMsg := "download file - " + fname
if u.v.GetString(u.br.Protocol()+".threadcontext") == "mattermost" {
threadMsgID := u.prefixContext("", p.Id, p.ParentId, "")
fileMsg = u.formatContextMessage(ts.Format("15:04"), threadMsgID, fileMsg)
}
spoof(nick, fileMsg)
}
}

if len(mmPostList.Order) > 0 {
Expand Down

0 comments on commit 4bef3f2

Please sign in to comment.