NIMChatroomMessage class Null safety
- Inheritance
- Object
- NIMMessage
- NIMChatroomMessage
- Annotations
Constructors
-
NIMChatroomMessage({bool enableHistory = true, bool isHighPriorityMessage = false, NIMChatroomMessageExtension? extension, String? messageId, String? sessionId, NIMSessionType? sessionType, required NIMMessageType messageType, NIMMessageType? messageSubType, NIMMessageStatus? status, required NIMMessageDirection messageDirection, String? fromAccount, String? content, required int timestamp, NIMMessageAttachment? messageAttachment, NIMMessageAttachmentStatus? attachmentStatus, String? uuid, int? serverId, Map<
String, dynamic> ? remoteExtension, Map<String, dynamic> ? localExtension, String? callbackExtension, Map<String, dynamic> ? pushPayload, String? pushContent, NIMMemberPushOption? memberPushOption, NIMClientType? senderClientType, NIMAntiSpamOption? antiSpamOption, bool messageAck = false, bool hasSendAck = false, int ackCount = 0, int unAckCount = 0, bool clientAntiSpam = false, bool isInBlackList = false, bool isChecked = false, bool sessionUpdate = true, NIMMessageThreadOption? messageThreadOption, int? quickCommentUpdateTime, bool isDeleted = false, Map<String, dynamic> ? yidunAntiCheating, String? env, String? fromNickname, bool? isRemoteRead}) -
NIMChatroomMessage.fromMap(Map<
String, dynamic> map) -
factory
Properties
- ackCount → int
-
群消息已读回执的已读数
@JsonKey(defaultValue: 0), final, inherited
- antiSpamOption ↔ NIMAntiSpamOption?
-
易盾反垃圾配置项
@JsonKey(fromJson: NIMAntiSpamOption._fromMap, toJson: NIMAntiSpamOption._toMap), read / write, inherited
- attachmentStatus ↔ NIMMessageAttachmentStatus?
-
消息附件下载状态 仅针对收到的消息
@JsonKey(unknownEnumValue: NIMMessageAttachmentStatus.transferred), read / write, inherited
- callbackExtension → String?
-
第三方回调回来的自定义扩展字段
final, inherited
- clientAntiSpam ↔ bool
-
命中了客户端反垃圾,服务器处理
@JsonKey(defaultValue: false), read / write, inherited
- config ↔ NIMCustomMessageConfig?
-
消息配置
@JsonKey(fromJson: NIMCustomMessageConfig._fromMap, toJson: NIMCustomMessageConfig._toMap), read / write, inherited
- content ↔ String?
-
消息文本
消息中除
IMMessageType.text
和IMMessageType.tip
外,其他消息text
字段都为 nullread / write, inherited - enableHistory ↔ bool
-
该消息是否要保存到服务器
@JsonKey(defaultValue: true), read / write
- env ↔ String?
-
环境变量
用于指向不同的抄送,第三方回调等配置
注意:数据库不会保存此字段
read / write, inherited
- extension ↔ NIMChatroomMessageExtension?
-
消息扩展
@JsonKey(fromJson: _chatroomMessageExtensionFromMap, toJson: _chatroomMessageExtensionToMap), read / write
- fromAccount ↔ String?
-
消息发送方帐号
read / write, inherited
- fromNickname → String?
-
消息发送方昵称
final, inherited
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- hasSendAck → bool
-
是否已经发送过群消息已读回执
@JsonKey(defaultValue: false), final, inherited
- isChecked ↔ bool
-
消息的选中状态
@JsonKey(defaultValue: false), read / write, inherited
- isDeleted → bool
-
消息是否标记为已删除
已删除的消息在获取本地消息列表时会被过滤掉,只有根据 messageId
获取消息的接口可能会返回已删除消息。聊天室消息里,此字段无效。
@JsonKey(defaultValue: false), final, inherited
- isHighPriorityMessage ↔ bool
-
是否是高优先级消息
@JsonKey(defaultValue: false), read / write
- isInBlackList → bool
-
发送消息给对方, 是不是被对方拉黑了(消息本身是发送成功的)
@JsonKey(defaultValue: false), final, inherited
- isRemoteRead ↔ bool?
-
判断自己发送的消息对方是否已读
只有当当前消息为 NIMSessionType.p2p 消息且 NIMMessageDirection.outgoing 为
true
read / write, inherited -
localExtension
↔ Map<
String, dynamic> ? -
本地扩展字段(仅本地有效)
@JsonKey(fromJson: castPlatformMapToDartMap), read / write, inherited
- memberPushOption ↔ NIMMemberPushOption?
-
指定成员推送选项
@JsonKey(fromJson: NIMMemberPushOption._fromMap, toJson: NIMMemberPushOption._toMap), read / write, inherited
- messageAck ↔ bool
-
是否需要消息已读(主要针对群消息)
@JsonKey(defaultValue: false), read / write, inherited
- messageAttachment ↔ NIMMessageAttachment?
-
消息附件内容
@JsonKey(fromJson: NIMMessageAttachment._fromMap, toJson: NIMMessageAttachment._toMap), read / write, inherited
- messageDirection ↔ NIMMessageDirection
-
发送消息或者接收到消息
@JsonKey(unknownEnumValue: NIMMessageDirection.outgoing), read / write, inherited
- messageId → String?
-
消息ID,唯一标识
@JsonKey(defaultValue: '-1'), final, inherited
- messageSubType ↔ NIMMessageType?
-
消息子类型
@JsonKey(unknownEnumValue: NIMMessageType.undef), read / write, inherited
- messageThreadOption ↔ NIMMessageThreadOption?
-
消息的thread信息
@JsonKey(fromJson: NIMMessageThreadOption._fromMap, toJson: NIMMessageThreadOption._toMap), read / write, inherited
- messageType → NIMMessageType
-
消息类型
@JsonKey(unknownEnumValue: NIMMessageType.undef, defaultValue: NIMMessageType.undef), final, inherited
- pushContent ↔ String?
-
消息推送文案,长度限制200字节
read / write, inherited
-
pushPayload
↔ Map<
String, dynamic> ? -
消息推送Payload
@discussion iOS 上支持字段参考苹果技术文档,长度限制 2K,撤回消息时该字段无效
@JsonKey(fromJson: castPlatformMapToDartMap), read / write, inherited
- quickCommentUpdateTime → int?
-
快捷评论的最后更新时间
final, inherited
-
remoteExtension
↔ Map<
String, dynamic> ? -
消息拓展字段
服务器下发的消息拓展字段,并不在本地做持久化,目前只有聊天室中的消息才有该字段
@JsonKey(fromJson: castPlatformMapToDartMap), read / write, inherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- senderClientType → NIMClientType?
-
发送者客户端类型
@JsonKey(unknownEnumValue: NIMClientType.unknown), final, inherited
- serverId → int?
-
消息 ServerID
final, inherited
- sessionId → String?
-
会话ID,如果当前session为team,则sessionId为teamId,如果是P2P则为对方帐号
final, inherited
- sessionType → NIMSessionType?
-
会话类型,当前仅支持P2P,Team和Chatroom
@JsonKey(unknownEnumValue: NIMSessionType.p2p), final, inherited
- sessionUpdate ↔ bool
-
消息是否需要刷新到session服务
只有消息存离线的情况下,才会判断该参数,默认:是
@JsonKey(defaultValue: true), read / write, inherited
- status ↔ NIMMessageStatus?
-
消息状态
@JsonKey(unknownEnumValue: NIMMessageStatus.sending), read / write, inherited
- timestamp → int
-
消息发送时间
本地存储消息可以通过修改时间戳来调整其在会话列表中的位置,发完服务器的消息时间戳将被服务器自动修正
final, inherited
- unAckCount → int
-
群消息已读回执的未读数
@JsonKey(defaultValue: 0), final, inherited
- uuid → String?
-
消息UUID
final, inherited
-
yidunAntiCheating
↔ Map<
String, dynamic> ? -
易盾反垃圾增强反作弊专属字段
@JsonKey(fromJson: castPlatformMapToDartMap), read / write, inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
toMap(
) → Map< String, dynamic> -
override
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited