Documentation ¶
Index ¶
- Variables
- func DownloadAvatar(ctx context.Context, url string) ([]byte, error)
- func DownloadMedia(ctx context.Context, mime, url string, maxSize int64) (int64, io.ReadCloser, error)
- func SetProxy(proxy string)
- type AttachmentMessage
- type AttachmentMessageWithCaption
- type AttachmentTransport
- type MediaTransportContainer
- type MessageConverter
- func (mc *MessageConverter) MetaToMatrixText(ctx context.Context, text string, rawMentions *socket.MentionData, ...) (content *event.MessageEventContent)
- func (mc *MessageConverter) ShouldFetchXMA(ctx context.Context) bool
- func (mc *MessageConverter) TextToWhatsApp(content *event.MessageEventContent) *waCommon.MessageText
- func (mc *MessageConverter) ToMatrix(ctx context.Context, portal *bridgev2.Portal, client *messagix.Client, ...) *bridgev2.ConvertedMessage
- func (mc *MessageConverter) ToMeta(ctx context.Context, client *messagix.Client, evt *event.Event, ...) ([]socket.Task, int64, error)
- func (mc *MessageConverter) ToWhatsApp(ctx context.Context, evt *event.Event, content *event.MessageEventContent, ...) (armadillo.RealMessageApplicationSub, ...)
- func (mc *MessageConverter) WhatsAppTextToMatrix(ctx context.Context, text *waCommon.MessageText) *bridgev2.ConvertedMessagePart
- func (mc *MessageConverter) WhatsAppToMatrix(ctx context.Context, portal *bridgev2.Portal, client *whatsmeow.Client, ...) *bridgev2.ConvertedMessage
- type MetaMention
- type UTF16String
Constants ¶
This section is empty.
Variables ¶
View Source
var BypassOnionForMedia bool
View Source
var ErrTooLargeFile = bridgev2.WrapErrorInStatus(errors.New("too large file")). WithErrorAsMessage().WithSendNotice(true).WithErrorReason(event.MessageStatusUnsupported)
View Source
var ErrURLNotFound = errors.New("url not found")
Functions ¶
func DownloadMedia ¶
Types ¶
type AttachmentMessage ¶
type AttachmentMessage[Integral MediaTransportContainer, Ancillary any, Transport AttachmentTransport[Integral, Ancillary]] interface { Decode() (Transport, error) }
type AttachmentMessageWithCaption ¶
type AttachmentMessageWithCaption[Integral MediaTransportContainer, Ancillary any, Transport AttachmentTransport[Integral, Ancillary]] interface { GetCaption() *waCommon.MessageText }
type AttachmentTransport ¶
type AttachmentTransport[Integral MediaTransportContainer, Ancillary any] interface { GetIntegral() Integral GetAncillary() Ancillary }
type MediaTransportContainer ¶
type MediaTransportContainer interface {
GetTransport() *waMediaTransport.WAMediaTransport
}
type MessageConverter ¶
type MessageConverter struct { Bridge *bridgev2.Bridge MaxFileSize int64 AsyncFiles bool BridgeMode types.Platform HTMLParser *format.HTMLParser DB *metadb.MetaDB }
func (*MessageConverter) MetaToMatrixText ¶
func (mc *MessageConverter) MetaToMatrixText(ctx context.Context, text string, rawMentions *socket.MentionData, portal *bridgev2.Portal) (content *event.MessageEventContent)
func (*MessageConverter) ShouldFetchXMA ¶
func (mc *MessageConverter) ShouldFetchXMA(ctx context.Context) bool
func (*MessageConverter) TextToWhatsApp ¶
func (mc *MessageConverter) TextToWhatsApp(content *event.MessageEventContent) *waCommon.MessageText
func (*MessageConverter) ToMatrix ¶
func (mc *MessageConverter) ToMatrix( ctx context.Context, portal *bridgev2.Portal, client *messagix.Client, intent bridgev2.MatrixAPI, msg *table.WrappedMessage, disableXMA bool, ) *bridgev2.ConvertedMessage
func (*MessageConverter) ToWhatsApp ¶
func (mc *MessageConverter) ToWhatsApp( ctx context.Context, evt *event.Event, content *event.MessageEventContent, portal *bridgev2.Portal, client *whatsmeow.Client, relaybotFormatted bool, replyTo *database.Message, ) (armadillo.RealMessageApplicationSub, *waMsgApplication.MessageApplication_Metadata, error)
func (*MessageConverter) WhatsAppTextToMatrix ¶
func (mc *MessageConverter) WhatsAppTextToMatrix(ctx context.Context, text *waCommon.MessageText) *bridgev2.ConvertedMessagePart
func (*MessageConverter) WhatsAppToMatrix ¶
type MetaMention ¶
func NewMetaMention ¶
func NewMetaMention(userID int64, name string) *MetaMention
type UTF16String ¶
type UTF16String []uint16
func NewUTF16String ¶
func NewUTF16String(s string) UTF16String
func (UTF16String) String ¶
func (u UTF16String) String() string
Click to show internal directories.
Click to hide internal directories.