Skip to content

Commit

Permalink
(fix) Send UserState for another user (not ourself).
Browse files Browse the repository at this point in the history
  • Loading branch information
Meetsch committed Jun 30, 2019
1 parent 81f0ba3 commit 53ac3e8
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions MumbleSharp/Model/User.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,25 @@ public void Move(Channel channel)
/// </summary>
public void SendUserState()
{
_owner.Connection.SendControl<UserState>(PacketType.UserState, new UserState()
UserState userstate = new UserState()
{
Actor = this.Id,
Session = _owner.LocalUser.Id,
ChannelId = this.ChannelId,
SelfMute = this.SelfMuted,
SelfDeaf = this.SelfDeaf,
});
Actor = _owner.LocalUser.Id,
ChannelId = this.ChannelId
};

if(this.Id == _owner.LocalUser.Id)
{
userstate.SelfMute = this.SelfMuted;
userstate.SelfDeaf = this.SelfDeaf;
} else
{
userstate.Session = _owner.LocalUser.Id;
userstate.UserId = this.Id;
userstate.Mute = this.Muted;
userstate.Deaf = this.Deaf;
}

_owner.Connection.SendControl<UserState>(PacketType.UserState, userstate);
}

protected internal IVoiceCodec GetCodec(SpeechCodecs codec)
Expand Down

0 comments on commit 53ac3e8

Please sign in to comment.