Documentation ¶
Index ¶
- type ChatDelete
- type ChatInfoChange
- type ChatResync
- type EventMeta
- func (evt *EventMeta) AddLogContext(c zerolog.Context) zerolog.Context
- func (evt *EventMeta) GetPortalKey() networkid.PortalKey
- func (evt *EventMeta) GetSender() bridgev2.EventSender
- func (evt *EventMeta) GetStreamOrder() int64
- func (evt *EventMeta) GetTimestamp() time.Time
- func (evt *EventMeta) GetType() bridgev2.RemoteEventType
- func (evt *EventMeta) PortalReceiverIsUncertain() bool
- func (evt *EventMeta) ShouldCreatePortal() bool
- type MarkUnread
- type Message
- func (evt *Message[T]) ConvertEdit(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, ...) (*bridgev2.ConvertedEdit, error)
- func (evt *Message[T]) ConvertMessage(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI) (*bridgev2.ConvertedMessage, error)
- func (evt *Message[T]) GetID() networkid.MessageID
- func (evt *Message[T]) GetTargetMessage() networkid.MessageID
- func (evt *Message[T]) GetTransactionID() networkid.TransactionID
- func (evt *Message[T]) HandleExisting(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, ...) (bridgev2.UpsertResult, error)
- type MessageRemove
- type Reaction
- type ReactionSync
- type Receipt
- type Typing
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatDelete ¶
ChatDelete is a simple implementation of bridgev2.RemoteChatDelete.
func (*ChatDelete) DeleteOnlyForMe ¶
func (evt *ChatDelete) DeleteOnlyForMe() bool
type ChatInfoChange ¶
type ChatInfoChange struct { EventMeta ChatInfoChange *bridgev2.ChatInfoChange }
ChatInfoChange is a simple implementation of bridgev2.RemoteChatInfoChange.
func (*ChatInfoChange) GetChatInfoChange ¶
func (evt *ChatInfoChange) GetChatInfoChange(ctx context.Context) (*bridgev2.ChatInfoChange, error)
type ChatResync ¶
type ChatResync struct { EventMeta ChatInfo *bridgev2.ChatInfo GetChatInfoFunc func(ctx context.Context, portal *bridgev2.Portal) (*bridgev2.ChatInfo, error) LatestMessageTS time.Time CheckNeedsBackfillFunc func(ctx context.Context, latestMessage *database.Message) (bool, error) BundledBackfillData any }
ChatResync is a simple implementation of bridgev2.RemoteChatResync.
If GetChatInfoFunc is set, it will be used to get the chat info. Otherwise, ChatInfo will be used.
If CheckNeedsBackfillFunc is set, it will be used to determine if backfill is required. Otherwise, the latest database message timestamp is compared to LatestMessageTS.
All four fields are optional.
func (*ChatResync) CheckNeedsBackfill ¶
func (*ChatResync) GetBundledBackfillData ¶
func (evt *ChatResync) GetBundledBackfillData() any
func (*ChatResync) GetChatInfo ¶
type EventMeta ¶
type EventMeta struct { Type bridgev2.RemoteEventType LogContext func(c zerolog.Context) zerolog.Context PortalKey networkid.PortalKey UncertainReceiver bool Sender bridgev2.EventSender CreatePortal bool Timestamp time.Time StreamOrder int64 }
EventMeta is a struct containing metadata fields used by most event types.
func (*EventMeta) AddLogContext ¶
func (*EventMeta) GetPortalKey ¶
func (*EventMeta) GetSender ¶
func (evt *EventMeta) GetSender() bridgev2.EventSender
func (*EventMeta) GetStreamOrder ¶
func (*EventMeta) GetTimestamp ¶
func (*EventMeta) GetType ¶
func (evt *EventMeta) GetType() bridgev2.RemoteEventType
func (*EventMeta) PortalReceiverIsUncertain ¶
func (*EventMeta) ShouldCreatePortal ¶
type MarkUnread ¶
func (*MarkUnread) GetUnread ¶
func (evt *MarkUnread) GetUnread() bool
type Message ¶
type Message[T any] struct { EventMeta Data T ID networkid.MessageID TransactionID networkid.TransactionID TargetMessage networkid.MessageID ConvertMessageFunc func(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, data T) (*bridgev2.ConvertedMessage, error) ConvertEditFunc func(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, existing []*database.Message, data T) (*bridgev2.ConvertedEdit, error) HandleExistingFunc func(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, existing []*database.Message, data T) (bridgev2.UpsertResult, error) }
Message is a simple implementation of bridgev2.RemoteMessage, bridgev2.RemoteEdit and bridgev2.RemoteMessageUpsert.
func (*Message[T]) ConvertEdit ¶
func (*Message[T]) ConvertMessage ¶
func (*Message[T]) GetTargetMessage ¶
func (*Message[T]) GetTransactionID ¶ added in v0.21.0
func (evt *Message[T]) GetTransactionID() networkid.TransactionID
type MessageRemove ¶
func (*MessageRemove) GetTargetMessage ¶
func (evt *MessageRemove) GetTargetMessage() networkid.MessageID
type Reaction ¶
type Reaction struct { EventMeta TargetMessage networkid.MessageID EmojiID networkid.EmojiID Emoji string ExtraContent map[string]any ReactionDBMeta any }
Reaction is a simple implementation of bridgev2.RemoteReaction and bridgev2.RemoteReactionRemove.
func (*Reaction) GetReactionDBMetadata ¶
func (*Reaction) GetReactionEmoji ¶
func (*Reaction) GetReactionExtraContent ¶
func (*Reaction) GetRemovedEmojiID ¶
func (*Reaction) GetTargetMessage ¶
type ReactionSync ¶
type ReactionSync struct { EventMeta TargetMessage networkid.MessageID Reactions *bridgev2.ReactionSyncData }
func (*ReactionSync) GetReactions ¶
func (evt *ReactionSync) GetReactions() *bridgev2.ReactionSyncData
func (*ReactionSync) GetTargetMessage ¶
func (evt *ReactionSync) GetTargetMessage() networkid.MessageID
type Receipt ¶
type Receipt struct { EventMeta LastTarget networkid.MessageID Targets []networkid.MessageID ReadUpTo time.Time }
func (*Receipt) GetLastReceiptTarget ¶
func (*Receipt) GetReadUpTo ¶
func (*Receipt) GetReceiptTargets ¶
type Typing ¶
type Typing struct { EventMeta Timeout time.Duration Type bridgev2.TypingType }
func (*Typing) GetTimeout ¶
func (*Typing) GetTypingType ¶
func (evt *Typing) GetTypingType() bridgev2.TypingType