Skip to content

Commit 6b56f40

Browse files
committed
improve function name
1 parent 2fca26e commit 6b56f40

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

common/src/main/kotlin/net/azisaba/spicyAzisaBan/punishment/Punishment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ data class Punishment(
404404
}
405405
}
406406

407-
fun doSomethingIfOnline(actor: Actor? = null) = async<Unit> {
407+
fun onPunished(actor: Actor? = null) = async<Unit> {
408408
val notifyTargetServer = (if (server == "global" && actor is PlayerActor) actor.getServer()?.name else server) ?: server
409409
// notes are ignored entirely
410410
if (type == PunishmentType.NOTE) return@async it.resolve()
@@ -506,7 +506,7 @@ data class Punishment(
506506
if (cancel) return@async
507507
SpicyAzisaBan.instance.connection.sendEvent(EventType.ADD_PUNISHMENT, JSONObject().put("id", id)).complete()
508508
clearCache(id, sendEvent = true)
509-
doSomethingIfOnline(actor).complete()
509+
onPunished(actor).complete()
510510
return@async context.resolve(
511511
Punishment(
512512
id,

common/src/main/kotlin/net/azisaba/spicyAzisaBan/util/TimerTasks.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class TimerTasks(private val connection: SQLConnection) {
4747
SpicyAzisaBan.debug("Ignoring event ${e.id} because the punishment #$id is no longer active")
4848
continue
4949
}
50-
p.doSomethingIfOnline()
50+
p.onPunished()
5151
if (!SpicyAzisaBan.instance.connection.eventsByUs.contains(e.id)) {
5252
p.notifyToAll(sendWebhook = !e.handled)
5353
}

0 commit comments

Comments
 (0)