From bbde1219479bb257c7bc1f9546bd67e8a151198c Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 10 Apr 2019 01:04:39 +0300 Subject: It compiles. Ship it! --- interface/matrix.go | 4 ++-- interface/ui.go | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) (limited to 'interface') diff --git a/interface/matrix.go b/interface/matrix.go index bfce8b5..8c80c6d 100644 --- a/interface/matrix.go +++ b/interface/matrix.go @@ -34,8 +34,8 @@ type MatrixContainer interface { Logout() SendPreferencesToMatrix() - SendMessage(roomID string, msgtype mautrix.MessageType, message string) (string, error) - SendMarkdownMessage(roomID string, msgtype mautrix.MessageType, message string) (string, error) + PrepareMarkdownMessage(roomID string, msgtype mautrix.MessageType, message string) *mautrix.Event + SendEvent(event *mautrix.Event) (string, error) SendTyping(roomID string, typing bool) MarkRead(roomID, eventID string) JoinRoom(roomID, server string) (*rooms.Room, error) diff --git a/interface/ui.go b/interface/ui.go index c64c748..12aabbe 100644 --- a/interface/ui.go +++ b/interface/ui.go @@ -53,14 +53,6 @@ type MainView interface { InitialSyncDone() } -type MessageDirection int - -const ( - AppendMessage MessageDirection = iota - PrependMessage - IgnoreMessage -) - type RoomView interface { MxRoom() *rooms.Room @@ -69,8 +61,7 @@ type RoomView interface { UpdateUserList() ParseEvent(evt *mautrix.Event) Message - AppendMessage(message Message) - MarkMessageFailed(message Message) + AddMessage(message Message) AddServiceMessage(message string) } @@ -81,4 +72,8 @@ type Message interface { Timestamp() time.Time NotificationSenderName() string NotificationContent() string + + SetState(state mautrix.OutgoingEventState) + SetIsHighlight(highlight bool) + SetID(id string) } -- cgit v1.2.3