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
4b26d4d2
Commit
4b26d4d2
authored
Jul 09, 2020
by
mzdluo123
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
fab03780
181f4a53
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
89 additions
and
62 deletions
+89
-62
CHANGELOG.md
CHANGELOG.md
+20
-0
buildSrc/src/main/kotlin/Versions.kt
buildSrc/src/main/kotlin/Versions.kt
+1
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/NewContact.kt
...irai/qqandroid/network/protocol/packet/chat/NewContact.kt
+11
-13
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbGetMsg.kt
...twork/protocol/packet/chat/receive/MessageSvc.PbGetMsg.kt
+15
-0
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt
...etwork/protocol/packet/chat/receive/OnlinePush.ReqPush.kt
+3
-1
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/ConfigPushSvc.kt
.../qqandroid/network/protocol/packet/login/ConfigPushSvc.kt
+15
-16
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/BotConfiguration.common.kt
...n/kotlin/net.mamoe.mirai/utils/BotConfiguration.common.kt
+4
-6
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/BotConfiguration.kt
.../jvmMain/kotlin/net/mamoe/mirai/utils/BotConfiguration.kt
+1
-6
mirai-core/src/jvmTest/kotlin/net/mamoe/mirai/event/JvmMethodEventsTest.kt
...mTest/kotlin/net/mamoe/mirai/event/JvmMethodEventsTest.kt
+19
-19
No files found.
CHANGELOG.md
View file @
4b26d4d2
# Version 1.x
# Version 1.x
## `1.1.0` 2020/7/9
-
支持 Android 手表协议 (
`BotConfiguration.MiraiProtocol.ANDROID_PAD`
)
-
`EventHandler`
现在支持
`Nothing`
类型.
-
修复无需同意直接进群时,在加载新群信息完成前收到消息过早处理的问题 (#370)
-
修复在某些情况下,管理员邀请群Bot加群会被误判为群成员申请加群的问题 (#402 by
[
@kenvix
](
https://github.com/kenvix
)
)
-
修复从其他客户端加群时未同步的问题 (#404, #410)
-
修复
`ConfigPushSvc.PushReq`
解析失败的问题 (#417)
-
修复
`_lowLevelGetGroupActiveData`
-
修复
`SimpleListenerHost.coroutineScope`
潜在的 Job 被覆盖的问题
## `1.0.4` 2020/7/2
-
修复上传图片失败时内存泄露的问题 (#385)
-
修复大量图片同时上传时出错的问题 (#387)
-
修复在一些情况下 BotOfflineEvent 没有正常处理而无法继续接收消息的问题 (#376)
-
修复 Bot 在某个群 T 出某个人导致 Bot 终止的问题 (#372)
-
修复
`@PlannedRemoval`
的文档
## `1.1-EA2` 2020/7/2
## `1.1-EA2` 2020/7/2
-
添加
`BotConfiguration.json`
, 作为序列化时使用的 Json format, 修复潜在的因 kotlinx.serialization 进行不兼容更新而导致的不兼容.
-
添加
`BotConfiguration.json`
, 作为序列化时使用的 Json format, 修复潜在的因 kotlinx.serialization 进行不兼容更新而导致的不兼容.
...
@@ -11,6 +28,9 @@
...
@@ -11,6 +28,9 @@
-
(
[
1.0.4
](
https://github.com/mamoe/mirai/releases/tag/1.0.4
)
中修复的问题)
-
(
[
1.0.4
](
https://github.com/mamoe/mirai/releases/tag/1.0.4
)
中修复的问题)
-
(
[
1.0.3
](
https://github.com/mamoe/mirai/releases/tag/1.0.3
)
中修复的问题)
-
(
[
1.0.3
](
https://github.com/mamoe/mirai/releases/tag/1.0.3
)
中修复的问题)
## `1.0.3` 2020/6/29
-
修复 friendlist.GetTroopListReqV2:java.lang.IllegalStateException: type mismatch 10 (#405)
## `1.1-EA` 2020/6/16
## `1.1-EA` 2020/6/16
**主要**
:
**主要**
:
...
...
buildSrc/src/main/kotlin/Versions.kt
View file @
4b26d4d2
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
object
Versions
{
object
Versions
{
object
Mirai
{
object
Mirai
{
const
val
version
=
"1.1
-EA2
"
const
val
version
=
"1.1
.0
"
}
}
object
Kotlin
{
object
Kotlin
{
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/NewContact.kt
View file @
4b26d4d2
...
@@ -148,22 +148,22 @@ internal class NewContact {
...
@@ -148,22 +148,22 @@ internal class NewContact {
return
struct
?.
msg
?.
run
{
return
struct
?.
msg
?.
run
{
//this.soutv("SystemMsg")
//this.soutv("SystemMsg")
when
(
subType
)
{
when
(
subType
)
{
1
->
{
//
管理员邀
请
1
->
{
//
处理被邀请入群 或 处理成员入群申
请
when
(
c2cInviteJoinGroupFlag
)
{
when
(
groupMsgType
)
{
1
->
{
1
->
{
// 被邀请入群
BotInvitedJoinGroupRequestEvent
(
bot
,
struct
.
msgSeq
,
actionUin
,
groupCode
,
groupName
,
actionUinNick
)
}
0
->
{
// 成员申请入群
// 成员申请入群
MemberJoinRequestEvent
(
MemberJoinRequestEvent
(
bot
,
struct
.
msgSeq
,
msgAdditional
,
bot
,
struct
.
msgSeq
,
msgAdditional
,
struct
.
reqUin
,
groupCode
,
groupName
,
reqUinNick
struct
.
reqUin
,
groupCode
,
groupName
,
reqUinNick
)
)
}
}
2
->
{
// 被邀请入群
BotInvitedJoinGroupRequestEvent
(
bot
,
struct
.
msgSeq
,
actionUin
,
groupCode
,
groupName
,
actionUinNick
)
}
else
->
throw
contextualBugReportException
(
else
->
throw
contextualBugReportException
(
"parse SystemMsgNewGroup, subType=1"
,
"parse SystemMsgNewGroup, subType=1"
,
this
.
_miraiContentToString
(),
this
.
_miraiContentToString
(),
...
@@ -171,16 +171,14 @@ internal class NewContact {
...
@@ -171,16 +171,14 @@ internal class NewContact {
)
)
}
}
}
}
2
->
{
2
->
{
// 被邀请入群, 自动同意, 不需处理
// 被邀请入群, 自动同意
val
group
=
bot
.
getNewGroup
(
groupCode
)
?:
return
null
val
group
=
bot
.
getNewGroup
(
groupCode
)
?:
return
null
val
invitor
=
group
[
actionUin
]
val
invitor
=
group
[
actionUin
]
BotJoinGroupEvent
.
Invite
(
invitor
)
BotJoinGroupEvent
.
Invite
(
invitor
)
}
}
3
->
{
3
->
{
// 已被请他管理员处理
// 已被请他管理员处理
null
null
}
}
5
->
{
5
->
{
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbGetMsg.kt
View file @
4b26d4d2
...
@@ -44,6 +44,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
...
@@ -44,6 +44,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
import
net.mamoe.mirai.qqandroid.network.protocol.packet.chat.GroupInfoImpl
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.chat.NewContact
import
net.mamoe.mirai.qqandroid.network.protocol.packet.list.FriendList
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.readProtoBuf
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.toByteArray
import
net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf
import
net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf
...
@@ -190,6 +191,20 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
...
@@ -190,6 +191,20 @@ internal object MessageSvcPbGetMsg : OutgoingPacketFactory<MessageSvcPbGetMsg.Re
34
->
{
// 与 33 重复
34
->
{
// 与 33 重复
return
@
mapNotNull
null
return
@
mapNotNull
null
}
}
85
->
bot
.
groupListModifyLock
.
withLock
{
// 其他客户端入群
val
group
=
bot
.
getGroupByUinOrNull
(
msg
.
msgHead
.
fromUin
)
if
(
msg
.
msgHead
.
toUin
==
bot
.
id
&&
group
==
null
)
{
val
newGroup
=
bot
.
getNewGroup
(
Group
.
calculateGroupCodeByGroupUin
(
msg
.
msgHead
.
fromUin
))
?:
return
@
mapNotNull
null
bot
.
groups
.
delegate
.
addLast
(
newGroup
)
return
@
mapNotNull
BotJoinGroupEvent
.
Active
(
newGroup
)
}
else
{
// unknown
return
@
mapNotNull
null
}
}
/*
/*
34 -> { // 主动入群
34 -> { // 主动入群
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt
View file @
4b26d4d2
...
@@ -81,7 +81,9 @@ internal object OnlinePushReqPush : IncomingPacketFactory<OnlinePushReqPush.ReqP
...
@@ -81,7 +81,9 @@ internal object OnlinePushReqPush : IncomingPacketFactory<OnlinePushReqPush.ReqP
val
packets
:
Sequence
<
Packet
>
=
reqPushMsg
.
vMsgInfos
.
deco
(
bot
.
client
)
{
msgInfo
->
val
packets
:
Sequence
<
Packet
>
=
reqPushMsg
.
vMsgInfos
.
deco
(
bot
.
client
)
{
msgInfo
->
when
(
msgInfo
.
shMsgType
.
toInt
())
{
when
(
msgInfo
.
shMsgType
.
toInt
())
{
732
->
{
732
->
{
val
group
=
bot
.
getGroup
(
readUInt
().
toLong
())
val
group
=
bot
.
getGroupOrNull
(
readUInt
().
toLong
())
?:
return
@
deco
emptySequence
()
// group has not been initialized
GroupImpl
.
checkIsInstance
(
group
)
GroupImpl
.
checkIsInstance
(
group
)
val
internalType
=
readByte
().
toInt
()
val
internalType
=
readByte
().
toInt
()
...
...
mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/login/ConfigPushSvc.kt
View file @
4b26d4d2
This diff is collapsed.
Click to expand it.
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/BotConfiguration.common.kt
View file @
4b26d4d2
...
@@ -52,26 +52,24 @@ expect open class BotConfiguration() : BotConfigurationBase {
...
@@ -52,26 +52,24 @@ expect open class BotConfiguration() : BotConfigurationBase {
@ConfigurationDsl
@ConfigurationDsl
fun
randomDeviceInfo
()
fun
randomDeviceInfo
()
/**
* 协议类型, 服务器仅允许使用不同协议同时登录.
*/
enum
class
MiraiProtocol
{
enum
class
MiraiProtocol
{
/**
/**
* Android 手机.
* Android 手机.
*
* - 与手机冲突
* - 与平板和电脑不冲突
*/
*/
ANDROID_PHONE
,
ANDROID_PHONE
,
/**
/**
* Android 平板.
* Android 平板.
*
* - 与平板冲突
* - 与手机和电脑不冲突
*/
*/
ANDROID_PAD
,
ANDROID_PAD
,
/**
/**
* Android 手表.
* Android 手表.
* */
* */
@SinceMirai
(
"1.1.0"
)
ANDROID_WATCH
;
ANDROID_WATCH
;
...
...
mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/utils/BotConfiguration.kt
View file @
4b26d4d2
...
@@ -134,23 +134,18 @@ actual open class BotConfiguration : BotConfigurationBase() { // open for Java
...
@@ -134,23 +134,18 @@ actual open class BotConfiguration : BotConfigurationBase() { // open for Java
)
{
)
{
/**
/**
* Android 手机.
* Android 手机.
*
* - 与手机冲突
* - 与平板和电脑不冲突
*/
*/
ANDROID_PHONE
(
537062845
),
ANDROID_PHONE
(
537062845
),
/**
/**
* Android 平板.
* Android 平板.
*
* - 与平板冲突
* - 与手机和电脑不冲突
*/
*/
ANDROID_PAD
(
537062409
),
ANDROID_PAD
(
537062409
),
/**
/**
* Android 手表.
* Android 手表.
* */
* */
@SinceMirai
(
"1.1.0"
)
ANDROID_WATCH
(
537061176
)
ANDROID_WATCH
(
537061176
)
}
}
...
...
mirai-core/src/jvmTest/kotlin/net/mamoe/mirai/event/JvmMethodEventsTest.kt
View file @
4b26d4d2
...
@@ -11,12 +11,12 @@
...
@@ -11,12 +11,12 @@
package
net.mamoe.mirai.event
package
net.mamoe.mirai.event
import
junit.framework.TestCase.assertEquals
import
kotlinx.coroutines.CoroutineScope
import
kotlinx.coroutines.CoroutineScope
import
net.mamoe.mirai.utils.internal.runBlocking
import
net.mamoe.mirai.utils.internal.runBlocking
import
org.junit.Test
import
org.junit.Test
import
java.util.concurrent.atomic.AtomicInteger
import
java.util.concurrent.atomic.AtomicInteger
import
kotlin.coroutines.EmptyCoroutineContext
import
kotlin.coroutines.EmptyCoroutineContext
import
kotlin.test.assertEquals
internal
class
JvmMethodEventsTest
{
internal
class
JvmMethodEventsTest
{
...
@@ -88,15 +88,15 @@ internal class JvmMethodEventsTest {
...
@@ -88,15 +88,15 @@ internal class JvmMethodEventsTest {
}
}
}
}
TestClass
().
run
{
//
TestClass().run {
this
.
registerEvents
()
//
this.registerEvents()
//
runBlocking
{
//
runBlocking {
TestEvent
().
broadcast
()
//
TestEvent().broadcast()
}
//
}
//
assertEquals
(
9
,
this
.
getCalled
())
//
assertEquals(9, this.getCalled())
}
//
}
}
}
@Test
@Test
...
@@ -121,14 +121,14 @@ internal class JvmMethodEventsTest {
...
@@ -121,14 +121,14 @@ internal class JvmMethodEventsTest {
}
}
}
}
TestClass
().
run
{
//
TestClass().run {
this
.
registerEvents
()
//
this.registerEvents()
//
runBlocking
{
//
runBlocking {
TestEvent
().
broadcast
()
//
TestEvent().broadcast()
}
//
}
//
assertEquals
(
1
,
this
.
getCalled
())
//
assertEquals(1, this.getCalled())
}
//
}
}
}
}
}
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