im::floo::floolib::BMXMessage

消息

Inherits from BMXBaseObject

Public Functions

Name

synchronized void

long

msgId() 消息唯一ID

long

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

long

fromId() 消息发送方ID

long

toId() 消息接收方ID

BMXMessage.MessageType

type() 消息类型

long

conversationId() 消息所属会话ID

BMXMessage.DeliveryStatus

deliveryStatus() 消息投递状态

void

setDeliveryStatus(BMXMessage.DeliveryStatus arg0) 设置消息投递状态

long

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

void

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

long

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

void

setClientTimestamp(long arg0) 设置消息本地时间戳

boolean

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

void

setIsPlayed(boolean arg0)

boolean

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

void

setIsPlayAcked(boolean arg0)

boolean

isReceiveMsg() 是否接收的消息

void

setIsReceiveMsg(boolean arg0)

boolean

isRead() 消息是否已读标志

void

setIsRead(boolean arg0)

boolean

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

void

setIsReadAcked(boolean arg0)

boolean

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

void

setIsDeliveryAcked(boolean arg0)

String

content() 消息文本内容

void

setContent(String content) 消息文本内容

BMXMessage.ContentType

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

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

config() 消息的配置信息

void

setConfig(BMXMessageConfig arg0) 设置消息配置信息

String

extension() 消息扩展信息

void

setExtension(String arg0) 设置消息扩展信息

BMXMessage.DeliveryQos

deliveryQos() 消息投递QOS

void

setDeliveryQos(BMXMessage.DeliveryQos qos) 设置消息投递QOS

String

senderName() 消息发送者的显示名称

void

setSenderName(String senderName) 设置消息的发送者显示名称

int

groupAckCount() 群消息已读AckCount数目

void

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

int

groupAckUnreadCount() 群消息未读AckCount数目

void

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

boolean

groupAckReadAll() 群消息是否全部已读

int

groupPlayAckCount() 获取群消息已播放计数

void

int

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

boolean

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

void

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

int

priority() 消息的扩散优先级

void

setPushMessageMode(boolean arg0) 设置是否推送消息

boolean

isPushMessage() 是否是推送消息

createMessage(long from, long to, BMXMessage.MessageType type, long conversationId, String content) 创建发送文本消息

createMessage(long from, long to, BMXMessage.MessageType type, long conversationId, BMXMessageAttachment attachment) 创建发送附件消息

createCommandMessage(long from, long to, BMXMessage.MessageType type, long conversationId, String content) 创建发送命令消息(命令消息通过content字段或者extension字段存放命令信息)

createMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, String content, long serverTimestamp) 创建收到的消息

createMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, BMXMessageAttachment attachment, long serverTimestamp) 创建收到的消息

createCommandMessage(long msgId, long from, long to, BMXMessage.MessageType type, long conversationId, String content, long serverTimestamp) 创建收到的命令消息(命令消息通过content字段或者extension字段存放命令信息)

createForwardMessage(BMXMessage msg, long from, long to, BMXMessage.MessageType type, long conversationId) 创建转发消息

Protected Functions

Name

BMXMessage(long cPtr, boolean cMemoryOwn)

void

Public Functions Documentation

function delete

inline synchronized void delete()

function msgId

inline long msgId()

消息唯一ID

Return: int64_t

function clientMsgId

inline long clientMsgId()

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

Return: int64_t

function fromId

inline long fromId()

消息发送方ID

Return: int64_t

function toId

inline long toId()

消息接收方ID

Return: int64_t

function type

inline BMXMessage.MessageType type()

消息类型

Return: [MessageType]

function conversationId

inline long conversationId()

消息所属会话ID

Return: int64_t

function deliveryStatus

inline BMXMessage.DeliveryStatus deliveryStatus()

消息投递状态

Return: [DeliveryStatus]

function setDeliveryStatus

inline void setDeliveryStatus(
    BMXMessage.DeliveryStatus arg0
)

设置消息投递状态

function serverTimestamp

inline long serverTimestamp()

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

Return: int64_t

function setServerTimestamp

inline void setServerTimestamp(
    long arg0
)

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

function clientTimestamp

inline long clientTimestamp()

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

Return: int64_t

function setClientTimestamp

inline void setClientTimestamp(
    long arg0
)

设置消息本地时间戳

function isPlayed

inline boolean isPlayed()

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

