From 19403012dacaeddba7747139c8bace3663e6f914 Mon Sep 17 00:00:00 2001 From: pimothyxd Date: Mon, 8 Jan 2024 05:59:50 +0100 Subject: [PATCH 1/3] refactor: use updated twitch pubsub client --- src/composable/usePubSub.ts | 67 ++++++++++++++----------------------- 1 file changed, 25 insertions(+), 42 deletions(-) diff --git a/src/composable/usePubSub.ts b/src/composable/usePubSub.ts index 43b1aebf9..ddf364fb2 100644 --- a/src/composable/usePubSub.ts +++ b/src/composable/usePubSub.ts @@ -1,36 +1,25 @@ import { reactive, ref } from "vue"; import { definePropertyHook } from "@/common/Reflection"; -declare const __Twitch__pubsubInstances: { - production: { - _client: PubSubClient; - _clientReady: boolean; - _clienType: string; - _env: string; - _hasDisconnected: boolean; - _iframeHost: string; - _numDisconnects: number; - _queuedRequests: unknown[]; - }; -}; +declare const __twitch_pubsub_client: PubSubClient; const client = ref(null); const socket = ref(null); definePropertyHook( - window as Window & { __Twitch__pubsubInstances?: typeof __Twitch__pubsubInstances }, - "__Twitch__pubsubInstances", + window as Window & { __twitch_pubsub_client?: typeof __twitch_pubsub_client }, + "__twitch_pubsub_client", { value(v) { - if (!v || !v.production || !v.production._client) return; + if (!v || !v.connection || !v.connection.socket) return; - client.value = v.production._client; + client.value = v; - definePropertyHook(client.value, "_primarySocket", { + definePropertyHook(client.value.connection, "socket", { value(v) { - if (!v || !v._socket) return; + if (!v || !v.socket) return; - socket.value = v._socket; + socket.value = v.socket; }, }); }, @@ -45,31 +34,25 @@ export function usePubSub() { } export interface PubSubClient { - _addr: string; - _connectCalled: boolean; - _connected: boolean; - _env: string; - _firstConnectTime: number; - _firstListenTime: number; - _listens: { - _events: Record void, PubSubClient]>; - }; - _opts: { + env: string; + reconnecting: boolean; + connection: { env: string; - }; - _primarySocket: { - _addr: string; - _connecting: boolean; - _connectionAttempts: number; - _id: string; - _opts: { - addr: string; + _events: Record void, PubSubClient]>; + iframeHost: string | null; + currentTopics: Record; + socket: { + env: string; + address: string; + closing: boolean; + connecting: boolean; + connectionAttempts: number; + pingInterval: number; + pongTimeout: number; + receivedPong: boolean; + sentPing: boolean; + socket: WebSocket; }; - _pingInterval: number; - _pongTimeout: number; - _receivedPong: number; - _sentPing: boolean; - _socket: WebSocket; }; } From ee9bb0ccf14e16b2885397ac11bed2f3a4aa98b3 Mon Sep 17 00:00:00 2001 From: pimothyxd Date: Mon, 8 Jan 2024 06:00:05 +0100 Subject: [PATCH 2/3] chore: update changelog --- CHANGELOG-nightly.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG-nightly.md b/CHANGELOG-nightly.md index ca25655e5..d27503a31 100644 --- a/CHANGELOG-nightly.md +++ b/CHANGELOG-nightly.md @@ -3,6 +3,7 @@ **The changes listed here are not assigned to an official release**. - Reinstated animated avatars +- Fixed an issue where suspicious users were not highlighted and clips not being displayed in chat ### 3.0.16.1000 From 75fb38fff9a7069df4d89f5e81b5a88487045b0d Mon Sep 17 00:00:00 2001 From: pimothyxd <29018740+pimothyxd@users.noreply.github.com> Date: Sat, 17 Feb 2024 03:34:25 +0100 Subject: [PATCH 3/3] refactor: update chat message types --- src/app/chat/msg/55.PaidMessage.vue | 124 ------------------- src/site/twitch.tv/index.ts | 9 +- src/site/twitch.tv/modules/chat/ChatList.vue | 1 - 3 files changed, 3 insertions(+), 131 deletions(-) delete mode 100644 src/app/chat/msg/55.PaidMessage.vue diff --git a/src/app/chat/msg/55.PaidMessage.vue b/src/app/chat/msg/55.PaidMessage.vue deleted file mode 100644 index f05e896ab..000000000 --- a/src/app/chat/msg/55.PaidMessage.vue +++ /dev/null @@ -1,124 +0,0 @@ - - - - - diff --git a/src/site/twitch.tv/index.ts b/src/site/twitch.tv/index.ts index 958378498..1d7bc78cd 100644 --- a/src/site/twitch.tv/index.ts +++ b/src/site/twitch.tv/index.ts @@ -76,12 +76,9 @@ export enum MessageType { COMMUNITY_INTRODUCTION = 47, SHOUTOUT = 48, ANNOUNCEMENT_MESSAGE = 49, - MIDNIGHT_SQUID = 50, - CHARITY_DONATION = 51, - MESSAGE_ID_UPDATE = 52, - PINNED_CHAT = 53, - VIEWER_MILESTONE = 54, - PAID_MESSAGE = 55, + CHARITY_DONATION = 50, + MESSAGE_ID_UPDATE = 51, + VIEWER_MILESTONE = 52, // 7TV Message Types SEVENTV_EMOTE_SET_UPDATE = 7000, diff --git a/src/site/twitch.tv/modules/chat/ChatList.vue b/src/site/twitch.tv/modules/chat/ChatList.vue index f5cb042a2..ca6cb0998 100644 --- a/src/site/twitch.tv/modules/chat/ChatList.vue +++ b/src/site/twitch.tv/modules/chat/ChatList.vue @@ -115,7 +115,6 @@ const onMessage = (msgData: Twitch.AnyMessage): boolean => { case MessageType.CHANNEL_POINTS_REWARD: case MessageType.ANNOUNCEMENT_MESSAGE: case MessageType.RESTRICTED_LOW_TRUST_USER_MESSAGE: - case MessageType.PAID_MESSAGE: case MessageType.CONNECTED: onChatMessage(msg, msgData); break;