LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

im::floo::floolib::BMXMessage#

Message

Inherits from BMXBaseObject

Public Functions#

Name
synchronized voiddelete()
longmsgId()
Message unique ID
longclientMsgId()
Message client ID, only exists on message sender-side
longfromId()
Message sender ID
longtoId()
Message receiver ID
BMXMessage.MessageTypetype()
Message type
longconversationId()
Conversation ID that message belongs to
BMXMessage.DeliveryStatusdeliveryStatus()
Messaging state
voidsetDeliveryStatus(BMXMessage.DeliveryStatus arg0)
Set messaging state
longserverTimestamp()
Message timestamp (when received by server-side)
voidsetServerTimestamp(long arg0)
Set message timestamp (when received by server-side)
longclientTimestamp()
Local timestamp (local time when message created or received)
voidsetClientTimestamp(long arg0)
Set message local timestamp
booleanisPlayed()
Whether voice or video message has been played, valid only for received audio/video messages
voidsetIsPlayed(boolean arg0)
booleanisPlayAcked()
Whether voice or video message receives a playback acknowledgement, valid only for received audio/video messages
voidsetIsPlayAcked(boolean arg0)
booleanisReceiveMsg()
Message whether to receive
voidsetIsReceiveMsg(boolean arg0)
booleanisRead()
Message read or unread mark
voidsetIsRead(boolean arg0)
booleanisReadAcked()
Show sender whether read acknowledgement received, and show receiver whether message read acknowledgement sent
voidsetIsReadAcked(boolean arg0)
booleanisDeliveryAcked()
Show sender whether message has been delivered to the other party, and show receiver whether message delivered acknowledgement has been sent
voidsetIsDeliveryAcked(boolean arg0)
Stringcontent()
Message text content
voidsetContent(String content)
Message text content
BMXMessage.ContentTypecontentType()
Message content type, attachment-type with attachment, text-type with no attachment
BMXMessageAttachmentattachment()
Message attachment, BMXMessage owns the attachment and is responsible for releasing it
BMXMessageConfigconfig()
Message settings
voidsetConfig(BMXMessageConfig arg0)
Set message config information
Stringextension()
Message extension information
voidsetExtension(String arg0)
Set message extension information
BMXMessage.DeliveryQosdeliveryQos()
QOS of messaging
voidsetDeliveryQos(BMXMessage.DeliveryQos qos)
Set QOS of messaging
StringsenderName()
Display name of message sender
voidsetSenderName(String senderName)
Set display name of message sender
intgroupAckCount()
AckCount of read group messages
voidsetGroupAckCount(int count)
Set groupAckCount of read messages (an SDK internal calling interface that shall not be called by upper layer)
intgroupAckUnreadCount()
AckCount of unread group messages
voidsetGroupAckUnreadCount(int count)
Set groupAckCount of unread messages (an SDK internal calling interface that shall not be called by upper layer)
booleangroupAckReadAll()
Whether all group messages are read
intgroupPlayAckCount()
Get count of played group messages
voidsetGroupPlayAckCount(int count)
intgroupPlayAckUnreadCount()
Get count of unread playback acknowledgements of group messages
voidsetGroupPlayAckUnreadCount(int count)
booleangroupPlayAckReadAll()
Set all playback acknowledgements of group messages as read
voidsetPriority(int priority)
Set message diffusion priority, default 0. 0 means diffusion, and the smaller the number, the more diffused. Value range 0-10. The default level of messages sent by ordinary users in chatroom is 5, which can be discarded. Admin level defaults to 0 and will not be discarded. Other values can be set according to business.
intpriority()
Message diffusion priority
voidsetPushMessageMode(boolean arg0)
Set whether to push messages
booleanisPushMessage()
Whether it is a push message
BMXMessagecreateMessage(long from, long to, BMXMessage.MessageType type, long conversationId, String content)
Create a text message
BMXMessagecreateMessage(long from, long to, BMXMessage.MessageType type, long conversationId, BMXMessageAttachment attachment)
Create a sent-attachment message
BMXMessagecreateCommandMessage(long from, long to, BMXMessage.MessageType type, long conversationId, String content)
Create a sent command message (command message holds command information in a content field or an extension field)
BMXMessagecreateMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, String content, long serverTimestamp)
Create a received message
BMXMessagecreateMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, BMXMessageAttachment attachment, long serverTimestamp)
Create a received message
BMXMessagecreateCommandMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, String content, long serverTimestamp)
Create a received command message (command message holds command information in a content field or an extension field)
BMXMessagecreateForwardMessage(BMXMessage msg, long from, long to, BMXMessage.MessageType type, long conversationId)
Create a forwarding message

