Browse Source

use flags for selfstream state instead of its own prop

pull/1369/head
Chris Johnston 6 years ago
parent
commit
057a7d0b7f
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      src/Discord.Net.WebSocket/Entities/Users/SocketVoiceState.cs

+ 4
- 3
src/Discord.Net.WebSocket/Entities/Users/SocketVoiceState.cs View File

@@ -24,6 +24,7 @@ namespace Discord.WebSocket
Deafened = 0x04, Deafened = 0x04,
SelfMuted = 0x08, SelfMuted = 0x08,
SelfDeafened = 0x10, SelfDeafened = 0x10,
SelfStream = 0x20,
} }


private readonly Flags _voiceStates; private readonly Flags _voiceStates;
@@ -46,7 +47,7 @@ namespace Discord.WebSocket
/// <inheritdoc /> /// <inheritdoc />
public bool IsSelfDeafened => (_voiceStates & Flags.SelfDeafened) != 0; public bool IsSelfDeafened => (_voiceStates & Flags.SelfDeafened) != 0;
/// <inheritdoc /> /// <inheritdoc />
public bool IsStream { get; }
public bool IsStream => (_voiceStates & Flags.SelfStream) != 0;


internal SocketVoiceState(SocketVoiceChannel voiceChannel, string sessionId, bool isSelfMuted, bool isSelfDeafened, bool isMuted, bool isDeafened, bool isSuppressed, bool isStream) internal SocketVoiceState(SocketVoiceChannel voiceChannel, string sessionId, bool isSelfMuted, bool isSelfDeafened, bool isMuted, bool isDeafened, bool isSuppressed, bool isStream)
{ {
@@ -64,9 +65,9 @@ namespace Discord.WebSocket
voiceStates |= Flags.Deafened; voiceStates |= Flags.Deafened;
if (isSuppressed) if (isSuppressed)
voiceStates |= Flags.Suppressed; voiceStates |= Flags.Suppressed;
if (isStream)
voiceStates |= Flags.SelfStream;
_voiceStates = voiceStates; _voiceStates = voiceStates;

IsStream = isStream;
} }
internal static SocketVoiceState Create(SocketVoiceChannel voiceChannel, Model model) internal static SocketVoiceState Create(SocketVoiceChannel voiceChannel, Model model)
{ {


Loading…
Cancel
Save