Commit Graph

791 Commits

Author SHA1 Message Date
Him188
164f621427 [build] Fully support Android target; Update to Gradle 8.0 2023-05-02 16:17:48 +01:00
Him188
f469e889d2
[build] Enable atomicfu compiler plugin for mirai-core and mirai-core-api, but disable transformations for JVM, #2315 2023-05-01 11:09:28 +01:00
cssxsh
71e9de3608
[core] 支持获取群公告图片 URL (#2619)
* fix: announcement protocol

* add: api dump
2023-04-13 11:57:04 +01:00
Him188
460275fc0f
[core] Allow using helper to use TxCaptchaHelper in CLI LoginSolver 2023-04-04 21:15:27 +01:00
Him188
8b84bd0aa3
[core] Add 'file://' to file paths in logs in LoginSolver 2023-04-04 21:08:31 +01:00
Karlatemp
893fb3e9f6
[core] Make MessageSource.kind a member not extension 2023-03-29 22:53:11 +08:00
Karlatemp
89fa2f7ffb
[core] Fix private message source target 2023-03-29 22:53:09 +08:00
Karlatemp
ec5870e0b3
[core] Get group incoming message source raw data directly 2023-03-29 22:53:00 +08:00
Karlatemp
e2d7332ac0
[core] Add QRCodeLoginListener.onCompleted 2023-03-27 00:55:54 +08:00
Him188
b9ee2a8931
[core] Commonize BotConfiguration, simplify MPP hierarchy: (#2583)
* [core] Commonize BotConfiguration, simplify MPP hierarchy:

Move platform specific API to `AbstractBotConfiguration`

* Updates docs for AbstractBotConfiguration

* Add @since for AbstractBotConfiguration

* Mark AbstractBotConfiguration as not stable for inheritance
2023-03-21 23:06:27 +00:00
cssxsh
f4fa2cabf4
[core] feat: essence message setting (#2314)
* feat: remove essence message

* feat: Essences

* add: share and remove

* fix: impl

* fix: arguments

* feat: image url to image

* add: doc

* fix: doc

* Copyright: 2023

* remove: method removeEssenceMessage

* feat: lazy load source

* add: no parse

* add: sendAndExpect try

* fix: remove throw

* fix: parse IMAGE_MD5_REGEX
2023-03-21 14:53:23 +00:00
Him188
403380514a
[core] 更新 MiraiProtocol 注释, 注明 ANDROID_WATCH 不支持戳一戳, 删除 ANDROID_PAD 的错误注释 (#2572) 2023-03-21 14:01:46 +00:00
Him188
427c37e649
[build] Update to Kotlin 1.8.10 2023-03-19 03:18:34 +00:00
StageGuard
78d0b4fd54
QRCode login support & Introduce new authorization factory (#2502)
* [core] process `wtlogin.trans_emp` to support qrcode login

* [core] fix `wtlogin.trans_emp` protocol

* [core] optimize QRCodeLoginProcessor logic

* [core] fix `wtlogin.trans_emp` outgoing packet

* [core] cancel login when logging a bot which is inconsistent from bot factory

* [core] ignore `flag3` check on ANDROID_WATCH & name `flag1` and `flag2`

* [core] provide default `QRCodeLoginListener` for jvm

* [core] don't catch IllegalStateException in QRCodeLoginProcessor

* [core] Use `LoginSolver.createQRCodeLoginListener()` instead of property; Rename configuration name

* [core] Code improvement

* [core] remove qrcode state lock

* [core] ignore `flag3` when command is `wtlogin.trans_emp` in packet codec

* [core] enable qrcode login for macos

* [core] remove debug property in log

* [core] reformat code

* [core] rename `TransEmpResponse` to `Response`

* [core] assert `flag3Exception` not null first

* [core] remove arg client

* [core] update qrcode login notes

* [core] set custom qrcode size

* [core] Draft BotAuthorization

* [core] make SecretsProtection mpp

* [core] BotAuthorization.byXXX

* [core] Move QRCodeLoginListener to `.auth`

* [core] Protect data of BotAccount

* [core] Add SelectorRequireReconnectException

* [core] Implementation of BotAuthorization

* Revert changes of BotConfiguration

* api dump

* [core] remove passwordMd5 in `BotAccount`

* [mock] Add new bot factory function to mock bot factory

* Delete LoginCommandTest

* [core] Improve QRCode render

* [core] Introduce UnsupportedCaptchaMethodException & UnsupportedQRCodeCaptchaException

* api dump

* update docs

* [core] update `DebugRunHelper`

* [core] add simple block for BotAuthorization

* api dump

* Rename `canDoQRLogin` to `supportsQRLogin`, and specify argument names for MiraiProtocolInternal

* Remove `phoneNumber` parameter from BotAccount

* Make `BotAccount.<init>` with String password parameter TestOnly

* Rename `InconsistentBotException` to `InconsistentBotIdException`

* Rename `QRCodeLoginListener.onStatusChanged` to `QRCodeLoginListener.onStateChanged`

* Rename `BotAuthorizationResult` to `BotAuthResult`

* Rename BotAuthComponent, move internal APIs to internal module

* Logic fixup

* doc update

* QRCodeLoginListener.qrCodeStateUpdateInterval & onIntervalLoop

* console login with BotAuthorization

* update testing

* Update mirai-core-api/src/jvmMain/kotlin/utils/LoginSolver.jvm.kt

* Move AuthControl outside SsoProcessor

* Redesign auth

* Add initialTicket to producerCoroutine

* Revert protocol changes of MACOS

* Fix latch death locking

* Fix CoroutineOnDemandValueScope.receiveOrNull exceptional finish

* Fix exception collecting

* Fix DefaultBotAuthorizationFactory loading

* [core] qrcode login for IPAD protocol

* Revert "[core] qrcode login for IPAD protocol"

This reverts commit c1136a8798.

---------

Co-authored-by: Karlatemp <kar@kasukusakura.com>
Co-authored-by: Him188 <Him188@mamoe.net>
2023-03-18 13:52:31 +00:00
ヒューマンワーキン
2f154b6807
[core] 增加 TxCaptchaHelper 可用性无法保证的警告 (#2564)
* Update LoginSolver.jvm.kt

* revert
2023-03-10 20:00:23 +00:00
Karlatemp
4d9f6e88f9
[core] Fix polymorphic serialization 2023-02-20 22:09:39 +08:00
Him188
26a3ddd505
[core] Improve docs on queryProfile, close #2460 2023-02-19 11:46:35 +00:00
Him188
aec5e21dda
[core] Fix docs for RoamingMessages 2023-02-11 13:08:47 +00:00
Him188
974be88410
[core] Remove SwingSolver and SeleniumLoginSolver. Always use StandardCharImageLoginSolver on desktop JVM. Close #2410 2023-01-11 21:31:46 +00:00
Him188
f04c623658 [core] Implement a more efficient algorithm to fetch roaming messages for group:
- Added `RoamingMessagesImplGroup`.
- Dump API changes for Group RoamingMessages.
- [mock] Fix MockRoamingMessages missing MessageSource
- [core] Convert hierarchical TimeBasedRoamingMessagesImpl to common, to reduce code complexity
2023-01-05 02:33:27 +00:00
StageGuard
2d0b4d470a [core] Proposal implementation of RoamingSupported for Group 2023-01-05 02:33:27 +00:00
Him188
3c580eead4 [core] Add default implementation for RoamingMessages.getMessagesStream 2023-01-05 02:33:27 +00:00
cssxsh
2cffb7a4a4
[core] feat: RockPaperScissors (#2220)
* [core] feat: RockPaperScissors

Co-authored-by: Karlatemp <kar@kasukusakura.com>

* docs update

* rename `eliminate` to `eliminates`

Co-authored-by: Karlatemp <kar@kasukusakura.com>
2023-01-03 10:00:32 +08:00
微莹·纤绫
553ea9abbc
[core] Introduce CacheValidator for validating caches (#2388)
* [core] Export DeviceInfo.serializer() to mirai-core

* [core] Introduce CacheValidator for validating caches
2023-01-02 15:39:36 +00:00
Him188
6365e23f2c
[core] Change StdoutLogger color for WARNING. Fix #2336.
Commit 28030dfb05 fixed this problem for PlatformLogger
2022-12-27 17:54:34 +00:00
Him188
7908edb57b
[core+console] Raise deprecation level for 2.14, API including:
- EventChannel.asChannel
- (internal) syncFromEventImpl
- EmptyMessageChain
- GroupEntranceAnnouncementChangeEvent
- MiraiConsole.createLogger
- SingletonExtensionPoint
2022-12-27 15:53:12 +00:00
Him188
76a70f596f
[core] Raise deprecation level for RemoteFile to ERROR (for v2.14) 2022-12-27 14:34:41 +00:00
Him188
6fc1482f69
[core] Relocate ktor-io in mirai-core-api. Fix #2381 2022-12-04 14:49:47 +00:00
ヒューマンワーキン
5a645b4e8e
修正 'contentToString` 注释不严谨处 (#2374)
* 修正 'contentToString` 注释不严谨处

* link `At`
2022-12-03 14:55:21 +00:00
Him188
28f198d03f
[core] Add QiaoMen to PokeMessage.values. Fix poke id of QiaoMen. Close #2170. 2022-11-27 20:20:45 +00:00
Him188
60bbcf6e2c
[core] Revert "Review atomic calls and enable atomicfu compiler. Close #2315", due to atomicfu does not behave correctly when mirai-console depends on mirai-core-utils. Fixes #2329.
This commit reverts part of commit 564a7ce8f8
2022-11-27 20:08:21 +00:00
Him188
3360347ca2 [build] Fix dependency exclusion for builds when IDEA_ACTIVE 2022-11-27 15:25:18 +00:00
Him188
c0ccdbe9d3 [build] Rewrite shadow relocation 2022-11-27 15:25:18 +00:00
Karlatemp
28030dfb05
[core] [logging] Change message color of WARNING & ERROR; fix #2336 2022-11-09 22:57:10 +08:00
cssxsh
1c79da0f38
[core] feat: Announcement confirmed member api (#2255)
* feat: Announcement confirmed

* add: native

* add: todo

* fix: dump
2022-11-03 10:42:21 +00:00
微莹·纤绫
4abb3e3703
[core] Introduce Flow<T>.toStream() for simply implement Streamable (#2259)
* [core] Introduce `Flow<T>.toStream()` for simply implement `Streamable`

* Drop `unintercepted` support

* fix ci

* update test
2022-10-31 13:09:58 +00:00
Him188
e47b205e0d
[core] Fix docs of examples on ExternalResource 2022-10-31 10:53:10 +00:00
Him188
9613c9b7e5
[core] Add more information on LIMITED_MESSAGING 2022-10-31 10:44:13 +00:00
Him188
573f08955c
[core] Show specific reason for error 46 while sending message. Close #2127 2022-10-31 10:41:06 +00:00
Him188
c59de206cb
[core] Add default implementation of deprecated LoginSolver.onSolveUnsafeDeviceLoginVerify 2022-10-31 09:58:28 +00:00
Him188
564a7ce8f8
[core] Review atomic calls and enable atomicfu compiler. Close #2315 2022-10-29 13:04:37 +01:00
cssxsh
9818c08054
[core] Add sign event (#2217)
* add: SignEvent

* add: SignEvent

* add: hasRank

* add: api dump

* add: toString

* add: toString

* fix: sign for review
2022-10-29 11:11:20 +01:00
Him188
36cd688382
[core] Improve documentation for Group files 2022-10-28 14:42:28 +01:00
Him188
25e66d19c7
[core] Filter out relocated ktor dependencies in runtime except for mirai-core-utils and mirai-core-all. Fix #2291 2022-10-21 16:09:27 +01:00
Him188
eab14647e1
[core] Fix ArrayIndexOutOfBoundsException when loading device infos generated by < 2.9.0. Fix #2280 2022-10-19 16:19:34 +01:00
Him188
4595f937e4
[core] Add MessageChain.deserializeFromMiraiCode without redundant receiver MessageChain. 2022-10-14 16:00:31 +01:00
Him188
73293251d1
[core] Improve docs for messages 2022-10-13 15:35:34 +01:00
Him188
3b5ced4328
[core] Improve exception thrown by MessageChain.recall and .recallIn: add tips 2022-10-13 15:35:24 +01:00
Him188
16609fb1e0
[core] Introduce Streamable for simplified multiplatform asFlow a… (#2256)
* [core] Introduce `Streamable` for simplified multiplatform `asFlow` and `asStream`. Make `Announcements.asFlow` not suspend.

* Remove `@JvmBlockingBridge` in native
2022-09-25 23:44:18 +08:00
Him188
d1273401f6
[core] Remove dependency kotlinx-coroutines-jdk8 from mirai-core-api 2022-09-23 21:38:07 +08:00