fork of indigo with slightly nicer lexgen

Fix from:me search queries

Changed files
+15 -1
search
+7 -1
search/parse_query.go
··· 62 62 63 63 switch tokParts[0] { 64 64 case "did": 65 - // TODO: not really clear what to do here; treating like a mention doesn't really make sense? 65 + // Used as a hack for `from:me` when suppplied by the client 66 + did, err := syntax.ParseDID(p) 67 + if err != nil { 68 + continue 69 + } 70 + params.Author = &did 71 + continue 66 72 case "from", "to", "mentions": 67 73 raw := tokParts[1] 68 74 if raw == "me" {
+8
search/parse_query_test.go
··· 86 86 } 87 87 assert.Equal(1, len(p.Filters())) 88 88 89 + q9 := "did:plc:abc222" 90 + p = ParsePostQuery(ctx, &dir, q9, nil) 91 + assert.Equal("*", p.Query) 92 + assert.Equal(1, len(p.Filters())) 93 + if p.Author != nil { 94 + assert.Equal("did:plc:abc222", p.Author.String()) 95 + } 96 + 89 97 // TODO: more parsing tests: bare handles, to:, since:, until:, URL, domain:, lang 90 98 }