X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FSoneMentionDetector.kt;fp=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FSoneMentionDetector.kt;h=f3d8cb41067da44474e5f135a9e163d66ebb499a;hp=32d311da0479b605de6dee1fa123c8e983f094d3;hb=0a2f92314bc1f78a6dea24dc353dd8ad3b041cb9;hpb=acdc9746bb0c853bfd36f1c982c95017158166c2 diff --git a/src/main/kotlin/net/pterodactylus/sone/text/SoneMentionDetector.kt b/src/main/kotlin/net/pterodactylus/sone/text/SoneMentionDetector.kt index 32d311d..f3d8cb4 100644 --- a/src/main/kotlin/net/pterodactylus/sone/text/SoneMentionDetector.kt +++ b/src/main/kotlin/net/pterodactylus/sone/text/SoneMentionDetector.kt @@ -24,7 +24,7 @@ import javax.inject.* /** * Listens to [NewPostFoundEvent]s and [NewPostReplyFoundEvent], parses the - * texts and emits a [LocalSoneMentionedInPostEvent] if a [SoneTextParser] + * texts and emits a [MentionOfLocalSoneFoundEvent] if a [SoneTextParser] * finds a [SonePart] that points to a local [Sone]. */ class SoneMentionDetector @Inject constructor(private val eventBus: EventBus, private val soneTextParser: SoneTextParser) { @@ -35,7 +35,7 @@ class SoneMentionDetector @Inject constructor(private val eventBus: EventBus, pr post.sone.isLocal.onFalse { val parts = soneTextParser.parse(post.text, null) if (parts.filterIsInstance().any { it.sone.isLocal }) { - eventBus.post(LocalSoneMentionedInPostEvent(post)) + eventBus.post(MentionOfLocalSoneFoundEvent(post)) } } } @@ -46,7 +46,7 @@ class SoneMentionDetector @Inject constructor(private val eventBus: EventBus, pr event.postReply.let { postReply -> postReply.sone.isLocal.onFalse { if (soneTextParser.parse(postReply.text, null).filterIsInstance().any { it.sone.isLocal }) { - postReply.post.let(::LocalSoneMentionedInPostEvent).also(eventBus::post) + postReply.post.let(::MentionOfLocalSoneFoundEvent).also(eventBus::post) } } }