msgconv

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2025 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const ViewOnceDisappearTimer = 5 * time.Minute

Variables

View Source
var (
	ErrAttachmentNotInBackup = errors.New("attachment not found in backup")
	ErrBackupNotSupported    = errors.New("downloading attachments from server-side backup is not yet supported")
)

Functions

func BackupToDataMessage added in v0.8.0

func BackupToDataMessage(ci *backuppb.ChatItem, attMap AttachmentMap) (*signalpb.DataMessage, []*backuppb.Reaction)

func CanConvertSignal

func CanConvertSignal(dm *signalpb.DataMessage) bool

Types

type AttachmentMap added in v0.8.0

type AttachmentMap map[uuid.UUID]*backuppb.FilePointer_BackupLocator

type MessageConverter

type MessageConverter struct {
	Bridge *bridgev2.Bridge

	SignalFmtParams *signalfmt.FormatParams
	MatrixFmtParams *matrixfmt.HTMLParser

	MaxFileSize       int64
	LocationFormat    string
	DisappearViewOnce bool
}

func NewMessageConverter

func NewMessageConverter(br *bridgev2.Bridge) *MessageConverter

func (*MessageConverter) ConvertDisappearingTimerChangeToMatrix

func (mc *MessageConverter) ConvertDisappearingTimerChangeToMatrix(ctx context.Context, timer uint32, timerVersion *uint32, updatePortal bool) *bridgev2.ConvertedMessagePart

func (*MessageConverter) ToMatrix

func (*MessageConverter) ToSignal

func (mc *MessageConverter) ToSignal(
	ctx context.Context,
	client *signalmeow.Client,
	portal *bridgev2.Portal,
	evt *event.Event,
	content *event.MessageEventContent,
	relaybotFormatted bool,
	replyTo *database.Message,
) (*signalpb.DataMessage, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL