MCPcopy Create free account
hub / github.com/block/buzz / filterMockUserStatuses

Function filterMockUserStatuses

desktop/src/testing/e2eBridge.ts:3253–3271  ·  view source on GitHub ↗
(filter: MockFilter)

Source from the content-addressed store, hash-verified

3251}
3252
3253function 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
3273function emitMockChannelMessage(
3274 channelId: string,

Callers 1

sendToMockSocketFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected