RCKMessageRecallPolicy class
消息「撤回」能力的统一门控。
撤回入口此前只判断 direction == send,没有校验消息是否还在可撤回的时间
窗内,导致发送超过时限的消息右键/长按菜单里仍出现「撤回」(QA:超过 3 分钟
的消息右键仍存在「撤回」选项)。点击后要么被服务端拒绝、要么产生与菜单
承诺不一致的体验。
判定口径对齐 Android / iOS 原生 IMKit 的 canRecallMessage:时限、发送
方向、发送状态、会话类型同时成立才允许撤回。原生默认时限为 120 秒,由
rc_message_recall_interval / maxRecallDuration 配置;Flutter 侧没有读取
原生该配置项的通道,因此时限由 Kit 配置显式传入,默认值与原生一致。
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
canRecall(
RCIMIWMessage message, {required int? now, required int? maxRecallSeconds}) → bool - 单条消息是否允许撤回。
- 该发送状态是否意味着消息不能被撤回。
-
isSupportedConversationType(
RCIMIWConversationType? type) → bool -
原生
canRecallMessage放开单聊、群聊、讨论组、超级群。 -
isWithinRecallWindow(
{required int? sentTime, required int? now, required int? maxRecallSeconds}) → bool - 消息是否仍在可撤回的时间窗内。
Constants
- defaultMaxRecallSeconds → const int
-
原生 IMKit 的默认可撤回时限(秒),与 Android
rc_message_recall_interval/ iOSmaxRecallDuration的默认值一致。