Vencord
Vencord copied to clipboard
feat(plugin) allCallTimers: adds timers to all users in guild voice calls
Builds on the idea of the callTimer plugin but adds timers to all users in guild voice calls.
VIEW
Settings
This does not modify any network behavior of Discord it simply grabs updates as they are naturally informed to the client. There is a toggle, Watch Large Guilds
to subscribe to all guilds (large guilds are not subscribed automatically), when this is disabled large guilds are usually updated roughly every 7-15 minutes (through passive updates). Since a user naturally subscribes to a guild when they interact with it, if the toggle Watch Large Guilds
is enabled, on client load, it acts as if all guilds have been interacted with by a user.
Please let me know if you have any questions or suggestions for improvement.
fixes https://github.com/Max-Herbold/AllCallTimersDiscordPlugin/issues/22
I think you could use IPC events instead of the interval to handle users joining/switching channels
How it is at the moment works; given it's never necessary to update this more than once a second. I agree it could definitely be run less often to fit more with the theme of Vencord. Where could I find some example how to do/use this? I have 0 experience with IPC events, especially within discord.
As per looks I think it looks kinda bad as the red color doesn't fit very well and it overlaps other things
I also agree. It's less than ideal to move elements around; there is very limited space. When it is inline, a long username will cause ellipsed usernames. Under the username makes it too confusing about who the timer belongs to. There is not enough space to the left of the user image. Where it is now is conditionally free when there are no rendered icons. The icons can still be seen. As for the red, again I agree but if the element doesn't fit cleanly why not go all out?
For the looks maybe use a clock icon and then put the time in the tooltip if it's okay to be only visible on hover
(mouse is hovering on the user's clock icon)
Also implemented with a toggle switch setting (because I like not having to move my mouse to see the times). The default setting is with the icon + tooltip.
I think the default UI/UX is fine now but you should probably make the other view look good too. Maybe make it smaller or somehow integrate it without overlapping and better text color.
Are you working on the IPC implementation? Or should I do it?
And a quick heads-up the README.md
is still missing
Are you working on the IPC implementation? Or should I do it? And a quick heads-up the
README.md
is still missing
I was planning to have a look tomorrow but I would love to see what you can do!
Done: https://github.com/Max-Herbold/Vencord/pull/1
It occurred to me previously but I only realised it was an issue now. VOICE_STATE_UPDATES does not dispatch updates for users in a guild that has not been opened (literally viewed on the client side). This plays into the issue I was trying to fix with https://github.com/Vendicated/Vencord/pull/2132/commits/5ebc2c8819b3fa489ce5e3bcaaa8083d00d65d33. I guess on the first open of a guild discord client bulk updates all users in the guild and then updates them when something actually happens. Essentially; if a guild hasn't been opened and a user moves/joins this is not tracked by VOICE_STATE_UPDATES. (Potentially also there is an issue after a certain period of time of a guild being unopened events stop being dispatched but this is only an intuitive guess that should be checked)
Is it reasonable to use VOICE_STATE_UPDATES to read users in voice channels using the original method?
Oh yes good catch haven't noticed that. Analyze the format when the client is loaded I don't think the way you do it right now is necessary.
Potentially also there is an issue after a certain period of time of a guild being unopened events stop being dispatched but this is only an intuitive guess that should be checked
I don't think so as this worked for me
I don't think the way you do it right now is necessary.
True. I think that change (https://github.com/Vendicated/Vencord/commit/5ebc2c8819b3fa489ce5e3bcaaa8083d00d65d33) simply made the issue more complicated.
I can't think of how to track an upopened guild's users
Hm but it does seem to work for me
Hm but it does seem to work for me
There is the case where a user joins/moves channel that hasn't been opened and they end up without a time (in the userJoinTimes
) and therefor no visual timer.
ex:
reverted the change to use VoiceStateStore but kept everything else.
https://github.com/Max-Herbold/Vencord/pull/2
VOICE_STATE_UPDATES does not dispatch updates for users in a guild that has not been opened (literally viewed on the client side)
There is the case where a user joins/moves channel that hasn't been opened and they end up without a time (in the
userJoinTimes
) and therefor no visual timer.
I can't reproduce this issue with the state of my PR. Can you give me more detailed instructions on how to reproduce it?
I have two Discord accounts open. With the Vencord one I'm just at the friends tab and when I log the voice state updates and search for my user ID I can clearly see the update looking fine on initial load (without oldChannelId
) and when switching channels
Edit: I could reproduce it now with a large server, investigating
I can't reproduce this issue with the state of my PR. Can you give me more detailed instructions on how to reproduce it? I have two Discord accounts open. With the Vencord one I'm just at the friends tab and when I log the voice state updates and search for my user ID I can clearly see the update looking fine on initial load (without
oldChannelId
) and when switching channels
After restarting Discord directly into DM's (somewhere other than a guild); I had added a console debug in the IPC only really to look at when it occurrs. Without opening any guilds it never occurred (other than the initial startup). Although this test case was probably exclusive to 10+ servers with 100+ users in voice calls. After opening some of the guilds and returning to DM's updates could then be seen flowing in the console.
soz for force - wrong branch
I think I definitely know why it happens and can fix the IPC implementation. Are you on Discord btw?
This is ready to merge.
Damn, and here was me thinking that I committed a lot
This is ready to be merged.
did i do something wrong because the build still doesn't work
did i do something wrong because the build still doesn't work
Hi, @6faw it looks as though you have copied across the folder AllCallTimers
. Unfortunately, this is not sufficient because some changes (refactoring/improvements/additions) were made to internal helper functions. Still waiting for some review/merge from @Vendicated.
You may check here (https://github.com/Max-Herbold/AllCallTimersDiscordPlugin/issues/22) for a temporary solution but this method is probably more effort to maintain for users than it is worth.