Fixed owner check in UpdatePermissions
This commit is contained in:
@@ -37,7 +37,7 @@ namespace Discord
|
|||||||
public bool IsOwner => _client.CurrentUserId == _ownerId;
|
public bool IsOwner => _client.CurrentUserId == _ownerId;
|
||||||
/// <summary> Returns the user that first created this server. </summary>
|
/// <summary> Returns the user that first created this server. </summary>
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public Member Owner => _client.Members[_ownerId, Id];
|
public Member Owner { get; private set; }
|
||||||
|
|
||||||
/// <summary> Returns the id of the AFK voice channel for this server (see AFKTimeout). </summary>
|
/// <summary> Returns the id of the AFK voice channel for this server (see AFKTimeout). </summary>
|
||||||
public string AFKChannelId { get; private set; }
|
public string AFKChannelId { get; private set; }
|
||||||
@@ -129,8 +129,11 @@ namespace Discord
|
|||||||
JoinedAt = model.JoinedAt.Value;
|
JoinedAt = model.JoinedAt.Value;
|
||||||
if (model.Name != null)
|
if (model.Name != null)
|
||||||
Name = model.Name;
|
Name = model.Name;
|
||||||
if (model.OwnerId != null)
|
if (model.OwnerId != null && _ownerId != model.OwnerId)
|
||||||
|
{
|
||||||
_ownerId = model.OwnerId;
|
_ownerId = model.OwnerId;
|
||||||
|
Owner = _client.Members[_ownerId, Id];
|
||||||
|
}
|
||||||
if (model.Region != null)
|
if (model.Region != null)
|
||||||
Region = model.Region;
|
Region = model.Region;
|
||||||
|
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ namespace Discord
|
|||||||
uint newPermissions = 0x0;
|
uint newPermissions = 0x0;
|
||||||
uint oldPermissions = permissions.RawValue;
|
uint oldPermissions = permissions.RawValue;
|
||||||
|
|
||||||
if (Id == server.Owner.Id)
|
if (server.Owner == this)
|
||||||
newPermissions = ChannelPermissions.All(channel).RawValue;
|
newPermissions = ChannelPermissions.All(channel).RawValue;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user