mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Added "Group Consecutive Messages" setting
This commit is contained in:
@@ -33,6 +33,7 @@ const opacity = urlParams.get("opacity") || "0.5";
|
|||||||
const hideAfter = GetIntParam("hideAfter", 0);
|
const hideAfter = GetIntParam("hideAfter", 0);
|
||||||
const excludeCommands = GetBooleanParam("excludeCommands", true);
|
const excludeCommands = GetBooleanParam("excludeCommands", true);
|
||||||
const ignoreChatters = urlParams.get("ignoreChatters") || "";
|
const ignoreChatters = urlParams.get("ignoreChatters") || "";
|
||||||
|
const groupConsecutiveMessages = GetBooleanParam("groupConsecutiveMessages", true);
|
||||||
|
|
||||||
const showTwitchMessages = GetBooleanParam("showTwitchMessages", true);
|
const showTwitchMessages = GetBooleanParam("showTwitchMessages", true);
|
||||||
const showTwitchAnnouncements = GetBooleanParam("showTwitchAnnouncements", true);
|
const showTwitchAnnouncements = GetBooleanParam("showTwitchAnnouncements", true);
|
||||||
@@ -393,7 +394,7 @@ async function TwitchChatMessage(data) {
|
|||||||
|
|
||||||
// Hide the header if the same username sends a message twice in a row
|
// Hide the header if the same username sends a message twice in a row
|
||||||
const messageList = document.getElementById("messageList");
|
const messageList = document.getElementById("messageList");
|
||||||
if (messageList.children.length > 0) {
|
if (groupConsecutiveMessages && messageList.children.length > 0) {
|
||||||
const lastPlatform = messageList.lastChild.dataset.platform;
|
const lastPlatform = messageList.lastChild.dataset.platform;
|
||||||
const lastUserId = messageList.lastChild.dataset.userId;
|
const lastUserId = messageList.lastChild.dataset.userId;
|
||||||
if (lastPlatform == "twitch" && lastUserId == data.user.id)
|
if (lastPlatform == "twitch" && lastUserId == data.user.id)
|
||||||
@@ -709,7 +710,7 @@ function YouTubeMessage(data) {
|
|||||||
|
|
||||||
// Hide the header if the same username sends a message twice in a row
|
// Hide the header if the same username sends a message twice in a row
|
||||||
const messageList = document.getElementById("messageList");
|
const messageList = document.getElementById("messageList");
|
||||||
if (messageList.children.length > 0) {
|
if (groupConsecutiveMessages && messageList.children.length > 0) {
|
||||||
const lastPlatform = messageList.lastChild.dataset.platform;
|
const lastPlatform = messageList.lastChild.dataset.platform;
|
||||||
const lastUserId = messageList.lastChild.dataset.userId;
|
const lastUserId = messageList.lastChild.dataset.userId;
|
||||||
if (lastPlatform == "youtube" && lastUserId == data.user.id)
|
if (lastPlatform == "youtube" && lastUserId == data.user.id)
|
||||||
|
|||||||
@@ -119,6 +119,14 @@
|
|||||||
"defaultValue": "StreamElements,Streamlabs",
|
"defaultValue": "StreamElements,Streamlabs",
|
||||||
"group": "General"
|
"group": "General"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "groupConsecutiveMessages",
|
||||||
|
"label": "Group Consecutive Messages",
|
||||||
|
"description": "Hide username on consecutive messages from the same user",
|
||||||
|
"type": "checkbox",
|
||||||
|
"defaultValue": true,
|
||||||
|
"group": "General"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "showTwitchMessages",
|
"id": "showTwitchMessages",
|
||||||
"label": "Chat Messages",
|
"label": "Chat Messages",
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ const hideAfter = GetIntParam("hideAfter", 0);
|
|||||||
const excludeCommands = GetBooleanParam("excludeCommands", true);
|
const excludeCommands = GetBooleanParam("excludeCommands", true);
|
||||||
const ignoreChatters = urlParams.get("ignoreChatters") || "";
|
const ignoreChatters = urlParams.get("ignoreChatters") || "";
|
||||||
const scrollDirection = GetIntParam("scrollDirection", 1);
|
const scrollDirection = GetIntParam("scrollDirection", 1);
|
||||||
|
const groupConsecutiveMessages = GetBooleanParam("groupConsecutiveMessages", false);
|
||||||
const inlineChat = GetBooleanParam("inlineChat", false);
|
const inlineChat = GetBooleanParam("inlineChat", false);
|
||||||
const imageEmbedPermissionLevel = GetIntParam("imageEmbedPermissionLevel", 20);
|
const imageEmbedPermissionLevel = GetIntParam("imageEmbedPermissionLevel", 20);
|
||||||
|
|
||||||
@@ -444,7 +445,7 @@ async function TwitchChatMessage(data) {
|
|||||||
// Hide the header if the same username sends a message twice in a row
|
// Hide the header if the same username sends a message twice in a row
|
||||||
// EXCEPT when the scroll direction is set to reverse (scrollDirection == 2)
|
// EXCEPT when the scroll direction is set to reverse (scrollDirection == 2)
|
||||||
const messageList = document.getElementById("messageList");
|
const messageList = document.getElementById("messageList");
|
||||||
if (messageList.children.length > 0 && scrollDirection != 2) {
|
if (groupConsecutiveMessages && messageList.children.length > 0 && scrollDirection != 2) {
|
||||||
const lastPlatform = messageList.lastChild.dataset.platform;
|
const lastPlatform = messageList.lastChild.dataset.platform;
|
||||||
const lastUserId = messageList.lastChild.dataset.userId;
|
const lastUserId = messageList.lastChild.dataset.userId;
|
||||||
if (lastPlatform == "twitch" && lastUserId == data.user.id)
|
if (lastPlatform == "twitch" && lastUserId == data.user.id)
|
||||||
@@ -1013,7 +1014,7 @@ function YouTubeMessage(data) {
|
|||||||
// Hide the header if the same username sends a message twice in a row
|
// Hide the header if the same username sends a message twice in a row
|
||||||
// EXCEPT when the scroll direction is set to reverse (scrollDirection == 2)
|
// EXCEPT when the scroll direction is set to reverse (scrollDirection == 2)
|
||||||
const messageList = document.getElementById("messageList");
|
const messageList = document.getElementById("messageList");
|
||||||
if (messageList.children.length > 0 && scrollDirection != 2) {
|
if (groupConsecutiveMessages && messageList.children.length > 0 && scrollDirection != 2) {
|
||||||
const lastPlatform = messageList.lastChild.dataset.platform;
|
const lastPlatform = messageList.lastChild.dataset.platform;
|
||||||
const lastUserId = messageList.lastChild.dataset.userId;
|
const lastUserId = messageList.lastChild.dataset.userId;
|
||||||
if (lastPlatform == "youtube" && lastUserId == data.user.id)
|
if (lastPlatform == "youtube" && lastUserId == data.user.id)
|
||||||
|
|||||||
@@ -147,6 +147,14 @@
|
|||||||
"defaultValue": 1,
|
"defaultValue": 1,
|
||||||
"group": "General"
|
"group": "General"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "groupConsecutiveMessages",
|
||||||
|
"label": "Group Consecutive Messages",
|
||||||
|
"description": "Hide username on consecutive messages from the same user<br>Note: This setting is ignored for \"Reversed\" scroll direction",
|
||||||
|
"type": "checkbox",
|
||||||
|
"defaultValue": false,
|
||||||
|
"group": "General"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "inlineChat",
|
"id": "inlineChat",
|
||||||
"label": "In-line Chat",
|
"label": "In-line Chat",
|
||||||
|
|||||||
Reference in New Issue
Block a user