UNPKG

communication-react-19

Version:

React library for building modern communication user experiences utilizing Azure Communication Services (React 19 compatible fork)

22 lines 1.29 kB
import { ChatMessage, ReadReceiptsBySenderId } from '../..'; import { BlockedMessage } from '../../types/ChatMessage'; /** * @private *logic: Looking at message A, how do we know it's read number? * Assumption: if user read the latest message, user has read all messages before that * ReadReceipt behaviour: read receipt is only sent to the last message * * If participant read a message that is sent later than message A, then the participant has read message A * How do we check if the message is sent later than message A? * We compare if the messageID of the last read message is larger than or equal to the message A's id * Because messageID is the creation timestamp of each message * Timestamps are in epoch time so lecixographical ordering is the same as time ordering. * * if MessageId of B is larger than message Id of A, then B is created after A * if the last read message is created after the message A is sent, then user should have read message A as well */ declare const _default: (message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage, readReceiptsBySenderId: ReadReceiptsBySenderId) => { id: string; displayName: string; }[]; export default _default; //# sourceMappingURL=getParticipantsWhoHaveReadMessage.d.ts.map