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
5eb731e9
Commit
5eb731e9
authored
Feb 15, 2020
by
Him188
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust property names
parent
c434b59f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
32 deletions
+33
-32
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/route/GroupManageRouteModule.kt
.../net/mamoe/mirai/api/http/route/GroupManageRouteModule.kt
+6
-6
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt
...ommonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt
+5
-5
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
+5
-5
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
.../src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
+2
-2
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Group.kt
...re/src/commonMain/kotlin/net.mamoe.mirai/contact/Group.kt
+7
-6
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Permission.kt
...c/commonMain/kotlin/net.mamoe.mirai/contact/Permission.kt
+3
-3
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
...mmonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
+5
-5
No files found.
mirai-api-http/src/main/kotlin/net/mamoe/mirai/api/http/route/GroupManageRouteModule.kt
View file @
5eb731e9
...
...
@@ -19,12 +19,12 @@ fun Application.groupManageModule() {
* 禁言(需要相关权限)
*/
miraiVerify
<
MuteDTO
>(
"/muteAll"
)
{
it
.
session
.
bot
.
getGroup
(
it
.
target
).
m
uteAll
=
true
it
.
session
.
bot
.
getGroup
(
it
.
target
).
isM
uteAll
=
true
call
.
respondStateCode
(
StateCode
.
Success
)
}
miraiVerify
<
MuteDTO
>(
"/unmuteAll"
)
{
it
.
session
.
bot
.
getGroup
(
it
.
target
).
m
uteAll
=
false
it
.
session
.
bot
.
getGroup
(
it
.
target
).
isM
uteAll
=
false
call
.
respondStateCode
(
StateCode
.
Success
)
}
...
...
@@ -65,8 +65,8 @@ fun Application.groupManageModule() {
with
(
dto
.
config
)
{
name
?.
let
{
group
.
name
=
it
}
announcement
?.
let
{
group
.
entranceAnnouncement
=
it
}
confessTalk
?.
let
{
group
.
confessTalk
=
it
}
allowMemberInvite
?.
let
{
group
.
a
llowMemberInvite
=
it
}
confessTalk
?.
let
{
group
.
isConfessTalkEnabled
=
it
}
allowMemberInvite
?.
let
{
group
.
isA
llowMemberInvite
=
it
}
// TODO: 待core接口实现设置可改
// autoApprove?.let { group.autoApprove = it }
// anonymousChat?.let { group.anonymousChat = it }
...
...
@@ -128,8 +128,8 @@ private data class GroupDetailDTO(
val
anonymousChat
:
Boolean
?
=
null
)
:
DTO
{
constructor
(
group
:
Group
)
:
this
(
group
.
name
,
group
.
entranceAnnouncement
,
group
.
confessTalk
,
group
.
a
llowMemberInvite
,
group
.
autoApprove
,
group
.
anonymousChat
group
.
name
,
group
.
entranceAnnouncement
,
group
.
isConfessTalkEnabled
,
group
.
isA
llowMemberInvite
,
group
.
isAutoApproveEnabled
,
group
.
isAnonymousChatEnabled
)
}
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/ContactImpl.kt
View file @
5eb731e9
...
...
@@ -394,7 +394,7 @@ internal class GroupImpl(
}
override
var
a
llowMemberInvite
:
Boolean
override
var
isA
llowMemberInvite
:
Boolean
get
()
=
_allowMemberInvite
set
(
newValue
)
{
this
.
checkBotPermissionOperator
()
...
...
@@ -414,19 +414,19 @@ internal class GroupImpl(
}
}
override
var
autoApprove
:
Boolean
override
var
isAutoApproveEnabled
:
Boolean
get
()
=
_autoApprove
set
(
newValue
)
{
TODO
()
}
override
var
anonymousChat
:
Boolean
override
var
isAnonymousChatEnabled
:
Boolean
get
()
=
_anonymousChat
set
(
newValue
)
{
TODO
()
}
override
var
confessTalk
:
Boolean
override
var
isConfessTalkEnabled
:
Boolean
get
()
=
_confessTalk
set
(
newValue
)
{
this
.
checkBotPermissionOperator
()
...
...
@@ -447,7 +447,7 @@ internal class GroupImpl(
}
override
var
m
uteAll
:
Boolean
override
var
isM
uteAll
:
Boolean
get
()
=
_muteAll
set
(
newValue
)
{
this
.
checkBotPermissionOperator
()
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt
View file @
5eb731e9
...
...
@@ -180,14 +180,14 @@ internal class OnlinePush {
return
if
(
target
==
0L
)
{
if
(
time
==
0
)
{
GroupMuteAllEvent
(
origin
=
group
.
m
uteAll
.
also
{
group
.
_muteAll
=
false
},
origin
=
group
.
isM
uteAll
.
also
{
group
.
_muteAll
=
false
},
new
=
false
,
operator
=
operator
,
group
=
group
)
}
else
{
GroupMuteAllEvent
(
origin
=
group
.
m
uteAll
.
also
{
group
.
_muteAll
=
true
},
origin
=
group
.
isM
uteAll
.
also
{
group
.
_muteAll
=
true
},
new
=
true
,
operator
=
operator
,
group
=
group
...
...
@@ -213,7 +213,7 @@ internal class OnlinePush {
val
operator
=
group
[
this
.
readUInt
().
toLong
()]
val
switch
=
this
.
readInt
()
==
0
return
GroupAllowAnonymousChatEvent
(
origin
=
group
.
anonymousChat
.
also
{
group
.
_anonymousChat
=
switch
},
origin
=
group
.
isAnonymousChatEnabled
.
also
{
group
.
_anonymousChat
=
switch
},
new
=
switch
,
operator
=
operator
,
group
=
group
...
...
@@ -236,7 +236,7 @@ internal class OnlinePush {
when
(
message
)
{
"管理员已关闭群聊坦白说"
->
{
return
GroupAllowConfessTalkEvent
(
origin
=
group
.
confessTalk
.
also
{
group
.
_confessTalk
=
false
},
origin
=
group
.
isConfessTalkEnabled
.
also
{
group
.
_confessTalk
=
false
},
new
=
false
,
group
=
group
,
isByBot
=
false
...
...
@@ -244,7 +244,7 @@ internal class OnlinePush {
}
"管理员已开启群聊坦白说"
->
{
return
GroupAllowConfessTalkEvent
(
origin
=
group
.
confessTalk
.
also
{
group
.
_confessTalk
=
true
},
origin
=
group
.
isConfessTalkEnabled
.
also
{
group
.
_confessTalk
=
true
},
new
=
true
,
group
=
group
,
isByBot
=
false
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Contact.kt
View file @
5eb731e9
...
...
@@ -38,8 +38,8 @@ interface Contact : CoroutineScope {
/**
* 可以是 QQ 号码或者群号码.
*
* 对于
QQ
, `uin` 与 `id` 是相同的意思.
* 对于
Group
, `groupCode` 与 `id` 是相同的意思.
* 对于
[QQ]
, `uin` 与 `id` 是相同的意思.
* 对于
[Group]
, `groupCode` 与 `id` 是相同的意思.
*/
val
id
:
Long
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Group.kt
View file @
5eb731e9
...
...
@@ -46,8 +46,9 @@ interface Group : Contact, CoroutineScope {
* 当前仅能修改状态.
*
* @see GroupMuteAllEvent
*/
// TODO: 2020/2/5 实现 muteAll 的查询
var
muteAll
:
Boolean
* @throws PermissionDeniedException 无权限修改时将会抛出异常
*/
var
isMuteAll
:
Boolean
/**
* 坦白说状态. `true` 为允许.
*
...
...
@@ -56,7 +57,7 @@ interface Group : Contact, CoroutineScope {
* @see GroupAllowConfessTalkEvent
* @throws PermissionDeniedException 无权限修改时将会抛出异常
*/
var
confessTalk
:
Boolean
var
isConfessTalkEnabled
:
Boolean
/**
* 允许群员邀请好友入群的状态. `true` 为允许
*
...
...
@@ -65,15 +66,15 @@ interface Group : Contact, CoroutineScope {
* @see GroupAllowMemberInviteEvent
* @throws PermissionDeniedException 无权限修改时将会抛出异常
*/
var
a
llowMemberInvite
:
Boolean
var
isA
llowMemberInvite
:
Boolean
/**
* 自动加群审批
*/
val
autoApprove
:
Boolean
val
isAutoApproveEnabled
:
Boolean
/**
* 匿名聊天
*/
val
anonymousChat
:
Boolean
val
isAnonymousChatEnabled
:
Boolean
/**
* 同为 groupCode, 用户看到的群号码.
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/contact/Permission.kt
View file @
5eb731e9
...
...
@@ -72,9 +72,9 @@ inline fun Member.isOperator(): Boolean = this.permission.isOperator()
/**
* 权限不足
*/
class
PermissionDeniedException
:
IllegalStateException
{
constructor
()
:
super
(
"Permission denied"
)
constructor
(
message
:
String
?)
:
super
(
message
)
expect
class
PermissionDeniedException
:
IllegalStateException
{
constructor
()
constructor
(
message
:
String
?)
}
@UseExperimental
(
MiraiExperimentalAPI
::
class
)
...
...
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/events/BotEvents.kt
View file @
5eb731e9
...
...
@@ -22,11 +22,11 @@ import net.mamoe.mirai.utils.MiraiExperimentalAPI
@Suppress
(
"unused"
)
class
EventCancelledException
:
RuntimeException
{
constructor
()
:
super
()
constructor
(
message
:
String
?)
:
super
(
message
)
constructor
(
message
:
String
?,
cause
:
Throwable
?)
:
super
(
message
,
cause
)
constructor
(
cause
:
Throwable
?)
:
super
(
cause
)
expect
class
EventCancelledException
:
RuntimeException
{
constructor
()
constructor
(
message
:
String
?)
constructor
(
message
:
String
?,
cause
:
Throwable
?)
constructor
(
cause
:
Throwable
?)
}
// note: 若你使用 IntelliJ IDEA, 按 alt + 7 可打开结构
...
...
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