藍鶯開發者
Web & Mini ProgramiOSAndroidC++Server API

im::floo::floolib::BMXConversation#

會話

Inherits from BMXBaseObject

Public Functions#

Name
synchronized voiddelete()
longconversationId()
會話Id
BMXConversation.Typetype()
會話類型
BMXMessagelastMsg()
最新訊息
intunreadNumber()
未讀訊息數
intmessageCount()
會話中所有訊息的數量
booleanisMuteNotification()
是否提醒使用者訊息,不提醒的情況下會話總未讀數不會統計該會話計數。
Stringextension()
擴展信息
[BMXErrorCode]setExtension(String ext)
設定擴展信息
StringeditMessage()
編輯訊息
[BMXErrorCode]setEditMessage(String editMessage)
設定編輯訊息
[BMXErrorCode]searchMessagesByKeyWords(String keywords, long refTime, long size, BMXMessageList result, BMXConversation.Direction arg4)
搜索訊息,如果不指定則從最新訊息開始
[BMXErrorCode]searchMessagesByKeyWords(String keywords, long refTime, long size, BMXMessageList result)
[BMXErrorCode]searchMessagesByType(BMXMessage.ContentType type, long refTime, long size, BMXMessageList result, BMXConversation.Direction arg4)
按照類型搜索訊息,如果不指定則從最新訊息開始
[BMXErrorCode]searchMessagesByType(BMXMessage.ContentType type, long refTime, long size, BMXMessageList result)
voidsetMessagePlayedStatus(final BMXMessage msg, final boolean status, final BMXCallBack callBack)
設定訊息播放狀態(只對語音/視訊訊息有效)
voidsetMessageReadStatus(final BMXMessage msg, final boolean status, final BMXCallBack callBack)
設定訊息未讀狀態,更新未讀訊息數
voidsetAllMessagesRead(final BMXCallBack callBack)
把所有訊息設定為已讀,更新未讀訊息數
voidupdateMessageExtension(final BMXMessage msg, final BMXCallBack callBack)
更新一條資料庫存儲訊息的擴展欄位信息
voidinsertMessage(final BMXMessage msg, final BMXCallBack callBack)
插入一條訊息
voidloadMessage(final long msgId, final BMXDataCallBack< BMXMessage > callBack)
讀取一條訊息
voidremoveAllMessages(final BMXCallBack callBack)
刪除會話中的所有訊息
voidloadMessages(final long refMsgId, final long size, final BMXConversation.Direction arg3, final BMXDataCallBack< BMXMessageList > callBack)
加載訊息,如果不指定則從最新訊息開始
voidloadMessages(final long refMsgId, final long size, final BMXDataCallBack< BMXMessageList > callBack)
voidsearchMessages(final String keywords, final long refTime, final long size, final BMXConversation.Direction arg4, final BMXDataCallBack< BMXMessageList > callBack)
搜索訊息,如果不指定則從最新訊息開始
voidsearchMessages(final String keywords, final long refTime, final long size, final BMXDataCallBack< BMXMessageList > callBack)
voidsearchMessages(final BMXMessage.ContentType type, final long refTime, final long size, final BMXConversation.Direction arg4, final BMXDataCallBack< BMXMessageList > callBack)
按照類型搜索訊息,如果不指定則從最新訊息開始
voidsearchMessages(final BMXMessage.ContentType type, final long refTime, final long size, final BMXDataCallBack< BMXMessageList > callBack)
voidrefreshConversation(final BMXCallBack callBack)
讀取資料庫當前會話所有訊息數量,強制更新conversation的訊息總數和未讀訊息數。

Protected Functions#

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

Public Functions Documentation#

function delete#

inline synchronized void delete()

Example:

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

function conversationId#

inline long conversationId()

會話Id

Return: int64_t

Example:

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

function type#

inline BMXConversation.Type type()

會話類型

Return: [Type]

Example:

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

function lastMsg#

inline BMXMessage lastMsg()

最新訊息

Return: BMXMessagePtr

Example:

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

function unreadNumber#

inline int unreadNumber()

未讀訊息數

Return: int32_t

Example:

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

function messageCount#

inline int messageCount()

會話中所有訊息的數量

Return: int32_t

Example:

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

function isMuteNotification#

inline boolean isMuteNotification()

是否提醒使用者訊息,不提醒的情況下會話總未讀數不會統計該會話計數。

Return: bool

Example:

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

function extension#

inline String extension()

擴展信息

Return: JSON(std::string)

Example:

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

function setExtension#

inline BMXErrorCode setExtension(
    String ext
)

設定擴展信息

Parameters:

  • ext 會話擴展訊息

Return: [BMXErrorCode]

Example:

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

function editMessage#

inline String editMessage()

編輯訊息

Return: std::string

Example:

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

function setEditMessage#

inline BMXErrorCode setEditMessage(
    String editMessage
)

設定編輯訊息

Parameters:

  • editMessage 會話正在編輯的文本訊息

Return: [BMXErrorCode]

Example:

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

function searchMessagesByKeyWords#

inline BMXErrorCode searchMessagesByKeyWords(
    String keywords,
    long refTime,
    long size,
    BMXMessageList result,
    BMXConversation.Direction arg4
)

搜索訊息,如果不指定則從最新訊息開始

Parameters:

  • keywords 搜索訊息的關鍵字
  • refTime 搜索訊息的起始時間
  • size 最大加載訊息條數
  • result 搜索到的訊息結果列表
  • arg4 訊息搜索方向,預設(Direction::Up)是從更早的訊息中搜索

Return: [BMXErrorCode]

Example:

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

function searchMessagesByKeyWords#

