java.lang.Object
it.auties.whatsapp.api.Whatsapp
A class used to interface a user to WhatsappWeb's WebSocket
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.auties.whatsapp.socket.SocketHandler
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Whatsapp
(Store store, Keys keys, ErrorHandler errorHandler, WebVerificationSupport webVerificationSupport, ExecutorService socketExecutor) -
Method Summary
Modifier and TypeMethodDescriptionacceptGroupInvite
(String inviteCode) Accepts the invite for a groupaddAboutChangedListener
(OnUserAboutChanged onUserAboutChanged) Registers a status change listeneraddAboutChangedListener
(OnWhatsappAboutChanged onUserStatusChange) Registers a status change listeneraddActionListener
(OnAction onAction) Registers an action listeneraddActionListener
(OnWhatsappAction onAction) Registers an action listeneraddChatMessagesSyncListener
(OnChatMessagesSync onChatRecentMessages) Registers a chat recent messages listeneraddChatMessagesSyncListener
(OnWhatsappChatMessagesSync onChatRecentMessages) Registers a chat recent messages listeneraddChatsListener
(OnChats onChats) Registers a chats listeneraddChatsListener
(OnWhatsappChats onChats) Registers a chats listeneraddContactBlockedListener
(OnContactBlocked onContactBlocked) Registers a contact blocked listeneraddContactBlockedListener
(OnWhatsappContactBlocked onContactBlocked) Registers a contact blocked listeneraddContactPictureChangedListener
(OnContactPictureChanged onContactPictureChanged) Registers a profile picture listeneraddContactPictureChangedListener
(OnWhatsappContactPictureChanged onProfilePictureChange) Registers a profile picture listeneraddContactPresenceListener
(OnContactPresence onContactPresence) Registers a contact presence listeneraddContactPresenceListener
(OnWhatsappContactPresence onContactPresence) Registers a contact presence listeneraddContactsListener
(OnContacts onContacts) Registers a contacts listeneraddContactsListener
(OnWhatsappContacts onContacts) Registers a contacts listeneraddDisconnectedListener
(OnDisconnected onDisconnected) Registers a disconnected listeneraddDisconnectedListener
(OnWhatsappDisconnected onDisconnected) Registers a disconnected listeneraddFeaturesListener
(OnFeatures onFeatures) Registers a features listeneraddFeaturesListener
(OnWhatsappFeatures onFeatures) Registers a features listeneraddGroupParticipant
(JidProvider group, JidProvider... contacts) Adds any number of contacts to a groupaddGroupPictureChangedListener
(OnGroupPictureChange onGroupPictureChange) Registers a group picture listeneraddGroupPictureChangedListener
(OnWhatsappGroupPictureChange onGroupPictureChange) Registers a group picture listeneraddHistorySyncProgressListener
(OnHistorySyncProgress onSyncProgress) Registers a sync progress listeneraddHistorySyncProgressListener
(OnWhatsappHistorySyncProgress onSyncProgress) Registers a sync progress listeneraddLinkedDevicesListener
(OnLinkedDevices onLinkedDevices) Registers a companion devices changed listeneraddLinkedDevicesListener
(OnWhatsappCall onWhatsappCall) Registers a call listeneraddLinkedDevicesListener
(OnWhatsappLinkedDevices onWhatsappLinkedDevices) Registers a companion devices changed listeneraddLinkedDevicesListener
(OnWhatsappRegistrationCode onWhatsappRegistrationCode) Registers a registration code listener for the mobile apiaddListener
(Listener listener) Registers a listeneraddLoggedInListener
(OnLoggedIn onLoggedIn) Registers a logged in listeneraddLoggedInListener
(OnWhatsappLoggedIn onLoggedIn) Registers a logged in listeneraddMediaStatusListener
(OnStatus onMediaStatus) Registers a status listeneraddMediaStatusListener
(OnWhatsappMediaStatus onStatus) Registers a status listeneraddMessageDeletedListener
(OnMessageDeleted onMessageDeleted) Registers a message deleted listeneraddMessageDeletedListener
(OnWhatsappMessageDeleted onMessageDeleted) Registers a message deleted listeneraddMessageReplyListener
(OnMessageReply onMessageReply) Registers a message reply listeneraddMessageReplyListener
(OnWhatsappMessageReply onMessageReply) Registers a message reply listeneraddMessageReplyListener
(ChatMessageInfo info, OnMessageReply onMessageReply) Registers a message reply listener for a specific messageaddMessageReplyListener
(ChatMessageInfo info, OnWhatsappMessageReply onMessageReply) Registers a message reply listener for a specific messageaddMessageReplyListener
(String id, OnMessageReply onMessageReply) Registers a message reply listener for a specific messageaddMessageReplyListener
(String id, OnWhatsappMessageReply onMessageReply) Registers a message reply listener for a specific messageaddMessageStatusListener
(OnMessageStatus onAnyMessageStatus) Registers a message status listeneraddMessageStatusListener
(OnWhatsappMessageStatus onMessageStatus) Registers a message status listeneraddMetadataListener
(OnMetadata onMetadata) Registers a metadata listeneraddMetadataListener
(OnWhatsappMetadata onMetadata) Registers a metadata listeneraddNameChangedListener
(OnUserNameChanged onUserNameChanged) Registers a name change listeneraddNameChangedListener
(OnWhatsappNameChanged onNameChange) Registers a name change listeneraddNewChatMessageListener
(OnNewMessage onNewMessage) Registers a new message listeneraddNewChatMessageListener
(OnWhatsappNewMessage onNewMessage) Registers a new message listeneraddNewContactListener
(OnNewContact onNewContact) Registers a new contact listenerprivate GroupMetadata
addNewGroup
(GroupMetadata result) addNewslettersListener
(OnNewsletters onNewsletters) Registers a newsletters listeneraddNewslettersListener
(OnWhatsappNewsletters onNewsletters) Registers a newsletters listeneraddNewStatusListener
(OnNewStatus onNewMediaStatus) Registers a new status listeneraddNewStatusListener
(OnWhatsappNewStatus onNewStatus) Registers a new status listeneraddNodeReceivedListener
(OnNodeReceived onNodeReceived) Registers a received node listeneraddNodeReceivedListener
(OnWhatsappNodeReceived onNodeReceived) Registers a received node listeneraddNodeSentListener
(OnNodeSent onNodeSent) Registers a sent node listeneraddNodeSentListener
(OnWhatsappNodeSent onNodeSent) Registers a sent node listeneraddPrivacySettingChangedListener
(OnPrivacySettingChanged onPrivacySettingChanged) Registers a privacy setting changed listeneraddPrivacySettingChangedListener
(OnWhatsappPrivacySettingChanged onWhatsappPrivacySettingChanged) Registers a privacy setting changed listeneraddRegistrationCodeListener
(OnCall onCall) Registers a call listeneraddRegistrationCodeListener
(OnRegistrationCode onRegistrationCode) Registers a registration code listener for the mobile apiaddSettingListener
(OnSetting onSetting) Registers a setting listeneraddSettingListener
(OnWhatsappSetting onSetting) Registers a setting listeneraddSocketEventListener
(OnSocketEvent onSocketEvent) Registers an event listeneraddSocketEventListener
(OnWhatsappSocketEvent onSocketEvent) Registers an event listeneraddUserPictureChangedListener
(OnProfilePictureChanged onProfilePictureChanged) Registers a picture change listeneraddUserPictureChangedListener
(OnWhatsappProfilePictureChanged onUserPictureChange) Registers a picture change listenerarchiveChat
(JidProvider chat) Archives a chat.private CompletableFuture
<Void> archiveChat
(JidProvider chat, boolean archive) private CompletableFuture
<Void> awaitCompanionRegistration
(Jid device) Awaits for a single newsletters to a messageAwaits for a single newsletters to a messageblockContact
(JidProvider contact) Blocks a contactprivate String
booleanToInt
(boolean keepStarredMessages) changeAbout
(String newAbout) Changes the about of this userchangeBusinessAddress
(String address) Change the address of this business profileprivate CompletableFuture
<String> changeBusinessAttribute
(String key, String value) changeBusinessCategories
(List<BusinessCategory> categories) Change the categories of this business profilechangeBusinessDescription
(String description) Change the description of this business profilechangeBusinessEmail
(String email) Change the email of this business profilechangeBusinessWebsites
(List<URI> websites) Change the websites of this business profilechangeCommunitySetting
(JidProvider community, CommunitySetting setting, ChatSettingPolicy policy) Changes a community settingchangeEphemeralTimer
(JidProvider chat, ChatEphemeralTimer timer) Enables ephemeral messages in a chat, this means that messages will be automatically cancelled in said chat after a weekchangeGroupDescription
(JidProvider group, String description) Changes the description of a groupprivate CompletableFuture
<Void> changeGroupDescription
(JidProvider group, String description, String descriptionId) changeGroupPicture
(JidProvider group, byte[] image) Changes the picture of a groupchangeGroupPicture
(JidProvider group, URI image) Changes the picture of a groupchangeGroupSetting
(JidProvider group, GroupSetting setting, ChatSettingPolicy policy) Changes a group settingchangeGroupSubject
(JidProvider group, String newName) Changes the name of a groupchangeName
(String newName) Changes the name of this userChanges the default ephemeral timer of new chats.changeNewsletterDescription
(JidProvider newsletter, String description) Changes the description of a newsletterchangePresence
(boolean available) Changes your presence for everyone on WhatsappchangePresence
(JidProvider chatJid, ContactStatus presence) Changes your presence for a specific chatfinal CompletableFuture
<Void> changePrivacySetting
(PrivacySettingType type, PrivacySettingValue value, JidProvider... excluded) Changes a privacy setting in Whatsapp's settings.changeProfilePicture
(byte[] image) Changes the profile picture of yourselfprivate void
checkBusinessAttributeConflict
(String key, String value, Node result) private Jid
checkGroupParticipantJid
(Jid jid, String errorMessage) clearChat
(JidProvider chat, boolean keepStarredMessages) Clears the content of a chat for this client and its companions using a modern version of Whatsapp Important: this message doesn't seem to work always as of nowconnect()
Connects to Whatsappprivate PatchRequest.PatchEntry
private AppStateSyncKey
createAppKey
(Jid jid, int index) private AppStateSyncKeyData
createAppKeyData
(Jid jid, int index) private AppStateSyncKeyFingerprint
createAppKeyFingerprint
(Jid jid, int index) private Node
createCallNode
(JidProvider provider) private Collection
<Node> createCategories
(List<BusinessCategory> categories) createCommunity
(String subject, String body) Creates a new communityprivate List
<PatchRequest.PatchEntry> private PatchRequest.PatchEntry
createContactRequestEntry
(Contact contact) private PatchRequest
private PatchRequest
Creates a new request to get a document containing all the data that was collected by Whatsapp about this user.createGroup
(String subject, ChatEphemeralTimer timer, JidProvider parentGroup) Creates a new groupcreateGroup
(String subject, ChatEphemeralTimer timer, JidProvider... contacts) Creates a new groupcreateGroup
(String subject, ChatEphemeralTimer timer, JidProvider parentCommunity, JidProvider... contacts) Creates a new groupcreateGroup
(String subject, JidProvider... contacts) Creates a new groupprivate ProtocolMessage
createHistoryProtocolMessage
(MediaFile upload, HistorySync.Type type) private PatchRequest.PatchEntry
createNewsletter
(String name) Creates a newslettercreateNewsletter
(String name, String description) Creates newsletter channelcreateNewsletter
(String name, String description, byte[] picture) Creates a newsletterprivate PatchRequest.PatchEntry
private PatchRequest.PatchEntry
createPrimaryVersionEntry
(PrimaryVersionAction primaryVersion, String to) private PatchRequest.PatchEntry
private ActionMessageRangeSync
createRange
(JidProvider chat, boolean allMessages) private PatchRequest
private PatchRequest
private PatchRequest.PatchEntry
createWebsites
(List<URI> websites) static WhatsappCustomBuilder
Creates an advanced builder if you need more customizationdeleteChat
(JidProvider chat) Deletes a chat for this client and its companions using a modern version of Whatsapp Important: this message doesn't seem to work always as of nowdeleteMessage
(ChatMessageInfo messageInfo, boolean everyone) Deletes a messagedeleteMessage
(NewsletterMessageInfo messageInfo) Deletes a messagedemoteGroupParticipant
(JidProvider group, JidProvider... contacts) Demotes any number of contacts to admin in a groupDisables two-factor authentication Mobile API onlyDisconnects from Whatsapp Web's WebSocket if a previous connection existsCompletableFuture
<Optional<byte[]>> downloadMedia
(ChatMessageInfo info) Downloads a media from Whatsapp's servers.CompletableFuture
<Optional<byte[]>> Downloads a media from Whatsapp's servers.CompletableFuture
<Optional<byte[]>> downloadMedia
(MediaMessage<?> mediaMessage) Downloads a media from Whatsapp's servers.<T extends MessageInfo>
CompletableFuture<T> editMessage
(T oldMessage, Message newMessage) Builds and sends an edited messageEnables two-factor authentication Mobile API onlyEnables two-factor authentication Mobile API onlyprivate CompletableFuture
<List<Jid>> executeActionOnGroupParticipant
(JidProvider group, GroupAction action, JidProvider... jids) private String
findErrorNode
(Node result) private String
fromMeToFlag
(MessageInfo info) private Optional
<BusinessProfile> getBusinessProfile
(Node result) private int
getDeleteBit
(MessageInfo info) private int
getEditBit
(MessageInfo info) Queries the document containing all the data that was collected by Whatsapp about this user.getInstanceByUuid
(UUID uuid) private int
private GroupPastParticipants
getPastParticipants
(Chat chat) private CompletableFuture
<CompanionLinkResult> handleCompanionEncrypt
(Node result, Jid companion, int keyId) private CompletableFuture
<CompanionLinkResult> handleCompanionPairing
(Node result, int keyId) private void
handleGroupAction
(GroupAction action, Chat chat, Jid entry) private void
handleLeaveGroup
(JidProvider group) hasWhatsapp
(JidProvider contact) Executes a query to determine whether a user has an account on WhatsapphasWhatsapp
(JidProvider... contacts) Executes a query to determine whether any number of users have an account on Whatsappboolean
Returns whether the connection is active or notstatic boolean
isConnected
(long phoneNumber) Checks if a connection existsstatic boolean
isConnected
(String alias) Checks if a connection existsstatic boolean
isConnected
(UUID uuid) Checks if a connection existsprivate boolean
isValidEmail
(String email) private Jid
joinNewsletter
(JidProvider newsletter) Joins a newsletterkeys()
Returns the keys associated with this sessionleaveGroup
(JidProvider group) Leaves a groupleaveNewsletter
(JidProvider newsletter) Leaves a newsletterlinkDevice
(byte[] qrCode) Links a companion to this deviceprivate CompletableFuture
<CompanionLinkResult> linkDevice
(byte[] advIdentity, byte[] identityKey, String ref, byte[] publicKey) linkDevice
(String qrCodeData) Links a companion to this device Mobile api onlylinkGroupsToCommunity
(JidProvider community, JidProvider... groups) Links any number of groups to a communitylogout()
Disconnects from Whatsapp Web's WebSocket and logs out of WhatsappWeb invalidating the previous saved credentials.private CompletableFuture
<Void> mark
(JidProvider chat, boolean read) private CompletableFuture
<Void> markAllAsRead
(JidProvider chat) markChatRead
(JidProvider chat) Marks a chat as read.markChatUnread
(JidProvider chat) Marks a chat as unreadMarks a message as playedMarks a message as readCreates a new mobile api The mobile api is based around the Whatsapp App available on IOS and AndroidmuteChat
(JidProvider chat) Mutes a chat indefinitelymuteChat
(JidProvider chat, ChatMute mute) Mutes a chatprivate Call
onCallSent
(JidProvider provider, String callId, Node result) private void
onDescriptionSet
(JidProvider groupJid, String description) private CompletableFuture
<Optional<Newsletter>> onNewsletterCreation
(Optional<Newsletter> result) private void
onPrivacyFeatureChanged
(PrivacySettingType type, PrivacySettingValue value, List<Jid> excludedJids) parseAcceptInvite
(Node result) private List
<BusinessCatalogEntry> parseCatalog
(Node result) private Optional
<BusinessVerifiedNameCertificate> parseCertificate
(Node result) private List
<BusinessCollectionEntry> parseCollections
(Node result) parseGroupActionResponse
(Node result, JidProvider groupJid, GroupAction action) private Optional
<GroupMetadata> parseGroupResponse
(Node response) private HasWhatsappResponse
parseHasWhatsappResponse
(Node node) private Map
<Jid, HasWhatsappResponse> parseHasWhatsappResponse
(List<Jid> contacts, List<Node> nodes) private String
parseInviteCode
(Node result) parseLinksResponse
(Node result, JidProvider[] groups) private void
parseMediaReupload
(ChatMessageInfo info, MediaMessage<?> mediaMessage, byte[] retryKey, byte[] retryIdData, Node node) parseNameResponse
(Node result) private Optional
<Newsletter> parseNewsletterCreation
(Node response) private long
parseNewsletterSubscribers
(Node response) private Optional
<RecommendedNewslettersResponse> parseRecommendedNewsletters
(Node response) private boolean
parseUnlinkResponse
(Node result, JidProvider group) private String
participantToFlag
(MessageInfo info) pinChat
(JidProvider chat) Pins a chat to the top.private CompletableFuture
<Void> pinChat
(JidProvider chat, boolean pin) promoteGroupParticipant
(JidProvider group, JidProvider... contacts) Promotes any number of contacts to admin in a groupqueryAbout
(JidProvider chat) Queries the written whatsapp status of a ContactQueries the block listQuery the catalog of this businessqueryBusinessCatalog
(int productsLimit) Query the catalog of this businessqueryBusinessCatalog
(JidProvider contact) Query the catalog of a businessqueryBusinessCatalog
(JidProvider contact, int productsLimit) Query the catalog of a businessQueries all the known business categoriesqueryBusinessCertificate
(JidProvider provider) Gets the verified name certificateQuery the collections of this businessqueryBusinessCollections
(int collectionsLimit) Query the collections of this businessqueryBusinessCollections
(JidProvider contact) Query the collections of a businessqueryBusinessCollections
(JidProvider contact, int collectionsLimit) Query the collections of a businessqueryBusinessProfile
(JidProvider contact) Queries a business profile, if availableQueries the invite code of a groupQueries the metadata of a groupqueryName
(JidProvider contactJid) Queries the display name of a contactprivate CompletableFuture
<Optional<String>> queryNameFromServer
(JidProvider contactJid) queryNewsletterMessages
(JidProvider newsletterJid, int count) Queries any number of messages from a newsletterqueryNewsletterSubscribers
(JidProvider newsletterJid) Queries the number of people subscribed to a newsletterqueryPicture
(JidProvider chat) Queries the profile picturequeryRecommendedNewsletters
(String countryCode) Queries a list of fifty recommended newsletters by countryqueryRecommendedNewsletters
(String countryCode, int limit) Queries a list of recommended newsletters by countryDisconnects and reconnects to Whatsapp Web's WebSocket if a previous connection existsremoveGroupParticipant
(JidProvider group, JidProvider... contacts) Removes any number of contacts from groupprotected static void
removeInstanceByUuid
(UUID uuid) removeListener
(Listener listener) Unregisters a listenerCompletableFuture
<? extends MessageInfo> removeReaction
(MessageInfo message) Remove a reaction from a messageAsks Whatsapp for a media reupload for a specific mediarevokeGroupInvite
(JidProvider chat) Revokes the invite code of a groupprivate CompletableFuture
<Void> sendAppStateKeysMessage
(Jid companion) private CompletableFuture
<Call> sendCallMessage
(JidProvider provider) sendChatMessage
(JidProvider recipient, MessageContainer message) Builds and sends a message from a recipient and a messageprivate CompletableFuture
<Void> sendHistoryProtocolMessage
(Jid jid, HistorySync historySync, HistorySync.Type type) private CompletableFuture
<Void> private CompletableFuture
<Void> private CompletableFuture
<Void> private CompletableFuture
<Void> sendMessage
(ChatMessageInfo info) Sends a message to a chatSends a message to a newsletterCompletableFuture
<? extends MessageInfo> sendMessage
(JidProvider chat, Message message) Builds and sends a message from a chat and a messageCompletableFuture
<? extends MessageInfo> sendMessage
(JidProvider recipient, MessageContainer message) Builds and sends a message from a recipient and a messageCompletableFuture
<? extends MessageInfo> sendMessage
(JidProvider chat, String message) Builds and sends a message from a chat and a messagesendNewsletterMessage
(JidProvider recipient, MessageContainer message) Builds and sends a message from a recipient and a messageSends a custom node to Whatsappprivate CompletableFuture
<Void> sendPushNamesMessage
(Jid jid) CompletableFuture
<? extends MessageInfo> sendReaction
(MessageInfo message, Emoji reaction) Send a reaction to a messageCompletableFuture
<? extends MessageInfo> sendReaction
(MessageInfo message, String reaction) Send a reaction to a messageprivate CompletableFuture
<Void> sendRecentMessage
(Jid jid) private CompletableFuture
<Boolean> starMessage
(ChatMessageInfo info) Stars a messageprivate CompletableFuture
<ChatMessageInfo> starMessage
(ChatMessageInfo info, boolean star) startCall
(JidProvider contact) Starts a call with a contact Mobile API onlyRejects an incoming call or stops an active call Mobile API onlyRejects an incoming call or stops an active call Mobile API onlystore()
Returns the store associated with this sessionSubscribes to a public newsletter's event stream of reactionsSends a request to Whatsapp in order to receive updates when the status of a contact changes.private CompletableFuture
<Void> syncCompanionState
(Jid companion) unarchive
(JidProvider chat) Unarchives a chatunblockContact
(JidProvider contact) Unblocks a contactunlinkDevice
(Jid companion) Unlinks a specific companionUnlinks all the companions of this deviceunlinkGroupFromCommunity
(JidProvider community, JidProvider group) Unlinks a group from a communityunmuteChat
(JidProvider chat) Unmutes a chatunpinChat
(JidProvider chat) Unpins a chat from the topunstarMessage
(ChatMessageInfo info) Removes star from a messageprivate void
updateSelfPresence
(JidProvider chatJid, ContactStatus presence) static ConnectionBuilder
<WebOptionsBuilder> Creates a new web api The web api is based around the WhatsappWeb client
-
Field Details
-
instances
-
socketHandler
private final it.auties.whatsapp.socket.SocketHandler socketHandler
-
-
Constructor Details
-
Whatsapp
protected Whatsapp(Store store, Keys keys, ErrorHandler errorHandler, WebVerificationSupport webVerificationSupport, ExecutorService socketExecutor)
-
-
Method Details
-
getInstanceByUuid
-
removeInstanceByUuid
-
isConnected
Checks if a connection exists- Parameters:
uuid
- the non-null uuid- Returns:
- a boolean
-
isConnected
public static boolean isConnected(long phoneNumber) Checks if a connection exists- Parameters:
phoneNumber
- the non-null phone number- Returns:
- a boolean
-
isConnected
Checks if a connection exists- Parameters:
alias
- the non-null alias- Returns:
- a boolean
-
webBuilder
Creates a new web api The web api is based around the WhatsappWeb client- Returns:
- a web api builder
-
mobileBuilder
Creates a new mobile api The mobile api is based around the Whatsapp App available on IOS and Android- Returns:
- a web mobile builder
-
customBuilder
Creates an advanced builder if you need more customization- Returns:
- a custom builder
-
connect
Connects to Whatsapp- Returns:
- a future
-
isConnected
public boolean isConnected()Returns whether the connection is active or not- Returns:
- a boolean
-
keys
Returns the keys associated with this session- Returns:
- a non-null WhatsappKeys
-
store
Returns the store associated with this session- Returns:
- a non-null WhatsappStore
-
disconnect
Disconnects from Whatsapp Web's WebSocket if a previous connection exists- Returns:
- a future
-
reconnect
Disconnects and reconnects to Whatsapp Web's WebSocket if a previous connection exists- Returns:
- a future
-
logout
Disconnects from Whatsapp Web's WebSocket and logs out of WhatsappWeb invalidating the previous saved credentials. The next time the API is used, the QR code will need to be scanned again.- Returns:
- a future
-
changePrivacySetting
public final CompletableFuture<Void> changePrivacySetting(PrivacySettingType type, PrivacySettingValue value, JidProvider... excluded) Changes a privacy setting in Whatsapp's settings. If the value isPrivacySettingValue.CONTACTS_EXCEPT
, the excluded parameter should also be filled or an exception will be thrown, otherwise it will be ignored.- Parameters:
type
- the non-null setting to changevalue
- the non-null value to attribute to the settingexcluded
- the non-null excluded contacts if value isPrivacySettingValue.CONTACTS_EXCEPT
- Returns:
- the same instance wrapped in a completable future
-
onPrivacyFeatureChanged
private void onPrivacyFeatureChanged(PrivacySettingType type, PrivacySettingValue value, List<Jid> excludedJids) -
changeNewChatsEphemeralTimer
Changes the default ephemeral timer of new chats.- Parameters:
timer
- the new ephemeral timer- Returns:
- the same instance wrapped in a completable future
-
createGdprAccountInfo
Creates a new request to get a document containing all the data that was collected by Whatsapp about this user. It takes three business days to receive it. To query the newsletters status, usegetGdprAccountInfoStatus()
- Returns:
- the same instance wrapped in a completable future
-
getGdprAccountInfoStatus
Queries the document containing all the data that was collected by Whatsapp about this user. To create a request for this document, usecreateGdprAccountInfo()
- Returns:
- the same instance wrapped in a completable future
-
changeName
Changes the name of this user- Parameters:
newName
- the non-null new name- Returns:
- the same instance wrapped in a completable future
-
changeAbout
Changes the about of this user- Parameters:
newAbout
- the non-null new status- Returns:
- the same instance wrapped in a completable future
-
subscribeToPresence
Sends a request to Whatsapp in order to receive updates when the status of a contact changes. These changes include the last known presence and the seconds the contact was last seen.- Parameters:
jid
- the contact whose status the api should receive updates on- Returns:
- a CompletableFuture
-
removeReaction
Remove a reaction from a message- Parameters:
message
- the non-null message- Returns:
- a CompletableFuture
-
sendReaction
Send a reaction to a message- Parameters:
message
- the non-null messagereaction
- the reaction to send, null if you want to remove the reaction- Returns:
- a CompletableFuture
-
sendReaction
Send a reaction to a message- Parameters:
message
- the non-null messagereaction
- the reaction to send, null if you want to remove the reaction. If a string that isn't an emoji supported by Whatsapp is used, it will not get displayed correctly. UsesendReaction(MessageInfo, Emoji)
if you need a typed emoji enum.- Returns:
- a CompletableFuture
-
sendMessage
Builds and sends a message from a chat and a message- Parameters:
chat
- the chat where the message should be sentmessage
- the message to send- Returns:
- a CompletableFuture
-
sendMessage
Builds and sends a message from a chat and a message- Parameters:
chat
- the chat where the message should be sentmessage
- the message to send- Returns:
- a CompletableFuture
-
sendMessage
public CompletableFuture<? extends MessageInfo> sendMessage(JidProvider recipient, MessageContainer message) Builds and sends a message from a recipient and a message- Parameters:
recipient
- the recipient where the message should be sentmessage
- the message to send- Returns:
- a CompletableFuture
-
sendChatMessage
public CompletableFuture<ChatMessageInfo> sendChatMessage(JidProvider recipient, MessageContainer message) Builds and sends a message from a recipient and a message- Parameters:
recipient
- the recipient where the message should be sentmessage
- the message to send- Returns:
- a CompletableFuture
-
sendNewsletterMessage
public CompletableFuture<NewsletterMessageInfo> sendNewsletterMessage(JidProvider recipient, MessageContainer message) Builds and sends a message from a recipient and a message- Parameters:
recipient
- the recipient where the message should be sentmessage
- the message to send- Returns:
- a CompletableFuture
-
editMessage
Builds and sends an edited message- Parameters:
oldMessage
- the message to editnewMessage
- the new message's content- Returns:
- a CompletableFuture
-
sendMessage
Sends a message to a chat- Parameters:
info
- the message to send- Returns:
- a CompletableFuture
-
sendMessage
Sends a message to a newsletter- Parameters:
info
- the message to send- Returns:
- a CompletableFuture
-
markChatRead
Marks a chat as read.- Parameters:
chat
- the target chat- Returns:
- a CompletableFuture
-
markAllAsRead
-
markChatUnread
Marks a chat as unread- Parameters:
chat
- the target chat- Returns:
- a CompletableFuture
-
mark
-
createRange
-
markMessageRead
Marks a message as read- Parameters:
info
- the target message- Returns:
- a CompletableFuture
-
awaitMessageReply
Awaits for a single newsletters to a message- Parameters:
info
- the non-null message whose newsletters is pending- Returns:
- a non-null newsletters
-
awaitMessageReply
Awaits for a single newsletters to a message- Parameters:
id
- the non-null id of message whose newsletters is pending- Returns:
- a non-null newsletters
-
hasWhatsapp
Executes a query to determine whether a user has an account on Whatsapp- Parameters:
contact
- the contact to check- Returns:
- a CompletableFuture that wraps a non-null newsletters
-
hasWhatsapp
Executes a query to determine whether any number of users have an account on Whatsapp- Parameters:
contacts
- the contacts to check- Returns:
- a CompletableFuture that wraps a non-null map
-
parseHasWhatsappResponse
-
parseHasWhatsappResponse
-
queryBlockList
Queries the block list- Returns:
- a CompletableFuture
-
queryName
Queries the display name of a contact- Parameters:
contactJid
- the non-null contact- Returns:
- a CompletableFuture
-
queryNameFromServer
-
parseNameResponse
-
queryAbout
Queries the written whatsapp status of a Contact- Parameters:
chat
- the target contact- Returns:
- a CompletableFuture that wraps an optional contact status newsletters
-
queryPicture
Queries the profile picture- Parameters:
chat
- the chat of the chat to query- Returns:
- a CompletableFuture that wraps nullable jpg url hosted on Whatsapp's servers
-
queryGroupMetadata
Queries the metadata of a group- Parameters:
chat
- the target group- Returns:
- a CompletableFuture
-
queryBusinessProfile
Queries a business profile, if available- Parameters:
contact
- the target contact- Returns:
- a CompletableFuture
-
getBusinessProfile
-
queryBusinessCategories
Queries all the known business categories- Returns:
- a CompletableFuture
-
queryGroupInviteCode
Queries the invite code of a group- Parameters:
chat
- the target group- Returns:
- a CompletableFuture
-
parseInviteCode
-
revokeGroupInvite
Revokes the invite code of a group- Parameters:
chat
- the target group- Returns:
- a CompletableFuture
-
acceptGroupInvite
Accepts the invite for a group- Parameters:
inviteCode
- the invite countryCode- Returns:
- a CompletableFuture
-
parseAcceptInvite
-
changePresence
Changes your presence for everyone on Whatsapp- Parameters:
available
- whether you are online or not- Returns:
- a CompletableFuture
-
updateSelfPresence
-
changePresence
Changes your presence for a specific chat- Parameters:
chatJid
- the target chatpresence
- the new status- Returns:
- a CompletableFuture
-
promoteGroupParticipant
public CompletableFuture<List<Jid>> promoteGroupParticipant(JidProvider group, JidProvider... contacts) Promotes any number of contacts to admin in a group- Parameters:
group
- the target groupcontacts
- the target contacts- Returns:
- a CompletableFuture
-
demoteGroupParticipant
public CompletableFuture<List<Jid>> demoteGroupParticipant(JidProvider group, JidProvider... contacts) Demotes any number of contacts to admin in a group- Parameters:
group
- the target groupcontacts
- the target contacts- Returns:
- a CompletableFuture
-
addGroupParticipant
Adds any number of contacts to a group- Parameters:
group
- the target groupcontacts
- the target contact/s- Returns:
- a CompletableFuture
-
removeGroupParticipant
public CompletableFuture<List<Jid>> removeGroupParticipant(JidProvider group, JidProvider... contacts) Removes any number of contacts from group- Parameters:
group
- the target groupcontacts
- the target contact/s- Returns:
- a CompletableFuture
-
executeActionOnGroupParticipant
private CompletableFuture<List<Jid>> executeActionOnGroupParticipant(JidProvider group, GroupAction action, JidProvider... jids) -
checkGroupParticipantJid
-
parseGroupActionResponse
-
handleGroupAction
-
changeGroupSubject
Changes the name of a group- Parameters:
group
- the target groupnewName
- the new name for the group- Returns:
- a CompletableFuture
- Throws:
IllegalArgumentException
- if the provided new name is empty or blank
-
changeGroupDescription
Changes the description of a group- Parameters:
group
- the target groupdescription
- the new name for the group, can be null if you want to remove it- Returns:
- a CompletableFuture
-
changeGroupDescription
private CompletableFuture<Void> changeGroupDescription(JidProvider group, String description, String descriptionId) -
onDescriptionSet
-
changeGroupSetting
public CompletableFuture<Void> changeGroupSetting(JidProvider group, GroupSetting setting, ChatSettingPolicy policy) Changes a group setting- Parameters:
group
- the non-null group affected by this changesetting
- the non-null settingpolicy
- the non-null policy- Returns:
- a future
-
changeProfilePicture
Changes the profile picture of yourself- Parameters:
image
- the new image, can be null if you want to remove it- Returns:
- a CompletableFuture
-
changeGroupPicture
Changes the picture of a group- Parameters:
group
- the target groupimage
- the new image, can be null if you want to remove it- Returns:
- a CompletableFuture
-
changeGroupPicture
Changes the picture of a group- Parameters:
group
- the target groupimage
- the new image, can be null if you want to remove it- Returns:
- a CompletableFuture
-
createGroup
public CompletableFuture<Optional<GroupMetadata>> createGroup(String subject, JidProvider... contacts) Creates a new group- Parameters:
subject
- the new group's namecontacts
- at least one contact to add to the group- Returns:
- a CompletableFuture
-
createGroup
public CompletableFuture<Optional<GroupMetadata>> createGroup(String subject, ChatEphemeralTimer timer, JidProvider... contacts) Creates a new group- Parameters:
subject
- the new group's nametimer
- the default ephemeral timer for messages sent in this groupcontacts
- at least one contact to add to the group- Returns:
- a CompletableFuture
-
createGroup
public CompletableFuture<Optional<GroupMetadata>> createGroup(String subject, ChatEphemeralTimer timer, JidProvider parentGroup) Creates a new group- Parameters:
subject
- the new group's nametimer
- the default ephemeral timer for messages sent in this groupparentGroup
- the community to whom the new group will be linked- Returns:
- a CompletableFuture
-
createGroup
public CompletableFuture<Optional<GroupMetadata>> createGroup(String subject, ChatEphemeralTimer timer, JidProvider parentCommunity, JidProvider... contacts) Creates a new group- Parameters:
subject
- the new group's nametimer
- the default ephemeral timer for messages sent in this groupparentCommunity
- the community to whom the new group will be linkedcontacts
- at least one contact to add to the group, not enforced if part of a community- Returns:
- a CompletableFuture
-
parseGroupResponse
-
addNewGroup
-
findErrorNode
-
leaveGroup
Leaves a group- Parameters:
group
- the target group- Throws:
IllegalArgumentException
- if the provided chat is not a group
-
handleLeaveGroup
-
linkGroupsToCommunity
public CompletableFuture<Map<Jid,Boolean>> linkGroupsToCommunity(JidProvider community, JidProvider... groups) Links any number of groups to a community- Parameters:
community
- the non-null community where the groups will be addedgroups
- the non-null groups to add- Returns:
- a CompletableFuture that wraps a map guaranteed to contain every group that was provided as input paired to whether the request was successful
-
parseLinksResponse
-
unlinkGroupFromCommunity
public CompletableFuture<Boolean> unlinkGroupFromCommunity(JidProvider community, JidProvider group) Unlinks a group from a community- Parameters:
community
- the non-null parent communitygroup
- the non-null group to unlink- Returns:
- a CompletableFuture that indicates whether the request was successful
-
parseUnlinkResponse
-
muteChat
Mutes a chat indefinitely- Parameters:
chat
- the target chat- Returns:
- a CompletableFuture
-
muteChat
Mutes a chat- Parameters:
chat
- the target chatmute
- the type of mute- Returns:
- a CompletableFuture
-
unmuteChat
Unmutes a chat- Parameters:
chat
- the target chat- Returns:
- a CompletableFuture
-
blockContact
Blocks a contact- Parameters:
contact
- the target chat- Returns:
- a CompletableFuture
-
unblockContact
Unblocks a contact- Parameters:
contact
- the target chat- Returns:
- a CompletableFuture
-
changeEphemeralTimer
Enables ephemeral messages in a chat, this means that messages will be automatically cancelled in said chat after a week- Parameters:
chat
- the target chat- Returns:
- a CompletableFuture
-
markMessagePlayed
Marks a message as played- Parameters:
info
- the target message- Returns:
- a CompletableFuture
-
pinChat
Pins a chat to the top. A maximum of three chats can be pinned to the top. This condition can be checked using;.- Parameters:
chat
- the target chat- Returns:
- a CompletableFuture
-
unpinChat
Unpins a chat from the top- Parameters:
chat
- the target chat- Returns:
- a CompletableFuture
-
pinChat
-
starMessage
Stars a message- Parameters:
info
- the target message- Returns:
- a CompletableFuture
-
starMessage
-
fromMeToFlag
-
participantToFlag
-
booleanToInt
-
unstarMessage
Removes star from a message- Parameters:
info
- the target message- Returns:
- a CompletableFuture
-
archiveChat
Archives a chat. If said chat is pinned, it will be unpinned.- Parameters:
chat
- the target chat- Returns:
- a CompletableFuture
-
archiveChat
-
unarchive
Unarchives a chat- Parameters:
chat
- the target chat- Returns:
- a CompletableFuture
-
deleteMessage
Deletes a message- Parameters:
messageInfo
- the non-null message to delete- Returns:
- a CompletableFuture
-
deleteMessage
Deletes a message- Parameters:
messageInfo
- non-null message to deleteeveryone
- whether the message should be deleted for everyone or only for this client and its companions- Returns:
- a CompletableFuture
-
getEditBit
-
getDeleteBit
-
deleteChat
Deletes a chat for this client and its companions using a modern version of Whatsapp Important: this message doesn't seem to work always as of now- Parameters:
chat
- the non-null chat to delete- Returns:
- a CompletableFuture
-
clearChat
Clears the content of a chat for this client and its companions using a modern version of Whatsapp Important: this message doesn't seem to work always as of now- Parameters:
chat
- the non-null chat to clearkeepStarredMessages
- whether starred messages in this chat should be kept- Returns:
- a CompletableFuture
-
changeBusinessDescription
Change the description of this business profile- Parameters:
description
- the new description, can be null- Returns:
- a CompletableFuture
-
changeBusinessAttribute
-
checkBusinessAttributeConflict
-
changeBusinessAddress
Change the address of this business profile- Parameters:
address
- the new address, can be null- Returns:
- a CompletableFuture
-
changeBusinessEmail
Change the email of this business profile- Parameters:
email
- the new email, can be null- Returns:
- a CompletableFuture
-
isValidEmail
-
changeBusinessCategories
public CompletableFuture<List<BusinessCategory>> changeBusinessCategories(List<BusinessCategory> categories) Change the categories of this business profile- Parameters:
categories
- the new categories, can be null- Returns:
- a CompletableFuture
-
createCategories
-
changeBusinessWebsites
Change the websites of this business profile- Parameters:
websites
- the new websites, can be null- Returns:
- a CompletableFuture
-
createWebsites
-
queryBusinessCatalog
Query the catalog of this business- Returns:
- a CompletableFuture
-
queryBusinessCatalog
Query the catalog of this business- Parameters:
productsLimit
- the maximum number of products to query- Returns:
- a CompletableFuture
-
queryBusinessCatalog
public CompletableFuture<List<BusinessCatalogEntry>> queryBusinessCatalog(JidProvider contact, int productsLimit) Query the catalog of a business- Parameters:
contact
- the businessproductsLimit
- the maximum number of products to query- Returns:
- a CompletableFuture
-
parseCatalog
-
queryBusinessCatalog
Query the catalog of a business- Parameters:
contact
- the business- Returns:
- a CompletableFuture
-
queryBusinessCollections
Query the collections of this business- Returns:
- a CompletableFuture
-
queryBusinessCollections
Query the collections of this business- Parameters:
collectionsLimit
- the maximum number of collections to query- Returns:
- a CompletableFuture
-
queryBusinessCollections
public CompletableFuture<List<BusinessCollectionEntry>> queryBusinessCollections(JidProvider contact, int collectionsLimit) Query the collections of a business- Parameters:
contact
- the businesscollectionsLimit
- the maximum number of collections to query- Returns:
- a CompletableFuture
-
parseCollections
-
queryBusinessCollections
Query the collections of a business- Parameters:
contact
- the business- Returns:
- a CompletableFuture
-
downloadMedia
Downloads a media from Whatsapp's servers. If the media was already downloaded, the cached version will be returned. If the download fails because the media is too old/invalid, a reupload request will be sent to Whatsapp. If the latter fails as well, an empty optional will be returned.- Parameters:
info
- the non-null message info wrapping the media- Returns:
- a CompletableFuture
-
downloadMedia
Downloads a media from Whatsapp's servers. If the media was already downloaded, the cached version will be returned. If the download fails because the media is too old/invalid, an empty optional will be returned.- Parameters:
info
- the non-null message info wrapping the media- Returns:
- a CompletableFuture
-
downloadMedia
Downloads a media from Whatsapp's servers. If the media was already downloaded, the cached version will be returned. If the download fails because the media is too old/invalid, an empty optional will be returned.- Parameters:
mediaMessage
- the non-null media- Returns:
- a CompletableFuture
-
requireMediaReupload
Asks Whatsapp for a media reupload for a specific media- Parameters:
info
- the non-null message info wrapping the media- Returns:
- a CompletableFuture
-
parseMediaReupload
private void parseMediaReupload(ChatMessageInfo info, MediaMessage<?> mediaMessage, byte[] retryKey, byte[] retryIdData, Node node) -
sendNode
Sends a custom node to Whatsapp- Parameters:
node
- the non-null node to send- Returns:
- the newsletters from Whatsapp
-
createCommunity
Creates a new community- Parameters:
subject
- the non-null name of the new communitybody
- the nullable description of the new community- Returns:
- a CompletableFuture
-
changeCommunitySetting
public CompletableFuture<Void> changeCommunitySetting(JidProvider community, CommunitySetting setting, ChatSettingPolicy policy) Changes a community setting- Parameters:
community
- the non-null community affected by this changesetting
- the non-null settingpolicy
- the non-null policy- Returns:
- a future
-
unlinkDevices
Unlinks all the companions of this device- Returns:
- a future
-
unlinkDevice
Unlinks a specific companion- Parameters:
companion
- the non-null companion to unlink- Returns:
- a future
-
linkDevice
Links a companion to this device- Parameters:
qrCode
- the non-null qr code as an image- Returns:
- a future
-
linkDevice
Links a companion to this device Mobile api only- Parameters:
qrCodeData
- the non-null qr code as a String- Returns:
- a future
-
linkDevice
private CompletableFuture<CompanionLinkResult> linkDevice(byte[] advIdentity, byte[] identityKey, String ref, byte[] publicKey) -
getMaxLinkedDevices
private int getMaxLinkedDevices() -
handleCompanionPairing
-
awaitCompanionRegistration
-
handleCompanionEncrypt
private CompletableFuture<CompanionLinkResult> handleCompanionEncrypt(Node result, Jid companion, int keyId) -
syncCompanionState
-
createRegularRequests
-
createRegularLowRequests
-
createCriticalBlockRequest
-
createCriticalUnblockLowRequest
-
createContactEntries
-
createPushNameEntry
-
createLocaleEntry
-
createAndroidEntry
-
createNuxRequest
-
createPrimaryVersionEntry
private PatchRequest.PatchEntry createPrimaryVersionEntry(PrimaryVersionAction primaryVersion, String to) -
createTimeFormatEntry
-
createContactRequestEntry
-
sendRecentMessage
-
sendPushNamesMessage
-
sendInitialStatusMessage
-
sendInitialBootstrapMessage
-
sendInitialNullMessage
-
getPastParticipants
-
sendAppStateKeysMessage
-
createAppKey
-
createAppKeyData
-
createAppKeyFingerprint
-
sendInitialSecurityMessage
-
sendHistoryProtocolMessage
private CompletableFuture<Void> sendHistoryProtocolMessage(Jid jid, HistorySync historySync, HistorySync.Type type) -
createHistoryProtocolMessage
-
queryBusinessCertificate
public CompletableFuture<Optional<BusinessVerifiedNameCertificate>> queryBusinessCertificate(JidProvider provider) Gets the verified name certificate- Returns:
- a future
-
parseCertificate
-
enable2fa
Enables two-factor authentication Mobile API only- Parameters:
code
- the six digits non-null numeric code- Returns:
- a future
-
enable2fa
Enables two-factor authentication Mobile API only- Parameters:
code
- the six digits non-null numeric codeemail
- the nullable recovery email- Returns:
- a future
-
disable2fa
Disables two-factor authentication Mobile API only- Returns:
- a future
-
set2fa
-
startCall
Starts a call with a contact Mobile API only- Parameters:
contact
- the non-null contact- Returns:
- a future
-
sendCallMessage
-
onCallSent
-
createCallNode
-
stopCall
Rejects an incoming call or stops an active call Mobile API only- Parameters:
callId
- the non-null id of the call to reject- Returns:
- a future
-
stopCall
Rejects an incoming call or stops an active call Mobile API only- Parameters:
call
- the non-null call to reject- Returns:
- a future
-
queryRecommendedNewsletters
public CompletableFuture<Optional<RecommendedNewslettersResponse>> queryRecommendedNewsletters(String countryCode) Queries a list of fifty recommended newsletters by country- Parameters:
countryCode
- the non-null country code- Returns:
- a list of recommended newsletters, if the feature is available
-
queryRecommendedNewsletters
public CompletableFuture<Optional<RecommendedNewslettersResponse>> queryRecommendedNewsletters(String countryCode, int limit) Queries a list of recommended newsletters by country- Parameters:
countryCode
- the non-null country codelimit
- how many entries should be returned- Returns:
- a list of recommended newsletters, if the feature is available
-
parseRecommendedNewsletters
-
queryNewsletterMessages
Queries any number of messages from a newsletter- Parameters:
newsletterJid
- the non-null jid of the newslettercount
- how many messages should be queried- Returns:
- a future
-
subscribeToNewsletterReactions
Subscribes to a public newsletter's event stream of reactions- Parameters:
channel
- the non-null channel- Returns:
- the time, in minutes, during which updates will be sent
-
createNewsletter
Creates a newsletter- Parameters:
name
- the non-null name of the newsletter- Returns:
- a future
-
createNewsletter
Creates newsletter channel- Parameters:
name
- the non-null name of the newsletterdescription
- the nullable description of the newsletter- Returns:
- a future
-
createNewsletter
public CompletableFuture<Optional<Newsletter>> createNewsletter(String name, String description, byte[] picture) Creates a newsletter- Parameters:
name
- the non-null name of the newsletterdescription
- the nullable description of the newsletterpicture
- the nullable profile picture of the newsletter- Returns:
- a future
-
parseNewsletterCreation
-
onNewsletterCreation
-
changeNewsletterDescription
public CompletableFuture<Void> changeNewsletterDescription(JidProvider newsletter, String description) Changes the description of a newsletter- Parameters:
newsletter
- the non-null target newsletterdescription
- the nullable new description- Returns:
- a future
-
joinNewsletter
Joins a newsletter- Parameters:
newsletter
- a non-null newsletter- Returns:
- a future
-
leaveNewsletter
Leaves a newsletter- Parameters:
newsletter
- a non-null newsletter- Returns:
- a future
-
queryNewsletterSubscribers
Queries the number of people subscribed to a newsletter- Parameters:
newsletterJid
- the id of the newsletter- Returns:
- a CompletableFuture
-
parseNewsletterSubscribers
-
addListener
Registers a listener- Parameters:
listener
- the listener to register- Returns:
- the same instance
-
removeListener
Unregisters a listener- Parameters:
listener
- the listener to unregister- Returns:
- the same instance
-
addActionListener
Registers an action listener- Parameters:
onAction
- the listener to register- Returns:
- the same instance
-
addChatMessagesSyncListener
Registers a chat recent messages listener- Parameters:
onChatRecentMessages
- the listener to register- Returns:
- the same instance
-
addChatsListener
Registers a chats listener- Parameters:
onChats
- the listener to register- Returns:
- the same instance
-
addChatsListener
Registers a chats listener- Parameters:
onChats
- the listener to register- Returns:
- the same instance
-
addNewslettersListener
Registers a newsletters listener- Parameters:
onNewsletters
- the listener to register- Returns:
- the same instance
-
addNewslettersListener
Registers a newsletters listener- Parameters:
onNewsletters
- the listener to register- Returns:
- the same instance
-
addContactPresenceListener
Registers a contact presence listener- Parameters:
onContactPresence
- the listener to register- Returns:
- the same instance
-
addContactsListener
Registers a contacts listener- Parameters:
onContacts
- the listener to register- Returns:
- the same instance
-
addMessageStatusListener
Registers a message status listener- Parameters:
onAnyMessageStatus
- the listener to register- Returns:
- the same instance
-
addDisconnectedListener
Registers a disconnected listener- Parameters:
onDisconnected
- the listener to register- Returns:
- the same instance
-
addFeaturesListener
Registers a features listener- Parameters:
onFeatures
- the listener to register- Returns:
- the same instance
-
addLoggedInListener
Registers a logged in listener- Parameters:
onLoggedIn
- the listener to register- Returns:
- the same instance
-
addMessageDeletedListener
Registers a message deleted listener- Parameters:
onMessageDeleted
- the listener to register- Returns:
- the same instance
-
addMetadataListener
Registers a metadata listener- Parameters:
onMetadata
- the listener to register- Returns:
- the same instance
-
addNewContactListener
Registers a new contact listener- Parameters:
onNewContact
- the listener to register- Returns:
- the same instance
-
addNewChatMessageListener
Registers a new message listener- Parameters:
onNewMessage
- the listener to register- Returns:
- the same instance
-
addNewStatusListener
Registers a new status listener- Parameters:
onNewMediaStatus
- the listener to register- Returns:
- the same instance
-
addNodeReceivedListener
Registers a received node listener- Parameters:
onNodeReceived
- the listener to register- Returns:
- the same instance
-
addNodeSentListener
Registers a sent node listener- Parameters:
onNodeSent
- the listener to register- Returns:
- the same instance
-
addSettingListener
Registers a setting listener- Parameters:
onSetting
- the listener to register- Returns:
- the same instance
-
addMediaStatusListener
Registers a status listener- Parameters:
onMediaStatus
- the listener to register- Returns:
- the same instance
-
addSocketEventListener
Registers an event listener- Parameters:
onSocketEvent
- the listener to register- Returns:
- the same instance
-
addActionListener
Registers an action listener- Parameters:
onAction
- the listener to register- Returns:
- the same instance
-
addHistorySyncProgressListener
Registers a sync progress listener- Parameters:
onSyncProgress
- the listener to register- Returns:
- the same instance
-
addChatMessagesSyncListener
Registers a chat recent messages listener- Parameters:
onChatRecentMessages
- the listener to register- Returns:
- the same instance
-
addContactPresenceListener
Registers a contact presence listener- Parameters:
onContactPresence
- the listener to register- Returns:
- the same instance
-
addContactsListener
Registers a contacts listener- Parameters:
onContacts
- the listener to register- Returns:
- the same instance
-
addMessageStatusListener
Registers a message status listener- Parameters:
onMessageStatus
- the listener to register- Returns:
- the same instance
-
addDisconnectedListener
Registers a disconnected listener- Parameters:
onDisconnected
- the listener to register- Returns:
- the same instance
-
addFeaturesListener
Registers a features listener- Parameters:
onFeatures
- the listener to register- Returns:
- the same instance
-
addLoggedInListener
Registers a logged in listener- Parameters:
onLoggedIn
- the listener to register- Returns:
- the same instance
-
addMessageDeletedListener
Registers a message deleted listener- Parameters:
onMessageDeleted
- the listener to register- Returns:
- the same instance
-
addMetadataListener
Registers a metadata listener- Parameters:
onMetadata
- the listener to register- Returns:
- the same instance
-
addNewChatMessageListener
Registers a new message listener- Parameters:
onNewMessage
- the listener to register- Returns:
- the same instance
-
addNewStatusListener
Registers a new status listener- Parameters:
onNewStatus
- the listener to register- Returns:
- the same instance
-
addNodeReceivedListener
Registers a received node listener- Parameters:
onNodeReceived
- the listener to register- Returns:
- the same instance
-
addNodeSentListener
Registers a sent node listener- Parameters:
onNodeSent
- the listener to register- Returns:
- the same instance
-
addSettingListener
Registers a setting listener- Parameters:
onSetting
- the listener to register- Returns:
- the same instance
-
addMediaStatusListener
Registers a status listener- Parameters:
onStatus
- the listener to register- Returns:
- the same instance
-
addSocketEventListener
Registers an event listener- Parameters:
onSocketEvent
- the listener to register- Returns:
- the same instance
-
addHistorySyncProgressListener
Registers a sync progress listener- Parameters:
onSyncProgress
- the listener to register- Returns:
- the same instance
-
addMessageReplyListener
Registers a message reply listener- Parameters:
onMessageReply
- the listener to register- Returns:
- the same instance
-
addMessageReplyListener
Registers a message reply listener for a specific message- Parameters:
info
- the non-null target messageonMessageReply
- the non-null listener
-
addMessageReplyListener
Registers a message reply listener- Parameters:
onMessageReply
- the listener to register- Returns:
- the same instance
-
addMessageReplyListener
public Whatsapp addMessageReplyListener(ChatMessageInfo info, OnWhatsappMessageReply onMessageReply) Registers a message reply listener for a specific message- Parameters:
info
- the non-null target messageonMessageReply
- the non-null listener
-
addMessageReplyListener
Registers a message reply listener for a specific message- Parameters:
id
- the non-null id of the target messageonMessageReply
- the non-null listener
-
addMessageReplyListener
Registers a message reply listener for a specific message- Parameters:
id
- the non-null id of the target messageonMessageReply
- the non-null listener
-
addNameChangedListener
Registers a name change listener- Parameters:
onUserNameChanged
- the non-null listener
-
addNameChangedListener
Registers a name change listener- Parameters:
onNameChange
- the non-null listener
-
addAboutChangedListener
Registers a status change listener- Parameters:
onUserAboutChanged
- the non-null listener
-
addAboutChangedListener
Registers a status change listener- Parameters:
onUserStatusChange
- the non-null listener
-
addUserPictureChangedListener
Registers a picture change listener- Parameters:
onProfilePictureChanged
- the non-null listener
-
addUserPictureChangedListener
Registers a picture change listener- Parameters:
onUserPictureChange
- the non-null listener
-
addContactPictureChangedListener
Registers a profile picture listener- Parameters:
onContactPictureChanged
- the non-null listener
-
addContactPictureChangedListener
public Whatsapp addContactPictureChangedListener(OnWhatsappContactPictureChanged onProfilePictureChange) Registers a profile picture listener- Parameters:
onProfilePictureChange
- the non-null listener
-
addGroupPictureChangedListener
Registers a group picture listener- Parameters:
onGroupPictureChange
- the non-null listener
-
addGroupPictureChangedListener
Registers a group picture listener- Parameters:
onGroupPictureChange
- the non-null listener
-
addContactBlockedListener
Registers a contact blocked listener- Parameters:
onContactBlocked
- the non-null listener
-
addContactBlockedListener
Registers a contact blocked listener- Parameters:
onContactBlocked
- the non-null listener
-
addPrivacySettingChangedListener
Registers a privacy setting changed listener- Parameters:
onPrivacySettingChanged
- the listener to register- Returns:
- the same instance
-
addPrivacySettingChangedListener
public Whatsapp addPrivacySettingChangedListener(OnWhatsappPrivacySettingChanged onWhatsappPrivacySettingChanged) Registers a privacy setting changed listener- Parameters:
onWhatsappPrivacySettingChanged
- the listener to register- Returns:
- the same instance
-
addLinkedDevicesListener
Registers a companion devices changed listener- Parameters:
onLinkedDevices
- the listener to register- Returns:
- the same instance
-
addLinkedDevicesListener
Registers a companion devices changed listener- Parameters:
onWhatsappLinkedDevices
- the listener to register- Returns:
- the same instance
-
addRegistrationCodeListener
Registers a registration code listener for the mobile api- Parameters:
onRegistrationCode
- the listener to register- Returns:
- the same instance
-
addLinkedDevicesListener
Registers a registration code listener for the mobile api- Parameters:
onWhatsappRegistrationCode
- the listener to register- Returns:
- the same instance
-
addRegistrationCodeListener
Registers a call listener- Parameters:
onCall
- the listener to register- Returns:
- the same instance
-
addLinkedDevicesListener
Registers a call listener- Parameters:
onWhatsappCall
- the listener to register- Returns:
- the same instance
-
jidOrThrowError
-