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
f3cf0004
Commit
f3cf0004
authored
Apr 11, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix values
parent
b6d91545
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/PbMessageSvc.kt
...ai/qqandroid/network/protocol/packet/chat/PbMessageSvc.kt
+2
-3
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.kt
...ndroid/network/protocol/packet/chat/receive/MessageSvc.kt
+6
-6
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/PbMessageSvc.kt
View file @
f3cf0004
...
...
@@ -20,7 +20,6 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgSvc
import
net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory
import
net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
import
net.mamoe.mirai.qqandroid.utils._miraiContentToString
import
net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf
import
net.mamoe.mirai.qqandroid.utils.io.serialization.toByteArray
import
net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf
...
...
@@ -93,7 +92,7 @@ internal class PbMessageSvc {
fromUin
=
client
.
bot
.
id
,
toUin
=
toUin
,
msgSeq
=
messageSequenceId
,
msgUid
=
1000000000000000000L
or
messageRandom
.
toULong
().
toLong
(
),
msgUid
=
0
x0100000000000000L
or
messageRandom
.
toLong
().
and
(
0
xFFFF_FFFF
),
msgTime
=
time
.
toLong
(),
routingHead
=
MsgSvc
.
RoutingHead
(
grpTmp
=
MsgSvc
.
GrpTmp
(
groupUin
,
toUin
)
...
...
@@ -124,7 +123,7 @@ internal class PbMessageSvc {
fromUin
=
client
.
bot
.
id
,
toUin
=
toUin
,
msgSeq
=
messageSequenceId
,
msgUid
=
1000000000000000000L
or
messageRandom
.
toULong
().
toLong
(
),
msgUid
=
0
x1000000000000000L
or
messageRandom
.
toLong
().
and
(
0
xFFFF_FFFF
),
msgTime
=
time
.
toLong
(),
routingHead
=
MsgSvc
.
RoutingHead
(
c2c
=
MsgSvc
.
C2C
(
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.kt
View file @
f3cf0004
...
...
@@ -49,7 +49,6 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.*
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.GroupInfoImpl
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.NewContact
import
net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList
import
net.mamoe.mirai.qqandroid.utils._miraiContentToString
import
net.mamoe.mirai.qqandroid.utils.io.serialization.decodeUniPacket
import
net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf
import
net.mamoe.mirai.qqandroid.utils.io.serialization.toByteArray
...
...
@@ -132,7 +131,7 @@ internal class MessageSvc {
open
class
Response
(
internal
val
syncFlagFromServer
:
MsgSvc
.
SyncFlag
,
delegate
:
List
<
Packet
>)
:
MultiPacketByIterable
<
Packet
>(
delegate
)
{
override
fun
toString
():
String
=
"MessageSvc.PbGetMsg.Response(
$
syncFlagFromServer=$syncFlagFromServer, messages=<Iterable>))"
"MessageSvc.PbGetMsg.Response(syncFlagFromServer=$syncFlagFromServer, messages=<Iterable>))"
}
object
EmptyResponse
:
GetMsgSuccess
(
emptyList
())
...
...
@@ -370,12 +369,13 @@ internal class MessageSvc {
message
:
MessageChain
,
crossinline
sourceCallback
:
(
MessageSourceToFriendImpl
)
->
Unit
):
OutgoingPacket
{
val
rand
=
Random
.
nextInt
().
absoluteValue
val
source
=
MessageSourceToFriendImpl
(
id
=
Random
.
nextInt
().
absoluteValue
,
id
=
rand
,
sender
=
client
.
bot
,
target
=
qq
,
time
=
currentTimeSeconds
.
toInt
(),
sequenceId
=
client
.
atomicNextMessageSequenceId
()
,
sequenceId
=
rand
,
originalMessage
=
message
)
sourceCallback
(
source
)
...
...
@@ -406,7 +406,7 @@ internal class MessageSvc {
),
msgSeq
=
source
.
sequenceId
,
msgRand
=
source
.
id
,
syncCookie
=
SyncCookie
(
time
=
source
.
time
.
to
ULong
().
to
Long
()).
toByteArray
(
SyncCookie
.
serializer
())
syncCookie
=
SyncCookie
(
time
=
source
.
time
.
toLong
()).
toByteArray
(
SyncCookie
.
serializer
())
// msgVia = 1
)
)
...
...
@@ -454,7 +454,7 @@ internal class MessageSvc {
),
msgSeq
=
source
.
sequenceId
,
msgRand
=
source
.
id
,
syncCookie
=
SyncCookie
(
time
=
source
.
time
.
to
ULong
().
to
Long
()).
toByteArray
(
SyncCookie
.
serializer
())
syncCookie
=
SyncCookie
(
time
=
source
.
time
.
toLong
()).
toByteArray
(
SyncCookie
.
serializer
())
)
)
}
...
...
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