Fix: add host for Voice.url (#584)

* Fix: add host for Voice.url

* Full return url for Voice
This commit is contained in:
Hieuzest 2020-09-15 19:29:16 +08:00 committed by GitHub
parent 1faccc72f3
commit 152709a0f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,9 +47,11 @@ public class Voice @MiraiInternalAPI constructor(
}
public val url: String?
get() =
if (_url.startsWith("http")) _url
else null
get() = when {
_url.isBlank() -> null
_url.startsWith("http") -> _url
else -> "http://grouptalk.c2c.qq.com$_url"
}
private var _stringValue: String? = null
get() = field ?: kotlin.run {