Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG-nightly.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 3.1.8.2000

- Added loading emote sets from Twitch's shared chat channels

### 3.1.8.1000

- Tomfoolery
Expand Down
9 changes: 5 additions & 4 deletions src/app/chat/ChatData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { v4 as uuidv4 } from "uuid";
const { target } = useWorker();
const ctx = useChannelContext();
const channelID = toRef(ctx, "id");
const peerChannelIDs = toRef(ctx, "peerChannelIds");
const messages = useChatMessages(ctx);
const emotes = useChatEmotes(ctx);
const { providers } = useStore();
Expand All @@ -24,12 +25,12 @@ const channelSets = useLiveQuery(
() =>
db.channels
.where("id")
.equals(ctx.id)
.first()
.then((c) => c?.set_ids ?? []),
.anyOf([ctx.id, ...ctx.peerChannelIds])
.toArray()
.then((res) => res.flatMap((c) => c?.set_ids ?? [])),
undefined,
{
reactives: [channelID],
reactives: [channelID, peerChannelIDs],
},
);

Expand Down
5 changes: 5 additions & 0 deletions src/composable/channel/useChannelContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export class ChannelContext implements CurrentChannel {
id = "";
username = "";
displayName = "";
peerChannelIds: string[] = [];
user?: SevenTV.User;
loaded = false;
setsFetched = false;
Expand Down Expand Up @@ -56,6 +57,10 @@ export class ChannelContext implements CurrentChannel {
return true;
}

setPeerChannelIds(ids: string[]) {
this.peerChannelIds = ids;
}

leave(): void {
this.active = false;

Expand Down
3 changes: 3 additions & 0 deletions src/site/twitch.tv/modules/chat/ChatController.vue
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ watch(
sharedChannels.set(channelID, useChannelContext(channelID, true));
}
}

// Update host channel context
ctx.setPeerChannelIds([...sharedChannels.keys()]);
},
});
},
Expand Down