Skip to content

Commit

Permalink
Added option hide shared chat
Browse files Browse the repository at this point in the history
  • Loading branch information
FrantaBOT committed Oct 16, 2024
1 parent 64fe972 commit 8de6a85
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
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.3.1000

- Added option hide shared chat

### 3.1.2.4000

- Fixed a bug that could cause issues when clicking an emoji in chat
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>

0 comments on commit 8de6a85

Please sign in to comment.