inline BMXErrorCode searchMessagesByKeyWords(
    String keywords,
    long refTime,
    long size,
    BMXMessageList result
)

Example:

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

function searchMessagesByType#

inline BMXErrorCode searchMessagesByType(
    BMXMessage.ContentType type,
    long refTime,
    long size,
    BMXMessageList result,
    BMXConversation.Direction arg4
)

按照類型搜索訊息,如果不指定則從最新訊息開始

Parameters:

  • type 搜索訊息的類型
  • refTime 搜索訊息的起始時間
  • size 最大加載訊息條數
  • result 搜索到的訊息結果列表
  • arg4 訊息搜索方向,預設(Direction::Up)是從更早的訊息中搜索

Return: [BMXErrorCode]

Example:

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

function searchMessagesByType#

inline BMXErrorCode searchMessagesByType(
    BMXMessage.ContentType type,
    long refTime,
    long size,
    BMXMessageList result
)

Example:

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

function setMessagePlayedStatus#

inline void setMessagePlayedStatus(
    final BMXMessage msg,
    final boolean status,
    final BMXCallBack callBack
)

設定訊息播放狀態(只對語音/視訊訊息有效)

Parameters:

  • msg 需要設定播放狀態的訊息
  • status 訊息是否已經播放
  • callBack 回呼

Example:

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

function setMessageReadStatus#

inline void setMessageReadStatus(
    final BMXMessage msg,
    final boolean status,
    final BMXCallBack callBack
)

設定訊息未讀狀態,更新未讀訊息數

Parameters:

  • msg 需要設定訊息已讀狀態的訊息
  • status 訊息是否設定已讀
  • callBack 回呼

Example:

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

function setAllMessagesRead#

inline void setAllMessagesRead(
    final BMXCallBack callBack
)

把所有訊息設定為已讀,更新未讀訊息數

Parameters:

  • callBack 回呼

Example:

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

function updateMessageExtension#

inline void updateMessageExtension(
    final BMXMessage msg,
    final BMXCallBack callBack
)

更新一條資料庫存儲訊息的擴展欄位信息

Parameters:

  • msg 需要更改擴展信息的訊息此時msg部分已經更新擴展字椴信息
  • callBack 回呼

Example:

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

function insertMessage#

inline void insertMessage(
    final BMXMessage msg,
    final BMXCallBack callBack
)

插入一條訊息

Parameters:

  • msg 插入的訊息
  • callBack 回呼

Example:

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

function loadMessage#

inline void loadMessage(
    final long msgId,
    final BMXDataCallBack< BMXMessage > callBack
)

讀取一條訊息

Parameters:

  • msgId 需要讀取的訊息的訊息id
  • callBack 回呼

Example:

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

function removeAllMessages#

inline void removeAllMessages(
    final BMXCallBack callBack
)

刪除會話中的所有訊息

Parameters:

  • callBack 回呼

Example:

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

function loadMessages#

inline void loadMessages(
    final long refMsgId,
    final long size,
    final BMXConversation.Direction arg3,
    final BMXDataCallBack< BMXMessageList > callBack
)

加載訊息,如果不指定則從最新訊息開始

Parameters:

  • refMsgId 加載訊息的起始id
  • size 最大加載訊息條數
  • arg3 加載訊息的方向,預設是加載更早的訊息
  • callBack 回呼

Example:

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

function loadMessages#

inline void loadMessages(
    final long refMsgId,
    final long size,
    final BMXDataCallBack< BMXMessageList > callBack
)

Example:

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

function searchMessages#

inline void searchMessages(
    final String keywords,
    final long refTime,
    final long size,
    final BMXConversation.Direction arg4,
    final BMXDataCallBack< BMXMessageList > callBack
)

搜索訊息,如果不指定則從最新訊息開始

Parameters:

  • keywords 搜索訊息的關鍵字
  • refTime 搜索訊息的起始時間
  • size 最大加載訊息條數
  • arg4 訊息搜索方向,預設(Direction::Up)是從更早的訊息中搜索
  • callBack 回呼

Example:

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

function searchMessages#

inline void searchMessages(
    final String keywords,
    final long refTime,
    final long size,
    final BMXDataCallBack< BMXMessageList > callBack
)

Example:

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

function searchMessages#

inline void searchMessages(
    final BMXMessage.ContentType type,
    final long refTime,
    final long size,
    final BMXConversation.Direction arg4,
    final BMXDataCallBack< BMXMessageList > callBack
)

按照類型搜索訊息,如果不指定則從最新訊息開始

Parameters:

  • type 搜索訊息的類型
  • refTime 搜索訊息的起始時間
  • size 最大加載訊息條數
  • arg4 訊息搜索方向,預設(Direction::Up)是從更早的訊息中搜索
  • callBack 回呼

Example:

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

function searchMessages#

inline void searchMessages(
    final BMXMessage.ContentType type,
    final long refTime,
    final long size,
    final BMXDataCallBack< BMXMessageList > callBack
)

Example:

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

function refreshConversation#

inline void refreshConversation(
    final BMXCallBack callBack
)

讀取資料庫當前會話所有訊息數量,強制更新conversation的訊息總數和未讀訊息數。

Parameters:

  • callBack 回呼

Protected Functions Documentation#

Example:

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

function BMXConversation#

inline BMXConversation(
    long cPtr,
    boolean cMemoryOwn
)

Example:

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

function finalize#

inline void finalize()

Example:

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

function getCPtr#

static inline long getCPtr(
    BMXConversation obj
)

Example:

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

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

自動產生的 API 內容,僅在必要位置補充精簡的 AI 解說。