蓝莺开发者
Web & Mini ProgramiOSAndroidC++Server API

im::floo::floolib::BMXMessage#

消息

Inherits from BMXBaseObject

Public Functions#

Name
synchronized voiddelete()
longmsgId()
消息唯一ID
longclientMsgId()
消息客户端ID,仅在消息发送端存在
longfromId()
消息发送方ID
longtoId()
消息接收方ID
BMXMessage.MessageTypetype()
消息类型
longconversationId()
消息所属会话ID
BMXMessage.DeliveryStatusdeliveryStatus()
消息投递状态
voidsetDeliveryStatus(BMXMessage.DeliveryStatus arg0)
设置消息投递状态
longserverTimestamp()
消息时间戳(服务端收到时的时间)
voidsetServerTimestamp(long arg0)
设置时间戳(服务端收到时的时间)
longclientTimestamp()
本地时间戳(消息创建或者收到时的本地时间)
voidsetClientTimestamp(long arg0)
设置消息本地时间戳
booleanisPlayed()
语音或者视频消息是否播放过,仅对收到的音视频消息有效
voidsetIsPlayed(boolean arg0)
booleanisPlayAcked()
语音或者视频消息是否收到播放回执,仅对收到的音视频消息有效
voidsetIsPlayAcked(boolean arg0)
booleanisReceiveMsg()
是否接收的消息
voidsetIsReceiveMsg(boolean arg0)
booleanisRead()
消息是否已读标志
voidsetIsRead(boolean arg0)
booleanisReadAcked()
对于发送方表示是否收到了已读回执,对于接收方表示是否发送了已读回执
voidsetIsReadAcked(boolean arg0)
booleanisDeliveryAcked()
对于发送方表示消息是否已投递到对方,对于接收方表示是否发送了消息已到达回执
voidsetIsDeliveryAcked(boolean arg0)
Stringcontent()
消息文本内容
voidsetContent(String content)
消息文本内容
BMXMessage.ContentTypecontentType()
消息内容类型,如果带附件就表示附件类型,不带附件就是文本类型
BMXMessageAttachmentattachment()
消息附件,BMXMessage拥有附件的所有权,负责释放
BMXMessageConfigconfig()
消息的配置信息
voidsetConfig(BMXMessageConfig arg0)
设置消息配置信息
Stringextension()
消息扩展信息
voidsetExtension(String arg0)
设置消息扩展信息
BMXMessage.DeliveryQosdeliveryQos()
消息投递QOS
voidsetDeliveryQos(BMXMessage.DeliveryQos qos)
设置消息投递QOS
StringsenderName()
消息发送者的显示名称
voidsetSenderName(String senderName)
设置消息的发送者显示名称
intgroupAckCount()
群消息已读AckCount数目
voidsetGroupAckCount(int count)
设置消息已读groupAckCount数目(SDK 内部调用接口,上层不应该调用)
intgroupAckUnreadCount()
群消息未读AckCount数目
voidsetGroupAckUnreadCount(int count)
设置消息未读groupAckCount数目(SDK 内部调用接口,上层不应该调用)
booleangroupAckReadAll()
群消息是否全部已读
intgroupPlayAckCount()
获取群消息已播放计数
voidsetGroupPlayAckCount(int count)
intgroupPlayAckUnreadCount()
获取群消息已播放回执未读计数
voidsetGroupPlayAckUnreadCount(int count)
booleangroupPlayAckReadAll()
设置所有群消息已播回执为已读
voidsetPriority(int priority)
设置消息的扩散优先级,默认为0。0表示扩散,数字越小扩散的越多。 取值范围0-10。普通人在聊天室发送的消息级别默认为5,可以丢弃。管理员默认为0不会丢弃。其它值可以根据业务自行设置。
intpriority()
消息的扩散优先级
voidsetPushMessageMode(boolean arg0)
设置是否推送消息
booleanisPushMessage()
是否是推送消息
BMXMessagecreateMessage(long from, long to, BMXMessage.MessageType type, long conversationId, String content)
创建发送文本消息
BMXMessagecreateMessage(long from, long to, BMXMessage.MessageType type, long conversationId, BMXMessageAttachment attachment)
创建发送附件消息
BMXMessagecreateCommandMessage(long from, long to, BMXMessage.MessageType type, long conversationId, String content)
创建发送命令消息(命令消息通过content字段或者extension字段存放命令信息)
BMXMessagecreateMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, String content, long serverTimestamp)
创建收到的消息
BMXMessagecreateMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, BMXMessageAttachment attachment, long serverTimestamp)
创建收到的消息
BMXMessagecreateCommandMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, String content, long serverTimestamp)
创建收到的命令消息(命令消息通过content字段或者extension字段存放命令信息)
BMXMessagecreateForwardMessage(BMXMessage msg, long from, long to, BMXMessage.MessageType type, long conversationId)
创建转发消息

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()

消息唯一ID

Return: int64_t

Example:

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

function clientMsgId#

inline long clientMsgId()

消息客户端ID,仅在消息发送端存在

Return: int64_t

Example:

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

function fromId#

inline long fromId()

消息发送方ID

Return: int64_t

Example:

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

function toId#

inline long toId()

消息接收方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()

消息类型

Return: [MessageType]

Example:

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

function conversationId#

inline long conversationId()

消息所属会话ID

Return: int64_t

Example:

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

function deliveryStatus#

inline BMXMessage.DeliveryStatus deliveryStatus()

消息投递状态

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
)

设置消息投递状态

Example:

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

function serverTimestamp#

inline long serverTimestamp()

消息时间戳(服务端收到时的时间)

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
)

设置时间戳(服务端收到时的时间)

Example:

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

function clientTimestamp#

inline long clientTimestamp()

本地时间戳(消息创建或者收到时的本地时间)

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
)

设置消息本地时间戳

Example:

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

function isPlayed#

inline boolean isPlayed()

语音或者视频消息是否播放过,仅对收到的音视频消息有效

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()

语音或者视频消息是否收到播放回执,仅对收到的音视频消息有效

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()

是否接收的消息

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()

消息是否已读标志

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()

对于发送方表示是否收到了已读回执,对于接收方表示是否发送了已读回执

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()

对于发送方表示消息是否已投递到对方,对于接收方表示是否发送了消息已到达回执

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()

消息文本内容

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
)

消息文本内容

Parameters:

  • content 消息文本内容

Example:

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

function contentType#

inline BMXMessage.ContentType contentType()

消息内容类型,如果带附件就表示附件类型,不带附件就是文本类型

Return: [ContentType]

Example:

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

function attachment#

inline BMXMessageAttachment attachment()

消息附件,BMXMessage拥有附件的所有权,负责释放

Return: BMXMessageAttachmentPtr

Example:

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

function config#

inline BMXMessageConfig config()

消息的配置信息

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
)

设置消息配置信息

Example:

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

function extension#

inline String extension()

消息扩展信息

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
)

设置消息扩展信息

Example:

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

function deliveryQos#

inline BMXMessage.DeliveryQos deliveryQos()

消息投递QOS

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
)

设置消息投递QOS

Parameters:

  • qos 消息投递QOS

Example:

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

function senderName#

inline String senderName()

消息发送者的显示名称

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
)

设置消息的发送者显示名称

Parameters:

  • senderName 消息文本内容

Example:

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

function groupAckCount#

inline int groupAckCount()

群消息已读AckCount数目

Return: int

Example:

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

function setGroupAckCount#

inline void setGroupAckCount(
    int count
)

设置消息已读groupAckCount数目(SDK 内部调用接口,上层不应该调用)

Parameters:

  • count 设置群消息已读数目

Example:

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

function groupAckUnreadCount#

inline int groupAckUnreadCount()

群消息未读AckCount数目

Return: int

Example:

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

function setGroupAckUnreadCount#

inline void setGroupAckUnreadCount(
    int count
)

设置消息未读groupAckCount数目(SDK 内部调用接口,上层不应该调用)

Parameters:

  • count 设置群消息未读数目

Example:

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

function groupAckReadAll#

inline boolean groupAckReadAll()

群消息是否全部已读

Return: bool

Example:

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

function groupPlayAckCount#

inline int groupPlayAckCount()

获取群消息已播放计数

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()

获取群消息已播放回执未读计数

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()

设置所有群消息已播回执为已读

Return: bool

Example:

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

function setPriority#

inline void setPriority(
    int priority
)

设置消息的扩散优先级,默认为0。0表示扩散,数字越小扩散的越多。 取值范围0-10。普通人在聊天室发送的消息级别默认为5,可以丢弃。管理员默认为0不会丢弃。其它值可以根据业务自行设置。

Parameters:

  • priority 优先级

Example:

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

function priority#

inline int 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
)

设置是否推送消息

Example:

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

function isPushMessage#

inline boolean isPushMessage()

是否是推送消息

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
)

创建发送文本消息

Parameters:

  • from 消息发送者
  • to 消息接收者
  • type 消息类型
  • conversationId 会话id
  • 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
)

创建发送附件消息

Parameters:

  • from 消息发送者
  • to 消息接收者
  • type 消息类型
  • conversationId 会话id
  • 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
)

创建发送命令消息(命令消息通过content字段或者extension字段存放命令信息)

Parameters:

  • from 消息发送者
  • to 消息接收者
  • type 消息类型
  • conversationId 会话id
  • 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
)

创建收到的消息

Parameters:

  • msgId 消息id
  • from 消息发送者
  • to 消息接收者
  • type 消息类型
  • conversationId 会话id
  • content 消息内容
  • serverTimestamp 服务器时间戳

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
)

创建收到的消息

Parameters:

  • msgId 消息id
  • from 消息发送者
  • to 消息接收者
  • type 消息类型
  • conversationId 会话id
  • attachment 附件
  • serverTimestamp 服务器时间戳

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
)

创建收到的命令消息(命令消息通过content字段或者extension字段存放命令信息)

Parameters:

  • msgId 消息id
  • from 消息发送者
  • to 消息接收者
  • type 消息类型
  • conversationId 会话id
  • content 消息内容
  • serverTimestamp 服务器时间戳

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
)

创建转发消息

Parameters:

  • msg 要转发的消息
  • from 消息发送者
  • to 消息接收者
  • type 消息类型
  • conversationId 会话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

自动生成的 API 内容,仅在必要位置补充精简的 AI 解释。