Skip to content

Commit

Permalink
Make native uploads default for discord.
Browse files Browse the repository at this point in the history
  • Loading branch information
yousefmansy1 committed Feb 22, 2023
1 parent e4a672c commit e4e520e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion bridge/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ type Protocol struct {
URL string // mattermost, slack // DEPRECATED
UseAPI bool // mattermost, slack
UseLocalAvatar []string // discord
UseNativeUpload bool // discord
UseSASL bool // IRC
UseTLS bool // IRC
UseDiscriminator bool // discord
Expand Down
9 changes: 1 addition & 8 deletions bridge/discord/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,7 @@ func (b *Bdiscord) messageCreate(s *discordgo.Session, m *discordgo.MessageCreat
}

if len(m.Attachments) > 0 {
if b.Config.GetBool("UseNativeUpload") {
b.handleDownloadFile(&rmsg, m)
} else {
// add the url of the attachments to content
for _, attach := range m.Attachments {
m.Content = m.Content + "\n" + attach.URL
}
}
b.handleDownloadFile(&rmsg, m)
}

hasAttachment := len(rmsg.Extra["file"]) > 0
Expand Down
3 changes: 0 additions & 3 deletions matterbridge.toml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -907,9 +907,6 @@ ShowEmbeds=false
# Example: ["irc"]
UseLocalAvatar=[]

# UseNativeUpload will use a naitive upload when relaying from discord to other platforms rather than using public links
UseNativeUpload=false

# UseUserName shows the username instead of the server nickname
UseUserName=false

Expand Down

0 comments on commit e4e520e

Please sign in to comment.