LANYINGDevelopers
Web & Mini ProgramiOSAndroidC++Server API

floo::BMXMessage#

Message

#include <bmx_message.h>

Inherits from BMXBaseObject

Public Types#

Name
enum classDeliveryStatus { New, Delivering, Deliveried, Failed, Recalled}
Messaging state
enum classMessageType { Single, Group, System}
Message type
enum classContentType { Text, Image, Voice, Video, File, Location, Command, Forward}
Type of message content
enum classDeliveryQos { AtLastOnce, AtMostOnce, ExactlyOnce}
Messaging quality

Public Functions#

Name
virtual~BMXMessage()
Destructor
int64_tmsgId()
Message unique ID
int64_tclientMsgId()
Message client ID, only exists on message sender-side
int64_tfromId()
Message sender ID
int64_ttoId()
Message receiver ID
MessageTypetype()
Message type
int64_tconversationId()
Conversation ID that message belongs to
DeliveryStatusdeliveryStatus()
Messaging state
voidsetDeliveryStatus(DeliveryStatus )
Set messaging state
int64_tserverTimestamp()
Message timestamp (when received by server-side)
voidsetServerTimestamp(int64_t )
Set message timestamp (when received by server-side)
int64_tclientTimestamp()
Local timestamp (local time when message created or received)
voidsetClientTimestamp(int64_t )
Set message local timestamp
boolisPlayed()
Whether voice or video message has been played, valid only for received audio/video messages
voidsetIsPlayed(bool )
Set whether a voice or video message has been played, valid only for received audio or video messages
boolisPlayAcked()
Means whether playback acknowledgement received for sender, and whether playback acknowledgement sent for receiver
voidsetIsPlayAcked(bool )
Set playback acknowledgement
boolisReceiveMsg()
Message whether to receive
voidsetIsReceiveMsg(bool )
Message to set receiving condition
boolisRead()
Message read or unread mark
voidsetIsRead(bool )
Message read or unread mark
boolisReadAcked()
Show sender whether read acknowledgement received, and show receiver whether message read acknowledgement sent
voidsetIsReadAcked(bool )
Set read acknowledgement
boolisDeliveryAcked()
Show sender whether message has been delivered to the other party, and show receiver whether message delivered acknowledgement has been sent
voidsetIsDeliveryAcked(bool )
Set delivery acknowledgement
const std::string &content()
Message text content
voidsetContent(const std::string & content)
Message text content
ContentTypecontentType()
Message content type, attachment-type with attachment, text-type with no attachment
BMXMessageAttachmentPtrattachment()
Message attachment, BMXMessage owns the attachment and is responsible for releasing it
BMXMessageConfigPtrconfig()
Message settings
voidsetConfig(BMXMessageConfigPtr )
Set message config information
const JSON &extension()
Message extension information
voidsetExtension(const JSON & )
Set message extension information
DeliveryQosdeliveryQos()
QOS of messaging
voidsetDeliveryQos(DeliveryQos qos)
Set QOS of messaging
const std::string &senderName()
Display name of message sender
voidsetSenderName(const std::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)
boolgroupAckReadAll()
Whether all group messages are read
intgroupPlayAckCount()
AckCount of played group messages (valid only for messages with audio/video attachment)
voidsetGroupPlayAckCount(int count)
Set groupAckCount of played messages (an SDK internal calling interface that shall not be called by upper layer) (valid only for messages with audio/video attachment)
intgroupPlayAckUnreadCount()
AckCount of unplayed group messages (valid only for messages with audio/video attachment)
voidsetGroupPlayAckUnreadCount(int count)
Set groupAckCount of unplayed messages (an SDK internal calling interface that shall not be called by upper layer) (valid only for messages with audio/video attachment)
boolgroupPlayAckReadAll()
Whether all group messages have been played
voidsetPriority(int priority)
Set message diffusion priority, default 0. 0 means diffusion, and the smaller the number, the more diffused.
intpriority()
Message diffusion priority
voidsetPushMessageMode(bool )
Set whether the message is a push.
boolisPushMessage()
Whether the message is a push
BMXMessagePtrcreateMessage(int64_t from, int64_t to, MessageType type, int64_t conversationId, const std::string & content)
Create a text message
BMXMessagePtrcreateMessage(int64_t from, int64_t to, MessageType type, int64_t conversationId, BMXMessageAttachmentPtr attachment)
Create a sent-attachment message
BMXMessagePtrcreateCommandMessage(int64_t from, int64_t to, MessageType type, int64_t conversationId, const std::string & content)
Create a sent command message (command message holds command information in a content field or an extension field)
BMXMessagePtrcreateMessage(int64_t msgId, int64_t from, int64_t to, MessageType type, int64_t conversationId, const std::string & content, int64_t serverTimestamp)
Create a received message
BMXMessagePtrcreateMessage(int64_t msgId, int64_t from, int64_t to, MessageType type, int64_t conversationId, BMXMessageAttachmentPtr attachment, int64_t serverTimestamp)
Create a received message
BMXMessagePtrcreateCommandMessage(int64_t msgId, int64_t from, int64_t to, MessageType type, int64_t conversationId, const std::string & content, int64_t serverTimestamp)
Create a received command message (command message holds command information in a content field or an extension field)
BMXMessagePtrcreateForwardMessage(BMXMessagePtr msg, int64_t from, int64_t to, MessageType type, int64_t conversationId)
Create a forwarding message

Public Types Documentation#

enum DeliveryStatus#

EnumeratorValueDescription
NewNewly created message
DeliveringMessage delivering
DeliveriedMessage delivered
FailedMessage delivery failed
RecalledMessage delivery canceled

Message delivery status

enum MessageType#

EnumeratorValueDescription
SingleSingle chat message
GroupGroup chat message
SystemSystem message

Message type

enum ContentType#

EnumeratorValueDescription
TextText message
ImageImage message
VoiceVoice message
VideoVideo clip message
FileFile message
LocationLocation message
CommandCommand message
ForwardForward message

Message content type

enum DeliveryQos#

EnumeratorValueDescription
AtLastOnceDeliver at least once
AtMostOnceDeliver at most once
ExactlyOnceDeliver only once

Message delivery QoS

Public Functions Documentation#

function ~BMXMessage#

virtual ~BMXMessage()

Destructor

function msgId#

int64_t msgId()

Message unique ID

Return: int64_t

function clientMsgId#

int64_t clientMsgId()

Message client ID, only exists on message sender-side

Return: int64_t

function fromId#

int64_t fromId()

Message sender ID

Return: int64_t

function toId#

int64_t toId()

Message receiver ID

Return: int64_t

function type#

MessageType type()

Message type

Return: MessageType

function conversationId#

int64_t conversationId()

Conversation ID that message belongs to

Return: int64_t

function deliveryStatus#

DeliveryStatus deliveryStatus()

Message delivery status

Return: DeliveryStatus

function setDeliveryStatus#

void setDeliveryStatus(
    DeliveryStatus 
)

Set messaging state

function serverTimestamp#

int64_t serverTimestamp()

Message timestamp (when received by server-side)

Return: int64_t

function setServerTimestamp#

void setServerTimestamp(
    int64_t 
)

Set message timestamp (when received by server-side)

function clientTimestamp#

int64_t clientTimestamp()

Local timestamp (local time when message created or received)

Return: int64_t

function setClientTimestamp#

void setClientTimestamp(
    int64_t 
)

Set message local timestamp

function isPlayed#

bool isPlayed()

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

Return: bool

function setIsPlayed#

void setIsPlayed(
    bool 
)

Set whether a voice or video message has been played, valid only for received audio or video messages

function isPlayAcked#

bool isPlayAcked()

Means whether playback acknowledgement received for sender, and whether playback acknowledgement sent for receiver

Return: bool

function setIsPlayAcked#

void setIsPlayAcked(
    bool 
)

Set playback acknowledgement

function isReceiveMsg#

bool isReceiveMsg()

Message whether to receive

Return: bool

function setIsReceiveMsg#

void setIsReceiveMsg(
    bool 
)

Message to set receiving condition

function isRead#

bool isRead()

Message read or unread mark

Return: bool

function setIsRead#

void setIsRead(
    bool 
)

Message read or unread mark

function isReadAcked#

bool isReadAcked()

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

Return: bool

function setIsReadAcked#

void setIsReadAcked(
    bool 
)

Set read acknowledgement

function isDeliveryAcked#

bool isDeliveryAcked()

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

Return: bool

function setIsDeliveryAcked#

void setIsDeliveryAcked(
    bool 
)

Set delivery acknowledgement

function content#

const std::string & content()

Message text content

Return: std::string

function setContent#

void setContent(
    const std::string & content
)

Message text content

Parameters:

  • content Message text content

function contentType#

