Commit 997261fa authored by Him188's avatar Him188

Make all event implementations internal

parent 38748e0c
......@@ -25,8 +25,8 @@ import kotlin.coroutines.coroutineContext
import kotlin.jvm.JvmField
import kotlin.reflect.KClass
@MiraiInternalAPI
fun <L : Listener<E>, E : Event> KClass<out E>.subscribeInternal(listener: L): L {
@PublishedApi
internal fun <L : Listener<E>, E : Event> KClass<out E>.subscribeInternal(listener: L): L {
with(this.listeners()) {
addLast(listener)
listener.invokeOnCompletion {
......
......@@ -22,9 +22,8 @@ import java.util.function.Consumer
import java.util.function.Function
import kotlin.coroutines.EmptyCoroutineContext
@MiraiInternalAPI
@Suppress("FunctionName")
fun <E : Event> Class<E>._subscribeEventForJaptOnly(
internal fun <E : Event> Class<E>._subscribeEventForJaptOnly(
scope: CoroutineScope,
onEvent: Function<E, ListeningStatus>
): Listener<E> {
......@@ -35,9 +34,8 @@ fun <E : Event> Class<E>._subscribeEventForJaptOnly(
) { withContext(Dispatchers.IO) { onEvent.apply(it) } })
}
@MiraiInternalAPI
@Suppress("FunctionName")
fun <E : Event> Class<E>._subscribeEventForJaptOnly(scope: CoroutineScope, onEvent: Consumer<E>): Listener<E> {
internal fun <E : Event> Class<E>._subscribeEventForJaptOnly(scope: CoroutineScope, onEvent: Consumer<E>): Listener<E> {
return this.kotlin.subscribeInternal(
scope.Handler(
EmptyCoroutineContext,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment