Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Fluxer.Net/Data/Apps/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

}

public static Application Create(FluxerBaseClient client, ApplicationJson json)

Check warning on line 19 in Fluxer.Net/Data/Apps/Application.cs

View workflow job for this annotation

GitHub Actions / build-and-publish

Missing XML comment for publicly visible type or member 'Application.Create(FluxerBaseClient, ApplicationJson)'

Check warning on line 19 in Fluxer.Net/Data/Apps/Application.cs

View workflow job for this annotation

GitHub Actions / build-and-publish

Missing XML comment for publicly visible type or member 'Application.Create(FluxerBaseClient, ApplicationJson)'
{
Application data = new Application(client);
data.Update(client, json);
return data;
}

internal void Update(FluxerBaseClient client, ApplicationJson json)
internal virtual void Update(FluxerBaseClient client, ApplicationJson json)
{
base.Update(client, json);
RedirectUrls = json.RedirectUrls;
Expand Down
9 changes: 6 additions & 3 deletions Fluxer.Net/Data/Channels/Channel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static Channel Create(FluxerBaseClient client, ChannelJson json)
break;
case ChannelType.DmPersonalNotes:
{
data = new SavedMessagesChannel(client);
data = new SavedNotesChannel(client);
data.IsTextable = true;
}
break;
Expand All @@ -128,7 +128,10 @@ public static Channel Create(FluxerBaseClient client, ChannelJson json)
break;
default:
{
data = new Channel(client);
if (data.GuildId.HasValue)
data = new GuildChannel(client);
else
data = new Channel(client);
data.IsTextable = true;
}
break;
Expand All @@ -137,7 +140,7 @@ public static Channel Create(FluxerBaseClient client, ChannelJson json)
return data;
}

internal void Update(FluxerBaseClient client, ChannelJson json)
internal virtual void Update(FluxerBaseClient client, ChannelJson json)
{
Id = json.Id;
GuildId = json.GuildId;
Expand Down
12 changes: 0 additions & 12 deletions Fluxer.Net/Data/Channels/GuildChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,4 @@ internal GuildChannel(FluxerBaseClient client) : base(client)
{

}

public static GuildChannel Create(FluxerBaseClient client, ChannelJson json)
{
var data = new GuildChannel(client);
data.Update(client, json);
return data;
}

internal void Update(FluxerBaseClient client, ChannelJson json)
{
base.Update(client, json);
}
}
4 changes: 2 additions & 2 deletions Fluxer.Net/Data/Channels/IPermissionOverwrite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public interface IPermissionOverwrite
/// <summary>
/// The bitwise value of allowed permissions.
/// </summary>
ulong Allow { get; }
ChannelPermissions Allow { get; }

/// <summary>
/// The bitwise value of denied permissions.
/// </summary>
ulong Deny { get; }
ChannelPermissions Deny { get; }
}
9 changes: 0 additions & 9 deletions Fluxer.Net/Data/Channels/NotesChannel.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Fluxer.Net/Data/Channels/PermissionOverwrite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ public class PermissionOverwrite : Entity, IPermissionOverwrite
public int Type { get; internal set; }

/// <inheritdoc />
public ulong Allow { get; internal set; }
public ChannelPermissions Allow { get; internal set; }

/// <inheritdoc />
public ulong Deny { get; internal set; }
public ChannelPermissions Deny { get; internal set; }

internal PermissionOverwrite(FluxerBaseClient client) : base(client)
{
Expand Down
4 changes: 2 additions & 2 deletions Fluxer.Net/Data/Channels/PermissionOverwriteJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public class PermissionOverwriteJson : IPermissionOverwrite

/// <inheritdoc />
[JsonProperty("allow")]
public ulong Allow { get; set; }
public ChannelPermissions Allow { get; set; }

/// <inheritdoc />
[JsonProperty("deny")]
public ulong Deny { get; set; }
public ChannelPermissions Deny { get; set; }
}
9 changes: 9 additions & 0 deletions Fluxer.Net/Data/Channels/SavedNotesChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Fluxer.Net;

public class SavedNotesChannel : Channel, ITextable
{
internal SavedNotesChannel(FluxerBaseClient client) : base(client)
{

}
}
16 changes: 16 additions & 0 deletions Fluxer.Net/Data/Channels/SocketCategoryChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Fluxer.Net;

