mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-21 11:09:10 +08:00
Fix commit 'Don't mark failed if received MessageSvcPushForceOffline
' (332e03377c
)
The original commit was to fix the problem when receiving MessageSvcPushForceOffline on first login, which calls `setLoginHalted`, and stops the login process.
This commit is contained in:
parent
efd864449e
commit
b4bb1696de
@ -51,6 +51,9 @@ internal interface BotInitProcessor {
|
|||||||
*
|
*
|
||||||
* This is called in [MessageSvcPushForceOffline], which is in case connection is closed by server during the [NetworkHandler.State.LOADING] state.
|
* This is called in [MessageSvcPushForceOffline], which is in case connection is closed by server during the [NetworkHandler.State.LOADING] state.
|
||||||
*
|
*
|
||||||
|
* This function only marks current initialization work has failed. It has nothing to do with result of login.
|
||||||
|
* To update that result, update `bot.components[SsoProcessor].firstLoginResult`.
|
||||||
|
*
|
||||||
* See [BotInitProcessorImpl.state].
|
* See [BotInitProcessorImpl.state].
|
||||||
*/
|
*/
|
||||||
fun setLoginHalted()
|
fun setLoginHalted()
|
||||||
@ -104,6 +107,7 @@ internal class BotInitProcessorImpl(
|
|||||||
bot.components[SsoProcessor].firstLoginResult.compareAndSet(null, FirstLoginResult.PASSED)
|
bot.components[SsoProcessor].firstLoginResult.compareAndSet(null, FirstLoginResult.PASSED)
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
setLoginHalted()
|
setLoginHalted()
|
||||||
|
bot.components[SsoProcessor].firstLoginResult.compareAndSet(null, FirstLoginResult.OTHER_FAILURE)
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user