diff --git a/.changeset/z_cat_settings.md b/.changeset/z_cat_settings.md
new file mode 100644
index 000000000..686fc480b
--- /dev/null
+++ b/.changeset/z_cat_settings.md
@@ -0,0 +1,5 @@
+---
+sable: minor
+---
+
+Added settings to Account that let you set if you are a cat or have cats, or not display other peoples cat status.
diff --git a/src/app/components/user-profile/UserRoomProfile.tsx b/src/app/components/user-profile/UserRoomProfile.tsx
index 0031943dc..3878bba59 100644
--- a/src/app/components/user-profile/UserRoomProfile.tsx
+++ b/src/app/components/user-profile/UserRoomProfile.tsx
@@ -31,8 +31,9 @@ import {
} from '$plugins/react-custom-html-parser';
import { useSpoilerClickHandler } from '$hooks/useSpoilerClickHandler';
import { RenderBody } from '$components/message';
-import { getSettings } from '$state/settings';
+import { getSettings, settingsAtom } from '$state/settings';
import { filterPronounsByLanguage } from '$utils/pronouns';
+import { useSetting } from '$state/hooks/settings';
import { CreatorChip } from './CreatorChip';
import { UserInviteAlert, UserBanAlert, UserModeration, UserKickAlert } from './UserModeration';
import { PowerChip } from './PowerChip';
@@ -50,6 +51,8 @@ const KNOWN_KEYS = [
'moe.sable.app.name_color',
'avatar_url',
'displayname',
+ 'kitty.meow.has_cats',
+ 'kitty.meow.is_cat',
];
type UserExtendedSectionProps = {
@@ -69,6 +72,18 @@ function UserExtendedSection({
};
const [showMore, setShowMore] = useState(false);
+ const [renderAnimals] = useSetting(settingsAtom, 'renderAnimals');
+ const isCat = profile.isCat === true;
+ const hasCats = profile.hasCats === true;
+
+ const catStatusText = useMemo(() => {
+ if (!renderAnimals) return null;
+ if (isCat && hasCats) return 'Cat with cats—needs pets & love!';
+ if (isCat) return 'Is a cat—give pets & love!';
+ if (hasCats) return 'Has cats—send love!';
+ return null;
+ }, [renderAnimals, isCat, hasCats]);
+
const renderValue = (val: any) => {
if (val === null || val === undefined) return 'n/a';
if (typeof val === 'boolean') return val ? 'Yes' : 'No';
@@ -152,6 +167,14 @@ function UserExtendedSection({
)}
+ {catStatusText && (
+
+
+
+ {catStatusText}
+
+
+ )}
)}
diff --git a/src/app/features/room/RoomTimeline.tsx b/src/app/features/room/RoomTimeline.tsx
index 7bbdf8599..38063d249 100644
--- a/src/app/features/room/RoomTimeline.tsx
+++ b/src/app/features/room/RoomTimeline.tsx
@@ -1153,6 +1153,8 @@ export function RoomTimeline({
delete cleanExtended['moe.sable.app.name_color'];
delete cleanExtended.avatar_url;
delete cleanExtended.displayname;
+ delete cleanExtended['kitty.meow.has_cats'];
+ delete cleanExtended['kitty.meow.is_cat'];
}
openUserRoomProfile(
diff --git a/src/app/features/settings/account/Profile.tsx b/src/app/features/settings/account/Profile.tsx
index 707c59161..4cbe5fda8 100644
--- a/src/app/features/settings/account/Profile.tsx
+++ b/src/app/features/settings/account/Profile.tsx
@@ -23,6 +23,7 @@ import {
Header,
config,
Spinner,
+ Switch,
} from 'folds';
import FocusTrap from 'focus-trap-react';
import { useSetAtom } from 'jotai';
@@ -51,6 +52,8 @@ import { PronounEditor } from './PronounEditor';
import { BioEditor } from './BioEditor';
import { NameColorEditor } from './NameColorEditor';
import { StatusEditor } from './StatusEditor';
+import { useSetting } from '$state/hooks/settings';
+import { settingsAtom } from '$state/settings';
type PronounSet = {
summary: string;
@@ -484,9 +487,14 @@ function ProfileExtended({ profile, userId }: ProfileProps) {
const presence = useUserPresence(userId);
const currentStatus = presence?.status || '';
+ // Keys we don't render here nor handle seperately but still need to exclude
+ const EXCLUDED_KEYS = ['kitty.meow.is_cat', 'kitty.meow.has_cats'];
+
// Unknown fields / unimplemented non-matrix-spec fields
// Only renders them, can't edit or set
- const extendedFields = Object.entries(profile.extended || {});
+ const extendedFields = Object.entries(profile.extended || {}).filter(
+ ([key]) => !EXCLUDED_KEYS.includes(key)
+ );
const handleSaveField = useCallback(
async (key: string, value: any) => {
@@ -627,6 +635,70 @@ function ProfileExtended({ profile, userId }: ProfileProps) {
);
}
+type AnimalCosmeticsProps = {
+ profile: UserProfile;
+ userId: string;
+};
+function AnimalCosmetics({ profile, userId }: AnimalCosmeticsProps) {
+ const mx = useMatrixClient();
+ const setGlobalProfiles = useSetAtom(profilesCacheAtom);
+ const [renderAnimals, setRenderAnimals] = useSetting(settingsAtom, 'renderAnimals');
+
+ const isCat = profile.isCat === true;
+ const hasCats = profile.hasCats === true;
+
+ const handleSaveField = useCallback(
+ async (key: string, value: any) => {
+ await mx.setExtendedProfileProperty?.(key, value);
+ setGlobalProfiles((prev) => {
+ const newCache = { ...prev };
+ delete newCache[userId];
+ return newCache;
+ });
+ },
+ [mx, userId, setGlobalProfiles]
+ );
+
+ return (
+
+ Animal Identity
+
+ }
+ />
+
+
+ handleSaveField('kitty.meow.is_cat', !isCat)}
+ />
+ }
+ />
+
+
+ handleSaveField('kitty.meow.has_cats', !hasCats)}
+ />
+ }
+ />
+
+
+ );
+}
+
export function Profile() {
const mx = useMatrixClient();
const userId = mx.getUserId()!;
@@ -662,6 +734,7 @@ export function Profile() {
+
);
}
diff --git a/src/app/hooks/useUserProfile.ts b/src/app/hooks/useUserProfile.ts
index f5af57c63..e5f1a013a 100644
--- a/src/app/hooks/useUserProfile.ts
+++ b/src/app/hooks/useUserProfile.ts
@@ -20,6 +20,8 @@ export type UserProfile = {
status?: string;
bannerUrl?: string;
nameColor?: string;
+ isCat?: boolean;
+ hasCats?: boolean;
extended?: Record;
_fetched?: boolean;
};
@@ -36,6 +38,8 @@ const normalizeInfo = (info: any): UserProfile => {
'chat.commet.profile_banner',
'chat.commet.profile_status',
'moe.sable.app.name_color',
+ 'kitty.meow.has_cats',
+ 'kitty.meow.is_cat',
];
const extended: Record = {};
@@ -54,6 +58,8 @@ const normalizeInfo = (info: any): UserProfile => {
status: info['chat.commet.profile_status'],
bannerUrl: info['chat.commet.profile_banner'],
nameColor: info['moe.sable.app.name_color'],
+ isCat: info['kitty.meow.is_cat'] === true,
+ hasCats: info['kitty.meow.has_cats'] === true,
extended,
_fetched: true,
};
diff --git a/src/app/state/settings.ts b/src/app/state/settings.ts
index 68aa8ff0d..d7067171e 100644
--- a/src/app/state/settings.ts
+++ b/src/app/state/settings.ts
@@ -79,6 +79,10 @@ export interface Settings {
badgeCountDMsOnly: boolean;
showPingCounts: boolean;
hideReads: boolean;
+ emojiSuggestThreshold: number;
+
+ // furry stuff
+ renderAnimals: boolean;
}
const defaultSettings: Settings = {
@@ -144,6 +148,10 @@ const defaultSettings: Settings = {
badgeCountDMsOnly: false,
showPingCounts: true,
hideReads: false,
+ emojiSuggestThreshold: 2,
+
+ // furry stuff
+ renderAnimals: true,
};
export const getSettings = () => {