( message: Element, ownBareJid: string, )
| 243 | // XEP-0085, standalone only: a state riding on a message is implied by the |
| 244 | // message itself. |
| 245 | export const parseChatState = ( |
| 246 | message: Element, |
| 247 | ownBareJid: string, |
| 248 | ): { peerId: string; senderId: string; state: DmChatState } | null => { |
| 249 | const state = chatStates.find((name) => |
| 250 | childOf(message, name, NS_CHAT_STATES), |
| 251 | ); |
| 252 | const parties = |
| 253 | state && !textOf(message, 'body') && getParties(message, ownBareJid); |
| 254 | |
| 255 | return parties ? { ...parties, state } : null; |
| 256 | }; |
| 257 | |
| 258 | type Reactable = { id: string; reactions?: DmReactions }; |
| 259 | type ReactionChange = Pick<DmReaction, 'messageId' | 'senderId' | 'emojis'>; |
no test coverage detected