Documentation ¶
Index ¶
- Constants
- Variables
- func KeyToMessageID(client *whatsmeow.Client, chat, sender types.JID, key *waCommon.MessageKey) networkid.MessageID
- type AnimatedStickerConfig
- type FailedMediaKeys
- func (f *FailedMediaKeys) GetDirectPath() string
- func (f *FailedMediaKeys) GetFileEncSHA256() []byte
- func (f *FailedMediaKeys) GetFileLength() uint64
- func (f *FailedMediaKeys) GetFileSHA256() []byte
- func (f *FailedMediaKeys) GetMediaKey() []byte
- func (f *FailedMediaKeys) GetMediaType() whatsmeow.MediaType
- type MediaMessage
- type MediaMessageWithCaption
- type MediaMessageWithDimensions
- type MediaMessageWithDuration
- type MediaMessageWithFileName
- type MediaMessageWithThumbnail
- type MessageConverter
- func (mc *MessageConverter) MediaRetryToMatrix(ctx context.Context, part *PreparedMedia, client *whatsmeow.Client, ...) *bridgev2.ConvertedEdit
- func (mc *MessageConverter) PollStartToWhatsApp(ctx context.Context, content *event.PollStartEventContent, ...) (*waE2E.Message, map[[32]byte]string, error)
- func (mc *MessageConverter) PollVoteToWhatsApp(ctx context.Context, client *whatsmeow.Client, ...) (*waE2E.Message, error)
- func (mc *MessageConverter) ToMatrix(ctx context.Context, portal *bridgev2.Portal, client *whatsmeow.Client, ...) *bridgev2.ConvertedMessage
- func (mc *MessageConverter) ToWhatsApp(ctx context.Context, client *whatsmeow.Client, evt *event.Event, ...) (*waE2E.Message, error)
- type PaddedImage
- type PreparedMedia
Constants ¶
View Source
const FailedMediaField = "fi.mau.whatsapp.failed_media"
View Source
const GroupInviteMetaField = "fi.mau.whatsapp.invite"
Variables ¶
View Source
var URLRegex = regexp.MustCompile(`https?://[^\s/_*]+(?:/\S*)?`)
Functions ¶
func KeyToMessageID ¶ added in v0.11.1
Types ¶
type AnimatedStickerConfig ¶
type FailedMediaKeys ¶
type FailedMediaKeys struct { Key []byte `json:"key"` Length uint64 `json:"length"` Type whatsmeow.MediaType `json:"type"` SHA256 []byte `json:"sha256"` EncSHA256 []byte `json:"enc_sha256"` DirectPath string `json:"direct_path,omitempty"` }
func (*FailedMediaKeys) GetDirectPath ¶
func (f *FailedMediaKeys) GetDirectPath() string
func (*FailedMediaKeys) GetFileEncSHA256 ¶
func (f *FailedMediaKeys) GetFileEncSHA256() []byte
func (*FailedMediaKeys) GetFileLength ¶
func (f *FailedMediaKeys) GetFileLength() uint64
func (*FailedMediaKeys) GetFileSHA256 ¶
func (f *FailedMediaKeys) GetFileSHA256() []byte
func (*FailedMediaKeys) GetMediaKey ¶
func (f *FailedMediaKeys) GetMediaKey() []byte
func (*FailedMediaKeys) GetMediaType ¶
func (f *FailedMediaKeys) GetMediaType() whatsmeow.MediaType
type MediaMessage ¶
type MediaMessage interface { whatsmeow.DownloadableMessage GetContextInfo() *waE2E.ContextInfo GetFileLength() uint64 GetMimetype() string }
type MediaMessageWithCaption ¶
type MediaMessageWithCaption interface { MediaMessage GetCaption() string }
type MediaMessageWithDimensions ¶
type MediaMessageWithDimensions interface { MediaMessage GetHeight() uint32 GetWidth() uint32 }
type MediaMessageWithDuration ¶
type MediaMessageWithDuration interface { MediaMessage GetSeconds() uint32 }
type MediaMessageWithFileName ¶
type MediaMessageWithFileName interface { MediaMessage GetFileName() string }
type MediaMessageWithThumbnail ¶
type MediaMessageWithThumbnail interface { MediaMessage GetJPEGThumbnail() []byte }
type MessageConverter ¶
type MessageConverter struct { Bridge *bridgev2.Bridge DB *wadb.Database MaxFileSize int64 HTMLParser *format.HTMLParser AnimatedStickerConfig AnimatedStickerConfig FetchURLPreviews bool ExtEvPolls bool DisableViewOnce bool DirectMedia bool OldMediaSuffix string }
func New ¶
func New(br *bridgev2.Bridge) *MessageConverter
func (*MessageConverter) MediaRetryToMatrix ¶
func (mc *MessageConverter) MediaRetryToMatrix( ctx context.Context, part *PreparedMedia, client *whatsmeow.Client, intent bridgev2.MatrixAPI, portal *bridgev2.Portal, existingPart *database.Message, ) *bridgev2.ConvertedEdit
func (*MessageConverter) PollStartToWhatsApp ¶
func (*MessageConverter) PollVoteToWhatsApp ¶
func (*MessageConverter) ToMatrix ¶
func (mc *MessageConverter) ToMatrix( ctx context.Context, portal *bridgev2.Portal, client *whatsmeow.Client, intent bridgev2.MatrixAPI, waMsg *waE2E.Message, info *types.MessageInfo, isViewOnce bool, previouslyConvertedPart *bridgev2.ConvertedMessagePart, ) *bridgev2.ConvertedMessage
type PaddedImage ¶
func (*PaddedImage) Bounds ¶
func (img *PaddedImage) Bounds() image.Rectangle
type PreparedMedia ¶
type PreparedMedia struct { Type event.Type `json:"type"` *event.MessageEventContent `json:"content"` Extra map[string]any `json:"extra"` FailedKeys *FailedMediaKeys `json:"whatsapp_media"` // only for failed media MentionedJID []string `json:"mentioned_jid,omitempty"` // only for failed media TypeDescription string `json:"type_description"` ContextInfo *waE2E.ContextInfo `json:"-"` }
func (*PreparedMedia) FillFileName ¶ added in v0.11.1
func (pm *PreparedMedia) FillFileName() *PreparedMedia
Click to show internal directories.
Click to hide internal directories.