ContentType contentType()

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

Return: ContentType

function attachment#

BMXMessageAttachmentPtr attachment()

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

Return: BMXMessageAttachmentPtr

function config#

BMXMessageConfigPtr config()

Message settings

Return: JSON(std::string)

function setConfig#

void setConfig(
    BMXMessageConfigPtr 
)

Set message config information

function extension#

const JSON & extension()

Message extension information

Return: JSON(std::string)

function setExtension#

void setExtension(
    const JSON & 
)

Set message extension information

function deliveryQos#

DeliveryQos deliveryQos()

QOS of messaging

Return: DeliveryQos

function setDeliveryQos#

void setDeliveryQos(
    DeliveryQos qos
)

Set QOS of messaging

Parameters:

  • qos QOS of messaging

function senderName#

const std::string & senderName()

Display name of message sender

Return: std::string

function setSenderName#

void setSenderName(
    const std::string & senderName
)

Set display name of message sender

Parameters:

  • senderName Message text content

function groupAckCount#

int groupAckCount()

AckCount of read group messages

Return: int

function setGroupAckCount#

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

function groupAckUnreadCount#

int groupAckUnreadCount()

AckCount of unread group messages

Return: int

function setGroupAckUnreadCount#

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

function groupAckReadAll#

bool groupAckReadAll()

Whether all group messages are read

Return: bool

function groupPlayAckCount#

int groupPlayAckCount()

AckCount of played group messages (valid only for messages with audio/video attachment)

Return: int

function setGroupPlayAckCount#

void setGroupPlayAckCount(
    int count
)

Set groupAckCount of played messages (an SDK internal calling interface that shall not be called by upper layer) (valid only for messages with audio/video attachment)

Parameters:

  • count Set the number of read group messages

function groupPlayAckUnreadCount#

int groupPlayAckUnreadCount()

AckCount of unplayed group messages (valid only for messages with audio/video attachment)

Return: int

function setGroupPlayAckUnreadCount#

void setGroupPlayAckUnreadCount(
    int count
)

Set groupAckCount of unplayed messages (an SDK internal calling interface that shall not be called by upper layer) (valid only for messages with audio/video attachment)

Parameters:

  • count Set the number of unplayed group messages

function groupPlayAckReadAll#

bool groupPlayAckReadAll()

Whether all group messages have been played

Return: bool

function setPriority#

void setPriority(
    int priority
)

Set message diffusion priority, default 0. 0 means diffusion, and the smaller the number, the more diffused.

Parameters:

  • priority Set the number of unread group messages

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.

function priority#

int priority()

Message diffusion priority

Return: int

function setPushMessageMode#

void setPushMessageMode(
    bool 
)

Set whether the message is a push.

function isPushMessage#

bool isPushMessage()

Whether the message is a push

Return: bool

function createMessage#

static BMXMessagePtr createMessage(
    int64_t from,
    int64_t to,
    MessageType type,
    int64_t conversationId,
    const std::string & content
)

Create a text message

Parameters:

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

function createMessage#

static BMXMessagePtr createMessage(
    int64_t from,
    int64_t to,
    MessageType type,
    int64_t conversationId,
    BMXMessageAttachmentPtr attachment
)

Create a sent-attachment message

Parameters:

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

function createCommandMessage#

static BMXMessagePtr createCommandMessage(
    int64_t from,
    int64_t to,
    MessageType type,
    int64_t conversationId,
    const std::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

function createMessage#

static BMXMessagePtr createMessage(
    int64_t msgId,
    int64_t from,
    int64_t to,
    MessageType type,
    int64_t conversationId,
    const std::string & content,
    int64_t 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

function createMessage#

static BMXMessagePtr createMessage(
    int64_t msgId,
    int64_t from,
    int64_t to,
    MessageType type,
    int64_t conversationId,
    BMXMessageAttachmentPtr attachment,
    int64_t 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

function createCommandMessage#

static BMXMessagePtr createCommandMessage(
    int64_t msgId,
    int64_t from,
    int64_t to,
    MessageType type,
    int64_t conversationId,
    const std::string & content,
    int64_t 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

function createForwardMessage#

static BMXMessagePtr createForwardMessage(
    BMXMessagePtr msg,
    int64_t from,
    int64_t to,
    MessageType type,
    int64_t conversationId
)

Create a forwarding message

Parameters:

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

Updated on 2022-01-26 at 17:20:40 +0800

Generated API content with concise AI notes where context helps.