Closed sector-f closed 7 years ago
It provides the ability to list users for a particular channel through the Server
trait function list_users
. Is this what you were looking for? Or do you have an application that requires directly getting at the HashMap for one reason or another?
If I'm understanding everything right: list_users
requires I pass it a channel name as an argument, meaning that I have to keep track of the channels the client is currently connected to. But the IrcServer
already keeps track of that. At risk of sounding lazy, why should I have to write code to keep track of the current channels when the irc
crate is already doing it?
Sure, I originally did just list users to avoid requiring the implementation to be a HashMap, but it sounds like it makes sense to be able to return a list of the channels as well. I'll implement this ASAP.
I've implemented this in commit 38c7ed2c71d2b34a3104fbc8337ca645ae1353ca and it is live in 0.11.8.
IrcServer
has aServerState
, andServerState
haschanlists: Mutex<HashMap<String, Vec<User>>>
...butServerState
isn'tpub
.I personally think it'd be really nice if
IrcServer
provided a method I could use to get aHashMap<String, Vec<User>>
. Is that as feasible as I'm hoping?