Gocnak / Botnak

A Java-based IRC chat client with focus on Twitch.tv streams.
https://gocnak.github.io/Botnak
MIT License
67 stars 28 forks source link

Username auto-completion fails sometimes #114

Closed Palehors68 closed 9 years ago

Palehors68 commented 9 years ago

I tried to test different theories (users with capital letters, mods vs viewers, etc) but I found no consensus. For some reason, the getUsers method in ChannelManager.java returns empty even though the user shows up in the Viewers list. Here it is working: image

And here it is failing: image

Gocnak commented 9 years ago

Oh wait this is because the user object isn't created from the viewer list.

When the user talks, the User object is created. I figured this was helpful for when you open a viewer list of somebody with 1k+ viewers, you don't have an influx of Objects being made for people that could be potentially leaving by the next update.

Viewer lists are really just for seeing the user if they're in chat.

We can create the user either in UserManager or in ListenerName, but I figured you'd really only want the user objects of people that chat.

I think twitch follows this same methodology with their user mention -- that the person has to type in chat before you can @mention them.

Palehors68 commented 9 years ago

So Botnak connects to a channel, and User objects are created real time as people chat? I can see a few of problems with that.

1) When you first connect to a channel, auto-complete isn’t useful since you have to wait on others to chat. 2) Like #1, auto-complete loses its utility in a quiet or slow chat. 3) You may NEVER get autocomplete for the streamer’s own userid since they often don’t type in their own chat but rely on a mic for communication.

ChristopherWirtOfficial commented 9 years ago

I'm going to test out some ideas with this today to see if it can be safely done in the background with some limits set up.

Gocnak commented 9 years ago

So we can probably compromise and have the UserManager heartbeat thread create user objects, so that way, if you know who is in chat, you'll have a reason to @mention them.

I could also make IRCViewer create the user object for the broadcaster of the channel you're joining, so you'll always be able to @mention them as well.