message

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: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderEvent

func RenderEvent(ctx context.Context, ev event.RoomEvent) string

RenderEvent returns the markup tail of an event message.

Types

type Message

type Message interface {
	gtk.Widgetter
	// SetBlur greys the message's content if true. It's used to indicate
	// idling.
	SetBlur(bool)
	// Event returns the message's event.
	Event() event.RoomEvent
	// OnRelatedEvent is called by the caller for each event that's related to
	// the message. The caller should check the m.relates_to field. If the
	// RoomEvent is unknown to the message, then false should be returned.
	OnRelatedEvent(event.RoomEvent) bool
	// LoadMore loads more information in the message, such as embeds. It should
	// be synchronous most of the time.
	LoadMore()
}

Message describes a generic message type.

func NewCozyMessage

func NewCozyMessage(ctx context.Context, view MessageViewer, ev event.RoomEvent, before Message) Message

NewCozyMessage creates a new cozy or collapsed message.

type MessageViewer

type MessageViewer interface {
	// ReplyTo sets the message event ID that the user wants to reply to.
	ReplyTo(matrix.EventID)
	// Edit starts the editing for given message ID.
	Edit(matrix.EventID)
	// ScrollTo scrolls to the given event, or if it doesn't exist, then false
	// is returned.
	ScrollTo(matrix.EventID) bool
}

MessageViewer describes the parent that holds messages.

type Reply added in v0.1.3

type Reply struct {
	*gtk.Box
	// contains filtered or unexported fields
}

func NewReply added in v0.1.3

func NewReply(ctx context.Context, v MessageViewer, roomID matrix.RoomID, eventID matrix.EventID) *Reply

NewReply creates a new Reply widget.

func (*Reply) InvalidateContent added in v0.1.3

func (r *Reply) InvalidateContent()

InvalidateContent invalidates the Reply's content. For now, this function does nothing after being called more than once.

func (*Reply) MentionURL added in v0.1.3

func (r *Reply) MentionURL() string

MentionURL returns the URL to matrix.to for the message that this is replying to.

func (*Reply) ShowContent added in v0.1.3

func (r *Reply) ShowContent()

ShowContent opens a new Popover with the message content.

Directories

Path Synopsis
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