Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
Mirai
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Mirai
Commits
f653f33a
Commit
f653f33a
authored
May 28, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve stability, returns -1 for sequenceId when failed to fetch from server
parent
a084eac8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/outgoingSourceImpl.kt
...n/net/mamoe/mirai/qqandroid/message/outgoingSourceImpl.kt
+2
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
...Main/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
+1
-1
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/outgoingSourceImpl.kt
View file @
f653f33a
...
...
@@ -128,8 +128,8 @@ internal class MessageSourceToGroupImpl(
@OptIn
(
ExperimentalCoroutinesApi
::
class
)
override
val
sequenceId
:
Int
get
()
=
when
{
sequenceIdDeferred
.
isCompleted
->
sequenceIdDeferred
.
getCompleted
()
?:
0
!
sequenceIdDeferred
.
isActive
->
0
sequenceIdDeferred
.
isCompleted
->
sequenceIdDeferred
.
getCompleted
()
?:
-
1
!
sequenceIdDeferred
.
isActive
->
-
1
else
->
error
(
"sequenceId not yet available"
)
}
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/message/data/MessageSource.kt
View file @
f653f33a
...
...
@@ -76,7 +76,7 @@ sealed class MessageSource : Message, MessageMetadata, ConstrainSingle<MessageSo
abstract
val
bot
:
Bot
/**
* 消息 id (序列号).
* 消息 id (序列号).
在获取失败时 (概率很低) 为 `-1`.
**
* #### 值域
* 值的范围约为 [UShort] 的范围.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment