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
b30c3806
Commit
b30c3806
authored
Apr 15, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #226
parent
77a0ba6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/contact/GroupImpl.kt
...ain/kotlin/net/mamoe/mirai/qqandroid/contact/GroupImpl.kt
+1
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/contact/MemberImpl.kt
...in/kotlin/net/mamoe/mirai/qqandroid/contact/MemberImpl.kt
+2
-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
+11
-10
No files found.
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/contact/GroupImpl.kt
View file @
b30c3806
...
...
@@ -331,7 +331,7 @@ internal class GroupImpl(
}.
sendAndExpect
()
if
(
response
is
MessageSvc
.
PbSendMsg
.
Response
.
Failed
)
{
when
(
response
.
resultType
)
{
120
->
error
(
"bot is being muted."
)
120
->
throw
BotIsBeingMutedException
(
this
@GroupImpl
)
34
->
{
kotlin
.
runCatching
{
// allow retry once
return
bot
.
lowLevelSendLongGroupMessage
(
id
,
msg
)
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/contact/MemberImpl.kt
View file @
b30c3806
...
...
@@ -105,8 +105,8 @@ internal class MemberImpl constructor(
@Suppress
(
"PropertyName"
)
var
_muteTimestamp
:
Int
=
memberInfo
.
muteTimestamp
override
val
muteTimeRemaining
:
Int
=
if
(
_muteTimestamp
==
0
||
_muteTimestamp
==
0
xFFFFFFFF
.
toInt
())
{
override
val
muteTimeRemaining
:
Int
get
()
=
if
(
_muteTimestamp
==
0
||
_muteTimestamp
==
0
xFFFFFFFF
.
toInt
())
{
0
}
else
{
(
_muteTimestamp
-
currentTimeSeconds
.
toInt
()).
coerceAtLeast
(
0
)
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt
View file @
b30c3806
...
...
@@ -261,10 +261,10 @@ internal class OnlinePush {
readUInt
().
toLong
()
// time
this
.
discardExact
(
2
)
val
target
=
readUInt
().
toLong
()
val
time
=
readInt
()
val
time
Seconds
=
readInt
()
if
(
target
==
0L
)
{
val
new
=
time
!=
0
val
new
=
time
Seconds
!=
0
if
(
group
.
settings
.
isMuteAll
==
new
)
{
return
@
lambda732
emptySequence
()
}
...
...
@@ -274,14 +274,15 @@ internal class OnlinePush {
if
(
target
==
bot
.
id
)
{
return
@
lambda732
when
{
group
.
botMuteRemaining
==
time
->
emptySequence
()
time
==
0
->
{
group
.
botMuteRemaining
==
time
Seconds
->
emptySequence
()
time
Seconds
==
0
||
timeSeconds
==
0
xFFFF_FFFF
.
toInt
()
->
{
group
.
botAsMember
.
checkIsMemberImpl
().
_muteTimestamp
=
0
sequenceOf
(
BotUnmuteEvent
(
operator
))
}
else
->
{
group
.
botAsMember
.
checkIsMemberImpl
().
_muteTimestamp
=
currentTimeSeconds
.
toInt
()
+
time
sequenceOf
(
BotMuteEvent
(
time
,
operator
))
group
.
botAsMember
.
checkIsMemberImpl
().
_muteTimestamp
=
currentTimeSeconds
.
toInt
()
+
timeSeconds
sequenceOf
(
BotMuteEvent
(
timeSeconds
,
operator
))
}
}
}
...
...
@@ -289,13 +290,13 @@ internal class OnlinePush {
val
member
=
group
.
getOrNull
(
target
)
?:
return
@
lambda732
emptySequence
()
member
.
checkIsMemberImpl
()
if
(
member
.
_muteTimestamp
==
time
)
{
if
(
member
.
_muteTimestamp
==
time
Seconds
)
{
return
@
lambda732
emptySequence
()
}
member
.
_muteTimestamp
=
time
return
@
lambda732
if
(
time
==
0
)
sequenceOf
(
MemberUnmuteEvent
(
member
,
operator
))
else
sequenceOf
(
MemberMuteEvent
(
member
,
time
,
operator
))
member
.
_muteTimestamp
=
time
Seconds
return
@
lambda732
if
(
time
Seconds
==
0
)
sequenceOf
(
MemberUnmuteEvent
(
member
,
operator
))
else
sequenceOf
(
MemberMuteEvent
(
member
,
time
Seconds
,
operator
))
},
// anonymous
...
...
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