Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Added option hide shared chat #1097

Merged
merged 2 commits into from
Oct 26, 2024
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG-nightly.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### 3.1.3.1000

- Added option hide shared chat
- Fixed extension login
- Fixed an issue when users had multiple personal emote sets

Expand Down
7 changes: 6 additions & 1 deletion src/site/twitch.tv/modules/chat/ChatList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const pageVisibility = useDocumentVisibility();
const isHovering = toRef(properties, "hovering");
const pausedByVisibility = ref(false);

const hideSharedChat = useConfig<boolean>("chat.hide_shared_chat");
const isModSliderEnabled = useConfig<boolean>("chat.mod_slider");
const showModerationMessages = useConfig<boolean>("chat.mod_messages");
const showMentionHighlights = useConfig("highlights.basic.mention");
Expand Down Expand Up @@ -169,7 +170,11 @@ function onChatMessage(msg: ChatMessage, msgData: Twitch.AnyMessage, shouldRende
sourceRoomID = msg.channelID;
}

if (sourceRoomID) {
if (hideSharedChat.value && msg.channelID != sourceRoomID) {
return;
}

if (sourceRoomID && !hideSharedChat.value) {
msgData.sourceData = sharedChatData.value?.get(sourceRoomID);
msg.setSourceData(msgData.sourceData);
}
Expand Down
6 changes: 6 additions & 0 deletions src/site/twitch.tv/modules/chat/ChatModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -454,5 +454,11 @@ export const config = [
path: ["Chat", "Style"],
defaultValue: false,
}),
declareConfig("chat.hide_shared_chat", "TOGGLE", {
label: "Hide Shared Chat",
hint: "Hides messages from other chats",
path: ["Chat", "Style"],
defaultValue: false,
}),
];
</script>
Loading