mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-05-24 14:24:15 +00:00
run gofmt
This commit is contained in:
parent
666b9e2bdd
commit
d4343c1a3e
@ -6,22 +6,22 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"path/filepath"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"io/ioutil"
|
||||
|
||||
"github.com/cyphar/filepath-securejoin"
|
||||
"github.com/gabriel-vasile/mimetype"
|
||||
"github.com/gin-gonic/gin"
|
||||
uuid "github.com/gofrs/uuid"
|
||||
"github.com/h2non/filetype"
|
||||
log "github.com/sirupsen/logrus"
|
||||
qrcode "github.com/skip2/go-qrcode"
|
||||
"github.com/gabriel-vasile/mimetype"
|
||||
"github.com/cyphar/filepath-securejoin"
|
||||
)
|
||||
|
||||
const signalCliV2GroupError = "Cannot create a V2 group as self does not have a versioned profile"
|
||||
@ -233,9 +233,9 @@ func parseWhitespaceDelimitedKeyValueStringList(in string, keys []string) []map[
|
||||
continue
|
||||
}
|
||||
|
||||
idx := strings.Index(temp, " " + key + ": ")
|
||||
idx := strings.Index(temp, " "+key+": ")
|
||||
pair := temp[:idx]
|
||||
value := strings.TrimPrefix(pair, key + ": ")
|
||||
value := strings.TrimPrefix(pair, key+": ")
|
||||
temp = strings.TrimLeft(temp[idx:], " "+key+": ")
|
||||
|
||||
m[keys[i-1]] = value
|
||||
@ -737,7 +737,7 @@ func (a *Api) GetQrCodeLink(c *gin.Context) {
|
||||
// @Router /v1/attachments [get]
|
||||
func (a *Api) GetAttachments(c *gin.Context) {
|
||||
files := []string{}
|
||||
err := filepath.Walk(a.signalCliConfig + "/attachments/", func(path string, info os.FileInfo, err error) error {
|
||||
err := filepath.Walk(a.signalCliConfig+"/attachments/", func(path string, info os.FileInfo, err error) error {
|
||||
if info.IsDir() {
|
||||
return nil
|
||||
}
|
||||
@ -763,7 +763,7 @@ func (a *Api) GetAttachments(c *gin.Context) {
|
||||
// @Router /v1/attachments/{attachment} [delete]
|
||||
func (a *Api) RemoveAttachment(c *gin.Context) {
|
||||
attachment := c.Param("attachment")
|
||||
path, err := securejoin.SecureJoin(a.signalCliConfig + "/attachments/", attachment)
|
||||
path, err := securejoin.SecureJoin(a.signalCliConfig+"/attachments/", attachment)
|
||||
if err != nil {
|
||||
c.JSON(400, Error{Msg: "Please provide a valid attachment name"})
|
||||
return
|
||||
@ -791,7 +791,7 @@ func (a *Api) RemoveAttachment(c *gin.Context) {
|
||||
// @Router /v1/attachments/{attachment} [get]
|
||||
func (a *Api) ServeAttachment(c *gin.Context) {
|
||||
attachment := c.Param("attachment")
|
||||
path, err := securejoin.SecureJoin(a.signalCliConfig + "/attachments/", attachment)
|
||||
path, err := securejoin.SecureJoin(a.signalCliConfig+"/attachments/", attachment)
|
||||
if err != nil {
|
||||
c.JSON(400, Error{Msg: "Please provide a valid attachment name"})
|
||||
return
|
||||
@ -949,7 +949,6 @@ func (a *Api) ListIdentities(c *gin.Context) {
|
||||
numberAndTrustStatus := keyValuePair["NumberAndTrustStatus"]
|
||||
numberAndTrustStatusSplitted := strings.Split(numberAndTrustStatus, ":")
|
||||
|
||||
|
||||
identityEntry := IdentityEntry{Number: strings.Trim(numberAndTrustStatusSplitted[0], " "),
|
||||
Status: strings.Trim(numberAndTrustStatusSplitted[1], " "),
|
||||
Added: keyValuePair["Added"],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user