Fix several bugs

This commit is contained in:
Drew DeVault 2015-07-31 19:06:20 -04:00
parent 54e546b47e
commit 00cccb986d
2 changed files with 5 additions and 0 deletions

View File

@ -59,6 +59,8 @@ namespace ChatSharp.Handlers
if (mode == null)
{
var user = client.Users.GetOrAdd(nick);
if (!user.Channels.Contains(channel))
user.Channels.Add(channel);
if (!user.ChannelModes.ContainsKey(channel))
user.ChannelModes.Add(channel, null);
else
@ -67,6 +69,8 @@ namespace ChatSharp.Handlers
else
{
var user = client.Users.GetOrAdd(nick.Substring(1));
if (!user.Channels.Contains(channel))
user.Channels.Add(channel);
if (!user.ChannelModes.ContainsKey(channel))
user.ChannelModes.Add(channel, mode.Value);
else

View File

@ -9,6 +9,7 @@ namespace ChatSharp
internal IrcUser()
{
Channels = new ChannelCollection();
ChannelModes = new Dictionary<IrcChannel, char?>();
}
public IrcUser(string host) : this()