void ClientJoin(JoinEventArgs e)
{
var channel = Server.Channel(e.Channel);
if (channel != null)
{
if (_iam == e.Who)
{
channel.ErrorCode = 0;
channel.Connected = true;
_log.Info("joined " + channel);
FireNotificationAdded(Notification.Types.ChannelJoined, channel);
OnChannelJoined(this, new EventArgs<Model.Domain.Channel>(channel));
}
else
{
var bot = channel.Bot(e.Who);
if (bot != null)
{
bot.Connected = true;
bot.LastMessage = "joined channel " + channel.Name;
if (bot.State != Bot.States.Active)
{
bot.State = Bot.States.Idle;
}
OnBotJoined(this, new EventArgs<Bot>(bot));
}
else
{
OnUserJoined(this, new EventArgs<Model.Domain.Channel, string>(channel, e.Who));
}
}
UpdateChannel(channel);
}
}