Return: bool

function setIsPlayed

inline void setIsPlayed(
    boolean arg0
)

function isPlayAcked

inline boolean isPlayAcked()

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

Return: bool

function setIsPlayAcked

inline void setIsPlayAcked(
    boolean arg0
)

function isReceiveMsg

inline boolean isReceiveMsg()

是否接收的消息

Return: bool

function setIsReceiveMsg

inline void setIsReceiveMsg(
    boolean arg0
)

function isRead

inline boolean isRead()

消息是否已读标志

Return: bool

function setIsRead

inline void setIsRead(
    boolean arg0
)

function isReadAcked

inline boolean isReadAcked()

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

Return: bool

function setIsReadAcked

inline void setIsReadAcked(
    boolean arg0
)

function isDeliveryAcked

inline boolean isDeliveryAcked()

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

Return: bool

function setIsDeliveryAcked

inline void setIsDeliveryAcked(
    boolean arg0
)

function content

inline String content()

消息文本内容

Return: std::string

function setContent

inline void setContent(
    String content
)

消息文本内容

Parameters:

  • content 消息文本内容

function contentType

inline BMXMessage.ContentType contentType()

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

Return: [ContentType]

function attachment

inline BMXMessageAttachment attachment()

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

Return: BMXMessageAttachmentPtr

function config

inline BMXMessageConfig config()

消息的配置信息

Return: JSON(std::string)

function setConfig

inline void setConfig(
    BMXMessageConfig arg0
)

设置消息配置信息

function extension

inline String extension()

消息扩展信息

Return: JSON(std::string)

function setExtension

inline void setExtension(
    String arg0
)

设置消息扩展信息

function deliveryQos

inline BMXMessage.DeliveryQos deliveryQos()

消息投递QOS

Return: [DeliveryQos]

function setDeliveryQos

inline void setDeliveryQos(
    BMXMessage.DeliveryQos qos
)

设置消息投递QOS

Parameters:

  • qos 消息投递QOS

function senderName

inline String senderName()

消息发送者的显示名称

Return: std::string

function setSenderName

inline void setSenderName(
    String senderName
)

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

Parameters:

  • senderName 消息文本内容

function groupAckCount

inline int groupAckCount()

群消息已读AckCount数目

Return: int

function setGroupAckCount

inline void setGroupAckCount(
    int count
)

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

Parameters:

  • count 设置群消息已读数目

function groupAckUnreadCount

inline int groupAckUnreadCount()

群消息未读AckCount数目

Return: int

function setGroupAckUnreadCount

inline void setGroupAckUnreadCount(
    int count
)

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

Parameters:

  • count 设置群消息未读数目

function groupAckReadAll

inline boolean groupAckReadAll()

群消息是否全部已读

Return: bool

function groupPlayAckCount

inline int groupPlayAckCount()

获取群消息已播放计数

Return: bool

function setGroupPlayAckCount

inline void setGroupPlayAckCount(
    int count
)

function groupPlayAckUnreadCount

inline int groupPlayAckUnreadCount()

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

Return: bool

function setGroupPlayAckUnreadCount

inline void setGroupPlayAckUnreadCount(
    int count
)

function groupPlayAckReadAll

inline boolean groupPlayAckReadAll()

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

Return: bool

function setPriority

inline void setPriority(
    int priority
)

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

Parameters:

  • priority 优先级

function priority

inline int priority()

消息的扩散优先级

Return: int

function setPushMessageMode

inline void setPushMessageMode(
    boolean arg0
)

设置是否推送消息

function isPushMessage

inline boolean isPushMessage()

是否是推送消息

Return: boolean

function createMessage

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

创建发送文本消息

Parameters:

  • from 消息发送者

  • to 消息接收者

  • type 消息类型

  • conversationId 会话id

  • content 消息内容

function createMessage

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

创建发送附件消息

Parameters:

  • from 消息发送者

  • to 消息接收者

  • type 消息类型

  • conversationId 会话id

  • attachment 附件

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 消息内容

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 服务器时间戳

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 服务器时间戳

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 服务器时间戳

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

function BMXMessage

inline BMXMessage(
    long cPtr,
    boolean cMemoryOwn
)

function finalize

inline void finalize()

function getCPtr

static inline long getCPtr(
    BMXMessage obj
)

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

Last updated

Was this helpful?