/// <summary> /// Server has changed some detail of a user /// </summary> /// <param name="userState"></param> public virtual void UserState(UserState userState) { if (userState.Session.HasValue) { bool added = false; User user = UserDictionary.AddOrUpdate(userState.Session.Value, i => { added = true; return new User(this, userState.Session.Value); }, (i, u) => u); if (added) UserJoined(user); if (userState.SelfDeaf.HasValue) user.Deaf = userState.SelfDeaf.Value; if (userState.SelfMute.HasValue) user.Muted = userState.SelfMute.Value; if (userState.Mute.HasValue) user.Muted = userState.Mute.Value; if (userState.Deaf.HasValue) user.Deaf = userState.Deaf.Value; if (userState.Suppress.HasValue) user.Muted = userState.Suppress.Value; if (userState.Name != null) user.Name = userState.Name; if (userState.Comment != null) user.Comment = userState.Comment; if (userState.ChannelId.HasValue) user.Channel = ChannelDictionary[userState.ChannelId.Value]; else user.Channel = RootChannel; if (userState.Comment != null) user.Comment = userState.Comment; } }
/// <summary> /// Server has changed some detail of a user /// </summary> /// <param name="userState"></param> public virtual void UserState(UserState userState) { if (userState.Session.HasValue) { User user = UserDictionary.AddOrUpdate(userState.Session.Value, i => new User(this, userState.Session.Value), (i, u) => u); if (userState.SelfDeaf.HasValue) user.Deaf = userState.SelfDeaf.Value; if (userState.SelfMute.HasValue) user.Muted = userState.SelfMute.Value; if (userState.Mute.HasValue) user.Muted = userState.Mute.Value; if (userState.Deaf.HasValue) user.Deaf = userState.Deaf.Value; if (userState.Suppress.HasValue) user.Muted = userState.Suppress.Value; if (userState.Name != null) user.Name = userState.Name; if (userState.Comment != null) user.Comment = userState.Comment; if (userState.ChannelId.HasValue) user.Channel = ChannelDictionary[userState.ChannelId.Value]; else user.Channel = RootChannel; //user.Comment = userState.Comment; } }