Skip to content
Snippets Groups Projects
Commit b9cacba2 authored by Travis Ralston's avatar Travis Ralston
Browse files

Apply code formatting

parent 72a3ae12
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ jobs: ...@@ -6,7 +6,7 @@ jobs:
working_directory: /go/src/github.com/turt2live/matrix-media-repo working_directory: /go/src/github.com/turt2live/matrix-media-repo
steps: steps:
- checkout - checkout
- run: - run:
name: build binaries name: build binaries
command: 'GOBIN=$PWD/`dirname $0`/bin go install -v ./cmd/...' command: 'GOBIN=$PWD/`dirname $0`/bin go install -v ./cmd/...'
- store_artifacts: - store_artifacts:
......
...@@ -50,5 +50,5 @@ func GetFederationInfo(r *http.Request, log *logrus.Entry, user api.UserInfo) in ...@@ -50,5 +50,5 @@ func GetFederationInfo(r *http.Request, log *logrus.Entry, user api.UserInfo) in
resp["base_url"] = url resp["base_url"] = url
resp["hostname"] = hostname resp["hostname"] = hostname
resp["versions_response"] = out resp["versions_response"] = out
return &api.DoNotCacheResponse{Payload:resp} return &api.DoNotCacheResponse{Payload: resp}
} }
...@@ -69,7 +69,7 @@ func QuarantineRoomMedia(r *http.Request, log *logrus.Entry, user api.UserInfo) ...@@ -69,7 +69,7 @@ func QuarantineRoomMedia(r *http.Request, log *logrus.Entry, user api.UserInfo)
total += resp.(*MediaQuarantinedResponse).NumQuarantined total += resp.(*MediaQuarantinedResponse).NumQuarantined
} }
return &api.DoNotCacheResponse{Payload:&MediaQuarantinedResponse{NumQuarantined: total}} return &api.DoNotCacheResponse{Payload: &MediaQuarantinedResponse{NumQuarantined: total}}
} }
func QuarantineMedia(r *http.Request, log *logrus.Entry, user api.UserInfo) interface{} { func QuarantineMedia(r *http.Request, log *logrus.Entry, user api.UserInfo) interface{} {
...@@ -94,7 +94,7 @@ func QuarantineMedia(r *http.Request, log *logrus.Entry, user api.UserInfo) inte ...@@ -94,7 +94,7 @@ func QuarantineMedia(r *http.Request, log *logrus.Entry, user api.UserInfo) inte
} }
resp, _ := doQuarantine(r.Context(), log, server, mediaId, allowOtherHosts) resp, _ := doQuarantine(r.Context(), log, server, mediaId, allowOtherHosts)
return &api.DoNotCacheResponse{Payload:resp} return &api.DoNotCacheResponse{Payload: resp}
} }
func doQuarantine(ctx context.Context, log *logrus.Entry, origin string, mediaId string, allowOtherHosts bool) (interface{}, bool) { func doQuarantine(ctx context.Context, log *logrus.Entry, origin string, mediaId string, allowOtherHosts bool) (interface{}, bool) {
......
...@@ -5,7 +5,7 @@ clone_folder: c:\gopath\src\github.com\turt2live\matrix-media-repo ...@@ -5,7 +5,7 @@ clone_folder: c:\gopath\src\github.com\turt2live\matrix-media-repo
environment: environment:
GOPATH: c:\gopath GOPATH: c:\gopath
GOVERSION: 1.12 GOVERSION: 1.12
branches: branches:
only: [master, develop] only: [master, develop]
......
...@@ -99,7 +99,7 @@ uploads: ...@@ -99,7 +99,7 @@ uploads:
# placed anywhere to match everything (eg: "image/*" matches all images). This will also # placed anywhere to match everything (eg: "image/*" matches all images). This will also
# restrict which file types are downloaded from remote servers. # restrict which file types are downloaded from remote servers.
allowedTypes: allowedTypes:
- "*/*" - "*/*"
# Specific users can have their own set of allowed file types. These are applied instead # Specific users can have their own set of allowed file types. These are applied instead
# of those listed in the allowedTypes list when a user is found. Much like allowedTypes, # of those listed in the allowedTypes list when a user is found. Much like allowedTypes,
......
...@@ -40,7 +40,7 @@ func GetPreview(urlStr string, onHost string, forUserId string, atTs int64, ctx ...@@ -40,7 +40,7 @@ func GetPreview(urlStr string, onHost string, forUserId string, atTs int64, ctx
now := util.NowMillis() now := util.NowMillis()
atTsBk := stores.GetBucketTs(atTs) atTsBk := stores.GetBucketTs(atTs)
nowBk := stores.GetBucketTs(now) nowBk := stores.GetBucketTs(now)
if (now - atTs) > 60000 && atTsBk != nowBk { if (now-atTs) > 60000 && atTsBk != nowBk {
// Because we don't have a cached preview, we'll use the current time as the preview time. // Because we don't have a cached preview, we'll use the current time as the preview time.
// We also give a 60 second buffer so we don't cause an infinite loop (considering we're // We also give a 60 second buffer so we don't cause an infinite loop (considering we're
// calling ourselves), and to give a lenient opportunity for slow execution. // calling ourselves), and to give a lenient opportunity for slow execution.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment