events

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MPL-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package events contains all the events that whatsmeow.Client emits to functions registered with AddEventHandler.

Index

Constants

View Source
const (
	ReceiptTypeDelivered = types.ReceiptTypeDelivered
	ReceiptTypeSender    = types.ReceiptTypeSender
	ReceiptTypeRetry     = types.ReceiptTypeRetry
	ReceiptTypeRead      = types.ReceiptTypeRead
	ReceiptTypeReadSelf  = types.ReceiptTypeReadSelf
	ReceiptTypePlayed    = types.ReceiptTypePlayed
)

Deprecated: use types.ReceiptType* constants directly

Variables

This section is empty.

Functions

This section is empty.

Types

type AppState

type AppState struct {
	Index []string
	*waProto.SyncActionValue
}

AppState is emitted directly for new data received from app state syncing. You should generally use the higher-level events like events.Contact and events.Mute.

type AppStateSyncComplete

type AppStateSyncComplete struct {
	Name appstate.WAPatchName
}

AppStateSyncComplete is emitted when app state is resynced.

type Archive

type Archive struct {
	JID       types.JID // The chat which was archived or unarchived.
	Timestamp time.Time // The time when the (un)archiving happened.

	Action       *waProto.ArchiveChatAction // The current archival status of the chat.
	FromFullSync bool                       // Whether the action is emitted because of a fullSync
}

Archive is emitted when a chat is archived or unarchived from another device.

type Blocklist

type Blocklist struct {
	// Action specifies what happened. If it's empty, there should be a list of changes in the Changes list.
	// If it's "modify", then the Changes list will be empty and the whole blocklist should be re-requested.
	Action    BlocklistAction
	DHash     string
	PrevDHash string
	Changes   []BlocklistChange
}

Blocklist is emitted when the user's blocked user list is changed.

type BlocklistAction

type BlocklistAction string
const (
	BlocklistActionDefault BlocklistAction = ""
	BlocklistActionModify  BlocklistAction = "modify"
)

type BlocklistChange

type BlocklistChange struct {
	JID    types.JID
	Action BlocklistChangeAction
}

type BlocklistChangeAction

type BlocklistChangeAction string
const (
	BlocklistChangeActionBlock   BlocklistChangeAction = "block"
	BlocklistChangeActionUnblock BlocklistChangeAction = "unblock"
)

type BusinessName

type BusinessName struct {
	JID             types.JID
	Message         *types.MessageInfo // This is only present if the change was detected in a message.
	OldBusinessName string
	NewBusinessName string
}

BusinessName is emitted when a message is received with a different verified business name than the previous value cached for the same user.

type CATRefreshError

type CATRefreshError struct {
	Error error
}

func (*CATRefreshError) PermanentDisconnectDescription

func (*CATRefreshError) PermanentDisconnectDescription() string

type CallAccept

type CallAccept struct {
	types.BasicCallMeta
	types.CallRemoteMeta

	Data *waBinary.Node
}

CallAccept is emitted when a call is accepted on WhatsApp.

type CallOffer

type CallOffer struct {
	types.BasicCallMeta
	types.CallRemoteMeta

	Data *waBinary.Node // The call offer data
}

CallOffer is emitted when the user receives a call on WhatsApp.

type CallOfferNotice

type CallOfferNotice struct {
	types.BasicCallMeta

	Media string // "audio" or "video" depending on call type
	Type  string // "group" when it's a group call

	Data *waBinary.Node
}

CallOfferNotice is emitted when the user receives a notice of a call on WhatsApp. This seems to be primarily for group calls (whereas CallOffer is for 1:1 calls).

type CallPreAccept

type CallPreAccept struct {
	types.BasicCallMeta
	types.CallRemoteMeta

	Data *waBinary.Node
}

type CallReject

type CallReject struct {
	types.BasicCallMeta
	Data *waBinary.Node
}

CallReject is sent when the other party rejects the call on WhatsApp.

type CallRelayLatency

type CallRelayLatency struct {
	types.BasicCallMeta
	Data *waBinary.Node
}

CallRelayLatency is emitted slightly after the user receives a call on WhatsApp.

type CallTerminate

type CallTerminate struct {
	types.BasicCallMeta
	Reason string
	Data   *waBinary.Node
}

CallTerminate is emitted when the other party terminates a call on WhatsApp.

type CallTransport

type CallTransport struct {
	types.BasicCallMeta
	types.CallRemoteMeta

	Data *waBinary.Node
}

type ChatPresence

type ChatPresence struct {
	types.MessageSource
	State types.ChatPresence      // The current state, either composing or paused
	Media types.ChatPresenceMedia // When composing, the type of message
}

ChatPresence is emitted when a chat state update (also known as typing notification) is received.

Note that WhatsApp won't send you these updates unless you mark yourself as online:

client.SendPresence(types.PresenceAvailable)

type ClearChat

type ClearChat struct {
	JID       types.JID // The chat which was cleared.
	Timestamp time.Time // The time when the clear happened.

	Action       *waProto.ClearChatAction // Information about the clear.
	FromFullSync bool                     // Whether the action is emitted because of a fullSync
}

ClearChat is emitted when a chat is cleared on another device. This is different from DeleteChat.

type ClientOutdated

type ClientOutdated struct{}

ClientOutdated is emitted when the WhatsApp server rejects the connection with the ConnectFailureClientOutdated code.

func (*ClientOutdated) PermanentDisconnectDescription

func (*ClientOutdated) PermanentDisconnectDescription() string

type ConnectFailure

type ConnectFailure struct {
	Reason  ConnectFailureReason
	Message string
	Raw     *waBinary.Node
}

ConnectFailure is emitted when the WhatsApp server sends a <failure> node with an unknown reason.

Known reasons are handled internally and emitted as different events (e.g. LoggedOut and TemporaryBan).

func (*ConnectFailure) PermanentDisconnectDescription

func (cf *ConnectFailure) PermanentDisconnectDescription() string

type ConnectFailureReason

type ConnectFailureReason int

ConnectFailureReason is an error code included in connection failure events.

const (
	ConnectFailureGeneric        ConnectFailureReason = 400
	ConnectFailureLoggedOut      ConnectFailureReason = 401
	ConnectFailureTempBanned     ConnectFailureReason = 402
	ConnectFailureMainDeviceGone ConnectFailureReason = 403 // this is now called LOCKED in the whatsapp web code
	ConnectFailureUnknownLogout  ConnectFailureReason = 406 // this is now called BANNED in the whatsapp web code

	ConnectFailureClientOutdated ConnectFailureReason = 405
	ConnectFailureBadUserAgent   ConnectFailureReason = 409

	ConnectFailureCATExpired ConnectFailureReason = 413
	ConnectFailureCATInvalid ConnectFailureReason = 414
	ConnectFailureNotFound   ConnectFailureReason = 415

	ConnectFailureInternalServerError ConnectFailureReason = 500
	ConnectFailureExperimental        ConnectFailureReason = 501
	ConnectFailureServiceUnavailable  ConnectFailureReason = 503
)

func (ConnectFailureReason) IsLoggedOut

func (cfr ConnectFailureReason) IsLoggedOut() bool

IsLoggedOut returns true if the client should delete session data due to this connect failure.

func (ConnectFailureReason) NumberString

func (cfr ConnectFailureReason) NumberString() string

func (ConnectFailureReason) String

func (cfr ConnectFailureReason) String() string

String returns the reason code and a short human-readable description of the error.

type Connected

type Connected struct{}

Connected is emitted when the client has successfully connected to the WhatsApp servers and is authenticated. The user who the client is authenticated as will be in the device store at this point, which is why this event doesn't contain any data.

type Contact

type Contact struct {
	JID       types.JID // The contact who was modified.
	Timestamp time.Time // The time when the modification happened.'

	Action       *waProto.ContactAction // The new contact info.
	FromFullSync bool                   // Whether the action is emitted because of a fullSync
}

Contact is emitted when an entry in the user's contact list is modified from another device.

type DecryptFailMode

type DecryptFailMode string
const (
	DecryptFailShow DecryptFailMode = ""
	DecryptFailHide DecryptFailMode = "hide"
)

type DeleteChat

type DeleteChat struct {
	JID       types.JID // The chat which was deleted.
	Timestamp time.Time // The time when the deletion happened.

	Action       *waProto.DeleteChatAction // Information about the deletion.
	FromFullSync bool                      // Whether the action is emitted because of a fullSync
}

DeleteChat is emitted when a chat is deleted on another device.

type DeleteForMe

type DeleteForMe struct {
	ChatJID   types.JID // The chat where the message was deleted.
	SenderJID types.JID // In group chats, the user who sent the message (except if the message was sent by the user).
	IsFromMe  bool      // Whether the message was sent by the user.
	MessageID string    // The message which was deleted.
	Timestamp time.Time // The time when the deletion happened.

	Action       *waProto.DeleteMessageForMeAction // Additional information for the deletion.
	FromFullSync bool                              // Whether the action is emitted because of a fullSync
}

DeleteForMe is emitted when a message is deleted (for the current user only) from another device.

type Disconnected

type Disconnected struct{}

Disconnected is emitted when the websocket is closed by the server.

type FBMessage

type FBMessage struct {
	Info    types.MessageInfo               // Information about the message like the chat and sender IDs
	Message armadillo.MessageApplicationSub // The actual message struct

	// If the message was re-requested from the sender, this is the number of retries it took.
	RetryCount int

	Transport   *waMsgTransport.MessageTransport     // The first level of wrapping the message was in
	Application *waMsgApplication.MessageApplication // The second level of wrapping the message was in
}

func (*FBMessage) GetArmadillo

func (evt *FBMessage) GetArmadillo() *waArmadilloApplication.Armadillo

func (*FBMessage) GetConsumerApplication

func (evt *FBMessage) GetConsumerApplication() *waConsumerApplication.ConsumerApplication

type GroupInfo

type GroupInfo struct {
	JID       types.JID  // The group ID in question
	Notify    string     // Seems like a top-level type for the invite
	Sender    *types.JID // The user who made the change. Doesn't seem to be present when notify=invite
	Timestamp time.Time  // The time when the change occurred

	Name      *types.GroupName      // Group name change
	Topic     *types.GroupTopic     // Group topic (description) change
	Locked    *types.GroupLocked    // Group locked status change (can only admins edit group info?)
	Announce  *types.GroupAnnounce  // Group announce status change (can only admins send messages?)
	Ephemeral *types.GroupEphemeral // Disappearing messages change

	MembershipApprovalMode *types.GroupMembershipApprovalMode // Membership approval mode change

	Delete *types.GroupDelete

	Link   *types.GroupLinkChange
	Unlink *types.GroupLinkChange

	NewInviteLink *string // Group invite link change

	PrevParticipantVersionID string
	ParticipantVersionID     string

	JoinReason string // This will be "invite" if the user joined via invite link

	Join  []types.JID // Users who joined or were added the group
	Leave []types.JID // Users who left or were removed from the group

	Promote []types.JID // Users who were promoted to admins
	Demote  []types.JID // Users who were demoted to normal users

	UnknownChanges []*waBinary.Node
}

GroupInfo is emitted when the metadata of a group changes.

type HistorySync

type HistorySync struct {
	Data *waProto.HistorySync
}

HistorySync is emitted when the phone has sent a blob of historical messages.

type IdentityChange

type IdentityChange struct {
	JID       types.JID
	Timestamp time.Time

	// Implicit will be set to true if the event was triggered by an untrusted identity error,
	// rather than an identity change notification from the server.
	Implicit bool
}

IdentityChange is emitted when another user changes their primary device.

type JoinedGroup

type JoinedGroup struct {
	Reason    string          // If the event was triggered by you using an invite link, this will be "invite".
	Type      string          // "new" if it's a newly created group.
	CreateKey types.MessageID // If you created the group, this is the same message ID you passed to CreateGroup.
	types.GroupInfo
}

JoinedGroup is emitted when you join or are added to a group.

type KeepAliveRestored

type KeepAliveRestored struct{}

KeepAliveRestored is emitted if the keepalive pings start working again after some KeepAliveTimeout events. Note that if the websocket disconnects before the pings start working, this event will not be emitted.

type KeepAliveTimeout

type KeepAliveTimeout struct {
	ErrorCount  int
	LastSuccess time.Time
}

KeepAliveTimeout is emitted when the keepalive ping request to WhatsApp web servers times out.

Currently, there's no automatic handling for these, but it's expected that the TCP connection will either start working again or notice it's dead on its own eventually. Clients may use this event to decide to force a disconnect+reconnect faster.

type LabelAssociationChat

type LabelAssociationChat struct {
	JID       types.JID // The chat which was labeled or unlabeled.
	Timestamp time.Time // The time when the (un)labeling happened.
	LabelID   string    // The label id which was added or removed.

	Action       *waProto.LabelAssociationAction // The current label status of the chat.
	FromFullSync bool                            // Whether the action is emitted because of a fullSync
}

LabelAssociationChat is emitted when a chat is labeled or unlabeled from any device.

type LabelAssociationMessage

type LabelAssociationMessage struct {
	JID       types.JID // The chat which was labeled or unlabeled.
	Timestamp time.Time // The time when the (un)labeling happened.
	LabelID   string    // The label id which was added or removed.
	MessageID string    // The message id which was labeled or unlabeled.

	Action       *waProto.LabelAssociationAction // The current label status of the message.
	FromFullSync bool                            // Whether the action is emitted because of a fullSync
}

LabelAssociationMessage is emitted when a message is labeled or unlabeled from any device.

type LabelEdit

type LabelEdit struct {
	Timestamp time.Time // The time when the label was edited.
	LabelID   string    // The label id which was edited.

	Action       *waProto.LabelEditAction // The new label info.
	FromFullSync bool                     // Whether the action is emitted because of a fullSync
}

LabelEdit is emitted when a label is edited from any device.

type LoggedOut

type LoggedOut struct {
	// OnConnect is true if the event was triggered by a connect failure message.
	// If it's false, the event was triggered by a stream:error message.
	OnConnect bool
	// If OnConnect is true, then this field contains the reason code.
	Reason ConnectFailureReason
}

LoggedOut is emitted when the client has been unpaired from the phone.

This can happen while connected (stream:error messages) or right after connecting (connect failure messages).

This will not be emitted when the logout is initiated by this client (using Client.LogOut()).

func (*LoggedOut) PermanentDisconnectDescription

func (l *LoggedOut) PermanentDisconnectDescription() string

type ManualLoginReconnect

type ManualLoginReconnect struct{}

ManualLoginReconnect is emitted after login if DisableLoginAutoReconnect is set.

type MarkChatAsRead

type MarkChatAsRead struct {
	JID       types.JID // The chat which was marked as read or unread.
	Timestamp time.Time // The time when the marking happened.

	Action       *waProto.MarkChatAsReadAction // Whether the chat was marked as read or unread, and info about the most recent messages.
	FromFullSync bool                          // Whether the action is emitted because of a fullSync
}

MarkChatAsRead is emitted when a whole chat is marked as read or unread from another device.

type MediaRetry

type MediaRetry struct {
	Ciphertext []byte
	IV         []byte

	// Sometimes there's an unencrypted media retry error. In these cases, Ciphertext and IV will be nil.
	Error *MediaRetryError

	Timestamp time.Time // The time of the response.

	MessageID types.MessageID // The ID of the message.
	ChatID    types.JID       // The chat ID where the message was sent.
	SenderID  types.JID       // The user who sent the message. Only present in groups.
	FromMe    bool            // Whether the message was sent by the current user or someone else.
}

MediaRetry is emitted when the phone sends a response to a media retry request.

type MediaRetryError

type MediaRetryError struct {
	Code int
}

type Message

type Message struct {
	Info    types.MessageInfo // Information about the message like the chat and sender IDs
	Message *waProto.Message  // The actual message struct

	IsEphemeral           bool // True if the message was unwrapped from an EphemeralMessage
	IsViewOnce            bool // True if the message was unwrapped from a ViewOnceMessage, ViewOnceMessageV2 or ViewOnceMessageV2Extension
	IsViewOnceV2          bool // True if the message was unwrapped from a ViewOnceMessageV2 or ViewOnceMessageV2Extension
	IsViewOnceV2Extension bool // True if the message was unwrapped from a ViewOnceMessageV2Extension
	IsDocumentWithCaption bool // True if the message was unwrapped from a DocumentWithCaptionMessage
	IsLottieSticker       bool // True if the message was unwrapped from a LottieStickerMessage
	IsEdit                bool // True if the message was unwrapped from an EditedMessage

	// If this event was parsed from a WebMessageInfo (i.e. from a history sync or unavailable message request), the source data is here.
	SourceWebMsg *waProto.WebMessageInfo
	// If this event is a response to an unavailable message request, the request ID is here.
	UnavailableRequestID types.MessageID
	// If the message was re-requested from the sender, this is the number of retries it took.
	RetryCount int

	NewsletterMeta *NewsletterMessageMeta

	// The raw message struct. This is the raw unmodified data, which means the actual message might
	// be wrapped in DeviceSentMessage, EphemeralMessage or ViewOnceMessage.
	RawMessage *waProto.Message
}

Message is emitted when receiving a new message.

func (*Message) UnwrapRaw

func (evt *Message) UnwrapRaw() *Message

UnwrapRaw fills the Message, IsEphemeral and IsViewOnce fields based on the raw message in the RawMessage field.

type Mute

type Mute struct {
	JID       types.JID // The chat which was muted or unmuted.
	Timestamp time.Time // The time when the (un)muting happened.

	Action       *waProto.MuteAction // The current mute status of the chat.
	FromFullSync bool                // Whether the action is emitted because of a fullSync
}

Mute is emitted when a chat is muted or unmuted from another device.

type NewsletterJoin

type NewsletterJoin struct {
	types.NewsletterMetadata
}

type NewsletterLeave

type NewsletterLeave struct {
	ID   types.JID            `json:"id"`
	Role types.NewsletterRole `json:"role"`
}

type NewsletterLiveUpdate

type NewsletterLiveUpdate struct {
	JID      types.JID
	Time     time.Time
	Messages []*types.NewsletterMessage
}

type NewsletterMessageMeta

type NewsletterMessageMeta struct {
	// When a newsletter message is edited, the message isn't wrapped in an EditedMessage like normal messages.
	// Instead, the message is the new content, the ID is the original message ID, and the edit timestamp is here.
	EditTS time.Time
	// This is the timestamp of the original message for edits.
	OriginalTS time.Time
}

type NewsletterMuteChange

type NewsletterMuteChange struct {
	ID   types.JID                 `json:"id"`
	Mute types.NewsletterMuteState `json:"mute"`
}

type OfflineSyncCompleted

type OfflineSyncCompleted struct {
	Count int
}

OfflineSyncCompleted is emitted after the server has finished sending missed events.

type OfflineSyncPreview

type OfflineSyncPreview struct {
	Total int

	AppDataChanges int
	Messages       int
	Notifications  int
	Receipts       int
}

OfflineSyncPreview is emitted right after connecting if the server is going to send events that the client missed during downtime.

type PairError

type PairError struct {
	ID           types.JID
	BusinessName string
	Platform     string
	Error        error
}

PairError is emitted when a pair-success event is received from the server, but finishing the pairing locally fails.

type PairSuccess

type PairSuccess struct {
	ID           types.JID
	BusinessName string
	Platform     string
}

PairSuccess is emitted after the QR code has been scanned with the phone and the handshake has been completed. Note that this is generally followed by a websocket reconnection, so you should wait for the Connected before trying to send anything.

type PermanentDisconnect

type PermanentDisconnect interface {
	PermanentDisconnectDescription() string
}

PermanentDisconnect is a class of events emitted when the client will not auto-reconnect by default.

type Picture

type Picture struct {
	JID       types.JID // The user or group ID where the picture was changed.
	Author    types.JID // The user who changed the picture.
	Timestamp time.Time // The timestamp when the picture was changed.
	Remove    bool      // True if the picture was removed.
	PictureID string    // The new picture ID if it was not removed.
}

Picture is emitted when a user's profile picture or group's photo is changed.

You can use Client.GetProfilePictureInfo to get the actual image URL after this event.

type Pin

type Pin struct {
	JID       types.JID // The chat which was pinned or unpinned.
	Timestamp time.Time // The time when the (un)pinning happened.

	Action       *waProto.PinAction // Whether the chat is now pinned or not.
	FromFullSync bool               // Whether the action is emitted because of a fullSync
}

Pin is emitted when a chat is pinned or unpinned from another device.

type Presence

type Presence struct {
	// The user whose presence event this is
	From types.JID
	// True if the user is now offline
	Unavailable bool
	// The time when the user was last online. This may be the zero value if the user has hid their last seen time.
	LastSeen time.Time
}

Presence is emitted when a presence update is received.

Note that WhatsApp only sends you presence updates for individual users after you subscribe to them:

client.SubscribePresence(user JID)

type PrivacySettings

type PrivacySettings struct {
	NewSettings         types.PrivacySettings
	GroupAddChanged     bool
	LastSeenChanged     bool
	StatusChanged       bool
	ProfileChanged      bool
	ReadReceiptsChanged bool
	OnlineChanged       bool
	CallAddChanged      bool
}

PrivacySettings is emitted when the user changes their privacy settings.

type PushName

type PushName struct {
	JID         types.JID          // The user whose push name changed.
	Message     *types.MessageInfo // The message where this change was first noticed.
	OldPushName string             // The previous push name from the local cache.
	NewPushName string             // The new push name that was included in the message.
}

PushName is emitted when a message is received with a different push name than the previous value cached for the same user.

type PushNameSetting

type PushNameSetting struct {
	Timestamp time.Time // The time when the push name was changed.

	Action       *waProto.PushNameSetting // The new push name for the user.
	FromFullSync bool                     // Whether the action is emitted because of a fullSync
}

PushNameSetting is emitted when the user's push name is changed from another device.

type QR

type QR struct {
	Codes []string
}

QR is emitted after connecting when there's no session data in the device store.

The QR codes are available in the Codes slice. You should render the strings as QR codes one by one, switching to the next one whenever enough time has passed. WhatsApp web seems to show the first code for 60 seconds and all other codes for 20 seconds.

When the QR code has been scanned and pairing is complete, PairSuccess will be emitted. If you run out of codes before scanning, the server will close the websocket, and you will have to reconnect to get more codes.

type QRScannedWithoutMultidevice

type QRScannedWithoutMultidevice struct{}

QRScannedWithoutMultidevice is emitted when the pairing QR code is scanned, but the phone didn't have multidevice enabled. The same QR code can still be scanned after this event, which means the user can just be told to enable multidevice and re-scan the code.

type Receipt

type Receipt struct {
	types.MessageSource
	MessageIDs []types.MessageID
	Timestamp  time.Time
	Type       types.ReceiptType

	// When you read the message of another user in a group, this field contains the sender of the message.
	// For receipts from other users, the message sender is always you.
	MessageSender types.JID
}

Receipt is emitted when an outgoing message is delivered to or read by another user, or when another device reads an incoming message.