Protected Functions#

Name
BMXMessage(long cPtr, boolean cMemoryOwn)
voidfinalize()
longgetCPtr(BMXMessage obj)

Public Functions Documentation#

function delete#

inline synchronized void delete()

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="delete" %}{% endlanying_code_snippet %}

function msgId#

inline long msgId()

Message unique ID

Return: int64_t

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="msgId" %}{% endlanying_code_snippet %}

function clientMsgId#

inline long clientMsgId()

Message client ID, only exists on message sender-side

Return: int64_t

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="clientMsgId" %}{% endlanying_code_snippet %}

function fromId#

inline long fromId()

Message sender ID

Return: int64_t

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="fromId" %}{% endlanying_code_snippet %}

function toId#

inline long toId()

Message receiver ID

Return: int64_t

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="toId" %}{% endlanying_code_snippet %}

function type#

inline BMXMessage.MessageType type()

Message type

Return: [MessageType]

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="type" %}{% endlanying_code_snippet %}

function conversationId#

inline long conversationId()

Conversation ID that message belongs to

Return: int64_t

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="conversationId" %}{% endlanying_code_snippet %}

function deliveryStatus#

inline BMXMessage.DeliveryStatus deliveryStatus()

Message delivery status

Return: [DeliveryStatus]

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="deliveryStatus" %}{% endlanying_code_snippet %}

function setDeliveryStatus#

inline void setDeliveryStatus(
    BMXMessage.DeliveryStatus arg0
)

Set messaging state

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setDeliveryStatus" %}{% endlanying_code_snippet %}

function serverTimestamp#

inline long serverTimestamp()

Message timestamp (when received by server-side)

Return: int64_t

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="serverTimestamp" %}{% endlanying_code_snippet %}

function setServerTimestamp#

inline void setServerTimestamp(
    long arg0
)

Set message timestamp (when received by server-side)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setServerTimestamp" %}{% endlanying_code_snippet %}

function clientTimestamp#

inline long clientTimestamp()

Local timestamp (local time when message created or received)

Return: int64_t

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="clientTimestamp" %}{% endlanying_code_snippet %}

function setClientTimestamp#

inline void setClientTimestamp(
    long arg0
)

Set message local timestamp

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setClientTimestamp" %}{% endlanying_code_snippet %}

function isPlayed#

inline boolean isPlayed()

Whether voice or video message has been played, valid only for received audio/video messages

Return: bool

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="isPlayed" %}{% endlanying_code_snippet %}

function setIsPlayed#

inline void setIsPlayed(
    boolean arg0
)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setIsPlayed" %}{% endlanying_code_snippet %}

function isPlayAcked#

inline boolean isPlayAcked()

Whether voice or video message receives a playback acknowledgement, valid only for received audio/video messages

Return: bool

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="isPlayAcked" %}{% endlanying_code_snippet %}

function setIsPlayAcked#

inline void setIsPlayAcked(
    boolean arg0
)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setIsPlayAcked" %}{% endlanying_code_snippet %}

function isReceiveMsg#

inline boolean isReceiveMsg()

Message whether to receive

Return: bool

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="isReceiveMsg" %}{% endlanying_code_snippet %}

function setIsReceiveMsg#

inline void setIsReceiveMsg(
    boolean arg0
)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setIsReceiveMsg" %}{% endlanying_code_snippet %}

function isRead#

inline boolean isRead()

Message read or unread mark

Return: bool

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="isRead" %}{% endlanying_code_snippet %}

function setIsRead#

inline void setIsRead(
    boolean arg0
)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setIsRead" %}{% endlanying_code_snippet %}

function isReadAcked#

inline boolean isReadAcked()

Show sender whether read acknowledgement received, and show receiver whether message read acknowledgement sent

Return: bool

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="isReadAcked" %}{% endlanying_code_snippet %}

function setIsReadAcked#

inline void setIsReadAcked(
    boolean arg0
)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setIsReadAcked" %}{% endlanying_code_snippet %}

function isDeliveryAcked#

inline boolean isDeliveryAcked()

Show sender whether message has been delivered to the other party, and show receiver whether message delivered acknowledgement has been sent

Return: bool

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="isDeliveryAcked" %}{% endlanying_code_snippet %}

