Documentation ¶
Index ¶
- Constants
- Variables
- type BackfillCollector
- type Config
- type DisplaynameParams
- type EnsureWAChatStateEvent
- func (evt *EnsureWAChatStateEvent) AddLogContext(c zerolog.Context) zerolog.Context
- func (evt *EnsureWAChatStateEvent) GetChatInfo(ctx context.Context, portal *bridgev2.Portal) (*bridgev2.ChatInfo, error)
- func (evt *EnsureWAChatStateEvent) GetPortalKey() networkid.PortalKey
- func (evt *EnsureWAChatStateEvent) GetSender() bridgev2.EventSender
- func (evt *EnsureWAChatStateEvent) GetType() bridgev2.RemoteEventType
- func (evt *EnsureWAChatStateEvent) ShouldCreatePortal() bool
- type FBChatResync
- func (r *FBChatResync) AddLogContext(c zerolog.Context) zerolog.Context
- func (r *FBChatResync) CheckNeedsBackfill(ctx context.Context, lastMessage *database.Message) (bool, error)
- func (r *FBChatResync) GetBundledBackfillData() any
- func (r *FBChatResync) GetChatInfo(ctx context.Context, portal *bridgev2.Portal) (*bridgev2.ChatInfo, error)
- func (r *FBChatResync) GetPortalKey() networkid.PortalKey
- func (r *FBChatResync) GetSender() bridgev2.EventSender
- func (r *FBChatResync) GetType() bridgev2.RemoteEventType
- func (r *FBChatResync) ShouldCreatePortal() bool
- type FBEditEvent
- func (evt *FBEditEvent) AddLogContext(c zerolog.Context) zerolog.Context
- func (evt *FBEditEvent) ConvertEdit(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, ...) (*bridgev2.ConvertedEdit, error)
- func (evt *FBEditEvent) GetPortalKey() networkid.PortalKey
- func (evt *FBEditEvent) GetSender() bridgev2.EventSender
- func (evt *FBEditEvent) GetTargetMessage() networkid.MessageID
- func (evt *FBEditEvent) GetType() bridgev2.RemoteEventType
- type FBMessageEvent
- func (evt *FBMessageEvent) AddLogContext(c zerolog.Context) zerolog.Context
- func (evt *FBMessageEvent) ConvertMessage(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI) (*bridgev2.ConvertedMessage, error)
- func (evt *FBMessageEvent) GetID() networkid.MessageID
- func (evt *FBMessageEvent) GetPortalKey() networkid.PortalKey
- func (evt *FBMessageEvent) GetSender() bridgev2.EventSender
- func (evt *FBMessageEvent) GetTimestamp() time.Time
- func (evt *FBMessageEvent) GetType() bridgev2.RemoteEventType
- func (evt *FBMessageEvent) PortalReceiverIsUncertain() bool
- type MetaClient
- func (m *MetaClient) Connect(ctx context.Context) error
- func (m *MetaClient) Disconnect()
- func (m *MetaClient) FetchMessages(ctx context.Context, params bridgev2.FetchMessagesParams) (*bridgev2.FetchMessagesResponse, error)
- func (m *MetaClient) FillBridgeState(state status.BridgeState) status.BridgeState
- func (m *MetaClient) FullReconnect()
- func (m *MetaClient) GetCapabilities(ctx context.Context, portal *bridgev2.Portal) *bridgev2.NetworkRoomCapabilities
- func (m *MetaClient) GetChatInfo(ctx context.Context, portal *bridgev2.Portal) (*bridgev2.ChatInfo, error)
- func (m *MetaClient) GetUserInfo(ctx context.Context, ghost *bridgev2.Ghost) (*bridgev2.UserInfo, error)
- func (m *MetaClient) HandleMatrixEdit(ctx context.Context, edit *bridgev2.MatrixEdit) error
- func (m *MetaClient) HandleMatrixMessage(ctx context.Context, msg *bridgev2.MatrixMessage) (*bridgev2.MatrixMessageResponse, error)
- func (m *MetaClient) HandleMatrixMessageRemove(ctx context.Context, msg *bridgev2.MatrixMessageRemove) error
- func (m *MetaClient) HandleMatrixReaction(ctx context.Context, msg *bridgev2.MatrixReaction) (*database.Reaction, error)
- func (m *MetaClient) HandleMatrixReactionRemove(ctx context.Context, msg *bridgev2.MatrixReactionRemove) error
- func (m *MetaClient) HandleMatrixReadReceipt(ctx context.Context, receipt *bridgev2.MatrixReadReceipt) error
- func (m *MetaClient) IsLoggedIn() bool
- func (m *MetaClient) IsThisUser(ctx context.Context, userID networkid.UserID) bool
- func (m *MetaClient) LogoutRemote(ctx context.Context)
- func (m *MetaClient) PreHandleMatrixReaction(ctx context.Context, msg *bridgev2.MatrixReaction) (bridgev2.MatrixReactionPreResponse, error)
- func (m *MetaClient) ResolveIdentifier(ctx context.Context, identifier string, createChat bool) (*bridgev2.ResolveIdentifierResponse, error)
- func (m *MetaClient) SearchUsers(ctx context.Context, search string) ([]*bridgev2.ResolveIdentifierResponse, error)
- type MetaConnector
- func (m *MetaConnector) CreateLogin(ctx context.Context, user *bridgev2.User, flowID string) (bridgev2.LoginProcess, error)
- func (m *MetaConnector) GetCapabilities() *bridgev2.NetworkGeneralCapabilities
- func (m *MetaConnector) GetConfig() (string, any, up.Upgrader)
- func (m *MetaConnector) GetDBMetaTypes() database.MetaTypes
- func (m *MetaConnector) GetLoginFlows() []bridgev2.LoginFlow
- func (m *MetaConnector) GetName() bridgev2.BridgeName
- func (m *MetaConnector) Init(bridge *bridgev2.Bridge)
- func (m *MetaConnector) LoadUserLogin(ctx context.Context, login *bridgev2.UserLogin) error
- func (m *MetaConnector) SetMaxFileSize(maxSize int64)
- func (m *MetaConnector) Start(ctx context.Context) error
- func (m *MetaConnector) ValidateConfig() error
- func (m *MetaConnector) ValidateUserID(id networkid.UserID) bool
- type MetaCookieLogin
- type ThreadKeyable
- type VerifyThreadExistsEvent
- func (evt *VerifyThreadExistsEvent) AddLogContext(c zerolog.Context) zerolog.Context
- func (evt *VerifyThreadExistsEvent) GetChatInfo(ctx context.Context, portal *bridgev2.Portal) (*bridgev2.ChatInfo, error)
- func (evt *VerifyThreadExistsEvent) GetPortalKey() networkid.PortalKey
- func (evt *VerifyThreadExistsEvent) GetSender() bridgev2.EventSender
- func (evt *VerifyThreadExistsEvent) GetType() bridgev2.RemoteEventType
- func (evt *VerifyThreadExistsEvent) ShouldCreatePortal() bool
- type WAMessageEvent
- func (evt *WAMessageEvent) AddLogContext(c zerolog.Context) zerolog.Context
- func (evt *WAMessageEvent) ConvertEdit(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, ...) (*bridgev2.ConvertedEdit, error)
- func (evt *WAMessageEvent) ConvertMessage(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI) (*bridgev2.ConvertedMessage, error)
- func (evt *WAMessageEvent) GetID() networkid.MessageID
- func (evt *WAMessageEvent) GetPortalKey() networkid.PortalKey
- func (evt *WAMessageEvent) GetReactionEmoji() (string, networkid.EmojiID)
- func (evt *WAMessageEvent) GetRemovedEmojiID() networkid.EmojiID
- func (evt *WAMessageEvent) GetSender() bridgev2.EventSender
- func (evt *WAMessageEvent) GetTargetMessage() networkid.MessageID
- func (evt *WAMessageEvent) GetTimestamp() time.Time
- func (evt *WAMessageEvent) GetType() bridgev2.RemoteEventType
Constants ¶
View Source
const ( WADisconnected status.BridgeStateErrorCode = "wa-transient-disconnect" WAPermanentError status.BridgeStateErrorCode = "wa-unknown-permanent-error" WACATError status.BridgeStateErrorCode = "wa-cat-refresh-error" MetaPermanentError status.BridgeStateErrorCode = "meta-unknown-permanent-error" MetaCookieRemoved status.BridgeStateErrorCode = "meta-cookie-removed" MetaNotLoggedIn status.BridgeStateErrorCode = "meta-not-logged-in" MetaConnectError status.BridgeStateErrorCode = "meta-connect-error" MetaTransientDisconnect status.BridgeStateErrorCode = "meta-transient-disconnect" IGChallengeRequired status.BridgeStateErrorCode = "ig-challenge-required" IGChallengeRequiredMaybe status.BridgeStateErrorCode = "ig-challenge-required-maybe" IGAccountSuspended status.BridgeStateErrorCode = "ig-account-suspended" IGConsentRequired status.BridgeStateErrorCode = "ig-consent-required" FBConsentRequired status.BridgeStateErrorCode = "fb-consent-required" )
View Source
const ( FlowIDFacebookCookies = "cookies-facebook" FlowIDMessengerCookies = "cookies-messenger" FlowIDInstagramCookies = "cookies-instagram" LoginStepIDCookies = "fi.mau.meta.cookies" LoginStepIDComplete = "fi.mau.meta.complete" )
View Source
const ConnectWaitTimeout = 1 * time.Minute
Variables ¶
View Source
var ( ErrServerRejectedMessage = bridgev2.WrapErrorInStatus(errors.New("server rejected message")).WithErrorAsMessage().WithSendNotice(true) ErrNotConnected = bridgev2.WrapErrorInStatus(errors.New("not connected")).WithErrorAsMessage().WithSendNotice(true) )
View Source
var ( ErrLoginMissingCookies = bridgev2.RespError{ErrCode: "FI.MAU.META_MISSING_COOKIES", Err: "Missing cookies", StatusCode: http.StatusBadRequest} ErrLoginChallenge = bridgev2.RespError{ErrCode: "FI.MAU.META_CHALLENGE_ERROR", Err: "Challenge required, please check the official website or app and then try again", StatusCode: http.StatusBadRequest} ErrLoginConsent = bridgev2.RespError{ErrCode: "FI.MAU.META_CONSENT_ERROR", Err: "Consent required, please check the official website or app and then try again", StatusCode: http.StatusBadRequest} ErrLoginTokenInvalidated = bridgev2.RespError{ErrCode: "FI.MAU.META_TOKEN_ERROR", Err: "Got logged out immediately", StatusCode: http.StatusBadRequest} ErrLoginUnknown = bridgev2.RespError{ErrCode: "M_UNKNOWN", Err: "Internal error logging in", StatusCode: http.StatusInternalServerError} )
View Source
var ExampleConfig string
Functions ¶
This section is empty.
Types ¶
type BackfillCollector ¶
type Config ¶
type Config struct { RawMode string `yaml:"mode"` Mode types.Platform `yaml:"-"` IGE2EE bool `yaml:"ig_e2ee"` Proxy string `yaml:"proxy"` GetProxyFrom string `yaml:"get_proxy_from"` DisableXMABackfill bool `yaml:"disable_xma_backfill"` DisableXMAAlways bool `yaml:"disable_xma_always"` MinFullReconnectIntervalSeconds int `yaml:"min_full_reconnect_interval_seconds"` ForceRefreshIntervalSeconds int `yaml:"force_refresh_interval_seconds"` DisplaynameTemplate string `yaml:"displayname_template"` // contains filtered or unexported fields }
func (*Config) FormatDisplayname ¶
func (c *Config) FormatDisplayname(params DisplaynameParams) string
func (*Config) UnmarshalYAML ¶
type DisplaynameParams ¶
type EnsureWAChatStateEvent ¶
func (*EnsureWAChatStateEvent) AddLogContext ¶
func (evt *EnsureWAChatStateEvent) AddLogContext(c zerolog.Context) zerolog.Context
func (*EnsureWAChatStateEvent) GetChatInfo ¶
func (*EnsureWAChatStateEvent) GetPortalKey ¶
func (evt *EnsureWAChatStateEvent) GetPortalKey() networkid.PortalKey
func (*EnsureWAChatStateEvent) GetSender ¶
func (evt *EnsureWAChatStateEvent) GetSender() bridgev2.EventSender
func (*EnsureWAChatStateEvent) GetType ¶
func (evt *EnsureWAChatStateEvent) GetType() bridgev2.RemoteEventType
func (*EnsureWAChatStateEvent) ShouldCreatePortal ¶
func (evt *EnsureWAChatStateEvent) ShouldCreatePortal() bool
type FBChatResync ¶
type FBChatResync struct { Raw *table.LSDeleteThenInsertThread PortalKey networkid.PortalKey Info *bridgev2.ChatInfo Members map[int64]bridgev2.ChatMember Backfill *table.UpsertMessages UpsertID int64 // contains filtered or unexported fields }
func (*FBChatResync) AddLogContext ¶
func (r *FBChatResync) AddLogContext(c zerolog.Context) zerolog.Context
func (*FBChatResync) CheckNeedsBackfill ¶
func (*FBChatResync) GetBundledBackfillData ¶
func (r *FBChatResync) GetBundledBackfillData() any
func (*FBChatResync) GetChatInfo ¶
func (*FBChatResync) GetPortalKey ¶
func (r *FBChatResync) GetPortalKey() networkid.PortalKey
func (*FBChatResync) GetSender ¶
func (r *FBChatResync) GetSender() bridgev2.EventSender
func (*FBChatResync) GetType ¶
func (r *FBChatResync) GetType() bridgev2.RemoteEventType
func (*FBChatResync) ShouldCreatePortal ¶
func (r *FBChatResync) ShouldCreatePortal() bool
type FBEditEvent ¶
type FBEditEvent struct { *table.LSEditMessage // contains filtered or unexported fields }
func (*FBEditEvent) AddLogContext ¶
func (evt *FBEditEvent) AddLogContext(c zerolog.Context) zerolog.Context
func (*FBEditEvent) ConvertEdit ¶
func (*FBEditEvent) GetPortalKey ¶
func (evt *FBEditEvent) GetPortalKey() networkid.PortalKey
func (*FBEditEvent) GetSender ¶
func (evt *FBEditEvent) GetSender() bridgev2.EventSender
func (*FBEditEvent) GetTargetMessage ¶
func (evt *FBEditEvent) GetTargetMessage() networkid.MessageID
func (*FBEditEvent) GetType ¶
func (evt *FBEditEvent) GetType() bridgev2.RemoteEventType
type FBMessageEvent ¶
type FBMessageEvent struct { *table.WrappedMessage // contains filtered or unexported fields }
func (*FBMessageEvent) AddLogContext ¶
func (evt *FBMessageEvent) AddLogContext(c zerolog.Context) zerolog.Context
func (*FBMessageEvent) ConvertMessage ¶
func (evt *FBMessageEvent) ConvertMessage(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI) (*bridgev2.ConvertedMessage, error)
func (*FBMessageEvent) GetID ¶
func (evt *FBMessageEvent) GetID() networkid.MessageID
func (*FBMessageEvent) GetPortalKey ¶
func (evt *FBMessageEvent) GetPortalKey() networkid.PortalKey
func (*FBMessageEvent) GetSender ¶
func (evt *FBMessageEvent) GetSender() bridgev2.EventSender
func (*FBMessageEvent) GetTimestamp ¶
func (evt *FBMessageEvent) GetTimestamp() time.Time
func (*FBMessageEvent) GetType ¶
func (evt *FBMessageEvent) GetType() bridgev2.RemoteEventType
func (*FBMessageEvent) PortalReceiverIsUncertain ¶
func (evt *FBMessageEvent) PortalReceiverIsUncertain() bool
type MetaClient ¶
type MetaClient struct { Main *MetaConnector Client *messagix.Client LoginMeta *metaid.UserLoginMetadata UserLogin *bridgev2.UserLogin Ghost *bridgev2.Ghost E2EEClient *whatsmeow.Client WADevice *store.Device // contains filtered or unexported fields }
func (*MetaClient) Disconnect ¶
func (m *MetaClient) Disconnect()
func (*MetaClient) FetchMessages ¶
func (m *MetaClient) FetchMessages(ctx context.Context, params bridgev2.FetchMessagesParams) (*bridgev2.FetchMessagesResponse, error)
func (*MetaClient) FillBridgeState ¶
func (m *MetaClient) FillBridgeState(state status.BridgeState) status.BridgeState
func (*MetaClient) FullReconnect ¶
func (m *MetaClient) FullReconnect()
func (*MetaClient) GetCapabilities ¶
func (m *MetaClient) GetCapabilities(ctx context.Context, portal *bridgev2.Portal) *bridgev2.NetworkRoomCapabilities
func (*MetaClient) GetChatInfo ¶
func (*MetaClient) GetUserInfo ¶
func (*MetaClient) HandleMatrixEdit ¶
func (m *MetaClient) HandleMatrixEdit(ctx context.Context, edit *bridgev2.MatrixEdit) error
func (*MetaClient) HandleMatrixMessage ¶
func (m *MetaClient) HandleMatrixMessage(ctx context.Context, msg *bridgev2.MatrixMessage) (*bridgev2.MatrixMessageResponse, error)
func (*MetaClient) HandleMatrixMessageRemove ¶
func (m *MetaClient) HandleMatrixMessageRemove(ctx context.Context, msg *bridgev2.MatrixMessageRemove) error
func (*MetaClient) HandleMatrixReaction ¶
func (m *MetaClient) HandleMatrixReaction(ctx context.Context, msg *bridgev2.MatrixReaction) (*database.Reaction, error)
func (*MetaClient) HandleMatrixReactionRemove ¶
func (m *MetaClient) HandleMatrixReactionRemove(ctx context.Context, msg *bridgev2.MatrixReactionRemove) error
func (*MetaClient) HandleMatrixReadReceipt ¶
func (m *MetaClient) HandleMatrixReadReceipt(ctx context.Context, receipt *bridgev2.MatrixReadReceipt) error
func (*MetaClient) IsLoggedIn ¶
func (m *MetaClient) IsLoggedIn() bool
func (*MetaClient) IsThisUser ¶
func (*MetaClient) LogoutRemote ¶
func (m *MetaClient) LogoutRemote(ctx context.Context)
func (*MetaClient) PreHandleMatrixReaction ¶
func (m *MetaClient) PreHandleMatrixReaction(ctx context.Context, msg *bridgev2.MatrixReaction) (bridgev2.MatrixReactionPreResponse, error)
func (*MetaClient) ResolveIdentifier ¶
func (m *MetaClient) ResolveIdentifier(ctx context.Context, identifier string, createChat bool) (*bridgev2.ResolveIdentifierResponse, error)
func (*MetaClient) SearchUsers ¶
func (m *MetaClient) SearchUsers(ctx context.Context, search string) ([]*bridgev2.ResolveIdentifierResponse, error)
type MetaConnector ¶
type MetaConnector struct { Bridge *bridgev2.Bridge Config Config MsgConv *msgconv.MessageConverter DeviceStore *sqlstore.Container DB *metadb.MetaDB }
func (*MetaConnector) CreateLogin ¶
func (m *MetaConnector) CreateLogin(ctx context.Context, user *bridgev2.User, flowID string) (bridgev2.LoginProcess, error)
func (*MetaConnector) GetCapabilities ¶
func (m *MetaConnector) GetCapabilities() *bridgev2.NetworkGeneralCapabilities
func (*MetaConnector) GetDBMetaTypes ¶
func (m *MetaConnector) GetDBMetaTypes() database.MetaTypes
func (*MetaConnector) GetLoginFlows ¶
func (m *MetaConnector) GetLoginFlows() []bridgev2.LoginFlow
func (*MetaConnector) GetName ¶
func (m *MetaConnector) GetName() bridgev2.BridgeName
func (*MetaConnector) Init ¶
func (m *MetaConnector) Init(bridge *bridgev2.Bridge)
func (*MetaConnector) LoadUserLogin ¶
func (*MetaConnector) SetMaxFileSize ¶
func (m *MetaConnector) SetMaxFileSize(maxSize int64)
func (*MetaConnector) ValidateConfig ¶
func (m *MetaConnector) ValidateConfig() error
func (*MetaConnector) ValidateUserID ¶
func (m *MetaConnector) ValidateUserID(id networkid.UserID) bool
type MetaCookieLogin ¶
type MetaCookieLogin struct { Mode types.Platform User *bridgev2.User Main *MetaConnector }
func (*MetaCookieLogin) Cancel ¶
func (m *MetaCookieLogin) Cancel()
func (*MetaCookieLogin) SubmitCookies ¶
type ThreadKeyable ¶
type ThreadKeyable interface {
GetThreadKey() int64
}
type VerifyThreadExistsEvent ¶
type VerifyThreadExistsEvent struct { *table.LSVerifyThreadExists // contains filtered or unexported fields }
func (*VerifyThreadExistsEvent) AddLogContext ¶
func (evt *VerifyThreadExistsEvent) AddLogContext(c zerolog.Context) zerolog.Context
func (*VerifyThreadExistsEvent) GetChatInfo ¶
func (*VerifyThreadExistsEvent) GetPortalKey ¶
func (evt *VerifyThreadExistsEvent) GetPortalKey() networkid.PortalKey
func (*VerifyThreadExistsEvent) GetSender ¶
func (evt *VerifyThreadExistsEvent) GetSender() bridgev2.EventSender
func (*VerifyThreadExistsEvent) GetType ¶
func (evt *VerifyThreadExistsEvent) GetType() bridgev2.RemoteEventType
func (*VerifyThreadExistsEvent) ShouldCreatePortal ¶
func (evt *VerifyThreadExistsEvent) ShouldCreatePortal() bool
type WAMessageEvent ¶
func (*WAMessageEvent) AddLogContext ¶
func (evt *WAMessageEvent) AddLogContext(c zerolog.Context) zerolog.Context
func (*WAMessageEvent) ConvertEdit ¶
func (*WAMessageEvent) ConvertMessage ¶
func (evt *WAMessageEvent) ConvertMessage(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI) (*bridgev2.ConvertedMessage, error)
func (*WAMessageEvent) GetID ¶
func (evt *WAMessageEvent) GetID() networkid.MessageID
func (*WAMessageEvent) GetPortalKey ¶
func (evt *WAMessageEvent) GetPortalKey() networkid.PortalKey
func (*WAMessageEvent) GetReactionEmoji ¶
func (evt *WAMessageEvent) GetReactionEmoji() (string, networkid.EmojiID)
func (*WAMessageEvent) GetRemovedEmojiID ¶
func (evt *WAMessageEvent) GetRemovedEmojiID() networkid.EmojiID
func (*WAMessageEvent) GetSender ¶
func (evt *WAMessageEvent) GetSender() bridgev2.EventSender
func (*WAMessageEvent) GetTargetMessage ¶
func (evt *WAMessageEvent) GetTargetMessage() networkid.MessageID
func (*WAMessageEvent) GetTimestamp ¶
func (evt *WAMessageEvent) GetTimestamp() time.Time
func (*WAMessageEvent) GetType ¶
func (evt *WAMessageEvent) GetType() bridgev2.RemoteEventType
Click to show internal directories.
Click to hide internal directories.