aboutsummaryrefslogtreecommitdiff
path: root/interface
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2019-06-17 12:27:31 +0300
committerTulir Asokan <tulir@maunium.net>2019-06-17 12:27:31 +0300
commitfe439f076ad3d76c459c9a76c4bbdcda5182ed85 (patch)
treec15399d67bea1661088146e0c28cab0a39a3a4ed /interface
parent754f8e493df64d6532ace194f3e75c9ccf5bfd95 (diff)
Wrap events in custom struct to add gomuks-specific fields
Diffstat (limited to 'interface')
-rw-r--r--interface/matrix.go9
-rw-r--r--interface/ui.go4
2 files changed, 7 insertions, 6 deletions
diff --git a/interface/matrix.go b/interface/matrix.go
index 6a1a977..424273b 100644
--- a/interface/matrix.go
+++ b/interface/matrix.go
@@ -17,6 +17,7 @@
package ifc
import (
+ "maunium.net/go/gomuks/matrix/event"
"maunium.net/go/mautrix"
"maunium.net/go/gomuks/matrix/rooms"
@@ -34,16 +35,16 @@ type MatrixContainer interface {
Logout()
SendPreferencesToMatrix()
- PrepareMarkdownMessage(roomID string, msgtype mautrix.MessageType, message string) *mautrix.Event
- SendEvent(event *mautrix.Event) (string, error)
+ PrepareMarkdownMessage(roomID string, msgtype mautrix.MessageType, message string) *event.Event
+ SendEvent(evt *event.Event) (string, error)
SendTyping(roomID string, typing bool)
MarkRead(roomID, eventID string)
JoinRoom(roomID, server string) (*rooms.Room, error)
LeaveRoom(roomID string) error
CreateRoom(req *mautrix.ReqCreateRoom) (*rooms.Room, error)
- GetHistory(room *rooms.Room, limit int) ([]*mautrix.Event, error)
- GetEvent(room *rooms.Room, eventID string) (*mautrix.Event, error)
+ GetHistory(room *rooms.Room, limit int) ([]*event.Event, error)
+ GetEvent(room *rooms.Room, eventID string) (*event.Event, error)
GetRoom(roomID string) *rooms.Room
GetOrCreateRoom(roomID string) *rooms.Room
diff --git a/interface/ui.go b/interface/ui.go
index ad2458a..32925a8 100644
--- a/interface/ui.go
+++ b/interface/ui.go
@@ -19,9 +19,9 @@ package ifc
import (
"time"
+ "maunium.net/go/gomuks/matrix/event"
"maunium.net/go/gomuks/matrix/pushrules"
"maunium.net/go/gomuks/matrix/rooms"
- "maunium.net/go/mautrix"
)
type UIProvider func(gmx Gomuks) GomuksUI
@@ -60,7 +60,7 @@ type RoomView interface {
SetTyping(users []string)
UpdateUserList()
- ParseEvent(evt *mautrix.Event) Message
+ ParseEvent(evt *event.Event) Message
GetEvent(eventID string) Message
AddMessage(message Message)
AddServiceMessage(message string)