藍鶯開發者
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 解說。