/// <summary> /// Gets the away channel by the clients away state. /// </summary> /// <param name="client">The client.</param> /// <param name="settings">The settings.</param> /// <returns>the away channel.</returns> public static uint? GetAwayChannelByState(this ClientListEntry client, AwaySettings settings) { if (client.IsAway(settings)) return settings.Channel; if (client.IsInputMuted(settings)) return settings.MuteMicrophoneChannel; if (client.IsOutputMuted(settings)) return settings.MuteHeadphoneChannel; return null; }
/// <summary> /// Initializes a new instance of the <see cref="Settings"/> class. /// </summary> public InstanceSettings(GlobalSettings globalSettings) { Global = globalSettings; Away = new AwaySettings(); BadNickname = new BadNicknameSettings(); Control = new ControlSettings(); Event = new EventSettings(); Idle = new IdleSettings(); Message = new MessageSettings(); Record = new RecordSettings(); Sticky = new StickySettings(); TeamSpeak = new TeamSpeakServerSettings(); Vote = new VoteSettings(); }
/// <summary> /// Initializes a new instance of the <see cref="Settings"/> class. /// </summary> public InstanceSettings(GlobalSettings globalSettings) { Global = globalSettings; Away = new AwaySettings(); BadNickname = new BadNicknameSettings(); Control = new ControlSettings(); Event = new EventSettings(); Idle = new IdleSettings(); Message = new MessageSettings(); Record = new RecordSettings(); Sticky = new StickySettings(); TeamSpeak = new TeamSpeakServerSettings(); Vote = new VoteSettings(); }
/// <summary> /// Gets the away channel by the clients away state. /// </summary> /// <param name="client">The client.</param> /// <param name="settings">The settings.</param> /// <returns>the away channel.</returns> public static uint?GetAwayChannelByState(this ClientListEntry client, AwaySettings settings) { if (client.IsAway(settings)) { return(settings.Channel); } if (client.IsInputMuted(settings)) { return(settings.MuteMicrophoneChannel); } if (client.IsOutputMuted(settings)) { return(settings.MuteHeadphoneChannel); } return(null); }
/// <summary> /// Determines whether [is output muted] [the specified client]. /// </summary> /// <param name="client">The client.</param> /// <param name="settings">The settings.</param> /// <returns> /// <c>true</c> if [is output muted] [the specified client]; otherwise, <c>false</c>. /// </returns> public static bool IsOutputMuted(this ClientListEntry client, AwaySettings settings) { return settings.Enabled && settings.MuteHeadphoneChannel > 0 && client.IsClientOutputMuted.GetValueOrDefault(); }
/// <summary> /// Determines whether the specified client is away. /// </summary> /// <param name="client">The client.</param> /// <param name="settings">The settings.</param> /// <returns> /// <c>true</c> if the specified client is away; otherwise, <c>false</c>. /// </returns> public static bool IsAway(this ClientListEntry client, AwaySettings settings) { return settings.Enabled && settings.Channel > 0 && client.IsClientAway.GetValueOrDefault(); }
/// <summary> /// Determines whether [is output muted] [the specified client]. /// </summary> /// <param name="client">The client.</param> /// <param name="settings">The settings.</param> /// <returns> /// <c>true</c> if [is output muted] [the specified client]; otherwise, <c>false</c>. /// </returns> public static bool IsOutputMuted(this ClientListEntry client, AwaySettings settings) { return(settings.Enabled && settings.MuteHeadphoneChannel > 0 && client.IsClientOutputMuted.GetValueOrDefault()); }
/// <summary> /// Determines whether the specified client is away. /// </summary> /// <param name="client">The client.</param> /// <param name="settings">The settings.</param> /// <returns> /// <c>true</c> if the specified client is away; otherwise, <c>false</c>. /// </returns> public static bool IsAway(this ClientListEntry client, AwaySettings settings) { return(settings.Enabled && settings.Channel > 0 && client.IsClientAway.GetValueOrDefault()); }