This commit is contained in:
tateisu 2021-03-23 15:40:15 +09:00
parent f6328b3d8a
commit 246af224a9
2 changed files with 7 additions and 1 deletions

View File

@ -244,6 +244,7 @@ class TootInstance(parser: TootParser, src: JsonObject) {
val MISSKEY_VERSION_11 = VersionString("11.0")
val MISSKEY_VERSION_12 = VersionString("12.0")
val MISSKEY_VERSION_12_75_0 = VersionString("12.75.0")
private val reDigits = """(\d+)""".asciiPattern()

View File

@ -475,12 +475,17 @@ class StreamConnection(
val socket = socket.get()
if (isDisposed.get() || socket == null) return
val type = when{
acctGroup.ti.versionGE(TootInstance.MISSKEY_VERSION_12_75_0) -> "sr"
else -> "subNote"
}
for (id in list) {
if (id.isDefault) continue
synchronized(capturedId) {
if (capturedId.contains(id)) return
try {
if (socket.send("""{"type":"subNote","body": {"id":"$id"}}""")) {
if (socket.send("""{"type":"$type","body":{"id":"$id"}}""")) {
capturedId.add(id)
} else {
log.w("capture failed.")