waid

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const LIDPrefix = "lid-"

Variables

This section is empty.

Functions

func MakeFakeMessageID

func MakeFakeMessageID(chat, sender types.JID, data string) networkid.MessageID

func MakeMediaID added in v0.11.1

func MakeMediaID(messageInfo *types.MessageInfo, receiver networkid.UserLoginID) networkid.MediaID

func MakeMessageID

func MakeMessageID(chat, sender types.JID, id types.MessageID) networkid.MessageID

func MakePortalID

func MakePortalID(jid types.JID) networkid.PortalID

func MakeUserID

func MakeUserID(user types.JID) networkid.UserID

func MakeUserLoginID

func MakeUserLoginID(user types.JID) networkid.UserLoginID

func ParsePortalID

func ParsePortalID(portal networkid.PortalID) (types.JID, error)

func ParseUserID

func ParseUserID(user networkid.UserID) types.JID

func ParseUserLoginID

func ParseUserLoginID(user networkid.UserLoginID, deviceID uint16) types.JID

Types

type GhostMetadata

type GhostMetadata struct {
	LastSync jsontime.Unix `json:"last_sync,omitempty"`
}

type GroupInviteMeta

type GroupInviteMeta struct {
	JID        types.JID `json:"jid"`
	Code       string    `json:"code"`
	Expiration int64     `json:"expiration,string"`
	Inviter    types.JID `json:"inviter"`
}

type MessageErrorType

type MessageErrorType string
const (
	MsgNoError             MessageErrorType = ""
	MsgErrDecryptionFailed MessageErrorType = "decryption_failed"
	MsgErrMediaNotFound    MessageErrorType = "media_not_found"
)

type MessageMetadata

type MessageMetadata struct {
	SenderDeviceID   uint16           `json:"sender_device_id,omitempty"`
	Error            MessageErrorType `json:"error,omitempty"`
	BroadcastListJID *types.JID       `json:"broadcast_list_jid,omitempty"`
	GroupInvite      *GroupInviteMeta `json:"group_invite,omitempty"`
	FailedMediaMeta  json.RawMessage  `json:"media_meta,omitempty"`
	DirectMediaMeta  json.RawMessage  `json:"direct_media_meta,omitempty"`
	IsMatrixPoll     bool             `json:"is_matrix_poll,omitempty"`
}

type ParsedMessageID

type ParsedMessageID struct {
	Chat   types.JID
	Sender types.JID
	ID     types.MessageID
}

func ParseMediaID added in v0.11.1

func ParseMediaID(mediaID networkid.MediaID) (*ParsedMessageID, networkid.UserLoginID, error)

func ParseMessageID

func ParseMessageID(messageID networkid.MessageID) (*ParsedMessageID, error)

func (*ParsedMessageID) String added in v0.11.1

func (pmi *ParsedMessageID) String() networkid.MessageID

type PortalMetadata

type PortalMetadata struct {
	DisappearingTimerSetAt int64         `json:"disappearing_timer_set_at,omitempty"`
	LastSync               jsontime.Unix `json:"last_sync,omitempty"`
}

type PushKeys

type PushKeys struct {
	P256DH  []byte `json:"p256dh"`
	Auth    []byte `json:"auth"`
	Private []byte `json:"private"`
}

type ReactionMetadata

type ReactionMetadata struct {
	SenderDeviceID uint16 `json:"sender_device_id,omitempty"`
}

type UserLoginMetadata

type UserLoginMetadata struct {
	WADeviceID      uint16        `json:"wa_device_id"`
	PhoneLastSeen   jsontime.Unix `json:"phone_last_seen"`
	PhoneLastPinged jsontime.Unix `json:"phone_last_pinged"`
	Timezone        string        `json:"timezone"`
	PushKeys        *PushKeys     `json:"push_keys,omitempty"`

	HistorySyncPortalsNeedCreating bool `json:"history_sync_portals_need_creating,omitempty"`
}

func (*UserLoginMetadata) GeneratePushKeys

func (m *UserLoginMetadata) GeneratePushKeys()

Jump to

Keyboard shortcuts

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