Documentation ¶
Index ¶
- type Content
- func (c *Content) ChannelID() discord.ChannelID
- func (c *Content) MessageID() discord.MessageID
- func (c *Content) Redact()
- func (c *Content) SetCustomChild(child ...gtk.Widgetter)
- func (c *Content) SetExtraMenu(menu gio.MenuModeller)
- func (c *Content) SetReactions(reactions []discord.Reaction)
- func (c *Content) Update(m *discord.Message, customs ...gtk.Widgetter)
- type ExtraMenuSetter
- type Message
- type MessageWithUser
- type TypingIndicator
- type View
- func (v *View) AddReaction(id discord.MessageID, emoji discord.APIEmoji)
- func (v *View) AddToast(toast *adw.Toast)
- func (v *View) ChannelID() discord.ChannelID
- func (v *View) ChannelName() string
- func (v *View) Delete(id discord.MessageID)
- func (v *View) Edit(id discord.MessageID)
- func (v *View) EditLastMessage() bool
- func (v *View) GuildID() discord.GuildID
- func (v *View) HeaderButtons() []gtk.Widgetter
- func (v *View) IsActive() bool
- func (v *View) MarkRead()
- func (v *View) ReplyTo(id discord.MessageID)
- func (v *View) ScrollToMessage(id discord.MessageID)
- func (v *View) SendMessage(sendingMsg composer.SendingMessage)
- func (v *View) StopEditing()
- func (v *View) StopReplying()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Content ¶
type Content struct { *gtk.Box // contains filtered or unexported fields }
Content is the message content widget.
func NewContent ¶
NewContent creates a new Content widget.
func (*Content) SetCustomChild ¶
func (c *Content) SetCustomChild(child ...gtk.Widgetter)
func (*Content) SetExtraMenu ¶
func (c *Content) SetExtraMenu(menu gio.MenuModeller)
SetExtraMenu implements ExtraMenuSetter.
func (*Content) SetReactions ¶
SetReactions sets the reactions inside the message.
type ExtraMenuSetter ¶
type ExtraMenuSetter interface {
SetExtraMenu(gio.MenuModeller)
}
ExtraMenuSetter is an interface for types that implement SetExtraMenu.
type Message ¶
type Message interface { gtk.Widgetter Update(*gateway.MessageCreateEvent) Redact() Content() *Content Message() *discord.Message AddCSSClass(string) RemoveCSSClass(string) }
TODO: Implement BlockedMessage widget Message describes a Message widget.
func NewCollapsedMessage ¶
NewCollapsedMessage creates a new collapsed cozy message.
type MessageWithUser ¶
MessageWithUser extends Message for types that also show user information.
type TypingIndicator ¶
type TypingIndicator struct { *gtk.Revealer // contains filtered or unexported fields }
TypingIndicator is a struct that represents a typing indicator box.
func NewTypingIndicator ¶
func NewTypingIndicator(ctx context.Context, chID discord.ChannelID) *TypingIndicator
NewTypingIndicator creates a new TypingIndicator.
func (*TypingIndicator) AddTyper ¶
func (t *TypingIndicator) AddTyper(userID discord.UserID, when discord.UnixTimestamp)
AddTyper adds a typer to the typing indicator.
func (*TypingIndicator) AddTyperMember ¶
func (t *TypingIndicator) AddTyperMember(userID discord.UserID, when discord.UnixTimestamp, member *discord.Member)
AddTyperMember adds a typer to the typing indicator with a member object.
func (*TypingIndicator) RemoveTyper ¶
func (t *TypingIndicator) RemoveTyper(userID discord.UserID)
RemoveTyper removes a typer from the typing indicator.
type View ¶
type View struct { *adaptive.LoadablePage ToastOverlay *adw.ToastOverlay LoadMore *gtk.Button Scroll *autoscroll.Window List *gtk.ListBox Composer *composer.View TypingIndicator *TypingIndicator // contains filtered or unexported fields }
View is a message view widget.
func NewView ¶
NewView creates a new View widget associated with the given channel ID. All methods call on it will act on that channel.
func (*View) AddReaction ¶
AddReaction adds an reaction to the message with the given ID.
func (*View) ChannelName ¶
ChannelName returns the name of the channel that the message view is displaying for.
func (*View) Delete ¶
Delete deletes the message with the given ID. It may prompt the user to confirm the deletion.
func (*View) EditLastMessage ¶
EditLastMessage implements composer.Controller.
func (*View) GuildID ¶
GuildID returns the guild ID of the channel that the message view is displaying for.
func (*View) HeaderButtons ¶
func (v *View) HeaderButtons() []gtk.Widgetter
HeaderButtons returns the header buttons widget for the message view. This widget is kept on the header bar for as long as the message view is active.
func (*View) IsActive ¶
IsActive returns true if View is active and visible. This implies that the window is focused.
func (*View) MarkRead ¶
func (v *View) MarkRead()
MarkRead marks the view's latest messages as read.
func (*View) ScrollToMessage ¶
ScrollToMessage scrolls to the message with the given ID.
func (*View) SendMessage ¶
func (v *View) SendMessage(sendingMsg composer.SendingMessage)
SendMessage implements composer.Controller.
func (*View) StopReplying ¶
func (v *View) StopReplying()
StopReplying implements composer.Controller.