Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
presence: Extract presence_info_from_event_schema.
Anders Kaseorgb4f14b41324e
diff --git a/web/src/presence.ts b/web/src/presence.tsindex 523b1a9f5c1..e256712b014 100644--- a/web/src/presence.ts+++ b/web/src/presence.ts@@ -1,4 +1,4 @@-import type {z} from "zod";+import {z} from "zod";import * as people from "./people.ts";import type {StateData, presence_schema} from "./state_data.ts";@@ -14,14 +14,15 @@ export type PresenceStatus = {last_active?: number | undefined;};-export type PresenceInfoFromEvent = {- website: {- client: "website";- status: "idle" | "active";- timestamp: number;- pushable: boolean;- };-};+export const presence_info_from_event_schema = z.object({+ website: z.object({+ client: z.literal("website"),+ status: z.enum(["idle", "active"]),+ timestamp: z.number(),+ pushable: z.boolean(),+ }),+});+export type PresenceInfoFromEvent = z.output<typeof presence_info_from_event_schema>;// This module just manages data. See activity.js for// the UI of our buddy list.