Commit Graph

33 Commits

Author SHA1 Message Date
Karlatemp
9c77c22b32
[core] Mock private message source implementation 2023-03-29 22:53:10 +08:00
Eritque arcus
1a8af784dc
[mock] fix mockHonorMember (#2473)
* fix mirai-core-mock honorMember

* add comments

* manually fetch honor data

* update implement

* remove deprecated

* chore: update test cases

* improve style
2023-03-29 15:29:54 +01:00
Eritque arcus
48db1a022f
[Mock] Support image isUploaded (#2582)
* finish image mock isUploaded

* typo

* move MockService register

* update implement

* chore: format

* suppress remove redundant qualifier name

* format
2023-03-25 14:46:58 +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
43b5e710ef
[mock] Fix mockUploadAudio always throws ISE, part of #2548 2023-03-19 12:28:35 +00:00
Him188
db3a0ad24a
[mock] Filter files for MockAbsoluteFolder.resolveFiles, part of #2548 2023-03-19 12:24:06 +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
Karlatemp
3ba53ee4c2
[mock] Update tests 2023-02-20 22:09:43 +08:00
Eritque arcus
cc22174e64
[mock] add size into MockImage (#2515) 2023-02-18 20:32:21 +00:00
Eritque arcus
0a7ebb7b4a
add implement of md5 and sha1 for MockAbsoluteFile (#2436)
* add impl of md5 and sha1

* add tests

* modify as required
2023-01-18 17:42:56 +08:00
Eritque arcus
56dea84336
[mock] Fix message recalling (#2421)
* Fix message recalling

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

* Message recalling tests

Co-authored-by: Karlatemp <kar@kasukusakura.com>
2023-01-18 17:39:40 +08:00
Eritque arcus
aa84e6d337
fix MockNormalMember modify admin (#2420)
* fix MockNormalMember modify admin (untested)

* modify as required

* fix changeOwner (tested)

* update test

* update tests
2023-01-17 13:12:31 +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
479fa773f5
[mock] Do not broadcast GroupEntranceAnnouncementChangeEvent because mirai-core does not do so.
This commit fixes 7908edb57b
2022-12-27 17:50:06 +00:00
Him188
bc6032f2e4
[mock] Suppress deprecation error for GroupEntranceAnnouncementChangeEvent in MockAnnouncementsImpl.mockPublish.
This commit fixes 7908edb57b
2022-12-27 17:44:00 +00:00
Him188
76a70f596f
[core] Raise deprecation level for RemoteFile to ERROR (for v2.14) 2022-12-27 14:34:41 +00:00
Karlatemp
d720a9f315
[mock] Fix a bad logic 2022-12-24 23:38:01 +08:00
Karlatemp
c957d008fb
[mock] Fix image multi-uploading; fix #2401 2022-12-24 23:29:46 +08:00
Karlatemp
ca840f88be
[mock] Create task :mirai-core-mock:buildRuntimeClasspath 2022-11-25 23:49:34 +08:00
Karlatemp
0ddf1e85fc
[core/mock] Introduce AvatarGenerator 2022-11-22 13:02:28 +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
Him188
1f8524fb04
Fix all compiler warnings throughout the project 2022-10-21 17:00:37 +01:00
Him188
c1f7149aa7
[mock] Add OtherClient parameter to broadcastMsgSyncEvent 2022-10-21 16:26:58 +01:00
Karlatemp
dc6f590581
[mock] Fix building
- caused by 5ed9dc7e
2022-10-13 00:27:55 +08:00
Karlatemp
cae7b1161c
[mock] Unified contacts data 2022-10-03 12:40:56 +08:00
Karlatemp
495542d2a2
[mock] Fix modules plus-ing 2022-10-03 12:40:56 +08: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
cssxsh
d000f2ea0f
[core] add group level api (#2115)
* add: api dump

* feat: Member.level

* add: api dump

* rename: level to rank

* feat: rank show

* feat: honor flag

* fix: honor flag index

* feat: record and chart

* feat: flag and docs

* add: api dump

* fix: active

* fix: honor

* fix: active

* fix: rebase

* fix: docs

* feat: MemberActive

* fix: for review

* feat: other notification

* remove: low level api

* add: since and api dump

* add: since

* for: review

* add: event sync

* fix: name and docs

* fix: api dump

* fix: for review

* add: ActiveRank, MemberMedal close #2233

* fix: active for review

* improve public API for inlined GroupHonorType

* Change `@since 2.13.0` to `@since 2.13`

* dump api changes

* implement mock framework for Active

* change `GroupActive.flush` to `GroupActive.refresh`

* improve docs for GroupActive

* remove unnecessary expect/actual for MemberActive

* change property names in GroupInfo

* check permission in MockGroupActiveImpl

* optimize member names in  CommonGroupActiveImpl

* fix error checking

* dump api

Co-authored-by: Him188 <Him188@mamoe.net>
2022-09-21 23:18:50 +08:00
Karlatemp
1ea68d82a7
[mock] Fix serialization 2022-09-18 17:55:28 +08:00
Karlatemp
657b414c90
[mock] remove override of AbstractExternalResource 2022-09-10 13:29:53 +08:00
微莹·纤绫
2db9804cf2
Mock Testing Framework (#1521)
Co-authored-by: Eritque arcus <1930893235@qq.com>
Co-authored-by: Him188 <Him188@mamoe.net>
2022-09-10 12:49:13 +08:00