From a6f6fb3ef22658508671296a31367a198205da99 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 8 Apr 2020 15:30:29 +0300 Subject: Display thumbnail for all files and add commands to download and open files --- interface/matrix.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'interface/matrix.go') 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 } -- cgit v1.2.3