summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-09-04 12:50:42 +0200
committerWim <wim@42.be>2017-09-04 12:50:42 +0200
commit21143cf5eea0e9e21a766dc9883967981086e45d (patch)
tree579af9c070a1a233336d3d99c6ca0181175516b2
parentdc2aed698d8e7e8b2f01940f221a7a40bd690732 (diff)
downloadmatterbridge-msglm-21143cf5eea0e9e21a766dc9883967981086e45d.tar.gz
matterbridge-msglm-21143cf5eea0e9e21a766dc9883967981086e45d.tar.bz2
matterbridge-msglm-21143cf5eea0e9e21a766dc9883967981086e45d.zip
Fix public links (mattermost)
-rw-r--r--matterclient/matterclient.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/matterclient/matterclient.go b/matterclient/matterclient.go
index d52a428d..fb91d0ba 100644
--- a/matterclient/matterclient.go
+++ b/matterclient/matterclient.go
@@ -511,8 +511,8 @@ 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
@@ -521,8 +521,8 @@ 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)
@@ -538,8 +538,8 @@ 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