BinaryMessage

new BinaryMessage(buffer)

二进制消息
Parameters:
Name Type Description
buffer ArrayBuffer
Since:
  • 4.0.0

Extends

Members

buffer :ArrayBuffer

nullable cid :String

消息所在的 conversation id
Inherited From:

nullable deliveredAt :Date

消息送达时间
Inherited From:

from :String

消息发送者
Inherited From:

id :String

Inherited From:

readonly mentioned :Boolean

当前用户是否在该消息中被提及
Since:
  • 4.0.0
Inherited From:

mentionedAll :Boolean

消息是否提及了所有人
Since:
  • 4.0.0
Inherited From:

mentionList :Array.<String>

消息提及的用户
Since:
  • 4.0.0
Inherited From:

readonly status :Symbol

消息状态,值为 module:leancloud-realtime.MessageStatus 之一
Since:
  • 3.2.0
Inherited From:

timestamp :Date

消息发送时间
Inherited From:

updatedAt :Date

消息修改或撤回时间,可以通过比较其与消息的 timestamp 是否相等判断消息是否被修改过或撤回过。
Since:
  • 3.5.0
Inherited From:

Methods

getMentionList() → {Array.<String>}

获取提及用户列表
Returns:
Array.<String> - 提及用户的 id 列表
Since:
  • 4.0.0
Inherited From:

mentionAll(valueopt) → {this}

设置是否提及所有人
Parameters:
Name Type Attributes Default Description
value Boolean <optional>
true
Returns:
this - self
Since:
  • 4.0.0
Inherited From:

setMentionList(clients) → {this}

设置提及用户列表
Parameters:
Name Type Description
clients Array.<String> 提及用户的 id 列表
Returns:
this - self
Since:
  • 4.0.0
Inherited From:

toFullJSON() → {Object}

返回 JSON 格式的消息,与 toJSON 不同的是,该对象包含了完整的信息,可以通过 IMClient#parseMessage 反序列化。
Returns:
Object - 返回值是一个 plain Object
Since:
  • 4.0.0
Overrides:

toJSON() → {Object}

返回 JSON 格式的消息
Returns:
Object - 返回值是一个 plain Object
Overrides: