(events: RelayEvent[])
| 191 | } |
| 192 | |
| 193 | export function extractHiddenDmIds(events: RelayEvent[]): Set<string> { |
| 194 | const latest = events.reduce<RelayEvent | null>( |
| 195 | (current, event) => |
| 196 | current === null || event.created_at > current.created_at |
| 197 | ? event |
| 198 | : current, |
| 199 | null, |
| 200 | ); |
| 201 | return new Set( |
| 202 | (latest?.tags ?? []) |
| 203 | .filter((tag) => tag[0] === "h" && tag[1]) |
| 204 | .map((tag) => tag[1]), |
| 205 | ); |
| 206 | } |
| 207 | |
| 208 | function unreadKindsForChannel(channelType: ChannelType): number[] { |
| 209 | return channelType === "dm" |
no outgoing calls
no test coverage detected