Add CreatedAt and Search feeds, combine date feeds into one type, fix Tags.replies, fix sort order of relay selections

This commit is contained in:
Jon Staab
2024-05-02 09:45:49 -07:00
parent fefcd1b042
commit a343f74241
4 changed files with 82 additions and 33 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ export class Router {
sortRelaySelections = (relaySelections: RelayValues[]) => {
const scores = new Map<string, number>()
const getScore = (relayValues: RelayValues) => scores.get(relayValues.relay) || 0
const getScore = (relayValues: RelayValues) => -(scores.get(relayValues.relay) || 0)
for (const relayValues of relaySelections) {
scores.set(relayValues.relay, this.scoreRelaySelection(relayValues))
+5 -1
View File
@@ -98,7 +98,11 @@ export class Tags extends (Fluent<Tag> as OmitStatics<typeof Fluent<Tag>, 'from'
const dispatchTags = (thisTags: Tags) =>
thisTags.forEach((t: Tag, i: number) => {
if (t.mark() === 'root') {
roots.push(t.valueOf())
if (thisTags.whereMark("reply").count() === 0) {
replies.push(t.valueOf())
} else {
roots.push(t.valueOf())
}
} else if (t.mark() === 'reply') {
replies.push(t.valueOf())
} else if (t.mark() === 'mention') {