Documentation
¶
Index ¶
- Constants
- func ConvertHEIF(_ []byte) ([]byte, error)
- func ConvertTIFF(data []byte) ([]byte, error)
- func GetReactionTargetContent(ctx context.Context, raw json.RawMessage) *event.MessageEventContent
- type BeeperLinkPreview
- type ConvertedMessage
- type ExtendedPortalMethods
- type MessageConverter
- func (mc *MessageConverter) BuildTapback(ctx context.Context, msgID uuid.UUID, partInfo imessage.MessagePartInfo, ...) *direct.IMessage
- func (mc *MessageConverter) ConvertRichLinkToBeeper(ctx context.Context, msgID uuid.UUID, richLink *imessage.RichLinkMetadata) (output *BeeperLinkPreview)
- func (mc *MessageConverter) IsPrivateChat(ctx context.Context) bool
- func (mc *MessageConverter) MultipartToIMessage(ctx context.Context, events []*event.Event) (*direct.IMessage, error)
- func (mc *MessageConverter) ToMatrix(ctx context.Context, msg *imessage.Message) []*ConvertedMessage
- func (mc *MessageConverter) ToSMS(ctx context.Context, im *direct.IMessage, id uuid.UUID) (*direct.ReflectedSMS, error)
- func (mc *MessageConverter) ToiMessage(ctx context.Context, evt *event.Event, content *event.MessageEventContent) (*direct.IMessage, error)
- type PortalMethods
Constants ¶
View Source
const ( EffectIDField = "com.beeper.imessage.effect" MessageIDField = "com.beeper.imessage.id" )
View Source
const CanConvertHEIF = false
Variables ¶
This section is empty.
Functions ¶
func ConvertHEIF ¶
func ConvertTIFF ¶
func GetReactionTargetContent ¶
func GetReactionTargetContent(ctx context.Context, raw json.RawMessage) *event.MessageEventContent
Types ¶
type BeeperLinkPreview ¶
type BeeperLinkPreview struct {
MatchedURL string `json:"matched_url"`
CanonicalURL string `json:"og:url,omitempty"`
Title string `json:"og:title,omitempty"`
Type string `json:"og:type,omitempty"`
Description string `json:"og:description,omitempty"`
ImageURL id.ContentURIString `json:"og:image,omitempty"`
ImageEncryption *event.EncryptedFileInfo `json:"beeper:image:encryption,omitempty"`
ImageSize int `json:"matrix:image:size,omitempty"`
ImageWidth int `json:"og:image:width,omitempty"`
ImageHeight int `json:"og:image:height,omitempty"`
ImageType string `json:"og:image:type,omitempty"`
}
type ConvertedMessage ¶
type ConvertedMessage struct {
PartInfo imessage.MessagePartInfo
Type event.Type
Content *event.MessageEventContent
Extra map[string]any
}
type ExtendedPortalMethods ¶
type ExtendedPortalMethods interface {
QueueFileTransfer(ctx context.Context, msgID uuid.UUID, partInfo imessage.MessagePartInfo, fileName string, ad *ids.AttachmentDownloader) (id.ContentURIString, error)
}
type MessageConverter ¶
type MessageConverter struct {
PortalMethods
ConvertHEIF bool
ConvertTIFF bool
ConvertMOV bool
ConvertCAF bool
MaxFileSize int64
AsyncFiles bool
Threads bool
}
func (*MessageConverter) BuildTapback ¶
func (mc *MessageConverter) BuildTapback(ctx context.Context, msgID uuid.UUID, partInfo imessage.MessagePartInfo, tapback imessage.TapbackType, remove bool, originalContent *event.MessageEventContent) *direct.IMessage
func (*MessageConverter) ConvertRichLinkToBeeper ¶
func (mc *MessageConverter) ConvertRichLinkToBeeper(ctx context.Context, msgID uuid.UUID, richLink *imessage.RichLinkMetadata) (output *BeeperLinkPreview)
func (*MessageConverter) IsPrivateChat ¶
func (mc *MessageConverter) IsPrivateChat(ctx context.Context) bool
func (*MessageConverter) MultipartToIMessage ¶
func (*MessageConverter) ToMatrix ¶
func (mc *MessageConverter) ToMatrix(ctx context.Context, msg *imessage.Message) []*ConvertedMessage
func (*MessageConverter) ToSMS ¶
func (mc *MessageConverter) ToSMS(ctx context.Context, im *direct.IMessage, id uuid.UUID) (*direct.ReflectedSMS, error)
func (*MessageConverter) ToiMessage ¶
func (mc *MessageConverter) ToiMessage(ctx context.Context, evt *event.Event, content *event.MessageEventContent) (*direct.IMessage, error)
type PortalMethods ¶
type PortalMethods interface {
UploadMatrixMedia(ctx context.Context, data []byte, fileName, contentType string) (id.ContentURIString, error)
DownloadMatrixMedia(ctx context.Context, uri id.ContentURIString) ([]byte, error)
GetMatrixReply(ctx context.Context, msg *imessage.Message) (threadRoot, replyFallback id.EventID)
GetiMessageThreadRoot(ctx context.Context, content *event.MessageEventContent) string
GetIM() *direct.Connector
GetData(ctx context.Context) *database.Portal
}
Click to show internal directories.
Click to hide internal directories.