Skip to content

Commit

Permalink
Add option to only show messages in joined channels for file events a…
Browse files Browse the repository at this point in the history
…lso (#566)
  • Loading branch information
hloeung authored Dec 13, 2023
1 parent 0416774 commit b762e5e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mm-go-irckit/userbridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,13 @@ func (u *User) handleChannelMessageEvent(event *bridge.ChannelMessageEvent) {
}

func (u *User) handleFileEvent(event *bridge.FileEvent) {
ch := u.getMessageChannel(event.ChannelID, event.Sender)
if event.ChannelType != "D" && ch.ID() == "&messages" {
if u.v.GetBool(u.br.Protocol() + ".showonlyjoined") {
return
}
}

for _, fname := range event.Files {
fileMsg := "\x1ddownload file - " + fname.Name + "\x1d"
if u.v.GetBool(u.br.Protocol()+".prefixcontext") || u.v.GetBool(u.br.Protocol()+".suffixcontext") {
Expand Down

0 comments on commit b762e5e

Please sign in to comment.