From a4481a2ccb6036bae662f8b4484aa484f2d30b1e Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Fri, 20 Oct 2023 12:48:23 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=AC=E9=96=8B=E7=AF=84=E5=9B=B2?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../usbharu/hideout/service/ap/APNoteService.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt b/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt index 6fbe6583..8a7b1a95 100644 --- a/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt +++ b/src/main/kotlin/dev/usbharu/hideout/service/ap/APNoteService.kt @@ -171,9 +171,9 @@ class APNoteServiceImpl( attributedTo = user.url, content = post.text, published = Instant.ofEpochMilli(post.createdAt).toString(), - to = listOf(public, user.url + "/follower"), + to = listOfNotNull(public, user.followers), sensitive = post.sensitive, - cc = listOf(public, user.url + "/follower"), + cc = listOfNotNull(public, user.followers), inReplyTo = reply?.url ) } @@ -202,17 +202,21 @@ class APNoteServiceImpl( targetActor ) + logger.debug("VISIBILITY url: {} to: {} cc: {}", note.id, note.to, note.cc) + val visibility = - if (note.to.contains(public) && note.cc.contains(public)) { + if (note.to.contains(public)) { Visibility.PUBLIC - } else if (note.to.find { it.endsWith("/followers") } != null && note.cc.contains(public)) { + } else if (note.to.contains(person.second.followers) && note.cc.contains(public)) { Visibility.UNLISTED - } else if (note.to.find { it.endsWith("/followers") } != null) { + } else if (note.to.contains(person.second.followers)) { Visibility.FOLLOWERS } else { Visibility.DIRECT } + logger.debug("VISIBILITY is {} url: {}", visibility.name, note.id) + val reply = note.inReplyTo?.let { fetchNote(it, targetActor) postQueryService.findByUrl(it)