function setIsDeliveryAcked#

inline void setIsDeliveryAcked(
    boolean arg0
)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setIsDeliveryAcked" %}{% endlanying_code_snippet %}

function content#

inline String content()

Message text content

Return: std::string

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="content" %}{% endlanying_code_snippet %}

function setContent#

inline void setContent(
    String content
)

Message text content

Parameters:

  • content Message text content

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setContent" %}{% endlanying_code_snippet %}

function contentType#

inline BMXMessage.ContentType contentType()

Message content type, attachment-type with attachment, text-type with no attachment

Return: [ContentType]

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="contentType" %}{% endlanying_code_snippet %}

function attachment#

inline BMXMessageAttachment attachment()

Message attachment, BMXMessage owns the attachment and is responsible for releasing it

Return: BMXMessageAttachmentPtr

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="attachment" %}{% endlanying_code_snippet %}

function config#

inline BMXMessageConfig config()

Message settings

Return: JSON(std::string)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="config" %}{% endlanying_code_snippet %}

function setConfig#

inline void setConfig(
    BMXMessageConfig arg0
)

Set message config information

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setConfig" %}{% endlanying_code_snippet %}

function extension#

inline String extension()

Message extension information

Return: JSON(std::string)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="extension" %}{% endlanying_code_snippet %}

function setExtension#

inline void setExtension(
    String arg0
)

Set message extension information

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setExtension" %}{% endlanying_code_snippet %}

function deliveryQos#

inline BMXMessage.DeliveryQos deliveryQos()

QOS of messaging

Return: [DeliveryQos]

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="deliveryQos" %}{% endlanying_code_snippet %}

function setDeliveryQos#

inline void setDeliveryQos(
    BMXMessage.DeliveryQos qos
)

Set QOS of messaging

Parameters:

  • qos QOS of messaging

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setDeliveryQos" %}{% endlanying_code_snippet %}

function senderName#

inline String senderName()

Display name of message sender

Return: std::string

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="senderName" %}{% endlanying_code_snippet %}

function setSenderName#

inline void setSenderName(
    String senderName
)

Set display name of message sender

Parameters:

  • senderName Message text content

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setSenderName" %}{% endlanying_code_snippet %}

function groupAckCount#

inline int groupAckCount()

AckCount of read group messages

Return: int

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="groupAckCount" %}{% endlanying_code_snippet %}

function setGroupAckCount#

inline void setGroupAckCount(
    int count
)

Set groupAckCount of read messages (an SDK internal calling interface that shall not be called by upper layer)

Parameters:

  • count Set the number of read group messages

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setGroupAckCount" %}{% endlanying_code_snippet %}

function groupAckUnreadCount#

inline int groupAckUnreadCount()

AckCount of unread group messages

Return: int

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="groupAckUnreadCount" %}{% endlanying_code_snippet %}

function setGroupAckUnreadCount#

inline void setGroupAckUnreadCount(
    int count
)

Set groupAckCount of unread messages (an SDK internal calling interface that shall not be called by upper layer)

Parameters:

  • count Set the number of unread group messages

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setGroupAckUnreadCount" %}{% endlanying_code_snippet %}

function groupAckReadAll#

inline boolean groupAckReadAll()

Whether all group messages are read

Return: bool

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="groupAckReadAll" %}{% endlanying_code_snippet %}

function groupPlayAckCount#

inline int groupPlayAckCount()

Get count of played group messages

Return: bool

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="groupPlayAckCount" %}{% endlanying_code_snippet %}

function setGroupPlayAckCount#

inline void setGroupPlayAckCount(
    int count
)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setGroupPlayAckCount" %}{% endlanying_code_snippet %}

function groupPlayAckUnreadCount#

inline int groupPlayAckUnreadCount()

Get count of unread playback acknowledgements of group messages

Return: bool

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="groupPlayAckUnreadCount" %}{% endlanying_code_snippet %}

function setGroupPlayAckUnreadCount#

inline void setGroupPlayAckUnreadCount(
    int count
)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setGroupPlayAckUnreadCount" %}{% endlanying_code_snippet %}

function groupPlayAckReadAll#

inline boolean groupPlayAckReadAll()

Set all playback acknowledgements of group messages as read

Return: bool

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="groupPlayAckReadAll" %}{% endlanying_code_snippet %}

function setPriority#

inline void setPriority(
    int priority
)

Set message diffusion priority, default 0. 0 means diffusion, and the smaller the number, the more diffused. Value range 0-10. The default level of messages sent by ordinary users in chatroom is 5, which can be discarded. Admin level defaults to 0 and will not be discarded. Other values can be set according to business.

Parameters:

  • priority Set the number of unread group messages

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setPriority" %}{% endlanying_code_snippet %}

function priority#

inline int priority()

Message diffusion priority

Return: int

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="priority" %}{% endlanying_code_snippet %}

function setPushMessageMode#

inline void setPushMessageMode(
    boolean arg0
)

Set whether to push messages

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="setPushMessageMode" %}{% endlanying_code_snippet %}

function isPushMessage#

inline boolean isPushMessage()

Whether it is a push message

Return: boolean

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="isPushMessage" %}{% endlanying_code_snippet %}

function createMessage#

static inline BMXMessage createMessage(
    long from,
    long to,
    BMXMessage.MessageType type,
    long conversationId,
    String content
)

Create a text message

Parameters:

  • from Message sender
  • to Message receiver
  • type Message type
  • conversationId Conversation id
  • content Message content

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="createMessage" %}{% endlanying_code_snippet %}

function createMessage#

static inline BMXMessage createMessage(
    long from,
    long to,
    BMXMessage.MessageType type,
    long conversationId,
    BMXMessageAttachment attachment
)

Create a sent-attachment message

Parameters:

  • from Message sender
  • to Message receiver
  • type Message type
  • conversationId Conversation id
  • attachment Attachment

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="createMessage" %}{% endlanying_code_snippet %}

function createCommandMessage#

static inline BMXMessage createCommandMessage(
    long from,
    long to,
    BMXMessage.MessageType type,
    long conversationId,
    String content
)

Create a sent command message (command message holds command information in a content field or an extension field)

Parameters:

  • from Message sender
  • to Message receiver
  • type Message type
  • conversationId Conversation id
  • content Message content

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="createCommandMessage" %}{% endlanying_code_snippet %}

function createMessage#

static inline BMXMessage createMessage(
    long msgId,
    long from,
    long to,
    BMXMessage.MessageType type,
    long conversationId,
    String content,
    long serverTimestamp
)

Create a received message

Parameters:

  • msgId Message id
  • from Message sender
  • to Message receiver
  • type Message type
  • conversationId Conversation id
  • content Message content
  • serverTimestamp Server timestamp

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="createMessage" %}{% endlanying_code_snippet %}

function createMessage#

static inline BMXMessage createMessage(
    long msgId,
    long from,
    long to,
    BMXMessage.MessageType type,
    long conversationId,
    BMXMessageAttachment attachment,
    long serverTimestamp
)

Create a received message

Parameters:

  • msgId Message id
  • from Message sender
  • to Message receiver
  • type Message type
  • conversationId Conversation id
  • attachment Attachment
  • serverTimestamp Server timestamp

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="createMessage" %}{% endlanying_code_snippet %}

function createCommandMessage#

static inline BMXMessage createCommandMessage(
    long msgId,
    long from,
    long to,
    BMXMessage.MessageType type,
    long conversationId,
    String content,
    long serverTimestamp
)

Create a received command message (command message holds command information in a content field or an extension field)

Parameters:

  • msgId Message id
  • from Message sender
  • to Message receiver
  • type Message type
  • conversationId Conversation id
  • content Message content
  • serverTimestamp Server timestamp

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="createCommandMessage" %}{% endlanying_code_snippet %}

function createForwardMessage#

static inline BMXMessage createForwardMessage(
    BMXMessage msg,
    long from,
    long to,
    BMXMessage.MessageType type,
    long conversationId
)

Create a forwarding message

Parameters:

  • msg Message to forward
  • from Message sender
  • to Message receiver
  • type Message type
  • conversationId Conversation id

Protected Functions Documentation#

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="createForwardMessage" %}{% endlanying_code_snippet %}

function BMXMessage#

inline BMXMessage(
    long cPtr,
    boolean cMemoryOwn
)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="BMXMessage" %}{% endlanying_code_snippet %}

function finalize#

inline void finalize()

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="finalize" %}{% endlanying_code_snippet %}

function getCPtr#

static inline long getCPtr(
    BMXMessage obj
)

Example:

{% lanying_code_snippet repo="lanying-im-android",class="BMXMessage",function="getCPtr" %}{% endlanying_code_snippet %}

Updated on 2022-01-26 at 17:18:31 +0800

Generated API content with concise AI notes where context helps.