forked from KickTalkOrg/KickTalk
-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
🐛 Bug Description
The UserBannedEvent handler has inconsistent call signatures that prevent banned user messages from being properly faded out, and there's no visual announcement when a user gets banned (unlike subscriptions/donations).
🔍 Current Behavior
- Expected: Banned user messages should be faded out (25% opacity) and a ban announcement should appear
- Actual: Messages are sometimes not faded out due to inconsistent function calls, and no ban announcement is shown
- Web UI comparison: Kick's web UI removes banned user messages completely
🐛 Root Cause
In src/renderer/src/providers/ChatProvider.jsx, there are two different call signatures for handleUserBanned:
✅ Correct call (line ~364):
case "App\\Events\\UserBannedEvent":
get().handleUserBanned(chatroom.id, parsedEvent); // ✅ Passes whole event❌ Incorrect call (line ~405):
} else if (eventDetail.event === "App\\Events\\UserBannedEvent") {
get().handleUserBanned(chatroomId, parsedEvent.user, parsedEvent.banned_by, parsedEvent.permanent); // ❌ Passes individual paramsFunction definition expects:
handleUserBanned: (chatroomId, event) => {
// Looks for event.user.id, but gets undefined when individual params are passed
}📋 Example Event Data
{
"event": "App\\Events\\UserBannedEvent",
"data": {
"id": "53e29339-a1fa-4cf8-af58-ea58ae6d66e3",
"user": {"id": 78521755, "username": "94151073ZY", "slug": "94151073zy"},
"banned_by": {"id": 0, "username": "Zuck", "slug": "zuck"},
"permanent": true
},
"channel": "chatrooms.386790.v2"
}🔧 Proposed Fix
1. Fix the inconsistent function call:
} else if (eventDetail.event === "App\\Events\\UserBannedEvent") {
- get().handleUserBanned(chatroomId, parsedEvent.user, parsedEvent.banned_by, parsedEvent.permanent);
+ get().handleUserBanned(chatroomId, parsedEvent);2. Add ban announcement message:
Similar to how subscriptions/donations show announcements, add a system message when users are banned:
// After fading messages, add announcement
get().addMessage(chatroomId, {
id: crypto.randomUUID(),
type: "mod_action",
modAction: parsedEvent?.permanent ? "user_banned_permanent" : "user_banned_temporary",
modActionDetails: parsedEvent,
timestamp: new Date().toISOString(),
content: `${parsedEvent.user.username} was ${parsedEvent.permanent ? 'permanently banned' : 'temporarily banned'} by ${parsedEvent.banned_by.username}`
});🎯 Expected Result
- All banned user messages consistently fade out (25% opacity)
- Ban announcement appears in chat showing:
"Username was permanently banned by ModeratorName""Username was temporarily banned by ModeratorName"
- Consistent behavior across all event handling paths
📍 Files to Change
src/renderer/src/providers/ChatProvider.jsx- Fix function call and add announcement- Possibly
src/renderer/src/components/Messages/SupportEventMessage.jsx- If we want special styling for ban announcements
🔍 Discovery Method
Found via WebSocket event collection tool while monitoring live ban events and comparing behavior with Kick's web UI.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request