From 719784a553bc1b009f5d71343650500149eaaa9f Mon Sep 17 00:00:00 2001 From: "v.lagerev" Date: Mon, 13 Apr 2026 02:22:44 +0300 Subject: [PATCH] rebranding from cinny to vojo: change basic icons and naming --- index.html | 20 +++---- package-lock.json | 4 +- package.json | 2 +- public/favicon.ico | Bin 33310 -> 0 bytes public/manifest.json | 12 +++-- public/res/svg/cinny-highlight.svg | 13 ----- public/res/svg/cinny-unread.svg | 13 ----- public/res/svg/cinny.svg | 19 ------- public/res/svg/vojo-highlight.svg | 6 +++ public/res/svg/vojo-unread.svg | 6 +++ public/res/svg/vojo.svg | 1 + .../components/splash-screen/SplashScreen.tsx | 2 +- src/app/features/lobby/Lobby.tsx | 6 +-- src/app/features/settings/about/About.tsx | 36 ++----------- .../features/settings/devices/LocalBackup.tsx | 2 +- .../notifications/SystemNotification.tsx | 2 +- src/app/hooks/usePowerLevelTags.ts | 8 ++- src/app/hooks/useSidebarItems.ts | 43 ++++++++------- .../auth/register/PasswordRegisterForm.tsx | 4 +- src/app/pages/client/ClientNonUIFeatures.tsx | 6 +-- src/app/pages/client/WelcomePage.tsx | 51 +++--------------- src/app/pages/client/sidebar/SpaceTabs.tsx | 10 ++-- src/app/state/sessions.ts | 50 ++++++++++++----- src/types/matrix/accountData.ts | 2 +- src/types/matrix/room.ts | 2 +- 25 files changed, 128 insertions(+), 192 deletions(-) delete mode 100644 public/favicon.ico delete mode 100644 public/res/svg/cinny-highlight.svg delete mode 100644 public/res/svg/cinny-unread.svg delete mode 100644 public/res/svg/cinny.svg create mode 100644 public/res/svg/vojo-highlight.svg create mode 100644 public/res/svg/vojo-unread.svg create mode 100644 public/res/svg/vojo.svg diff --git a/index.html b/index.html index 2eefeee2..763aaa82 100644 --- a/index.html +++ b/index.html @@ -4,33 +4,33 @@ - Cinny - - + Vojo + + - - - + + + - + - - + + diff --git a/package-lock.json b/package-lock.json index b7281a0d..65e05e68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "cinny", + "name": "vojo", "version": "4.11.1", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "cinny", + "name": "vojo", "version": "4.11.1", "license": "AGPL-3.0-only", "dependencies": { diff --git a/package.json b/package.json index 8e7b37b4..cf6d861e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "cinny", + "name": "vojo", "version": "4.11.1", "description": "Yet another matrix client", "main": "index.js", diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index 916713065b069f0e59a63d520178ea8101818913..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33310 zcmds=39uDKmWD41Zh#;vi?Te&jSgf)fe5#7iEs_K7-bc0ca0fVQQL(<(1~z#P}xOo zffki;3)exq8(Txi1sUl<9R+3_z%4`&ci_Dz@8N_@)vbGhJ`v|--mH`7 zoII6#o~&0Wv?{bIbnIAASXb!Xx=2=oYpw6#Dh^e;-mP z{JBS=aPrCiZ-rYY~UjHYwh?%PzZ^Hf`E0QrzRAupr%Lj~h3Ry!A~@O{Srt zf&Au^Pd+J%ug!1u*a{C{53=_kFkrwokvDGJwyg*%ZqXce*kLwbm`@{R!5*^J%sF%B zAg<`kEeiN;(B+IX&an9j;Xz1Q3^v_opMBQNm@xx#FB6#s{Py75Yp?b4OP1vm=)rrD z&FgpFbyqWV=+NSqUw-LjR2hur@xlu)*nH?~sB*r)F{)hUq5s3!3P&* zdoRCVuV#^7_VjFW=9y;}*RNk6$euQBnpwPfvAOQL>&&gU-da5R=%dlWqupbVJ-j-} zyHHvKc2HP6<&;y34?XmddFrXB%-wh2ZQ8bN>!tHdNZfmW3cdQQ=d-C3`n}cXVd)9I zI5PZqZtD+vTWCj}^z94pCSegfDcuW2h|UeA^;hjIXg{*cY-ETo5_yKMdfu%4gm@Gr zbAamAEZ&P`H-NsKBik?igu0r7x)ZPeQBWwT&q)bAML$Zimgt?Vkqx(i#Fh3(JsT

2R zFG!XG*S1%@Xa^hm`Z|>MPoNSsA{qg7=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)ToSt5aUQ_FsdeujP| zPoQs|EUf0c!0+QOVYxn1B$6fgY9mVx_Sg->D1Bu3{^yPENigJetWq5tncwjPWxS{N{p7~TccrJbBIq8k0+w|@O==zRZisjGJsZ z%Z04fsx>d(iFs@;c|7bIccC ze37de@SU&mT#)i}S0j_%StIAUCyFt-1Cdpq4EZSgx(xXO9r>O?p1|C@B@9W#QZ!PmI_m#yRNDsl z8a12$x|ZA0akqN&=FL^H0ry!rC({41sg@lks~p2@S+a(U7A>ku`7KlChx`wX;lqb} zcaKW%58!*i{Q~~y0&5BXf4I2VjP(!xb}qEBG?!m~xm7iF$Q@R`Hb)^Wo)NGK}3>fIClCU;dv$8sP34-vr`LbcTC__|;jMtw^9p zmbm?;0{iNBaQ>yZwN<8& zyPGe+{Ib(tGHo5&jNfKYs~>)G#h3?(q%oCrktXDB_*D%wgTHN>lIDLr zM{5JszW)-o31jJwG)Gz?eel_?B`{CqzER*Wt9Y&J#LtpBS-6{UdjV@E){VKXoyDu1 z9g&5vF8(_^3b22`9!kagNa7J!etb0lS=dRqqXK(r>?g9Px=I*V7T5HZ;(>o6KAP~} j*?{u}e9Z0;a@O`|A?J>z-vJ - - - - - - - - - - - - diff --git a/public/res/svg/cinny-unread.svg b/public/res/svg/cinny-unread.svg deleted file mode 100644 index be301375..00000000 --- a/public/res/svg/cinny-unread.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/public/res/svg/cinny.svg b/public/res/svg/cinny.svg deleted file mode 100644 index 8701d67b..00000000 --- a/public/res/svg/cinny.svg +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/public/res/svg/vojo-highlight.svg b/public/res/svg/vojo-highlight.svg new file mode 100644 index 00000000..7b34cf0b --- /dev/null +++ b/public/res/svg/vojo-highlight.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/res/svg/vojo-unread.svg b/public/res/svg/vojo-unread.svg new file mode 100644 index 00000000..ad040fad --- /dev/null +++ b/public/res/svg/vojo-unread.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/res/svg/vojo.svg b/public/res/svg/vojo.svg new file mode 100644 index 00000000..183c812d --- /dev/null +++ b/public/res/svg/vojo.svg @@ -0,0 +1 @@ +Speak-no-evil-monkey SVG Icon \ No newline at end of file diff --git a/src/app/components/splash-screen/SplashScreen.tsx b/src/app/components/splash-screen/SplashScreen.tsx index 27adadba..1301fe69 100644 --- a/src/app/components/splash-screen/SplashScreen.tsx +++ b/src/app/components/splash-screen/SplashScreen.tsx @@ -21,7 +21,7 @@ export function SplashScreen({ children }: SplashScreenProps) { justifyContent="Center" > - Cinny + Vojo diff --git a/src/app/features/lobby/Lobby.tsx b/src/app/features/lobby/Lobby.tsx index 4b19e516..cd212d72 100644 --- a/src/app/features/lobby/Lobby.tsx +++ b/src/app/features/lobby/Lobby.tsx @@ -43,7 +43,7 @@ import { ASCIILexicalTable, orderKeys } from '../../utils/ASCIILexicalTable'; import { getStateEvent } from '../../utils/room'; import { useClosedLobbyCategoriesAtom } from '../../state/hooks/closedLobbyCategories'; import { - makeCinnySpacesContent, + makeVojoSpacesContent, sidebarItemWithout, useSidebarItems, } from '../../hooks/useSidebarItems'; @@ -421,8 +421,8 @@ export function Lobby() { if (!sidebarSpaces.has(rId)) { newItems.push(rId); } - const newSpacesContent = makeCinnySpacesContent(mx, newItems); - mx.setAccountData(AccountDataEvent.CinnySpaces as any, newSpacesContent as any); + const newSpacesContent = makeVojoSpacesContent(mx, newItems); + mx.setAccountData(AccountDataEvent.VojoSpaces as any, newSpacesContent as any); }, [mx, sidebarItems, sidebarSpaces] ); diff --git a/src/app/features/settings/about/About.tsx b/src/app/features/settings/about/About.tsx index f536d12e..19b29398 100644 --- a/src/app/features/settings/about/About.tsx +++ b/src/app/features/settings/about/About.tsx @@ -4,7 +4,7 @@ import { Page, PageContent, PageHeader } from '../../../components/page'; import { SequenceCard } from '../../../components/sequence-card'; import { SequenceCardStyle } from '../styles.css'; import { SettingTile } from '../../../components/setting-tile'; -import CinnySVG from '../../../../../public/res/svg/cinny.svg'; +import VojoSVG from '../../../../../public/res/svg/vojo.svg'; import { clearCacheAndReload } from '../../../../client/initMatrix'; import { useMatrixClient } from '../../../hooks/useMatrixClient'; @@ -38,47 +38,19 @@ export function About({ requestClose }: AboutProps) { Cinny logo - Cinny + Vojo v4.11.1 Yet another matrix client. - - - - diff --git a/src/app/features/settings/devices/LocalBackup.tsx b/src/app/features/settings/devices/LocalBackup.tsx index 00128c8f..fb89f3f2 100644 --- a/src/app/features/settings/devices/LocalBackup.tsx +++ b/src/app/features/settings/devices/LocalBackup.tsx @@ -28,7 +28,7 @@ function ExportKeys() { const blob = new Blob([encKeys], { type: 'text/plain;charset=us-ascii', }); - FileSaver.saveAs(blob, 'cinny-keys.txt'); + FileSaver.saveAs(blob, 'vojo-keys.txt'); }, [mx] ) diff --git a/src/app/features/settings/notifications/SystemNotification.tsx b/src/app/features/settings/notifications/SystemNotification.tsx index e0df06df..93e0dfdb 100644 --- a/src/app/features/settings/notifications/SystemNotification.tsx +++ b/src/app/features/settings/notifications/SystemNotification.tsx @@ -27,7 +27,7 @@ function EmailNotification() { device_display_name: email, lang: 'en', data: { - brand: 'Cinny', + brand: 'Vojo', }, append: true, }); diff --git a/src/app/hooks/usePowerLevelTags.ts b/src/app/hooks/usePowerLevelTags.ts index 0a6cca50..519774e5 100644 --- a/src/app/hooks/usePowerLevelTags.ts +++ b/src/app/hooks/usePowerLevelTags.ts @@ -87,11 +87,15 @@ const generateFallbackTag = (powerLevelTags: PowerLevelTags, power: number): Mem }; }; +const LEGACY_CINNY_POWER_LEVEL_TAGS = 'in.cinny.room.power_level_tags' as StateEvent; + export const usePowerLevelTags = (room: Room, powerLevels: IPowerLevels): PowerLevelTags => { const tagsEvent = useStateEvent(room, StateEvent.PowerLevelTags); + const legacyTagsEvent = useStateEvent(room, LEGACY_CINNY_POWER_LEVEL_TAGS); + const activeTagsEvent = tagsEvent ?? legacyTagsEvent; const powerLevelTags: PowerLevelTags = useMemo(() => { - const content = tagsEvent?.getContent(); + const content = activeTagsEvent?.getContent(); const powerToTags: PowerLevelTags = { ...content }; const powers = getUsedPowers(powerLevels); @@ -102,7 +106,7 @@ export const usePowerLevelTags = (room: Room, powerLevels: IPowerLevels): PowerL }); return powerToTags; - }, [powerLevels, tagsEvent]); + }, [powerLevels, activeTagsEvent]); return powerLevelTags; }; diff --git a/src/app/hooks/useSidebarItems.ts b/src/app/hooks/useSidebarItems.ts index 16aba225..a7a8c211 100644 --- a/src/app/hooks/useSidebarItems.ts +++ b/src/app/hooks/useSidebarItems.ts @@ -14,7 +14,7 @@ export type ISidebarFolder = { export type TSidebarItem = string | ISidebarFolder; export type SidebarItems = Array; -export type InCinnySpacesContent = { +export type InVojoSpacesContent = { shortcut?: string[]; sidebar?: SidebarItems; }; @@ -22,7 +22,7 @@ export type InCinnySpacesContent = { export const parseSidebar = ( mx: MatrixClient, orphanSpaces: string[], - content?: InCinnySpacesContent + content?: InVojoSpacesContent ) => { const sidebar = content?.sidebar ?? content?.shortcut ?? []; const orphans = new Set(orphanSpaces); @@ -63,34 +63,34 @@ export const parseSidebar = ( return items; }; +const LEGACY_CINNY_SPACES = 'in.cinny.spaces'; + +const getSpacesContent = (mx: MatrixClient): InVojoSpacesContent | undefined => + getAccountData(mx, AccountDataEvent.VojoSpaces)?.getContent() ?? + getAccountData(mx, LEGACY_CINNY_SPACES as AccountDataEvent)?.getContent(); + export const useSidebarItems = ( orphanSpaces: string[] ): [SidebarItems, Dispatch>] => { const mx = useMatrixClient(); - const [sidebarItems, setSidebarItems] = useState(() => { - const inCinnySpacesContent = getAccountData( - mx, - AccountDataEvent.CinnySpaces - )?.getContent(); - return parseSidebar(mx, orphanSpaces, inCinnySpacesContent); - }); + const [sidebarItems, setSidebarItems] = useState(() => + parseSidebar(mx, orphanSpaces, getSpacesContent(mx)) + ); useEffect(() => { - const inCinnySpacesContent = getAccountData( - mx, - AccountDataEvent.CinnySpaces - )?.getContent(); - setSidebarItems(parseSidebar(mx, orphanSpaces, inCinnySpacesContent)); + setSidebarItems(parseSidebar(mx, orphanSpaces, getSpacesContent(mx))); }, [mx, orphanSpaces]); useAccountDataCallback( mx, useCallback( (mEvent) => { - if (mEvent.getType() === AccountDataEvent.CinnySpaces) { - const newContent = mEvent.getContent(); - setSidebarItems(parseSidebar(mx, orphanSpaces, newContent)); + if ( + mEvent.getType() === AccountDataEvent.VojoSpaces || + mEvent.getType() === LEGACY_CINNY_SPACES + ) { + setSidebarItems(parseSidebar(mx, orphanSpaces, mEvent.getContent())); } }, [mx, orphanSpaces] @@ -122,14 +122,13 @@ export const sidebarItemWithout = (items: SidebarItems, roomId: string) => { return newItems; }; -export const makeCinnySpacesContent = ( +export const makeVojoSpacesContent = ( mx: MatrixClient, items: SidebarItems -): InCinnySpacesContent => { - const currentInSpaces = - getAccountData(mx, AccountDataEvent.CinnySpaces)?.getContent() ?? {}; +): InVojoSpacesContent => { + const currentInSpaces = getSpacesContent(mx) ?? {}; - const newSpacesContent: InCinnySpacesContent = { + const newSpacesContent: InVojoSpacesContent = { ...currentInSpaces, sidebar: items, }; diff --git a/src/app/pages/auth/register/PasswordRegisterForm.tsx b/src/app/pages/auth/register/PasswordRegisterForm.tsx index 9f173422..0e182181 100644 --- a/src/app/pages/auth/register/PasswordRegisterForm.tsx +++ b/src/app/pages/auth/register/PasswordRegisterForm.tsx @@ -109,7 +109,7 @@ function RegisterUIAFlow({ auth: authDict, password, username, - initial_device_display_name: 'Cinny Web', + initial_device_display_name: 'Vojo Web', }); }, [onRegister, formData] @@ -250,7 +250,7 @@ export function PasswordRegisterForm({ auth: { session: authData.session, }, - initial_device_display_name: 'Cinny Web', + initial_device_display_name: 'Vojo Web', }); }; diff --git a/src/app/pages/client/ClientNonUIFeatures.tsx b/src/app/pages/client/ClientNonUIFeatures.tsx index ce952bfc..aabe8f88 100644 --- a/src/app/pages/client/ClientNonUIFeatures.tsx +++ b/src/app/pages/client/ClientNonUIFeatures.tsx @@ -3,9 +3,9 @@ import React, { ReactNode, useCallback, useEffect, useRef } from 'react'; import { useNavigate } from 'react-router-dom'; import { RoomEvent, RoomEventHandlerMap } from 'matrix-js-sdk'; import { roomToUnreadAtom, unreadEqual, unreadInfoToUnread } from '../../state/room/roomToUnread'; -import LogoSVG from '../../../../public/res/svg/cinny.svg'; -import LogoUnreadSVG from '../../../../public/res/svg/cinny-unread.svg'; -import LogoHighlightSVG from '../../../../public/res/svg/cinny-highlight.svg'; +import LogoSVG from '../../../../public/res/svg/vojo.svg'; +import LogoUnreadSVG from '../../../../public/res/svg/vojo-unread.svg'; +import LogoHighlightSVG from '../../../../public/res/svg/vojo-highlight.svg'; import NotificationSound from '../../../../public/sound/notification.ogg'; import InviteSound from '../../../../public/sound/invite.ogg'; import { notificationPermission, setFavicon } from '../../utils/dom'; diff --git a/src/app/pages/client/WelcomePage.tsx b/src/app/pages/client/WelcomePage.tsx index b3ec2eb4..885bc4d2 100644 --- a/src/app/pages/client/WelcomePage.tsx +++ b/src/app/pages/client/WelcomePage.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import { Box, Button, Icon, Icons, Text, config, toRem } from 'folds'; +import { Box, config } from 'folds'; import { Page, PageHero, PageHeroSection } from '../../components/page'; -import CinnySVG from '../../../../public/res/svg/cinny.svg'; +import VojoSVG from '../../../../public/res/svg/vojo.svg'; export function WelcomePage() { return ( @@ -14,49 +14,10 @@ export function WelcomePage() { > } - title="Welcome to Cinny" - subTitle={ - - Yet another matrix client.{' '} - - v4.11.1 - - - } - > - - - - - - - + icon={Vojo Logo} + title="Welcome to Vojo" + subTitle={v4.11.1} + /> diff --git a/src/app/pages/client/sidebar/SpaceTabs.tsx b/src/app/pages/client/sidebar/SpaceTabs.tsx index 6fc528a1..1e214b67 100644 --- a/src/app/pages/client/sidebar/SpaceTabs.tsx +++ b/src/app/pages/client/sidebar/SpaceTabs.tsx @@ -68,7 +68,7 @@ import { ISidebarFolder, SidebarItems, TSidebarItem, - makeCinnySpacesContent, + makeVojoSpacesContent, parseSidebar, sidebarItemWithout, useSidebarItems, @@ -744,9 +744,9 @@ export function SpaceTabs({ scrollRef }: SpaceTabsProps) { newItems.push(i); }); - const newSpacesContent = makeCinnySpacesContent(mx, newItems); + const newSpacesContent = makeVojoSpacesContent(mx, newItems); localEchoSidebarItem(parseSidebar(mx, orphanSpaces, newSpacesContent)); - mx.setAccountData(AccountDataEvent.CinnySpaces, newSpacesContent); + mx.setAccountData(AccountDataEvent.VojoSpaces, newSpacesContent); }, [mx, sidebarItems, setOpenedFolder, localEchoSidebarItem, orphanSpaces] ) @@ -790,9 +790,9 @@ export function SpaceTabs({ scrollRef }: SpaceTabsProps) { if (orphanSpaces.includes(roomId)) return; const newItems = sidebarItemWithout(sidebarItems, roomId); - const newSpacesContent = makeCinnySpacesContent(mx, newItems); + const newSpacesContent = makeVojoSpacesContent(mx, newItems); localEchoSidebarItem(parseSidebar(mx, orphanSpaces, newSpacesContent)); - mx.setAccountData(AccountDataEvent.CinnySpaces, newSpacesContent); + mx.setAccountData(AccountDataEvent.VojoSpaces, newSpacesContent); }, [mx, sidebarItems, orphanSpaces, localEchoSidebarItem] ); diff --git a/src/app/state/sessions.ts b/src/app/state/sessions.ts index a9c34ce9..04b1b8ba 100644 --- a/src/app/state/sessions.ts +++ b/src/app/state/sessions.ts @@ -29,28 +29,54 @@ export type SessionStoreName = { // crypto: 'crypto-store', // } as const; +const LEGACY_CINNY_KEYS = { + access_token: 'cinny_access_token', + device_id: 'cinny_device_id', + user_id: 'cinny_user_id', + hs_base_url: 'cinny_hs_base_url', +} as const; + +function migrateLegacyCinnySession() { + if (localStorage.getItem('vojo_access_token') !== null) return; + + const accessToken = localStorage.getItem(LEGACY_CINNY_KEYS.access_token); + const deviceId = localStorage.getItem(LEGACY_CINNY_KEYS.device_id); + const userId = localStorage.getItem(LEGACY_CINNY_KEYS.user_id); + const baseUrl = localStorage.getItem(LEGACY_CINNY_KEYS.hs_base_url); + + if (accessToken && deviceId && userId && baseUrl) { + localStorage.setItem('vojo_access_token', accessToken); + localStorage.setItem('vojo_device_id', deviceId); + localStorage.setItem('vojo_user_id', userId); + localStorage.setItem('vojo_hs_base_url', baseUrl); + } + + Object.values(LEGACY_CINNY_KEYS).forEach((key) => localStorage.removeItem(key)); +} + export function setFallbackSession( accessToken: string, deviceId: string, userId: string, baseUrl: string ) { - localStorage.setItem('cinny_access_token', accessToken); - localStorage.setItem('cinny_device_id', deviceId); - localStorage.setItem('cinny_user_id', userId); - localStorage.setItem('cinny_hs_base_url', baseUrl); + localStorage.setItem('vojo_access_token', accessToken); + localStorage.setItem('vojo_device_id', deviceId); + localStorage.setItem('vojo_user_id', userId); + localStorage.setItem('vojo_hs_base_url', baseUrl); } export const removeFallbackSession = () => { - localStorage.removeItem('cinny_hs_base_url'); - localStorage.removeItem('cinny_user_id'); - localStorage.removeItem('cinny_device_id'); - localStorage.removeItem('cinny_access_token'); + localStorage.removeItem('vojo_hs_base_url'); + localStorage.removeItem('vojo_user_id'); + localStorage.removeItem('vojo_device_id'); + localStorage.removeItem('vojo_access_token'); }; export const getFallbackSession = (): Session | undefined => { - const baseUrl = localStorage.getItem('cinny_hs_base_url'); - const userId = localStorage.getItem('cinny_user_id'); - const deviceId = localStorage.getItem('cinny_device_id'); - const accessToken = localStorage.getItem('cinny_access_token'); + migrateLegacyCinnySession(); + const baseUrl = localStorage.getItem('vojo_hs_base_url'); + const userId = localStorage.getItem('vojo_user_id'); + const deviceId = localStorage.getItem('vojo_device_id'); + const accessToken = localStorage.getItem('vojo_access_token'); if (baseUrl && userId && deviceId && accessToken) { const session: Session = { diff --git a/src/types/matrix/accountData.ts b/src/types/matrix/accountData.ts index 98715996..53d88cec 100644 --- a/src/types/matrix/accountData.ts +++ b/src/types/matrix/accountData.ts @@ -3,7 +3,7 @@ export enum AccountDataEvent { Direct = 'm.direct', IgnoredUserList = 'm.ignored_user_list', - CinnySpaces = 'in.cinny.spaces', + VojoSpaces = 'in.vojo.spaces', ElementRecentEmoji = 'io.element.recent_emoji', diff --git a/src/types/matrix/room.ts b/src/types/matrix/room.ts index c73c0f0b..50edff3f 100644 --- a/src/types/matrix/room.ts +++ b/src/types/matrix/room.ts @@ -39,7 +39,7 @@ export enum StateEvent { SpaceParent = 'm.space.parent', PoniesRoomEmotes = 'im.ponies.room_emotes', - PowerLevelTags = 'in.cinny.room.power_level_tags', + PowerLevelTags = 'in.vojo.room.power_level_tags', } export enum MessageEvent {