mirror of
https://github.com/42wim/matterbridge.git
synced 2024-12-23 19:52:41 +01:00
Fix public links (mattermost)
This commit is contained in:
parent
dc2aed698d
commit
21143cf5ee
@ -511,8 +511,8 @@ func (m *MMClient) GetPosts(channelId string, limit int) *model.PostList {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *MMClient) GetPublicLink(filename string) string {
|
func (m *MMClient) GetPublicLink(filename string) string {
|
||||||
res, err := m.Client.GetFileLink(filename)
|
res, resp := m.Client.GetFileLink(filename)
|
||||||
if err != nil {
|
if resp.Error != nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
@ -521,8 +521,8 @@ func (m *MMClient) GetPublicLink(filename string) string {
|
|||||||
func (m *MMClient) GetPublicLinks(filenames []string) []string {
|
func (m *MMClient) GetPublicLinks(filenames []string) []string {
|
||||||
var output []string
|
var output []string
|
||||||
for _, f := range filenames {
|
for _, f := range filenames {
|
||||||
res, err := m.Client.GetFileLink(f)
|
res, resp := m.Client.GetFileLink(f)
|
||||||
if err != nil {
|
if resp.Error != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
output = append(output, res)
|
output = append(output, res)
|
||||||
@ -538,8 +538,8 @@ func (m *MMClient) GetFileLinks(filenames []string) []string {
|
|||||||
|
|
||||||
var output []string
|
var output []string
|
||||||
for _, f := range filenames {
|
for _, f := range filenames {
|
||||||
res, err := m.Client.GetFileLink(f)
|
res, resp := m.Client.GetFileLink(f)
|
||||||
if err != nil {
|
if resp.Error != nil {
|
||||||
// public links is probably disabled, create the link ourselves
|
// public links is probably disabled, create the link ourselves
|
||||||
output = append(output, uriScheme+m.Credentials.Server+model.API_URL_SUFFIX_V3+"/files/"+f+"/get")
|
output = append(output, uriScheme+m.Credentials.Server+model.API_URL_SUFFIX_V3+"/files/"+f+"/get")
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user