Documentation ¶
Index ¶
- Variables
- func RemoveEntityLinkFromText(msgPart *bridgev2.ConvertedMessagePart, indices []int)
- func XMDFromEventMessage(eventMessage *event.XEventMessage) *types.MessageData
- type Config
- type DisplaynameParams
- type PushKeys
- type TwitterClient
- func (tc *TwitterClient) Connect(ctx context.Context)
- func (tc *TwitterClient) ConversationToChatInfo(conv *types.Conversation) *bridgev2.ChatInfo
- func (tc *TwitterClient) ConversationTypeToRoomType(convType types.ConversationType) *database.RoomType
- func (tc *TwitterClient) Disconnect()
- func (tc *TwitterClient) FetchMessages(ctx context.Context, params bridgev2.FetchMessagesParams) (*bridgev2.FetchMessagesResponse, error)
- func (tc *TwitterClient) GetCapabilities(_ context.Context, _ *bridgev2.Portal) *bridgev2.NetworkRoomCapabilities
- func (tc *TwitterClient) GetChatInfo(_ context.Context, portal *bridgev2.Portal) (*bridgev2.ChatInfo, error)
- func (tc *TwitterClient) GetCurrentUser() (user *types.User, err error)
- func (tc *TwitterClient) GetPushConfigs() *bridgev2.PushConfig
- func (tc *TwitterClient) GetUserInfo(_ context.Context, ghost *bridgev2.Ghost) (*bridgev2.UserInfo, error)
- func (tc *TwitterClient) GetUserInfoBridge(userID string) *bridgev2.UserInfo
- func (tc *TwitterClient) HandleMatrixEdit(_ context.Context, edit *bridgev2.MatrixEdit) error
- func (tc *TwitterClient) HandleMatrixMessage(ctx context.Context, msg *bridgev2.MatrixMessage) (message *bridgev2.MatrixMessageResponse, err error)
- func (tc *TwitterClient) HandleMatrixReaction(_ context.Context, msg *bridgev2.MatrixReaction) (reaction *database.Reaction, err error)
- func (tc *TwitterClient) HandleMatrixReactionRemove(_ context.Context, msg *bridgev2.MatrixReactionRemove) error
- func (tc *TwitterClient) HandleMatrixReadReceipt(ctx context.Context, msg *bridgev2.MatrixReadReceipt) error
- func (tc *TwitterClient) HandleMatrixTyping(_ context.Context, msg *bridgev2.MatrixTyping) error
- func (tc *TwitterClient) HandleTwitterEvent(rawEvt any)
- func (tc *TwitterClient) IsLoggedIn() bool
- func (tc *TwitterClient) IsThisUser(_ context.Context, userID networkid.UserID) bool
- func (tc *TwitterClient) LogoutRemote(ctx context.Context)
- func (tc *TwitterClient) MakeAvatar(avatarURL string) *bridgev2.Avatar
- func (tc *TwitterClient) MakePortalKey(conv types.Conversation) networkid.PortalKey
- func (tc *TwitterClient) MakePortalKeyFromID(conversationID string) networkid.PortalKey
- func (tc *TwitterClient) ParticipantToChatMember(participant types.Participant, isFromMe bool) bridgev2.ChatMember
- func (tc *TwitterClient) ParticipantsToMemberList(participants []types.Participant) *bridgev2.ChatMemberList
- func (tc *TwitterClient) PreHandleMatrixReaction(_ context.Context, msg *bridgev2.MatrixReaction) (bridgev2.MatrixReactionPreResponse, error)
- func (tc *TwitterClient) RegisterPushNotifications(ctx context.Context, pushType bridgev2.PushType, token string) error
- func (tc *TwitterClient) ResolveIdentifier(ctx context.Context, identifier string, startChat bool) (*bridgev2.ResolveIdentifierResponse, error)
- func (tc *TwitterClient) TwitterAttachmentToMatrix(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, ...) (*bridgev2.ConvertedMessagePart, []int, error)
- func (tc *TwitterClient) UserToChatMember(user types.User, isFromMe bool) bridgev2.ChatMember
- func (tc *TwitterClient) UsersToMemberList(users []types.User) *bridgev2.ChatMemberList
- type TwitterConnector
- func (tc *TwitterConnector) CreateLogin(_ context.Context, user *bridgev2.User, flowID string) (bridgev2.LoginProcess, error)
- func (tc *TwitterConnector) GetCapabilities() *bridgev2.NetworkGeneralCapabilities
- func (tc *TwitterConnector) GetConfig() (string, any, up.Upgrader)
- func (tc *TwitterConnector) GetDBMetaTypes() database.MetaTypes
- func (tc *TwitterConnector) GetLoginFlows() []bridgev2.LoginFlow
- func (tc *TwitterConnector) GetName() bridgev2.BridgeName
- func (tc *TwitterConnector) Init(bridge *bridgev2.Bridge)
- func (tc *TwitterConnector) LoadUserLogin(ctx context.Context, login *bridgev2.UserLogin) error
- func (tc *TwitterConnector) Start(_ context.Context) error
- type TwitterLogin
- type UserLoginMetadata
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LoginStepIDCookies = "fi.mau.twitter.login.enter_cookies" LoginStepIDComplete = "fi.mau.twitter.login.complete" )
View Source
var ExampleConfig string
View Source
var ( MSG_TYPE_TO_MEDIA_CATEGORY = map[event.MessageType]payload.MediaCategory{ event.MsgVideo: payload.MEDIA_CATEGORY_DM_VIDEO, event.MsgImage: payload.MEDIA_CATEGORY_DM_IMAGE, } )
Functions ¶
func RemoveEntityLinkFromText ¶
func RemoveEntityLinkFromText(msgPart *bridgev2.ConvertedMessagePart, indices []int)
func XMDFromEventMessage ¶
func XMDFromEventMessage(eventMessage *event.XEventMessage) *types.MessageData
Types ¶
type Config ¶
type Config struct { Proxy string `yaml:"proxy"` GetProxyURL string `yaml:"get_proxy_url"` DisplaynameTemplate string `yaml:"displayname_template"` ConversationSyncLimit int `yaml:"conversation_sync_limit"` // contains filtered or unexported fields }
func (*Config) FormatDisplayname ¶
func (*Config) UnmarshalYAML ¶
type DisplaynameParams ¶
type TwitterClient ¶
type TwitterClient struct {
// contains filtered or unexported fields
}
func NewTwitterClient ¶
func NewTwitterClient(ctx context.Context, tc *TwitterConnector, login *bridgev2.UserLogin) *TwitterClient
func (*TwitterClient) Connect ¶
func (tc *TwitterClient) Connect(ctx context.Context)
func (*TwitterClient) ConversationToChatInfo ¶
func (tc *TwitterClient) ConversationToChatInfo(conv *types.Conversation) *bridgev2.ChatInfo
func (*TwitterClient) ConversationTypeToRoomType ¶
func (tc *TwitterClient) ConversationTypeToRoomType(convType types.ConversationType) *database.RoomType
func (*TwitterClient) Disconnect ¶
func (tc *TwitterClient) Disconnect()
func (*TwitterClient) FetchMessages ¶
func (tc *TwitterClient) FetchMessages(ctx context.Context, params bridgev2.FetchMessagesParams) (*bridgev2.FetchMessagesResponse, error)
func (*TwitterClient) GetCapabilities ¶
func (tc *TwitterClient) GetCapabilities(_ context.Context, _ *bridgev2.Portal) *bridgev2.NetworkRoomCapabilities
func (*TwitterClient) GetChatInfo ¶
func (*TwitterClient) GetCurrentUser ¶
func (tc *TwitterClient) GetCurrentUser() (user *types.User, err error)
func (*TwitterClient) GetPushConfigs ¶
func (tc *TwitterClient) GetPushConfigs() *bridgev2.PushConfig
func (*TwitterClient) GetUserInfo ¶
func (*TwitterClient) GetUserInfoBridge ¶
func (tc *TwitterClient) GetUserInfoBridge(userID string) *bridgev2.UserInfo
func (*TwitterClient) HandleMatrixEdit ¶
func (tc *TwitterClient) HandleMatrixEdit(_ context.Context, edit *bridgev2.MatrixEdit) error
func (*TwitterClient) HandleMatrixMessage ¶
func (tc *TwitterClient) HandleMatrixMessage(ctx context.Context, msg *bridgev2.MatrixMessage) (message *bridgev2.MatrixMessageResponse, err error)
func (*TwitterClient) HandleMatrixReaction ¶
func (tc *TwitterClient) HandleMatrixReaction(_ context.Context, msg *bridgev2.MatrixReaction) (reaction *database.Reaction, err error)
func (*TwitterClient) HandleMatrixReactionRemove ¶
func (tc *TwitterClient) HandleMatrixReactionRemove(_ context.Context, msg *bridgev2.MatrixReactionRemove) error
func (*TwitterClient) HandleMatrixReadReceipt ¶
func (tc *TwitterClient) HandleMatrixReadReceipt(ctx context.Context, msg *bridgev2.MatrixReadReceipt) error
func (*TwitterClient) HandleMatrixTyping ¶
func (tc *TwitterClient) HandleMatrixTyping(_ context.Context, msg *bridgev2.MatrixTyping) error
func (*TwitterClient) HandleTwitterEvent ¶
func (tc *TwitterClient) HandleTwitterEvent(rawEvt any)
func (*TwitterClient) IsLoggedIn ¶
func (tc *TwitterClient) IsLoggedIn() bool
func (*TwitterClient) IsThisUser ¶
func (*TwitterClient) LogoutRemote ¶
func (tc *TwitterClient) LogoutRemote(ctx context.Context)
func (*TwitterClient) MakeAvatar ¶
func (tc *TwitterClient) MakeAvatar(avatarURL string) *bridgev2.Avatar
func (*TwitterClient) MakePortalKey ¶
func (tc *TwitterClient) MakePortalKey(conv types.Conversation) networkid.PortalKey
func (*TwitterClient) MakePortalKeyFromID ¶
func (tc *TwitterClient) MakePortalKeyFromID(conversationID string) networkid.PortalKey
func (*TwitterClient) ParticipantToChatMember ¶
func (tc *TwitterClient) ParticipantToChatMember(participant types.Participant, isFromMe bool) bridgev2.ChatMember
func (*TwitterClient) ParticipantsToMemberList ¶
func (tc *TwitterClient) ParticipantsToMemberList(participants []types.Participant) *bridgev2.ChatMemberList
func (*TwitterClient) PreHandleMatrixReaction ¶
func (tc *TwitterClient) PreHandleMatrixReaction(_ context.Context, msg *bridgev2.MatrixReaction) (bridgev2.MatrixReactionPreResponse, error)
func (*TwitterClient) RegisterPushNotifications ¶
func (*TwitterClient) ResolveIdentifier ¶
func (tc *TwitterClient) ResolveIdentifier(ctx context.Context, identifier string, startChat bool) (*bridgev2.ResolveIdentifierResponse, error)
func (*TwitterClient) TwitterAttachmentToMatrix ¶
func (tc *TwitterClient) TwitterAttachmentToMatrix(ctx context.Context, portal *bridgev2.Portal, intent bridgev2.MatrixAPI, attachment *types.Attachment) (*bridgev2.ConvertedMessagePart, []int, error)
func (*TwitterClient) UserToChatMember ¶
func (tc *TwitterClient) UserToChatMember(user types.User, isFromMe bool) bridgev2.ChatMember
func (*TwitterClient) UsersToMemberList ¶
func (tc *TwitterClient) UsersToMemberList(users []types.User) *bridgev2.ChatMemberList
type TwitterConnector ¶
type TwitterConnector struct { Config Config // contains filtered or unexported fields }
func (*TwitterConnector) CreateLogin ¶
func (tc *TwitterConnector) CreateLogin(_ context.Context, user *bridgev2.User, flowID string) (bridgev2.LoginProcess, error)
func (*TwitterConnector) GetCapabilities ¶
func (tc *TwitterConnector) GetCapabilities() *bridgev2.NetworkGeneralCapabilities
func (*TwitterConnector) GetConfig ¶
func (tc *TwitterConnector) GetConfig() (string, any, up.Upgrader)
func (*TwitterConnector) GetDBMetaTypes ¶
func (tc *TwitterConnector) GetDBMetaTypes() database.MetaTypes
func (*TwitterConnector) GetLoginFlows ¶
func (tc *TwitterConnector) GetLoginFlows() []bridgev2.LoginFlow
func (*TwitterConnector) GetName ¶
func (tc *TwitterConnector) GetName() bridgev2.BridgeName
func (*TwitterConnector) Init ¶
func (tc *TwitterConnector) Init(bridge *bridgev2.Bridge)
func (*TwitterConnector) LoadUserLogin ¶
type TwitterLogin ¶
type TwitterLogin struct { User *bridgev2.User Cookies string // contains filtered or unexported fields }
func (*TwitterLogin) Cancel ¶
func (t *TwitterLogin) Cancel()
func (*TwitterLogin) SubmitCookies ¶
type UserLoginMetadata ¶
type UserLoginMetadata struct { Cookies string `json:"cookies"` PushKeys *PushKeys `json:"push_keys,omitempty"` }
func (*UserLoginMetadata) GeneratePushKeys ¶
func (m *UserLoginMetadata) GeneratePushKeys()
Click to show internal directories.
Click to hide internal directories.