diff options
Diffstat (limited to 'appservice')
-rw-r--r-- | appservice/account.go | 18 | ||||
-rw-r--r-- | appservice/db.go | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/appservice/account.go b/appservice/account.go index f1f9d13..4bb2dfe 100644 --- a/appservice/account.go +++ b/appservice/account.go @@ -286,24 +286,24 @@ func (a *Account) eventInternal(event *Event) error { if err != nil { return err } - content := map[string]interface{} { - "body": mxfile.Filename(), + content := map[string]interface{}{ + "body": mxfile.Filename(), "filename": mxfile.Filename(), - "url": fmt.Sprintf("mxc://%s/%s", mxfile.MxcServer, mxfile.MxcMediaId), + "url": fmt.Sprintf("mxc://%s/%s", mxfile.MxcServer, mxfile.MxcMediaId), } if sz := mxfile.ImageSize(); sz != nil { content["msgtype"] = "m.image" - content["info"] = map[string]interface{} { + content["info"] = map[string]interface{}{ "mimetype": mxfile.Mimetype(), - "size": mxfile.Size(), - "w": sz.Width, - "h": sz.Height, + "size": mxfile.Size(), + "w": sz.Width, + "h": sz.Height, } } else { content["msgtype"] = "m.file" - content["info"] = map[string]interface{} { + content["info"] = map[string]interface{}{ "mimetype": mxfile.Mimetype(), - "size": mxfile.Size(), + "size": mxfile.Size(), } } err = mx.SendAs(mx_room_id, "m.room.message", content, mx_user_id) diff --git a/appservice/db.go b/appservice/db.go index 646dae3..9c3280c 100644 --- a/appservice/db.go +++ b/appservice/db.go @@ -41,7 +41,7 @@ func InitDb() error { type DbCache struct { gorm.Model - Key string `gorm:"unique_index"` + Key string `gorm:"unique_index"` Value string } |