Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 6c07ae5

Browse files
committed
Use 2545's terminology instead of ponies.im's
1 parent 4226b8e commit 6c07ae5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/views/rooms/MSC2545StickerPicker.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ import ScrollPanel from '../../structures/ScrollPanel';
2727
import GenericElementContextMenu from '../context_menus/GenericElementContextMenu';
2828
import Search from '../emojipicker/Search';
2929

30-
const EMOTE_ROOMS_EVENT_TYPE = "im.ponies.emote_rooms";
31-
const ROOM_EMOTES_EVENT_TYPE = "im.ponies.room_emotes";
30+
// TODO: support more image sources:
31+
// https://github.com/Sorunome/matrix-doc/blob/soru/emotes/proposals/2545-emotes.md#image-sources
32+
const USER_PACK_ROOMS_EVENT_TYPE = "im.ponies.emote_rooms";
33+
const PACK_ROOM_EVENT_TYPE = "im.ponies.room_emotes";
3234

3335
// Css Class; it's a short name for easy usage.
3436
const cc = (thing: string) => "mx_2545Stickers_" + thing;
@@ -88,15 +90,15 @@ export const MSC2545StickerPicker: React.FC<{
8890
const [searchFilter, setSearchFilter] = useState("");
8991
if (!isStickerPickerOpen) return null;
9092

91-
const evt = cli.getAccountData(EMOTE_ROOMS_EVENT_TYPE);
93+
const evt = cli.getAccountData(USER_PACK_ROOMS_EVENT_TYPE);
9294
const evtContent = evt.event.content as { rooms: { [roomId: string]: { [packName: string]: {} } } };
9395

9496
const packs = Object.keys(evtContent.rooms)
9597
.map(roomId => {
9698
const room = cli.getRoom(roomId);
9799
return Object.keys(evtContent.rooms[roomId])
98100
.map(name => {
99-
const pack = room.currentState.getStateEvents(ROOM_EMOTES_EVENT_TYPE, name)
101+
const pack = room.currentState.getStateEvents(PACK_ROOM_EVENT_TYPE, name)
100102
.event.content as I2545Pack;
101103
return { room, pack, packName: name };
102104
});

0 commit comments

Comments
 (0)