Documentation
¶
Index ¶
- func New(ctx context.Context, cfg *config.Config, cred bridge.Credentials, ...) (bridge.Bridger, *matrixclient.Client, error)
- type Matrix
- func (m *Matrix) AddReaction(ctx context.Context, msgID, emoji string) error
- func (m *Matrix) BridgeConfig() *config.BridgeConfig
- func (m *Matrix) Config() any
- func (m *Matrix) Connected() bool
- func (m *Matrix) CreateChannel(ctx context.Context, channelName string, channelType string) (*bridge.ChannelInfo, error)
- func (m *Matrix) DeviceInfo() (string, string)
- func (m *Matrix) DeviceVerified() (bool, error)
- func (m *Matrix) EncryptionEnabled() bool
- func (m *Matrix) FormatterConfig() *config.FormatterConfig
- func (m *Matrix) GetChannel(ctx context.Context, channelID string) (*bridge.ChannelInfo, error)
- func (m *Matrix) GetChannelCount() int
- func (m *Matrix) GetChannelID(ctx context.Context, name, teamID string) string
- func (m *Matrix) GetChannelName(ctx context.Context, channelID string) string
- func (m *Matrix) GetChannelUsers(ctx context.Context, channelID string) ([]*bridge.UserInfo, error)
- func (m *Matrix) GetChannels() []*bridge.ChannelInfo
- func (m *Matrix) GetDMChannelID(ctx context.Context, userID string) string
- func (m *Matrix) GetDMChannelName(userID1 string, userID2 string) string
- func (m *Matrix) GetDMOtherUserID(channelName, myUserID string) (string, bool)
- func (m *Matrix) GetDMUser(ctx context.Context, channelName string) *bridge.UserInfo
- func (m *Matrix) GetDMUserIDs(channelName string) (string, string, bool)
- func (m *Matrix) GetFilesInfo(ctx context.Context, fileIDs []string) []*bridge.File
- func (m *Matrix) GetLastSentMsgs() []string
- func (m *Matrix) GetLastViewedAt(ctx context.Context, channelID string) int64
- func (m *Matrix) GetMe() *bridge.UserInfo
- func (m *Matrix) GetPostChannelID(ctx context.Context, postID string) string
- func (m *Matrix) GetPostSizeLimit() int
- func (m *Matrix) GetPostThread(ctx context.Context, postID string) []*bridge.Event
- func (m *Matrix) GetPosts(ctx context.Context, channelID string, limit int) []*bridge.Event
- func (m *Matrix) GetPostsSince(ctx context.Context, channelID string, since int64) []*bridge.Event
- func (m *Matrix) GetReplayEvents(ctx context.Context, channelID string, since int64) []*bridge.Event
- func (m *Matrix) GetSyncReplayEvents(ctx context.Context, channelID string, since int64, reconnect bool) []*bridge.Event
- func (m *Matrix) GetTeamName(ctx context.Context, teamID string) string
- func (m *Matrix) GetUser(ctx context.Context, userID string) *bridge.UserInfo
- func (m *Matrix) GetUserByUsername(ctx context.Context, username string) *bridge.UserInfo
- func (m *Matrix) GetUserChannels(ctx context.Context, userID string) ([]string, error)
- func (m *Matrix) GetUserCount() int
- func (m *Matrix) GetUsers() []*bridge.UserInfo
- func (m *Matrix) HasCustomStatus(userID string) bool
- func (m *Matrix) Invite(ctx context.Context, channelID, username string) error
- func (m *Matrix) IsChannelMember(channelID string) bool
- func (m *Matrix) IsDMChannelName(channelName string) bool
- func (m *Matrix) IsOnline(status string) bool
- func (m *Matrix) Join(ctx context.Context, channelName string) (string, string, error)
- func (m *Matrix) Kick(ctx context.Context, channelID, username string) error
- func (m *Matrix) List(ctx context.Context) (map[string]string, error)
- func (m *Matrix) Logout(ctx context.Context) error
- func (m *Matrix) ModifyPost(ctx context.Context, msgID, text string) error
- func (m *Matrix) MsgChannel(ctx context.Context, channelID, text string) (string, error)
- func (m *Matrix) MsgChannelThread(ctx context.Context, channelID, parentID, text string) (string, error)
- func (m *Matrix) MsgUser(ctx context.Context, userID, text string) (string, error)
- func (m *Matrix) MsgUserThread(ctx context.Context, userID, parentID, text string) (string, error)
- func (m *Matrix) Nick(ctx context.Context, name string) error
- func (m *Matrix) NickAllowsColon() bool
- func (m *Matrix) NormalizePostID(msgID string) string
- func (m *Matrix) OnEdit(e *matrixclient.Edit)
- func (m *Matrix) OnInvite(invite *matrixclient.Invitation)
- func (m *Matrix) OnMember(c *matrixclient.MemberChange)
- func (m *Matrix) OnMessage(msg *matrixclient.Message)
- func (m *Matrix) OnPin(p *matrixclient.PinChange)
- func (m *Matrix) OnPresence(p *matrixclient.PresenceChange)
- func (m *Matrix) OnReaction(r *matrixclient.Reaction)
- func (m *Matrix) OnReconnect(downtime time.Duration)
- func (m *Matrix) OnReconnectInfo(info matrixclient.ReconnectInfo)
- func (m *Matrix) OnRedaction(r *matrixclient.Redaction)
- func (m *Matrix) OnRoomName(r *matrixclient.RoomRename)
- func (m *Matrix) OnTopic(t *matrixclient.TopicChange)
- func (m *Matrix) OnTyping(t *matrixclient.Typing)
- func (m *Matrix) OnVerification(v *matrixclient.Verification)
- func (m *Matrix) Part(ctx context.Context, channelID string) error
- func (m *Matrix) Ping(ctx context.Context, proto ...string) error
- func (m *Matrix) Protocol() string
- func (m *Matrix) Ready()
- func (m *Matrix) RemoveReaction(ctx context.Context, msgID, emoji string) error
- func (m *Matrix) ReplayHidesHistory(channelID string) bool
- func (m *Matrix) SearchPosts(ctx context.Context, search string) []*bridge.Event
- func (m *Matrix) SearchUsers(ctx context.Context, query string) ([]*bridge.UserInfo, error)
- func (m *Matrix) SendTyping(ctx context.Context, channelName string)
- func (m *Matrix) SetStatus(ctx context.Context, status string) error
- func (m *Matrix) SetTopic(ctx context.Context, channelID, text string) error
- func (m *Matrix) StatusUser(ctx context.Context, userID string) (string, error)
- func (m *Matrix) StatusUsers(ctx context.Context) (map[string]string, error)
- func (m *Matrix) Topic(ctx context.Context, channelID string) string
- func (m *Matrix) UpdateChannels(ctx context.Context) error
- func (m *Matrix) UpdateLastViewed(ctx context.Context, channelID string)
- func (m *Matrix) UpdateLastViewedUser(ctx context.Context, userID string) error
- func (m *Matrix) UserDetails(ctx context.Context, userID string) (string, bool)
- func (m *Matrix) Verify(ctx context.Context, action, user string) (string, error)
- func (m *Matrix) WaitReady(ctx context.Context) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Matrix ¶
type Matrix struct {
// contains filtered or unexported fields
}
func (*Matrix) AddReaction ¶
func (*Matrix) BridgeConfig ¶
func (m *Matrix) BridgeConfig() *config.BridgeConfig
func (*Matrix) CreateChannel ¶
func (*Matrix) DeviceInfo ¶
DeviceInfo returns the device ID and Ed25519 fingerprint to verify this session manually from another client.
func (*Matrix) DeviceVerified ¶
DeviceVerified reports whether this session is verified or cross-signed. A non-nil error means the state could not be determined.
func (*Matrix) EncryptionEnabled ¶
EncryptionEnabled reports whether this session can use encrypted rooms.
func (*Matrix) FormatterConfig ¶
func (m *Matrix) FormatterConfig() *config.FormatterConfig
func (*Matrix) GetChannel ¶
func (*Matrix) GetChannelCount ¶
func (*Matrix) GetChannelID ¶
func (*Matrix) GetChannelName ¶
func (*Matrix) GetChannelUsers ¶
func (*Matrix) GetChannels ¶
func (m *Matrix) GetChannels() []*bridge.ChannelInfo
func (*Matrix) GetDMChannelID ¶
func (*Matrix) GetDMChannelName ¶
GetDMChannelName returns the room ID, which GetChannelID resolves again.
func (*Matrix) GetDMOtherUserID ¶
func (*Matrix) GetDMUserIDs ¶
func (*Matrix) GetFilesInfo ¶
GetFilesInfo takes mxc:// URIs as file IDs.
func (*Matrix) GetLastSentMsgs ¶
func (*Matrix) GetLastViewedAt ¶
GetLastViewedAt returns the time of the event our read marker points to, 0 if unknown.
func (*Matrix) GetPostChannelID ¶
func (*Matrix) GetPostSizeLimit ¶
func (*Matrix) GetPostThread ¶
func (*Matrix) GetPostsSince ¶
func (*Matrix) GetReplayEvents ¶
func (*Matrix) GetSyncReplayEvents ¶
func (m *Matrix) GetSyncReplayEvents(ctx context.Context, channelID string, since int64, reconnect bool) []*bridge.Event
GetSyncReplayEvents returns history for startup or reconnect channel sync. On reconnect, Matrix /sync already delivers missed events unless a room's timeline was truncated, so only truncated rooms fetch older history (from their prev_batch token), and events already queued via /sync are skipped.
func (*Matrix) GetTeamName ¶
func (*Matrix) GetUserByUsername ¶
func (*Matrix) GetUserChannels ¶
func (*Matrix) GetUserCount ¶
func (*Matrix) HasCustomStatus ¶
func (*Matrix) IsChannelMember ¶
func (*Matrix) IsDMChannelName ¶
func (*Matrix) ModifyPost ¶
func (*Matrix) MsgChannel ¶
func (*Matrix) MsgChannelThread ¶
func (*Matrix) MsgUserThread ¶
func (*Matrix) NickAllowsColon ¶
NickAllowsColon reports whether nicks may contain ':', so sanitizeNick must keep it.
func (*Matrix) NormalizePostID ¶
func (*Matrix) OnEdit ¶
func (m *Matrix) OnEdit(e *matrixclient.Edit)
OnEdit implements matrixclient.EditHandler.
func (*Matrix) OnInvite ¶
func (m *Matrix) OnInvite(invite *matrixclient.Invitation)
OnInvite implements matrixclient.InviteHandler.
func (*Matrix) OnMember ¶
func (m *Matrix) OnMember(c *matrixclient.MemberChange)
OnMember implements matrixclient.MemberHandler.
func (*Matrix) OnMessage ¶
func (m *Matrix) OnMessage(msg *matrixclient.Message)
OnMessage implements matrixclient.Handler.
func (*Matrix) OnPin ¶
func (m *Matrix) OnPin(p *matrixclient.PinChange)
OnPin implements matrixclient.PinHandler.
func (*Matrix) OnPresence ¶
func (m *Matrix) OnPresence(p *matrixclient.PresenceChange)
OnPresence implements matrixclient.PresenceHandler.
func (*Matrix) OnReaction ¶
func (m *Matrix) OnReaction(r *matrixclient.Reaction)
OnReaction implements matrixclient.Handler.
func (*Matrix) OnReconnect ¶
OnReconnect implements matrixclient.ReconnectHandler.
func (*Matrix) OnReconnectInfo ¶
func (m *Matrix) OnReconnectInfo(info matrixclient.ReconnectInfo)
OnReconnectInfo implements matrixclient.ReconnectInfoHandler.
func (*Matrix) OnRedaction ¶
func (m *Matrix) OnRedaction(r *matrixclient.Redaction)
OnRedaction implements matrixclient.RedactionHandler.
func (*Matrix) OnRoomName ¶
func (m *Matrix) OnRoomName(r *matrixclient.RoomRename)
OnRoomName implements matrixclient.RoomNameHandler.
func (*Matrix) OnTopic ¶
func (m *Matrix) OnTopic(t *matrixclient.TopicChange)
OnTopic implements matrixclient.TopicHandler.
func (*Matrix) OnTyping ¶
func (m *Matrix) OnTyping(t *matrixclient.Typing)
OnTyping implements matrixclient.TypingHandler.
func (*Matrix) OnVerification ¶
func (m *Matrix) OnVerification(v *matrixclient.Verification)
OnVerification implements matrixclient.VerificationHandler. It must not block or call verification methods, as the engine may hold its transaction lock.
func (*Matrix) RemoveReaction ¶
func (*Matrix) ReplayHidesHistory ¶
ReplayHidesHistory reports whether replay can't show the history of a room: encrypted events aren't fetched, so marking the room read afterwards would acknowledge unseen messages.
func (*Matrix) SearchPosts ¶
func (*Matrix) SearchUsers ¶
func (*Matrix) StatusUser ¶
func (*Matrix) StatusUsers ¶
func (*Matrix) UpdateLastViewed ¶
func (*Matrix) UpdateLastViewedUser ¶
func (*Matrix) UserDetails ¶
UserDetails returns the avatar URL and whether the user is verified, for WHOIS.