private void HandleJoin(IReceiveMessage message) { ChannelUser channelUser = message.Sender as ChannelUser; Channel channel = message.Receiver as Channel; AddUserToChannel(channelUser.User as User, channel); if (_me.Equals(channelUser.User)) { this.SendAndForget( _messageSender.Mode(channel) , _messageSender.Who(channel.Name) ); } else { this.SendAndForget(_messageSender.Who(channelUser.Name)); } }
private void ChangeNickname(User user, String nickname) { if (_users.Contains(nickname)) { _logger.Error("Changing nickname of " + user.Name + " into " + nickname + ", but a user with that nickname already exists. Some observable subscriptions may be lost."); if (user.Equals(_me)) { _me = _users[nickname] as User; } user.Channels.Cast <Channel>().Do(c => c.ChangeName(user.Name, nickname)); _users.Remove(user); return; } _users.ChangeItemKey(user, nickname); user.Channels.Cast <Channel>().Do(c => c.ChangeName(user.Name, nickname)); user.Name.Value = nickname; user.Identity.Name.Value = nickname; }
private void ChangeNickname(User user, String nickname) { if(_users.Contains(nickname)) { _logger.Error("Changing nickname of " + user.Name + " into " + nickname + ", but a user with that nickname already exists. Some observable subscriptions may be lost."); if(user.Equals(_me)) _me = _users[nickname] as User; user.Channels.Cast<Channel>().Do(c => c.ChangeName(user.Name, nickname)); _users.Remove(user); return; } _users.ChangeItemKey(user, nickname); user.Channels.Cast<Channel>().Do(c => c.ChangeName(user.Name, nickname)); user.Name.Value = nickname; user.Identity.Name.Value = nickname; }