Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

commit 4143db1fcc3b1d35a013fbf3d55e54bbdea8cabb Author: Wim <wim@42.be> Date: Mon Sep 04 12:50:42 2017 +0000 Fix public links (mattermost) diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index d52a428..fb91d0b 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -5118 +5118 @@ func (m *MMClient) GetPosts(channelId string, limit int) *model.PostList {  }    func (m *MMClient) GetPublicLink(filename string) string { - res, err := m.Client.GetFileLink(filename) - if err != nil { + res, resp := m.Client.GetFileLink(filename) + if resp.Error != nil {   return ""   }   return res @@ -5218 +5218 @@ func (m *MMClient) GetPublicLink(filename string) string {  func (m *MMClient) GetPublicLinks(filenames []string) []string {   var output []string   for _, f := range filenames { - res, err := m.Client.GetFileLink(f) - if err != nil { + res, resp := m.Client.GetFileLink(f) + if resp.Error != nil {   continue   }   output = append(output, res) @@ -5388 +5388 @@ func (m *MMClient) GetFileLinks(filenames []string) []string {     var output []string   for _, f := range filenames { - res, err := m.Client.GetFileLink(f) - if err != nil { + res, resp := m.Client.GetFileLink(f) + if resp.Error != nil {   // public links is probably disabled, create the link ourselves   output = append(output, uriScheme+m.Credentials.Server+model.API_URL_SUFFIX_V3+"/files/"+f+"/get")   continue