getReadMembers method
Returns a list of Member who has read given message
. If includeAll
is provided as true
then current user will be included as well.
Implementation
List<Member> getReadMembers(BaseMessage message, {bool includeAll = false}) {
if (message is AdminMessage) return [];
if (isSuper) return [];
// if (_sdk.state.currentUser == null) return []; //check connection
return members.where((m) {
if (!includeAll && m.isCurrentUser) return false;
if (message.sender?.userId == m.userId) return false;
final readStatus = _sdk.cache.find<ReadStatus>(
channelKey: channelUrl,
key: m.userId,
);
if (readStatus == null || readStatus.timestamp == 0) return false;
return readStatus.timestamp >= message.createdAt;
}).toList();
}