Documentation
¶
Index ¶
- Variables
- func CanConvertSignal(dm *signalpb.DataMessage) bool
- type BeeperLinkPreview
- type ConvertedMessage
- type ConvertedMessagePart
- type ExtendedPortalMethods
- type MessageConverter
- func (mc *MessageConverter) ConvertDisappearingTimerChangeToMatrix(ctx context.Context, timer uint32, updatePortal bool) *ConvertedMessagePart
- func (mc *MessageConverter) IsPrivateChat(ctx context.Context) bool
- func (mc *MessageConverter) ToMatrix(ctx context.Context, dm *signalpb.DataMessage) *ConvertedMessage
- func (mc *MessageConverter) ToSignal(ctx context.Context, evt *event.Event, content *event.MessageEventContent, ...) (*signalpb.DataMessage, error)
- type PortalMethods
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnsupportedMsgType = errors.New("unsupported msgtype") ErrMediaDownloadFailed = errors.New("failed to download media") ErrMediaDecryptFailed = errors.New("failed to decrypt media") ErrMediaConvertFailed = errors.New("failed to convert") ErrMediaUploadFailed = errors.New("failed to upload media") ErrInvalidGeoURI = errors.New("invalid `geo:` URI in message") )
View Source
var URLRegex = regexp.MustCompile(`https?://[^\s/_*]+(?:/\S*)?`)
Functions ¶
func CanConvertSignal ¶
func CanConvertSignal(dm *signalpb.DataMessage) bool
Types ¶
type BeeperLinkPreview ¶
type BeeperLinkPreview struct {
mautrix.RespPreviewURL
MatchedURL string `json:"matched_url"`
ImageEncryption *event.EncryptedFileInfo `json:"beeper:image:encryption,omitempty"`
}
type ConvertedMessage ¶
type ConvertedMessage struct {
Parts []*ConvertedMessagePart
Timestamp uint64
DisappearIn uint32
}
func (*ConvertedMessage) MergeCaption ¶
func (cm *ConvertedMessage) MergeCaption()
type ConvertedMessagePart ¶
type ExtendedPortalMethods ¶
type ExtendedPortalMethods interface {
QueueFileTransfer(ctx context.Context, msgTS uint64, fileName string, ap *signalpb.AttachmentPointer) (id.ContentURIString, error)
}
type MessageConverter ¶
type MessageConverter struct {
PortalMethods
SignalFmtParams *signalfmt.FormatParams
MatrixFmtParams *matrixfmt.HTMLParser
ConvertVoiceMessages bool
ConvertGIFToAPNG bool
MaxFileSize int64
AsyncFiles bool
LocationFormat string
}
func (*MessageConverter) ConvertDisappearingTimerChangeToMatrix ¶
func (mc *MessageConverter) ConvertDisappearingTimerChangeToMatrix(ctx context.Context, timer uint32, updatePortal bool) *ConvertedMessagePart
func (*MessageConverter) IsPrivateChat ¶
func (mc *MessageConverter) IsPrivateChat(ctx context.Context) bool
func (*MessageConverter) ToMatrix ¶
func (mc *MessageConverter) ToMatrix(ctx context.Context, dm *signalpb.DataMessage) *ConvertedMessage
func (*MessageConverter) ToSignal ¶
func (mc *MessageConverter) ToSignal(ctx context.Context, evt *event.Event, content *event.MessageEventContent, relaybotFormatted bool) (*signalpb.DataMessage, 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 *signalpb.DataMessage_Quote) (replyTo id.EventID, replyTargetSender id.UserID)
GetSignalReply(ctx context.Context, content *event.MessageEventContent) *signalpb.DataMessage_Quote
GetClient(ctx context.Context) *signalmeow.Client
GetData(ctx context.Context) *database.Portal
}
Click to show internal directories.
Click to hide internal directories.