02:41:20.869 [info] == Running Pleroma.Repo.Migrations.UpdateActivityVisibility.up/0 forward 02:41:20.869 [info] execute “create or replace function activity_visibility(actor varchar, recipients varchar[], data jsonb) returns varchar as $$\nDECLARE\n fa varchar;\n public varchar := ‘https://www.w3.org/ns/activitystreams#Public';nBEGINn SELECT COALESCE(users.follower_address, “) into fa from users where users.ap_id = actor;\n\n IF data-‘to’ ? public THEN\n RETURN ‘public’;\n ELSIF data-‘cc’ ? public THEN\n RETURN ‘unlisted’;\n ELSIF ARRAY[fa] && recipients THEN\n RETURN ‘private’;\n ELSIF not(ARRAY[fa, public] && recipients) THEN\n RETURN ‘direct’;\n ELSE\n RETURN ‘unknown’;\n END IF;\nEND;\n$$ LANGUAGE plpgsql IMMUTABLE PARALLEL SAFE SECURITY DEFINER;\n”