N.B. WhatsApp on Android sends message IDs from newest message to oldest, but WhatsApp on iOS sends them in the opposite order (oldest first).

type ReceiptType deprecated

type ReceiptType = types.ReceiptType

Deprecated: use types.ReceiptType directly

type Star

type Star struct {
	ChatJID   types.JID // The chat where the message was pinned.
	SenderJID types.JID // In group chats, the user who sent the message (except if the message was sent by the user).
	IsFromMe  bool      // Whether the message was sent by the user.
	MessageID string    // The message which was starred or unstarred.
	Timestamp time.Time // The time when the (un)starring happened.

	Action       *waProto.StarAction // Whether the message is now starred or not.
	FromFullSync bool                // Whether the action is emitted because of a fullSync
}

Star is emitted when a message is starred or unstarred from another device.

type StreamError

type StreamError struct {
	Code string
	Raw  *waBinary.Node
}

StreamError is emitted when the WhatsApp server sends a <stream:error> node with an unknown code.

Known codes are handled internally and emitted as different events (e.g. LoggedOut).

type StreamReplaced

type StreamReplaced struct{}

StreamReplaced is emitted when the client is disconnected by another client connecting with the same keys.

This can happen if you accidentally start another process with the same session or otherwise try to connect twice with the same session.

func (*StreamReplaced) PermanentDisconnectDescription

func (*StreamReplaced) PermanentDisconnectDescription() string

type TempBanReason

type TempBanReason int

TempBanReason is an error code included in temp ban error events.

const (
	TempBanSentToTooManyPeople    TempBanReason = 101
	TempBanBlockedByUsers         TempBanReason = 102
	TempBanCreatedTooManyGroups   TempBanReason = 103
	TempBanSentTooManySameMessage TempBanReason = 104
	TempBanBroadcastList          TempBanReason = 106
)

func (TempBanReason) String

func (tbr TempBanReason) String() string

String returns the reason code and a human-readable description of the ban reason.

type TemporaryBan

type TemporaryBan struct {
	Code   TempBanReason
	Expire time.Duration
}

TemporaryBan is emitted when there's a connection failure with the ConnectFailureTempBanned reason code.

func (*TemporaryBan) PermanentDisconnectDescription

func (tb *TemporaryBan) PermanentDisconnectDescription() string

func (*TemporaryBan) String

func (tb *TemporaryBan) String() string

type UnarchiveChatsSetting

type UnarchiveChatsSetting struct {
	Timestamp time.Time // The time when the setting was changed.

	Action       *waProto.UnarchiveChatsSetting // The new settings.
	FromFullSync bool                           // Whether the action is emitted because of a fullSync
}

UnarchiveChatsSetting is emitted when the user changes the "Keep chats archived" setting from another device.

type UndecryptableMessage

type UndecryptableMessage struct {
	Info types.MessageInfo

	// IsUnavailable is true if the recipient device didn't send a ciphertext to this device at all
	// (as opposed to sending a ciphertext, but the ciphertext not being decryptable).
	IsUnavailable bool

	DecryptFailMode DecryptFailMode
}

UndecryptableMessage is emitted when receiving a new message that failed to decrypt.

The library will automatically ask the sender to retry. If the sender resends the message, and it's decryptable, then it will be emitted as a normal Message event.

The UndecryptableMessage event may also be repeated if the resent message is also undecryptable.

type UnknownCallEvent

type UnknownCallEvent struct {
	Node *waBinary.Node
}

UnknownCallEvent is emitted when a call element with unknown content is received.

type UserStatusMute

type UserStatusMute struct {
	JID       types.JID // The user who was muted or unmuted
	Timestamp time.Time // The timestamp when the action happened

	Action       *waProto.UserStatusMuteAction // The new mute status
	FromFullSync bool                          // Whether the action is emitted because of a fullSync
}

UserStatusMute is emitted when the user mutes or unmutes another user's status updates.

Jump to

Keyboard shortcuts

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