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
f4810e1f
Commit
f4810e1f
authored
Feb 09, 2020
by
jiahua.liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MemberList change
parent
f0de474a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
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
+12
-2
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt
...ndroid/network/protocol/packet/chat/receive/OnlinePush.kt
+8
-5
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.kt
View file @
f4810e1f
...
...
@@ -23,7 +23,9 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.proto.SyncCookie
import
net.mamoe.mirai.qqandroid.network.protocol.packet.*
import
net.mamoe.mirai.qqandroid.message.toMessageChain
import
net.mamoe.mirai.qqandroid.message.toRichTextElems
import
net.mamoe.mirai.utils.MiraiDebugAPI
import
net.mamoe.mirai.utils.MiraiInternalAPI
import
net.mamoe.mirai.utils.cryptor.contentToString
import
net.mamoe.mirai.utils.currentTimeSeconds
import
kotlin.math.absoluteValue
import
kotlin.random.Random
...
...
@@ -33,15 +35,19 @@ internal class MessageSvc {
* 告知要刷新好友消息
*/
internal
object
PushNotify
:
IncomingPacketFactory
<
RequestPushNotify
>(
"MessageSvc.PushNotify"
)
{
@MiraiDebugAPI
override
suspend
fun
ByteReadPacket
.
decode
(
bot
:
QQAndroidBot
,
sequenceId
:
Int
):
RequestPushNotify
{
discardExact
(
4
)
// don't remove
return
decodeUniPacket
(
RequestPushNotify
.
serializer
())
}
override
suspend
fun
QQAndroidBot
.
handle
(
packet
:
RequestPushNotify
,
sequenceId
:
Int
):
OutgoingPacket
?
{
network
.
run
{
return
PbGetMsg
(
client
,
MsgSvc
.
SyncFlag
.
START
,
packet
.
stMsgInfo
?.
uMsgTime
?:
currentTimeSeconds
)
return
PbGetMsg
(
client
,
MsgSvc
.
SyncFlag
.
START
,
packet
.
stMsgInfo
?.
uMsgTime
?:
currentTimeSeconds
)
}
}
}
...
...
@@ -120,6 +126,10 @@ internal class MessageSvc {
val
messages
=
resp
.
uinPairMsgs
.
asSequence
().
filterNot
{
it
.
msg
==
null
}.
flatMap
{
it
.
msg
!!
.
asSequence
()
}.
mapNotNull
{
when
(
it
.
msgHead
.
msgType
)
{
33
->
{
println
(
"GroupUin"
+
it
.
msgHead
.
fromUin
+
"新群员"
+
it
.
msgHead
.
authUin
+
" 出现了["
+
it
.
msgHead
.
authNick
+
"] 添加刷新"
)
null
}
166
->
{
when
{
it
.
msgHead
.
fromUin
==
bot
.
uin
->
null
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt
View file @
f4810e1f
...
...
@@ -104,9 +104,9 @@ internal class OnlinePush {
val
groupUin
=
content
.
fromUin
val
target
=
var7
if
(
this
.
readByte
().
toInt
()
==
1
)
{
println
(
"群"
+
groupUin
+
"新增管理员"
+
target
)
println
(
"群
uin
"
+
groupUin
+
"新增管理员"
+
target
)
}
else
{
println
(
"群"
+
groupUin
+
"减少管理员"
+
target
)
println
(
"群
uin
"
+
groupUin
+
"减少管理员"
+
target
)
}
}
}
...
...
@@ -115,8 +115,9 @@ internal class OnlinePush {
if
(
readByte
().
toInt
()
==
1
)
{
val
target
=
readUInt
().
toLong
()
val
groupUin
=
content
.
fromUin
println
(
"群"
+
groupUin
+
"t掉了"
+
target
)
println
(
"群
uin
"
+
groupUin
+
"t掉了"
+
target
)
}
}
}
}
...
...
@@ -193,6 +194,10 @@ internal class OnlinePush {
}
}
}
4352
->
{
println
(
msgInfo
.
contentToString
())
println
(
msgInfo
.
vMsg
.
toUHexString
())
}
else
->
{
println
(
"unknown group internal type $internalType , data: "
+
this
.
readBytes
().
toUHexString
()
+
" "
)
}
...
...
@@ -200,8 +205,6 @@ internal class OnlinePush {
}
else
if
(
msgInfo
.
shMsgType
.
toInt
()
==
528
)
{
val
content
=
msgInfo
.
vMsg
.
loadAs
(
OnlinePushPack
.
MsgType0x210
.
serializer
())
println
(
content
.
contentToString
())
}
else
if
(
msgInfo
.
shMsgType
.
toInt
()
==
4352
)
{
println
(
"4352"
)
}
else
{
println
(
"unknown shtype ${msgInfo.shMsgType.toInt()}"
)
}
...
...
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