You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
3.5 KiB

;; Stuff that can happen on a WhatsApp connection.
(in-package :whatscl)
(defclass wac-event () ()
(:documentation "Base class for all WhatsApp connection events."))
(defclass event-ping-timeout (wac-event) ()
(:documentation "Event signifying that a ping timeout has occurred."))
(defclass event-qrcode-obtained (wac-event)
:reader qrcode
:initarg :qrcode
:documentation "The text to go into the rendered QR code."))
(:documentation "A QR code has been obtained from WhatsApp."))
(defclass event-raw-connection-ack (wac-event)
:reader raw
:initarg :raw
:documentation "The raw connection ack message."))
(:documentation "A 'connection acknowledgement' key generation message was received."))
(defclass event-connected (wac-event)
:reader jid
:initarg :jid
:documentation "The user's JID, AS A STRING (!)."))
(:documentation "Emitted when the user has logged in."))
(defclass event-contacts (wac-event)
:reader contacts
:initarg :contacts
:documentation "A list of WHATSCL::CONTACT objects."))
(:documentation "Contains a list of WhatsApp contacts, sent by the server after login."))
(defclass event-chats (wac-event)
:reader chats
:initarg :chats
:documentation "A list of WHATSCL::CHAT-ENTRY objects."))
(:documentation "Contains a list of open WhatsApp chats, sent by the server after login."))
(defclass event-chat-message (wac-event)
:reader message
:initarg :message
:documentation "A WHATSCL::MESSAGE object.")
:reader delivery-type
:initarg :delivery-type
:documentation "A symbol denoting what kind of delivery event this is. FIXME: explain types"))
(:documentation "A chat message was received from WhatsApp."))
(defclass event-contact-add (wac-event)
:reader contact
:initarg :contact
:documentation "A WHATSCL::CONTACT object."))
(:documentation "The user added a new WhatsApp contact."))
(defclass event-picture-change (wac-event)
:reader jid
:initarg :jid
:documentation "The JID of the user.")
:reader was-removed
:initarg :was-removed
:documentation "T if the profile picture was removed."))
(:documentation "A user changed their profile picture, or removed it."))
(defclass event-presence (wac-event)
:reader presence-of
:initarg :of
:documentation "The JID of the user sending presence, or group presence is sent in (if PARTICIPANT is set)")
:reader presence-type
:initarg :type
:documentation "The type of presence (usually a symbol)")
:reader participant
:initarg :participant
:documentation "The user inside the group sending presence.")
:reader denied
:initarg :denied
:documentation "Whether presence broadcasts are blocked from this user or not."))
(:documentation "Presence information was received for a user."))
(defclass event-message-acked (wac-event)
:reader mswgid
:initarg :msgid
:documentation "The ID of the message being acked.")
:reader ack-level
:initarg :ack-level
:documentation "The level of the ack, as a symbol.")
:reader from
:initarg :from)
:reader to
:initarg :to)
:reader participant
:initarg :participant)
:reader part-of-many-p
:initform nil
:initarg :part-of-many-p)
:reader ts
:initarg :ts))
(:documentation "A message was acknowledged."))