Commit b4d72e33 authored by Steven's avatar Steven

fix: memo visibilities with filter

parent 60a0ead0
...@@ -807,9 +807,6 @@ func convertVisibilityToStore(visibility v1pb.Visibility) store.Visibility { ...@@ -807,9 +807,6 @@ func convertVisibilityToStore(visibility v1pb.Visibility) store.Visibility {
} }
func (s *APIV1Service) buildMemoFindWithFilter(ctx context.Context, find *store.FindMemo, filter string) error { func (s *APIV1Service) buildMemoFindWithFilter(ctx context.Context, find *store.FindMemo, filter string) error {
if find == nil {
find = &store.FindMemo{}
}
if find.PayloadFind == nil { if find.PayloadFind == nil {
find.PayloadFind = &store.FindMemoPayload{} find.PayloadFind = &store.FindMemoPayload{}
} }
...@@ -912,7 +909,8 @@ func (s *APIV1Service) buildMemoFindWithFilter(ctx context.Context, find *store. ...@@ -912,7 +909,8 @@ func (s *APIV1Service) buildMemoFindWithFilter(ctx context.Context, find *store.
} }
find.VisibilityList = []store.Visibility{store.Public} find.VisibilityList = []store.Visibility{store.Public}
} else if find.CreatorID != nil && *find.CreatorID != user.ID { } else if find.CreatorID == nil || *find.CreatorID != user.ID {
// If creator is not specified or the creator is not the current user, only public and protected memos are visible.
find.VisibilityList = []store.Visibility{store.Public, store.Protected} find.VisibilityList = []store.Visibility{store.Public, store.Protected}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment