Fix comments not showing after commenting

This commit is contained in:
FooIbar committed 2023-12-29 13:22:36 +08:00
1 parent d880b30ea9
commit 8a2dbb99f0
1 file changed
+11 -6
@@ -254,13 +254,18 @@ object EhEngine {
append("edit_comment", id.toString())
}
}
}.fetchUsingAsText {
val document = Jsoup.parse(this)
val elements = document.select("#chd + p")
if (elements.size > 0) {
throw EhException(elements[0].text())
}.execute { response ->
// Ktor does not handle POST redirect, we need to do it manually
// https://youtrack.jetbrains.com/issue/KTOR-478
val location = response.headers["Location"] ?: url
ehRequest(location, url).fetchUsingAsText {
val document = Jsoup.parse(this)
val elements = document.select("#chd + p")
if (elements.size > 0) {
throw EhException(elements[0].text())
}
GalleryDetailParser.parseComments(document)
}
GalleryDetailParser.parseComments(document)
}
suspend fun modifyFavorites(gid: Long, token: String?, dstCat: Int = -1, note: String = "") {