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
fbe5f14a
Commit
fbe5f14a
authored
Feb 12, 2020
by
Him188
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
f91a44ba
e072c5b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
22 deletions
+21
-22
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
+19
-12
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
...mmonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
+2
-10
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt
View file @
fbe5f14a
...
@@ -129,11 +129,12 @@ internal class OnlinePush {
...
@@ -129,11 +129,12 @@ internal class OnlinePush {
val
target
=
readUInt
().
toLong
()
val
target
=
readUInt
().
toLong
()
val
groupUin
=
content
.
fromUin
val
groupUin
=
content
.
fromUin
val
member
=
bot
.
getGroupByUin
(
groupUin
)[
target
]
as
MemberImpl
bot
.
getGroupByUin
(
groupUin
).
let
{
val
member
=
it
[
target
]
as
MemberImpl
return
MemberLeaveEvent
.
Kick
(
member
,
TODO
(
"踢出时获取管理员"
))
this
.
discardExact
(
1
)
return
MemberLeaveEvent
.
Kick
(
member
,
it
.
members
[
readUInt
().
toLong
()])
}
}
}
}
}
}
}
}
}
...
@@ -193,27 +194,33 @@ internal class OnlinePush {
...
@@ -193,27 +194,33 @@ internal class OnlinePush {
4096
->
{
4096
->
{
val
dataBytes
=
this
.
readBytes
(
26
)
val
dataBytes
=
this
.
readBytes
(
26
)
val
message
=
this
.
readString
(
this
.
readByte
().
toInt
())
val
message
=
this
.
readString
(
this
.
readByte
().
toInt
())
println
(
dataBytes
.
toUHexString
())
TODO
(
"读取操作人"
)
/*
return
if
(
dataBytes
[
0
].
toInt
()
!=
59
)
{
return
if
(
dataBytes
[
0
].
toInt
()
!=
59
)
{
GroupNameChangeEvent(origin = group.name, new =
)
return
GroupNameChangeEvent
(
origin
=
group
.
name
,
new
=
message
,
group
=
group
)
}
else
{
}
else
{
println(message + ":" + dataBytes.toUHexString())
//
println(message + ":" + dataBytes.toUHexString())
when
(
message
)
{
when
(
message
)
{
"管理员已关闭群聊坦白说"
->
{
"管理员已关闭群聊坦白说"
->
{
GroupAllowConfessTalkEvent(group.confessTalk, false, ope)
return
GroupAllowConfessTalkEvent
(
origin
=
group
.
confessTalk
,
new
=
false
,
group
=
group
)
}
}
"管理员已开启群聊坦白说"
->
{
"管理员已开启群聊坦白说"
->
{
return
GroupAllowConfessTalkEvent
(
origin
=
group
.
confessTalk
,
new
=
false
,
group
=
group
)
}
}
else
->
{
else
->
{
println
(
"Unknown server messages $message"
)
println
(
"Unknown server messages $message"
)
return
NoPacket
}
}
}
}
}
}
*/
}
}
4352
->
{
4352
->
{
println
(
msgInfo
.
contentToString
())
println
(
msgInfo
.
contentToString
())
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
View file @
fbe5f14a
...
@@ -138,11 +138,7 @@ interface GroupSettingChangeEvent<T> : GroupEvent, BotPassiveEvent {
...
@@ -138,11 +138,7 @@ interface GroupSettingChangeEvent<T> : GroupEvent, BotPassiveEvent {
data class
GroupNameChangeEvent
(
data class
GroupNameChangeEvent
(
override
val
origin
:
String
,
override
val
origin
:
String
,
override
val
new
:
String
,
override
val
new
:
String
,
override
val
group
:
Group
,
override
val
group
:
Group
/**
* 操作人. 为 null 时则是机器人操作
*/
val
operator
:
Member
?
)
:
GroupSettingChangeEvent
<
String
>,
Packet
)
:
GroupSettingChangeEvent
<
String
>,
Packet
/**
/**
...
@@ -191,11 +187,7 @@ data class GroupAllowAnonymousChatEvent(
...
@@ -191,11 +187,7 @@ data class GroupAllowAnonymousChatEvent(
data class
GroupAllowConfessTalkEvent
(
data class
GroupAllowConfessTalkEvent
(
override
val
origin
:
Boolean
,
override
val
origin
:
Boolean
,
override
val
new
:
Boolean
,
override
val
new
:
Boolean
,
override
val
group
:
Group
,
override
val
group
:
Group
/**
* 操作人. 为 null 时则是机器人操作
*/
val
operator
:
Member
?
)
:
GroupSettingChangeEvent
<
Boolean
>,
Packet
)
:
GroupSettingChangeEvent
<
Boolean
>,
Packet
/**
/**
...
...
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