public class SocketCategoryChannel : CategoryChannel
{
internal SocketCategoryChannel(FluxerBaseClient client) : base(client)
{

}

public static SocketCategoryChannel Create(FluxerBaseClient client, ChannelJson json)

Check warning on line 10 in Fluxer.Net/Data/Channels/SocketCategoryChannel.cs

View workflow job for this annotation

GitHub Actions / build-and-publish

'SocketCategoryChannel.Create(FluxerBaseClient, ChannelJson)' hides inherited member 'Channel.Create(FluxerBaseClient, ChannelJson)'. Use the new keyword if hiding was intended.

Check warning on line 10 in Fluxer.Net/Data/Channels/SocketCategoryChannel.cs

View workflow job for this annotation

GitHub Actions / build-and-publish

'SocketCategoryChannel.Create(FluxerBaseClient, ChannelJson)' hides inherited member 'Channel.Create(FluxerBaseClient, ChannelJson)'. Use the new keyword if hiding was intended.
{
var data = new SocketCategoryChannel(client);
data.Update(client, json);
return data;
}
}
32 changes: 0 additions & 32 deletions Fluxer.Net/Data/Channels/SocketChannel.cs

This file was deleted.

9 changes: 9 additions & 0 deletions Fluxer.Net/Data/Channels/SocketDMChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Fluxer.Net;

public class SocketDMChannel : DMChannel
{
internal SocketDMChannel(FluxerBaseClient client) : base(client)
{

}
}
16 changes: 16 additions & 0 deletions Fluxer.Net/Data/Channels/SocketGroupChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Fluxer.Net;

public class SocketGroupChannel : GroupChannel
{
internal SocketGroupChannel(FluxerBaseClient client) : base(client)
{

}

public static SocketGroupChannel Create(FluxerBaseClient client, ChannelJson json)

Check warning on line 10 in Fluxer.Net/Data/Channels/SocketGroupChannel.cs

View workflow job for this annotation

GitHub Actions / build-and-publish

'SocketGroupChannel.Create(FluxerBaseClient, ChannelJson)' hides inherited member 'Channel.Create(FluxerBaseClient, ChannelJson)'. Use the new keyword if hiding was intended.

Check warning on line 10 in Fluxer.Net/Data/Channels/SocketGroupChannel.cs

View workflow job for this annotation

GitHub Actions / build-and-publish

'SocketGroupChannel.Create(FluxerBaseClient, ChannelJson)' hides inherited member 'Channel.Create(FluxerBaseClient, ChannelJson)'. Use the new keyword if hiding was intended.
{
var data = new SocketGroupChannel(client);
data.Update(client, json);
return data;
}
}
16 changes: 16 additions & 0 deletions Fluxer.Net/Data/Channels/SocketLinkChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Fluxer.Net;

public class SocketLinkChannel : LinkChannel
{
internal SocketLinkChannel(FluxerBaseClient client) : base(client)
{

}

public static SocketLinkChannel Create(FluxerBaseClient client, ChannelJson json)

Check warning on line 10 in Fluxer.Net/Data/Channels/SocketLinkChannel.cs

View workflow job for this annotation

GitHub Actions / build-and-publish

'SocketLinkChannel.Create(FluxerBaseClient, ChannelJson)' hides inherited member 'Channel.Create(FluxerBaseClient, ChannelJson)'. Use the new keyword if hiding was intended.

Check warning on line 10 in Fluxer.Net/Data/Channels/SocketLinkChannel.cs

View workflow job for this annotation

GitHub Actions / build-and-publish

'SocketLinkChannel.Create(FluxerBaseClient, ChannelJson)' hides inherited member 'Channel.Create(FluxerBaseClient, ChannelJson)'. Use the new keyword if hiding was intended.
{
var data = new SocketLinkChannel(client);
data.Update(client, json);
return data;
}
}
16 changes: 16 additions & 0 deletions Fluxer.Net/Data/Channels/SocketSavedNotesChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace Fluxer.Net;

public class SocketSavedNotesChannel : SavedNotesChannel
{
internal SocketSavedNotesChannel(FluxerBaseClient client) : base(client)
{

}

public static SocketSavedNotesChannel Create(FluxerBaseClient client, ChannelJson json)

Check warning on line 10 in Fluxer.Net/Data/Channels/SocketSavedNotesChannel.cs

View workflow job for this annotation

GitHub Actions / build-and-publish

'SocketSavedNotesChannel.Create(FluxerBaseClient, ChannelJson)' hides inherited member 'Channel.Create(FluxerBaseClient, ChannelJson)'. Use the new keyword if hiding was intended.

Check warning on line 10 in Fluxer.Net/Data/Channels/SocketSavedNotesChannel.cs

View workflow job for this annotation

GitHub Actions / build-and-publish

'SocketSavedNotesChannel.Create(FluxerBaseClient, ChannelJson)' hides inherited member 'Channel.Create(FluxerBaseClient, ChannelJson)'. Use the new keyword if hiding was intended.
{
var data = new SocketSavedNotesChannel(client);
data.Update(client, json);
return data;
}
}
9 changes: 9 additions & 0 deletions Fluxer.Net/Data/Channels/SocketTextChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Fluxer.Net;

