Thumbnail

rani/matterbridge.git

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

commit aaf1bfbd1cf1ca5fe8662388c83511e438548d7a Author: Wim <wim@42.be> Date: Wed Jul 12 22:47:30 2017 +0000 Add GetFileLinks, also get files if public links is disabled diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go index 8c2ebbb..47fb211 100644 --- a/matterclient/matterclient.go +++ b/matterclient/matterclient.go @@ -5006 +50025 @@ func (m *MMClient) GetPublicLinks(filenames []string) []string {   return output  }   +func (m *MMClient) GetFileLinks(filenames []string) []string { + uriScheme := "https://" + if m.NoTLS { + uriScheme = "http://" + } + + var output []string + for _, f := range filenames { + res, err := m.Client.GetPublicLink(f) + if err != 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 + } + output = append(output, res) + } + return output +} +  func (m *MMClient) UpdateChannelHeader(channelId string, header string) {   data := make(map[string]string)   data["channel_id"] = channelId