aboutsummaryrefslogtreecommitdiff
path: root/interface
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2020-04-08 15:30:29 +0300
committerTulir Asokan <tulir@maunium.net>2020-04-08 15:30:29 +0300
commita6f6fb3ef22658508671296a31367a198205da99 (patch)
tree448766b706b0dab25e6541fd1d9cb5e2a7439c51 /interface
parent80564b2887085a088a4f753042dbe345092e45a1 (diff)
Display thumbnail for all files and add commands to download and open files
Diffstat (limited to 'interface')
-rw-r--r--interface/matrix.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/interface/matrix.go b/interface/matrix.go
index d4351d7..34d8f7f 100644
--- a/interface/matrix.go
+++ b/interface/matrix.go
@@ -17,6 +17,7 @@
package ifc
import (
+ "maunium.net/go/gomuks/config"
"maunium.net/go/gomuks/matrix/event"
"maunium.net/go/mautrix"
@@ -24,12 +25,13 @@ import (
)
type Relation struct {
- Type mautrix.RelationType
+ Type mautrix.RelationType
Event *event.Event
}
type MatrixContainer interface {
Client() *mautrix.Client
+ Preferences() *config.UserPreferences
InitClient() error
Initialized() bool
@@ -55,7 +57,8 @@ type MatrixContainer interface {
GetRoom(roomID string) *rooms.Room
GetOrCreateRoom(roomID string) *rooms.Room
- Download(mxcURL string) ([]byte, string, string, error)
- GetDownloadURL(homeserver, fileID string) string
- GetCachePath(homeserver, fileID string) string
+ Download(uri mautrix.ContentURI) ([]byte, error)
+ DownloadToDisk(uri mautrix.ContentURI, target string) (string, error)
+ GetDownloadURL(uri mautrix.ContentURI) string
+ GetCachePath(uri mautrix.ContentURI) string
}