| 3251 | } |
| 3252 | |
| 3253 | function filterMockUserStatuses(filter: MockFilter) { |
| 3254 | const authors = filter.authors?.map((author) => author.toLowerCase()); |
| 3255 | const dTags = filter["#d"]; |
| 3256 | |
| 3257 | return mockUserStatuses |
| 3258 | .filter((event) => { |
| 3259 | if (authors && !authors.includes(event.pubkey.toLowerCase())) { |
| 3260 | return false; |
| 3261 | } |
| 3262 | if ( |
| 3263 | dTags && |
| 3264 | !event.tags.some((tag) => tag[0] === "d" && dTags.includes(tag[1])) |
| 3265 | ) { |
| 3266 | return false; |
| 3267 | } |
| 3268 | return true; |
| 3269 | }) |
| 3270 | .sort((a, b) => b.created_at - a.created_at); |
| 3271 | } |
| 3272 | |
| 3273 | function emitMockChannelMessage( |
| 3274 | channelId: string, |