Skip to content

Commit c3e9f68

Browse files
committed
Remove duplicated classes
1 parent 3c80b8f commit c3e9f68

12 files changed

+13
-230
lines changed

foxy/src/main/kotlin/net/cakeyfox/foxy/website/routes/dashboard/GetGenericServerModuleRoute.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class GetGenericServerModuleRoute(val server: FoxyWebsite) : BaseRoute("/servers
2020
val isProduction = server.isProduction
2121
val moduleId = context.call.parameters["module"] ?: return
2222

23-
val (user, guild, session, guildInfo, authorizedGuilds) = checkPermissions(server, context, locale) ?: return
23+
val (user, guild, session, guildInfo, authorizedGuilds) = checkPermissions(server, context, locale, context.call) ?: return
2424

2525
respondWithPage(context.call) {
2626
getModuleConfig(session, moduleId, guildInfo, false, locale, isProduction, authorizedGuilds)

foxy/src/main/kotlin/net/cakeyfox/foxy/website/routes/dashboard/GetYouTubeChannelRoute.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class GetYouTubeChannelRoute(
2323

2424
val locale = FoxyLocale(lang)
2525
try {
26-
val (user, guild, session, guildInfo, authorizedGuilds) = checkPermissions(server, context, locale) ?: return
26+
val (user, guild, session, guildInfo, authorizedGuilds) = checkPermissions(server, context, locale, context.call) ?: return
2727

2828
respondWithPage(context.call) {
2929
buildDashboardModule(

foxy/src/main/kotlin/net/cakeyfox/foxy/website/routes/partials/GetServerGeneralSettingsPartial.kt

Lines changed: 0 additions & 43 deletions
This file was deleted.

foxy/src/main/kotlin/net/cakeyfox/foxy/website/routes/partials/GetServerListPartial.kt

Lines changed: 0 additions & 54 deletions
This file was deleted.

foxy/src/main/kotlin/net/cakeyfox/foxy/website/routes/partials/GetServerLogsSettingsRoute.kt

Lines changed: 0 additions & 45 deletions
This file was deleted.

foxy/src/main/kotlin/net/cakeyfox/foxy/website/routes/partials/GetServerWelcomerSettingsPartial.kt

Lines changed: 0 additions & 48 deletions
This file was deleted.

foxy/src/main/kotlin/net/cakeyfox/foxy/website/routes/partials/GetYouTubeChannelPartial.kt

Lines changed: 0 additions & 33 deletions
This file was deleted.

foxy/src/main/kotlin/net/cakeyfox/foxy/website/routes/partials/dashboard/guild/GetServerGeneralSettingsPartial.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class GetServerGeneralSettingsPartial {
2929

3030
try {
3131
val guild = server.foxy.database.guild.getGuildOrNull(guildId)!!
32-
val channels = RouteUtils.getChannelsFromDiscord(server, guildId)
32+
val channels = RouteUtils.getChannelsFromDiscord(server, guildId, call) ?: return@get
3333
val blockedChannels = guild.guildSettings.blockedChannels
3434

3535
respondWithPage(call) { getGeneralSettings(guild, locale, channels, blockedChannels, idempotencyKey) }

foxy/src/main/kotlin/net/cakeyfox/foxy/website/routes/partials/dashboard/guild/GetServerListPartial.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class GetServerListPartial {
2626
val session = checkSession(call, server, call.sessions.get<UserSession>()) ?: return@get
2727
val lang = call.parameters["lang"] ?: return@get
2828
val locale = FoxyLocale(lang)
29-
val guilds = getUserGuilds(server, session, httpClient)
29+
val guilds = getUserGuilds(server, session, httpClient, call) ?: return@get
3030

3131
try {
3232
respondWithPage(call) {

foxy/src/main/kotlin/net/cakeyfox/foxy/website/routes/partials/dashboard/guild/GetServerLogsSettingsRoute.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import io.ktor.server.routing.route
88
import io.ktor.server.sessions.get
99
import io.ktor.server.sessions.sessions
1010
import io.ktor.utils.io.ExperimentalKtorApi
11+
import mu.KotlinLogging
1112
import net.cakeyfox.common.FoxyLocale
1213
import net.cakeyfox.foxy.website.FoxyWebsite
1314
import net.cakeyfox.foxy.website.utils.RouteUtils
@@ -28,7 +29,7 @@ class GetServerLogsSettingsRoute {
2829
val guild = server.foxy.database.guild.getGuildOrNull(guildId)!!
2930

3031
try {
31-
val channels = RouteUtils.getChannelsFromDiscord(server, guildId)
32+
val channels = RouteUtils.getChannelsFromDiscord(server, guildId, call) ?: return@get
3233

3334
respondWithPage(call) {
3435
renderServerLogsPartial(guild, locale, channels, idempotencyKey)

0 commit comments

Comments
 (0)