messageview

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2022 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller interface {
	SetSelectedRoom(id matrix.RoomID)
}

type Page

type Page struct {
	gtk.Widgetter
	Composer *compose.Composer
	// contains filtered or unexported fields
}

Page describes a tab page, which is a single message view. It satisfies teh MessageViewer interface.

func NewPage

func NewPage(ctx context.Context, parent *View, roomID matrix.RoomID) *Page

NewPage creates a new page.

func (*Page) AddSendingMessage

func (p *Page) AddSendingMessage(ev event.RoomEvent) interface{}

AddSendingMessage adds the given message into the page and returns the row. The user must call BindSendingMessage afterwards to ensure that the added message is merged with the synchronized one.

func (*Page) AddSendingMessageCustom

func (p *Page) AddSendingMessageCustom(ev event.RoomEvent, w gtk.Widgetter) interface{}

SetSendingMessageBody sets the body of the message to the given widget. This is useful for sending actions that require displaying some information to the user.

func (*Page) BindSendingMessage

func (p *Page) BindSendingMessage(mark interface{}, evID matrix.EventID) (replaced bool)

BindSendingMessage is used after the sending message has been sent through the backend, and that an event ID is returned. The page will try to match the message up with an existing event.

func (*Page) Edit

func (p *Page) Edit(eventID matrix.EventID)

Edit triggers the input composer to edit an existing message.

func (*Page) FocusLatestUserEventID

func (p *Page) FocusLatestUserEventID() matrix.EventID

FocusLatestUserEventID returns the latest valid event ID of the current user in the room or an empty string if none. It implements compose.Controller.

func (*Page) IsActive

func (p *Page) IsActive() bool

IsActive returns true if this page is the one the user is viewing.

func (*Page) Load

func (p *Page) Load()

Load asynchronously loads the page. The given callback is called once the page finishes loading.

func (*Page) MarkAsRead

func (p *Page) MarkAsRead()

MarkAsRead marks the room as read.

func (*Page) OnRoomEvent

func (p *Page) OnRoomEvent(ev event.RoomEvent)

OnRoomEvent is called on every room timeline event belonging to this room.

func (*Page) OnScrollBottomed

func (p *Page) OnScrollBottomed()

OnScrollBottomed marks the room as read if the page is focused, the window the page is in are focused, and the user is currently scrolled to the bottom.

func (*Page) OnTitle

func (p *Page) OnTitle(f func(string))

OnTitle subscribes to the page's title changes.

func (*Page) ReplyTo

func (p *Page) ReplyTo(eventID matrix.EventID)

ReplyTo sets the event ID that the user wants to reply to.

func (*Page) RoomID

func (p *Page) RoomID() matrix.RoomID

RoomID returns this room's ID.

func (*Page) RoomName

func (p *Page) RoomName() string

RoomName returns this page's room name.

func (*Page) RoomTopic

func (p *Page) RoomTopic() string

RoomTopic returns the room's topic name.

func (*Page) ScrollTo added in v0.1.3

func (p *Page) ScrollTo(eventID matrix.EventID) bool

ScrollTo implements message.MessageViewer.

func (*Page) StopSendingMessage

func (p *Page) StopSendingMessage(mark interface{}) bool

StopSendingMessage removes the sending message with the given mark.

type View

type View struct {
	*gtk.Stack
	// contains filtered or unexported fields
}

View describes a view for multiple message views.

func New

func New(ctx context.Context, ctrl Controller) *View

New creates a new instance of View.

func (*View) Current

func (v *View) Current() *Page

Current returns the current page or nil if none.

func (*View) OpenRoom

func (v *View) OpenRoom(id matrix.RoomID) *Page

OpenRoom opens a Matrix room on the curernt page. If there is no page yet, then a new one is created. If the room already exists in another tab, then that tab is selected.

func (*View) SetPlaceholder

func (v *View) SetPlaceholder(w gtk.Widgetter)

SetPlaceholder sets the placeholder widget.

Directories

Path Synopsis
Package compose contains widgets used for composing a Matrix message.
Package compose contains widgets used for composing a Matrix message.
mauthor
Package mauthor handles rendering Matrix room members' names.
Package mauthor handles rendering Matrix room members' names.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL