public interface IMMessage
extends java.io.Serializable
Modifier and Type | Method and Description |
---|---|
MsgAttachment |
getAttachment()
Get the attachment of a message The interface is valid inf the retuned value of
getMsgType() is not text. |
AttachStatusEnum |
getAttachStatus()
Get the status of a message attachment
|
java.lang.String |
getAttachStr()
Get the text of an attachment
|
java.lang.String |
getCallbackExtension()
Get the custom extension field returned by a third party callback
|
CustomMessageConfig |
getConfig()
Get the configuration of a message.
|
java.lang.String |
getContent()
Get the content of a message
If the message type is MsgTypeEnum.text , the text is the message content. |
MsgDirectionEnum |
getDirect()
Get the message direction: sent or received message
|
java.lang.String |
getEnv()
Get the environment variable
Used to point to different types of configurations for message delivery and third-party callbacks.
|
java.lang.String |
getFromAccount()
Get the sender of a message
|
int |
getFromClientType()
Get the sender type
|
java.lang.String |
getFromNick()
Get the nickname of a sender
|
java.util.Map<java.lang.String,java.lang.Object> |
getLocalExtension()
Get the local extension field that is applied locally
|
MemberPushOption |
getMemberPushOption()
Get the push option for specified members
|
MsgTypeEnum |
getMsgType()
Get the message type.
|
NIMAntiSpamOption |
getNIMAntiSpamOption()
Get the GuardEase anti-spam configuration
|
java.lang.String |
getPushContent()
Get the custom push content
|
java.util.Map<java.lang.String,java.lang.Object> |
getPushPayload()
Get the third-party push payload
|
long |
getQuickCommentUpdateTime()
Get the most recent update time of a quick comment.
|
java.util.Map<java.lang.String,java.lang.Object> |
getRemoteExtension()
Get the extension field that will be sent to other clients.
|
long |
getServerId()
Get the server ID of a message
|
java.lang.String |
getSessionId()
Get the ID of the peer (friend account or group ID)
|
SessionTypeEnum |
getSessionType()
Get the session type
|
MsgStatusEnum |
getStatus()
Get the status of a message.
|
int |
getSubtype()
Get the subtype of a message
|
int |
getTeamMsgAckCount()
Get the read count of a group message
|
int |
getTeamMsgUnAckCount()
Get the unread count of a group message
|
MsgThreadOption |
getThreadOption()
Get the thread info
|
long |
getTime()
Get the time when the message was sent.
|
java.lang.String |
getUuid()
Get the UUID of a mesage.
|
java.lang.String |
getYidunAntiCheating()
Get the trigger words of GuardEase anti-spam
|
java.lang.String |
getYidunAntiSpamExt()
Get the extension field of GuardEase anti-spam
|
java.lang.String |
getYidunAntiSpamRes()
Get the result returned by GuardEase
|
boolean |
hasSendAck()
Check if the read receipt of a message is sent
|
java.lang.Boolean |
isChecked()
the select state of a message
|
boolean |
isDeleted()
Check if the message is recalled or deleted from the server
|
boolean |
isInBlackList()
Check if the current user is added to the blacklist by the peer by sending a message.
|
boolean |
isRemoteRead()
Check whether the message sent by the current user is read
|
boolean |
isSessionUpdate()
Specify whether to update the message in a session
The parameter takes effect only if the message is saved when the user is offline.
|
boolean |
isTheSame(IMMessage message)
Check if two messages are the same using the message parameter.
|
boolean |
isThread()
Check is the message belongs to a thread.
|
boolean |
needMsgAck()
Specify message receipt for group messages.
|
void |
setAttachment(MsgAttachment attachment)
Set the attachment for a message
If the attachment includes a state propertu or belongs to a custom type, developers can update the state based on the business requirements for UI display. |
void |
setAttachStatus(AttachStatusEnum attachStatus)
Set the status of a message attachment
|
void |
setChecked(java.lang.Boolean isChecked)
Set the select state of a message
|
void |
setClientAntiSpam(boolean hit)
hit by anti-spam rules on the client and handled on the server.
|
void |
setConfig(CustomMessageConfig config)
Set the message configuration
|
void |
setContent(java.lang.String content)
Set the content of a message.
|
void |
setDirect(MsgDirectionEnum direct)
Set the message direction
|
void |
setEnv(java.lang.String env)
Set the environment variable
Used to point to different types of configurations for message delivery and third-party callbacks.
|
void |
setForceUploadFile(boolean forceUpload)
If the same file already exists on the server, specify whether to upload the file forcibly.
|
void |
setFromAccount(java.lang.String account)
Set the peer account Edit the
getDirect() based on the peer account |
void |
setLocalExtension(java.util.Map<java.lang.String,java.lang.Object> localExtension)
Set a local extension field that is applied locally and is not sent to other clients.
|
void |
setMemberPushOption(MemberPushOption pushOption)
Set the push option for specified members
|
void |
setMsgAck()
Set read receipt for a message
|
void |
setNIMAntiSpamOption(NIMAntiSpamOption nimAntiSpamOption)
Set the GuardEase anti-spam configuration
|
void |
setPushContent(java.lang.String pushContent)
Set custom push content.
|
void |
setPushPayload(java.util.Map<java.lang.String,java.lang.Object> pushPayload)
Set the third-party push payload
|
void |
setRemoteExtension(java.util.Map<java.lang.String,java.lang.Object> remoteExtension)
Set an extension field that will be sent to other clients.
|
void |
setSessionUpdate(boolean sessionUpdate)
Update messages in a session.
|
void |
setStatus(MsgStatusEnum status)
Set the message status
|
void |
setSubtype(int subtype)
Set the message subtype
|
void |
setThreadOption(IMMessage parent)
Set the thread info using the parent message.
|
void |
setYidunAntiCheating(java.lang.String yidunAntiCheating)
Set anti-spam trigger words in JSON format
|
void |
setYidunAntiSpamExt(java.lang.String yidunAntiSpamExt)
Set an extension field for GuardEase anti-spam
|
java.lang.String getUuid()
boolean isTheSame(IMMessage message)
getUuid()
message
- Message objectjava.lang.String getSessionId()
SessionTypeEnum getSessionType()
java.lang.String getFromNick()
MsgTypeEnum getMsgType()
int getSubtype()
void setSubtype(int subtype)
subtype.
- The subtype of a message. If the value is less than or equal to 0, no subtype is available.MsgStatusEnum getStatus()
void setStatus(MsgStatusEnum status)
status
- message statusvoid setDirect(MsgDirectionEnum direct)
direct
- message directionMsgDirectionEnum getDirect()
void setContent(java.lang.String content)
MsgTypeEnum.text
, the text is the message content.
If the message belongs to other types, the text is optional. If a text is set, it will be the push text delivered by APNS push for iOS devices and Android built-in push service for Android devices.content
- Message content or push textjava.lang.String getContent()
MsgTypeEnum.text
, the text is the message content.
If the message belongs to other types, the text is optional. If a text is set, it will be the push text delivered by APNS push for iOS devices and Android built-in push service for Android devices (pushContent is recommended for v1.7.0 or later).long getTime()
void setFromAccount(java.lang.String account)
getDirect()
based on the peer accountaccount
- Peer accountjava.lang.String getFromAccount()
void setAttachment(MsgAttachment attachment)
MsgService.updateIMMessageStatus(com.netease.nimlib.sdk.msg.model.IMMessage)
.attachment
- MsgAttachment getAttachment()
getMsgType()
is not text.java.lang.String getAttachStr()
AttachStatusEnum getAttachStatus()
void setAttachStatus(AttachStatusEnum attachStatus)
CustomMessageConfig getConfig()
void setConfig(CustomMessageConfig config)
config
- message configurationjava.util.Map<java.lang.String,java.lang.Object> getRemoteExtension()
void setRemoteExtension(java.util.Map<java.lang.String,java.lang.Object> remoteExtension)
remoteExtension
- extension field Map. Make sure the Map object can be converted to JsonObject.java.util.Map<java.lang.String,java.lang.Object> getLocalExtension()
void setLocalExtension(java.util.Map<java.lang.String,java.lang.Object> localExtension)
localExtension
- java.lang.String getCallbackExtension()
java.lang.String getPushContent()
void setPushContent(java.lang.String pushContent)
pushContent
- Cutom push contentjava.util.Map<java.lang.String,java.lang.Object> getPushPayload()
void setPushPayload(java.util.Map<java.lang.String,java.lang.Object> pushPayload)
pushPayload
- Third party custom push payload. Make sure the payload can be converted into JsonObject. The maximum size of the content is 2048 bytes.MemberPushOption getMemberPushOption()
void setMemberPushOption(MemberPushOption pushOption)
pushOption
- the push option for specified membersboolean isRemoteRead()
boolean needMsgAck()
void setMsgAck()
boolean hasSendAck()
int getTeamMsgAckCount()
int getTeamMsgUnAckCount()
int getFromClientType()
NIMAntiSpamOption getNIMAntiSpamOption()
void setNIMAntiSpamOption(NIMAntiSpamOption nimAntiSpamOption)
nimAntiSpamOption
- void setClientAntiSpam(boolean hit)
hit
- void setForceUploadFile(boolean forceUpload)
forceUpload
- boolean isInBlackList()
long getServerId()
void setChecked(java.lang.Boolean isChecked)
isChecked
- true: selected; false: unselected; null: Not in multi-select statejava.lang.Boolean isChecked()
boolean isSessionUpdate()
void setSessionUpdate(boolean sessionUpdate)
MsgThreadOption getThreadOption()
void setThreadOption(IMMessage parent)
parent
- The parent message of the current message to which the reply is sent.boolean isThread()
long getQuickCommentUpdateTime()
boolean isDeleted()
java.lang.String getYidunAntiCheating()
void setYidunAntiCheating(java.lang.String yidunAntiCheating)
yidunAntiCheating
- anti-spam trigger words in JSON formatjava.lang.String getEnv()
void setEnv(java.lang.String env)
env
- Environment variablejava.lang.String getYidunAntiSpamExt()
void setYidunAntiSpamExt(java.lang.String yidunAntiSpamExt)
yidunAntiSpamExt
- extension field for GuardEase anti-spam in JSON.java.lang.String getYidunAntiSpamRes()