java.lang.Object
it.auties.whatsapp.model.chat.Chat.ChatBuilder
- Enclosing class:
- Chat
-
Method Summary
Modifier and TypeMethodDescriptionarchived
(boolean archived) This field is used to determine whether a chat is archived or not.build()
createdAt
(long createdAt) The timestamp at which the chat, if a group, was createdcreatedBy
(ContactJid createdBy) The user who created this chat, if a groupdefaultSubGroup
(boolean defaultSubGroup) Whether this chat is a default sub groupdescription
(String description) The description of this chat, if a groupdisappearInitiator
(ChatDisappear disappearInitiator) The initiator of disappearing chatsdisplayName
(String displayName) ExperimentalendOfHistoryTransfer
(boolean endOfHistoryTransfer) Whether this chat has been trasfered completelyendOfHistoryTransferType
(Chat.EndOfHistoryTransferType endOfHistoryTransferType) The history sync statusephemeralMessageDuration
(ChatEphemeralTimer ephemeralMessageDuration) The seconds in seconds before a message is automatically deleted from this chat both locally and from WhatsappWeb's servers.ephemeralMessagesToggleTime
(long ephemeralMessagesToggleTime) The seconds in seconds sinceInstant.EPOCH
when ephemeral messages were turned on.identityKey
(byte[] identityKey) The public identity key of this chatjid
(@NonNull ContactJid jid) The non-null unique jid used to identify this chatlidJid
(ContactJid lidJid) ExperimentalmarkedAsUnread
(boolean markedAsUnread) Whether this chat was manually marked as unreadmediaVisibility
(@NonNull ChatMediaVisibility mediaVisibility) The type of this media visibility set for this chatmessages
(List<MessageInfo> messages) The mute status of this chatThe non-null display name of this chatnewJid
(ContactJid newJid) The nullable new unique jid for this Chat.notSpam
(boolean notSpam) This field is used to determine whether a chat was marked as being spam or not.oldJid
(ContactJid oldJid) The nullable old jid for this Chat.parentGroup
(boolean parentGroup) Whether this chat is a parent groupparentGroupJid
(ContactJid parentGroupJid) The parent group's jid in a communityparticipants
(List<GroupParticipant> participants) participantsPreKeys
(@NonNull Set<ContactJid> participantsPreKeys) A set that hold all the jids of the participants in this chat that have received pre keys.pastParticipants
(List<PastParticipant> pastParticipants) The participants that used to be in this chat, if it's a grouppinned
(long pinned) The seconds in seconds sinceInstant.EPOCH
when this chat was pinned to the top.pnhDuplicateLidThread
(boolean pnhDuplicateLidThread) ExperimentalExperimentalpresences
(@NonNull Map<ContactJid, ContactStatus> presences) A map that holds the status of each participant, excluding yourself, for this chat.readOnly
(boolean readOnly) Whether this chat is read onlyshareOwnPn
(boolean shareOwnPn) Experimentalsupport
(boolean support) Whether this chat is an official support chat from Whatsappsuspended
(boolean suspended) Whether this chat was suspended and therefore cannot be accessed anymoreterminated
(boolean terminated) Whether this chat was terminatedtimestamp
(long timestamp) The timestamp for the creation of this chat in seconds sinceInstant.EPOCH
token
(byte[] token) The token of this chattokenSenderTimestamp
(long tokenSenderTimestamp) The timestamp of the sender of the token of this chattokenTimestamp
(long tokenTimestamp) The timestamp of the token of this chattoString()
unreadMessagesCount
(int unreadMessagesCount) The number of unread messages in this chat.wallpaper
(ChatWallpaper wallpaper) The wallpaper of this chat
-
Method Details
-
messages
-
participants
-
jid
The non-null unique jid used to identify this chat- Returns:
this
.
-
newJid
The nullable new unique jid for this Chat. This field is not null when a contact changes phone number and connects their new phone number with Whatsapp.- Returns:
this
.
-
oldJid
The nullable old jid for this Chat. This field is not null when a contact changes phone number and connects their new phone number with Whatsapp.- Returns:
this
.
-
timestamp
The timestamp for the creation of this chat in seconds sinceInstant.EPOCH
- Returns:
this
.
-
unreadMessagesCount
The number of unread messages in this chat. If this field is negative, this chat is marked as unread.- Returns:
this
.
-
readOnly
Whether this chat is read only- Returns:
this
.
-
endOfHistoryTransfer
Whether this chat has been trasfered completely- Returns:
this
.
-
ephemeralMessageDuration
The seconds in seconds before a message is automatically deleted from this chat both locally and from WhatsappWeb's servers. If ephemeral messages aren't enabled, this field has a value of 0- Returns:
this
.
-
ephemeralMessagesToggleTime
The seconds in seconds sinceInstant.EPOCH
when ephemeral messages were turned on. If ephemeral messages aren't enabled, this field has a value of 0.- Returns:
this
.
-
endOfHistoryTransferType
public Chat.ChatBuilder endOfHistoryTransferType(Chat.EndOfHistoryTransferType endOfHistoryTransferType) The history sync status- Returns:
this
.
-
name
The non-null display name of this chat- Returns:
this
.
-
notSpam
This field is used to determine whether a chat was marked as being spam or not.- Returns:
this
.
-
archived
This field is used to determine whether a chat is archived or not.- Returns:
this
.
-
disappearInitiator
The initiator of disappearing chats- Returns:
this
.
-
markedAsUnread
Whether this chat was manually marked as unread- Returns:
this
.
-
pastParticipants
The participants that used to be in this chat, if it's a group- Returns:
this
.
-
token
The token of this chat- Returns:
this
.
-
tokenTimestamp
The timestamp of the token of this chat- Returns:
this
.
-
identityKey
The public identity key of this chat- Returns:
this
.
-
pinned
The seconds in seconds sinceInstant.EPOCH
when this chat was pinned to the top. If the chat isn't pinned, this field has a value of 0.- Returns:
this
.
-
mute
The mute status of this chat- Returns:
this
.
-
wallpaper
The wallpaper of this chat- Returns:
this
.
-
mediaVisibility
The type of this media visibility set for this chat- Returns:
this
.
-
tokenSenderTimestamp
The timestamp of the sender of the token of this chat- Returns:
this
.
-
suspended
Whether this chat was suspended and therefore cannot be accessed anymore- Returns:
this
.
-
terminated
Whether this chat was terminated- Returns:
this
.
-
createdAt
The timestamp at which the chat, if a group, was created- Returns:
this
.
-
createdBy
The user who created this chat, if a group- Returns:
this
.
-
description
The description of this chat, if a group- Returns:
this
.
-
support
Whether this chat is an official support chat from Whatsapp- Returns:
this
.
-
parentGroup
Whether this chat is a parent group- Returns:
this
.
-
defaultSubGroup
Whether this chat is a default sub group- Returns:
this
.
-
parentGroupJid
The parent group's jid in a community- Returns:
this
.
-
displayName
Experimental- Returns:
this
.
-
pnJid
Experimental- Returns:
this
.
-
pnhDuplicateLidThread
Experimental- Returns:
this
.
-
lidJid
Experimental- Returns:
this
.
-
presences
A map that holds the status of each participant, excluding yourself, for this chat. If the chat is not a group, this map's size will range from 0 to 1. Otherwise, it will range from 0 to the number of participants - 1. It is important to remember that is not guaranteed that every participant will be present as a key. In this case, if this chat is a group, it can be safely assumed that the user is not available. Otherwise, it's recommended to useWhatsapp.subscribeToPresence(ContactJidProvider)
to force Whatsapp to send updates regarding the status of the other participant. It's also possible to listen for updates to a contact's presence in a group or in a conversation by implementingListener.onContactPresence(it.auties.whatsapp.api.Whatsapp, it.auties.whatsapp.model.chat.Chat, it.auties.whatsapp.model.contact.Contact, it.auties.whatsapp.model.contact.ContactStatus)
. The presence that this map indicates might not line up withContact.lastKnownPresence()
if the contact is composing, recording or paused. This is because a contact can be online on Whatsapp and composing, recording or paused in a specific chat.- Returns:
this
.
-
participantsPreKeys
A set that hold all the jids of the participants in this chat that have received pre keys. This set is only used if the chat is a group chat. It's not important for anything other than message ciphering.- Returns:
this
.
-
build
-
toString
-