public class SocketTextChannel : TextChannel
{
internal SocketTextChannel(FluxerBaseClient client) : base(client)
{

}
}
84 changes: 84 additions & 0 deletions Fluxer.Net/Data/Channels/SocketUnknownChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
namespace Fluxer.Net;

public class SocketUnknownChannel : Channel
{
/// <summary>
/// Permissions for the channel.
/// </summary>
public ChannelPermissions Permissions { get; internal set; }

internal SocketUnknownChannel(FluxerBaseClient client) : base(client)
{

}

public static Channel Create(FluxerBaseClient client, ChannelJson json, ulong guildId)
{
Channel data = null;

switch (json.Type)
{
case ChannelType.GuildText:
{
data = new SocketTextChannel(client);
data.IsTextable = true;
}
break;
case ChannelType.GuildVoice:
{
data = new SocketVoiceChannel(client);
}
break;
case ChannelType.Dm:
{
data = new SocketDMChannel(client);
data.IsTextable = true;
}
break;
case ChannelType.DmPersonalNotes:
{
data = new SocketSavedNotesChannel(client);
data.IsTextable = true;
}
break;
case ChannelType.GroupDm:
{
data = new SocketGroupChannel(client);
data.IsTextable = true;
}
break;
case ChannelType.GuildCategory:
{
data = new SocketCategoryChannel(client);
}
break;
case ChannelType.GuildLink:
{
data = new SocketLinkChannel(client);
}
break;
default:
{
if (data.GuildId.HasValue)
data = new SocketUnknownGuildChannel(client);
else
data = new SocketUnknownChannel(client);
data.IsTextable = true;
}
break;
}
data.GuildId = guildId;
data.Update(client, json);
return data;
}

internal override void Update(FluxerBaseClient client, ChannelJson json)
{
base.Update(client, json);
PermissionOverwriteJson? overwrite = json.PermissionOverwrites.FirstOrDefault(x => x.Id == Id);
if (overwrite != null)
Permissions = overwrite.Allow;
else
Permissions = new ChannelPermissions(0);
}
}
9 changes: 9 additions & 0 deletions Fluxer.Net/Data/Channels/SocketUnknownGuildChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Fluxer.Net;

public class SocketUnknownGuildChannel : GuildChannel
{
internal SocketUnknownGuildChannel(FluxerBaseClient client) : base(client)
{

}
}
9 changes: 9 additions & 0 deletions Fluxer.Net/Data/Channels/SocketVoiceChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Fluxer.Net;

public class SocketVoiceChannel : VoiceChannel
{
internal SocketVoiceChannel(FluxerBaseClient client) : base(client)
{

}
}
2 changes: 1 addition & 1 deletion Fluxer.Net/Data/Channels/VoiceChannel.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Fluxer.Net;

internal class VoiceChannel : GuildChannel
public class VoiceChannel : GuildChannel
{
internal VoiceChannel(FluxerBaseClient client) : base(client)
{
Expand Down
2 changes: 1 addition & 1 deletion Fluxer.Net/Data/Guilds/Guild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static Guild Create(FluxerBaseClient client, GuildJson json)
return data;
}

internal void Update(FluxerBaseClient client, GuildJson json)
internal virtual void Update(FluxerBaseClient client, GuildJson json)
{
base.Update(client, json);
OwnerId = json.OwnerId;
Expand Down
2 changes: 1 addition & 1 deletion Fluxer.Net/Data/Guilds/Members/GuildMember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static GuildMember Create(FluxerBaseClient client, GuildMemberJson json)
return data;
}

internal void Update(FluxerBaseClient client, GuildMemberJson json)
internal virtual void Update(FluxerBaseClient client, GuildMemberJson json)
{
GuildId = json.GuildId;
User = User.Create(client, json.User);
Expand Down
2 changes: 1 addition & 1 deletion Fluxer.Net/Data/Guilds/Members/IRole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public interface IRole
/// <summary>
/// The role's permission bitfield. Sent as a quoted string by the gateway (e.g. "8933636165184").
/// </summary>
Permissions Permissions { get; }
GuildPermissions Permissions { get; }

/// <summary>
/// The position of the role in the role hierarchy.
Expand Down
4 changes: 2 additions & 2 deletions Fluxer.Net/Data/Guilds/Members/Role.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Role : Entity, IRole
public string Name { get; internal set; }

/// <inheritdoc />
public Permissions Permissions { get; internal set; }
public GuildPermissions Permissions { get; internal set; }

/// <inheritdoc />
public int Position { get; internal set; }
Expand Down Expand Up @@ -46,7 +46,7 @@ public static Role Create(FluxerBaseClient client, RoleJson json, ulong guildId)
return data;
}

internal void Update(FluxerBaseClient client, RoleJson json)
internal virtual void Update(FluxerBaseClient client, RoleJson json)
{
Id = json.Id;
Name = json.Name;
Expand Down
Loading
Loading