Commit Graph

3075 Commits

Author SHA1 Message Date
Him188
f0651c81c6
[core+console] Improve logging hierarchy: (#2196)
- always use factory API from mirai-core
- Terminal is still overriding standard outputs
- plugins are forbidden to override logging framework (this was allowed but not working before)
2022-08-27 18:46:16 +08:00
Him188
f4db93745d
[core] Move structureToString from .core.utils.debug to .core.utils
due to compiler bug.
2022-08-27 01:21:14 +08:00
Him188
965ab57aaa
[core] Move StructureToStringTransformer to mirai-core-utils, and use legacy implementation as fallback. close #2097. 2022-08-26 18:42:56 +08:00
Eritque arcus
fea1d28488
[core] Support friend group (#2113)
* feat: support friend group

* remove unnecessary modifications

* toByteArray2

* support friendGroup, with api dump

* support rename, with api dump

* modify as required

* modify as required

* reverse

* doc

* FriendGroups

* api dump

* modify as required

* fix CI

* FriendGroup sync notice

* api dump

* modify as required

* immutable

* add friends: ContactList in FriendGroup

* more sync notice

* modify log content

* Change `FriendGroup.friends` to `Collection<Friend>`

* Fix `FriendGroup.friends.isEmpty()`

* modified as require, untested

* del count and online count in info

* change import

* fix missing import

* set @since 2.13 and modified as required

* modified as required

* modified as required

* doc

* change friendGroupId type to Int?

* api dumped

* change friendGroupId type to Int?

* introduce null to friendGroupId

* modified as required

* chore

* api dump

* chore: remark

* change int? to int

* api dump

* Update mirai-core-api/src/commonMain/kotlin/data/FriendGroups.kt

Co-authored-by: Him188 <Him188@mamoe.net>

* Move FriendGroup and FriendGroups to contact.friendgroup

* Make `Friend.friendGroup` not null

* add FriendGroups.default for default group

* Redesign FriendGroup interface

Co-authored-by: Karlatemp <kar@kasukusakura.com>
Co-authored-by: Him188 <Him188@mamoe.net>
2022-08-26 16:56:09 +08:00
Him188
fb3f39e328 [core] Improve NetworkHandler exception handling and optimize exception logging:
- close #2175
- close #2148
- Fix `Throwable.findCause`
- Rename `mirai.network.handle.selector.logging` to `mirai.network.handler.selector.logging`
- Hide rather long and complicated `CancellationException`s, use `mirai.network.handler.cancellation.trace` to re-enable it
2022-08-26 15:20:04 +08:00
Eritque arcus
b4066ac6d1
NextEventAndIntercept and NextMessageAndIntercept (#2177)
* rewrote pr, no tested

* test and change param position

* enable ci

* finish test

* modified as required

* typo
2022-08-23 18:07:03 +08:00
Him188
648681a2ee
[core] Avoid deserialization error on sending group announcement, helps #2069.
Note this can not actually solve the problem that announcement had failed to send.
2022-08-20 16:15:33 +08:00
Him188
7ff61becee
[core] fix up 2e4cab43: Rename MiraiInternalMessageFlag to SkipEventBroadcast; Do not broadcast pre- and post-message events for FileMessages that sent internally. #2195
full rev: 2e4cab4365
2022-08-16 11:33:56 +08:00
Him188
9dc25bb1f3
[core] fix up previous 2e4cab43: fix omitted change. #2195 2022-08-16 11:33:00 +08:00
Him188
2e4cab4365
[core] Fix sending FileMessage on uploadNewFile (regression in 2.12.0), fix #2195 2022-08-16 10:54:55 +08:00
Him188
39074f1764
[build] Update to Kotlin 1.7.10:
Kotlin 1.7.10
kotlinx-serialization 1.3.3
kotlinx-coroutines 1.6.4
kotlinx-atomicfu 0.17.3
Ktor 2.1.0
2022-08-15 18:36:40 +08:00
Him188
e6bef9ce1e
[core/common] Process packet body in launched coroutines, instead of suspending the processing queue. part of #2160. 2022-08-15 16:41:17 +08:00
微莹·纤绫
a3cb15f13a
[core] Fix forward message seq-id; Fix ordering on iOS (#2191) 2022-08-15 00:44:47 +08:00
Eritque arcus
6b8c054948
[core] Support change friend remark (#2112)
* feat: support ChangeFriendName

* fix: register factory

[skip ci]

* rebase dev

* kdoc?

* api dump

* kdoc

* rebase dev

* remove unnecessary modification

* info::remark -> info.remark

* rebase dev

* api dump

* try to fix CI

* Add `@since` for `Friend.remark` setter

Co-authored-by: Him188 <Him188@mamoe.net>
2022-08-14 10:15:42 +08:00
Karlatemp
ff74129974
[core] Fix cache directory resolving 2022-08-09 21:51:54 +08:00
Karlatemp
c685a77c68
[core] Fix highway uploading 2022-08-09 21:44:50 +08:00
Him188
2df0fc2e4d
[core] change server list logging priority from info to verbose 2022-08-05 01:30:07 +08:00
Him188
0fe0e7afb8
[core] Fix TestFactory checks 2022-08-03 11:48:51 +08:00
Him188
bbd89417ea Add addOtherClient for GroupExtensions for tests, add other clients before running tests for MessageSyncEvent 2022-08-03 11:27:39 +08:00
cssxsh
9db5d2c4b5 Add client properties to MessageSyncEvents, add OtherClientCommandSenderOnMessageSync and MessageSyncEvent.toCommandSender 2022-08-03 11:27:39 +08:00
Him188
7dee5fe6c8
[core/test] Fix AbstractTest.checkTestFactories 2022-07-31 19:39:58 +08:00
Him188
eeb10cc89a
[core] Update docs for implementations 2022-07-31 15:44:48 +08:00
cssxsh
c38740ce2f
在 Image 序列化时支持全部属性 (#2036)
* fix: Image Serializer Delegate

* use: api dump

* add: test Image serialization

* fix: type (SerialName) and deserialize

* fix: native test
2022-07-22 03:05:08 +08:00
Him188
e5cad1d0ba
Rewrite MessageSerializers for new project structure (#2159) 2022-07-20 15:09:09 +08:00
Him188
699718f958 Add multiplatform DynamicTest 2022-07-20 00:30:16 +08:00
Him188
fd67ba9204 Configure shadow relocation and add checks for multiplatform publishing 2022-07-20 00:30:16 +08:00
AdoptOSS
dc747ea438 fix: platform socket on Windows (#2121)
* fix: platform socket on Windows

* fix(workflow): use win platform ssl provider instead of openssl for cURL
openssl can't use system's native CA store by default
2022-07-20 00:30:16 +08:00
Him188
2022074007 Minor docs update for NetworkHandler 2022-07-20 00:30:16 +08:00
AdoptOSS
7325c1f7e2 native: 优化 build script 及 actions,修复 ECDH 相关资源释放问题 (#2110)
* build: fix build on Windows

* test: fix ContentEqualsTest on native

* build: allow disabling targets with property

* fix: free ECDH-related resources properly on native
avoid memory leaking (usually on *nix) or crash (usually on Windows)

Signed-off-by: AdoptOSS <adoptoss@outlook.com>

* build(workflow): remove invalid options

* fix(styling): `mirai.target` property

* build(workflow): try to limit memory usage during mirai-console:tools:gradle-plugin:integTest

* enhance(test): use buildList

* build(workflow): retry

Co-authored-by: ArcticLampyrid <arcticlampyrid@outlook.com>
2022-07-20 00:30:16 +08:00
Him188
afedbdad7b Fix services 2022-07-20 00:30:16 +08:00
Him188
f962618bee Fix compiler warnings 2022-07-20 00:30:16 +08:00
Him188
21c4a5ba04 Use kotlinx-coroutines-test 2022-07-20 00:30:16 +08:00
Him188
e1123e9a96 Move AudioTest to message/data 2022-07-20 00:30:16 +08:00
Him188
0f26dbff5c Add test for test Audio extraData 2022-07-20 00:30:16 +08:00
Him188
cca40b8aa3 Add dummy jvmBase target for IDE 2022-07-20 00:30:16 +08:00
Him188
7dbb1a5ad7 Add RunConfigurations 2022-07-20 00:30:16 +08:00
Him188
fe0a4de368 Produce shared libraries and static libraries 2022-07-20 00:30:16 +08:00
Him188
dab703869f core: Close and join all jobs after each test 2022-07-20 00:30:16 +08:00
Him188
4c6b879873 Upgrade to Ktor 2.0.2, use CIO engine for linux targets; Remove ktor-client-okhttp from mirai-core-api jvmBaseMain
Use Input.readAllText instead of Input.readText, because readText only reads one buffer.
#2084
2022-07-20 00:30:16 +08:00
Him188
7836b2a4b3 Broadcast BotOfflineEvent.Active after state OK -> CLOSED 2022-07-20 00:30:16 +08:00
Him188
c260abb6f3 Cancel TestEventDispatcher jobs after test 2022-07-20 00:30:16 +08:00
Him188
a964f7ee87 Improve core network stability:
Close network and do logout only if networkInitialized

core, network: Guard changing state

core, network: Protect state overriding when setting a state

Always close NetworkHandlerSupport even if CommonNetworkHandler is in CLOSED state
2022-07-20 00:30:16 +08:00
Him188
2f537f90b4 Use different types for TestState 2022-07-20 00:30:16 +08:00
Him188
daf9c4a208 Configure GitHub Actions for native 2022-07-20 00:30:16 +08:00
Him188
21d883b630 Introduce higher performance compression/decompression methods for different purposes for common 2022-07-20 00:30:16 +08:00
Him188
89fa379f8f Add native test entrance 2022-07-20 00:30:16 +08:00
Him188
d27228c8c8 Rewrite MessageSerializers, register serializers in each MessageProtocol, implement for native targets 2022-07-20 00:30:16 +08:00
Him188
13dadd5a95 Implement mirai-core for native 2022-07-20 00:30:16 +08:00
Him188
7088835402 HMPP 2022-07-20 00:30:16 +08:00
Him188
92942c1037 Improve setState stability 2022-07-20 00:30:16 +08:00