mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
ShamrockPrivate
: 尝试修复自发消息异常闪退
Signed-off-by: WhiteChi <whitechi73@outlook.com>
This commit is contained in:
parent
dc2503b045
commit
41675ed874
@ -56,9 +56,10 @@ internal object MsgSvc: BaseSvc() {
|
||||
qqMsgId: Long
|
||||
): Result<MsgRecord> {
|
||||
val contact = MessageHelper.generateContact(chatType, peerId)
|
||||
val service = QRoute.api(IMsgService::class.java) ?:
|
||||
return Result.failure(Exception("获取消息服务"))
|
||||
|
||||
val msg = withTimeoutOrNull(5000) {
|
||||
val service = QRoute.api(IMsgService::class.java)
|
||||
suspendCancellableCoroutine { continuation ->
|
||||
service.getMsgsByMsgId(contact, arrayListOf(qqMsgId)) { code, _, msgRecords ->
|
||||
if (code == 0 && msgRecords.isNotEmpty()) {
|
||||
|
@ -117,6 +117,8 @@ internal object AioListener: IKernelMsgListener {
|
||||
} else if (record.sendStatus == MsgConstant.KSENDSTATUSFAILED) {
|
||||
it.resume(null)
|
||||
}
|
||||
}.onFailure { _ ->
|
||||
it.resume(null)
|
||||
}
|
||||
delay(50)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user