aboutsummaryrefslogtreecommitdiff
path: root/interface
diff options
context:
space:
mode:
Diffstat (limited to 'interface')
-rw-r--r--interface/matrix.go18
1 files changed, 16 insertions, 2 deletions
diff --git a/interface/matrix.go b/interface/matrix.go
index 7895957..122757f 100644
--- a/interface/matrix.go
+++ b/interface/matrix.go
@@ -18,6 +18,7 @@ package ifc
import (
"maunium.net/go/mautrix"
+ "maunium.net/go/mautrix/crypto/attachment"
"maunium.net/go/mautrix/event"
"maunium.net/go/mautrix/id"
@@ -59,8 +60,21 @@ type MatrixContainer interface {
GetRoom(roomID id.RoomID) *rooms.Room
GetOrCreateRoom(roomID id.RoomID) *rooms.Room
- Download(uri id.ContentURI) ([]byte, error)
- DownloadToDisk(uri id.ContentURI, target string) (string, error)
+ Download(uri id.ContentURI, file *attachment.EncryptedFile) ([]byte, error)
+ DownloadToDisk(uri id.ContentURI, file *attachment.EncryptedFile, target string) (string, error)
GetDownloadURL(uri id.ContentURI) string
GetCachePath(uri id.ContentURI) string
+
+ Crypto() Crypto
+}
+
+type Crypto interface {
+ Load() error
+ FlushStore() error
+ ProcessSyncResponse(resp *mautrix.RespSync, since string)
+ HandleMemberEvent(*event.Event)
+ DecryptMegolmEvent(*event.Event) (*event.Event, error)
+ EncryptMegolmEvent(id.RoomID, event.Type, event.Content) (*event.EncryptedEventContent, error)
+ ShareGroupSession(id.RoomID, []id.UserID) error
+ Fingerprint() string
}