const recent = await ctx.db
.query("messages")
.withIndex("by_channel_createdAt", q => q.eq("channel", channel))
.order("desc")
.take(2000);
const friendSet = new Set(friendIds);
return recent.filter(m => friendSet.has(m.authorId));
const recent = await ctx.db
.query("messages")
.withIndex("by_channel_createdAt", q => q.eq("channel", channel))
.order("desc")
.take(2000);
const friendSet = new Set(friendIds);
return recent.filter(m => friendSet.has(m.authorId));