Commit Graph

136 Commits

Author SHA1 Message Date
Him188
7d3971259d
Review deprecation for 2.10. close #1742 (#1774) 2022-01-14 18:26:44 +00:00
Him188
662fbf8d1e Deprecate experimental CoroutineScopeUtils 2022-01-10 23:27:23 +00:00
Karlatemp
6d16d77dad Secrets Protection 2022-01-03 17:38:34 +00:00
Him188
ecc4425463 Move KClass.createInstance to mirai-core-utils and optimize TestPointPluginImpl.<init> 2021-12-23 01:37:11 +00:00
Him188
7faf630454 Update kotlin-jvm-blocking-bridge to 2.0.0-160.2 2021-12-23 01:37:11 +00:00
Him188
0711b5ae2e Add TypeSafeMap.toMutableTypeSafeMap 2021-12-21 03:32:27 +00:00
Karlatemp
1d1a77ff1a
Test of rename folder 2021-12-19 00:46:46 +08:00
Him188
2367ee0fd9
Revert prohibition of sending file message: (#1716)
* Revert prohibition of sending file message:
- close #1715
- Report a warning in logging with stacktrace
- Show stacktrace only once

* Update util.kt
2021-12-06 15:32:51 +00:00
Karlatemp
561d333cc7
NetInternalKit 2021-12-05 18:28:44 +08:00
Him188
d5d0b35806 Add DeviceInfo.random(Random) and implement equals and hashCode for DeviceInfo 2021-11-29 14:33:20 +00:00
Him188
a8e3916261 Add @DeprecatedSinceMirai, close #1669 2021-11-26 17:50:25 +00:00
Karlatemp
cf2b4a193c
Fix bytecode analyze 2021-11-16 18:13:22 +08:00
Karlatemp
2422aa34b5
Add image caches; Fix deserialized image not rendering in ForwardMessage; fix #1507, fix #1636 2021-11-16 12:32:28 +08:00
Karlatemp
b5d8c708bd
Redesign MultiMsg; Support nested ForwardMessage sending; close #1198 2021-11-16 12:32:28 +08:00
Karlatemp
456903628e
Make MessageChain truly read-only; fix #1676 2021-11-15 23:22:52 +08:00
Him188
a42a024b5a Add castUp 2021-11-15 01:44:42 +00:00
Him188
4a488f3416 Add utils threadLocal 2021-11-09 22:53:57 +00:00
Him188
cb4fb495a3 Rename ByteArray.encodeToString to .decodeToString 2021-11-09 22:12:11 +00:00
Him188
9e151e7026
Redesign group files (#1589)
* Prototype new `RemoteFiles` design

* add `@JavaFriendlyAPI`

* remove `quietly`

* move `moveTo` to `AbsoluteFile`

* Add java friendly apis

* Remove `condoneMissing`

* Change `renameTo`

* Extract interface declarations

* update docs

* Add `AbsoluteFileFolder.exists`

* Add common ProgressionCallback

* Implement `RemoteFiles` and relevant `Absolute*`

* Implement `refresh` and `refreshed`

* Update docs

* Forbid blank paths

* Update docs

* Deprecate `RemoteFile` and implement `FileMessage.toAbsoluteFile`

* Change corresponding properties on operations

* Deprecate more old declarations

* Update docs

* Add check for permission

* Allow relative paths and fix upload

* fix absolutePath

* doc update

* api dump

* `Result<R>.onSuccessCatching`

* return null when file not exists

* Fix file uploading

* Fix folder.absolutePath

* add `resolveFileById`

* Implement toString

* Add `nameWithoutExtension` and `extension`

* Add `deep` to resolveFileById

* Implement permission check

* Remove notes

* Fix `resolveFileById`

* Fix `extension`

* add docs

* Improve docs

Co-authored-by: Karlatemp <karlatemp@vip.qq.com>
2021-10-30 16:05:57 +01:00
Karlatemp
217907c58a
Support sending MusicShare to friends. (#1615)
* Support sending `MusicShare` to friends.

- Also fix a potential data out-of-bounds issues

* `TypeSafeMap.get` with default values

* Fix tests
2021-10-28 13:44:18 +01:00
Karlatemp
938e7eae57
Fix ImageDecoder of JPEG format; fix #1610 2021-10-17 17:11:34 +08:00
sandtechnology
4ce57f52a8
Add height, width, size and imageType attribute to Image class (#1548)
* Add height, width, size and imageType attribute to Image class
Close #1543 #1204 #1032

* Let ImageType enum code before the `Internals`, Also add @JvmStatic and OrNull version for match method

* Use runBIO and throws annotation for getImageInfo

* Add .kt suffix for MPP imagesImpl

* Return empty imageInfo for unsupported images

* Fix wrong file name

* apiDump

* Renaming MPP file instead of adding JvmName annotation

* Optimize readability and only use BIO at call-site

* Fix bug for detecting image type

* Detecting javax module for java 9+

* Clean up

* Disable some image types which not supported

* Use cross platform code to read images, readd support for apng

* Fix bug in reading image

* apiDump

* Fix bug in image reading and write unite test

* Fix wording

* Remove webp support and throws IllegalArgumentException for unsupported format

* Remove WEBP enum type

* Add unit test for unsupported image and correct comments

* Fix buffer input stream error when reading images

* Applying suggestions and fix jpg reading

* Add complete SOF decoding for jpg and clean up

* Caching jpg sof byte ranges

* Save `values()` as IMAGE_TYPE_ENUM_LIST for preventing clone operation

* Remove duplicated it
2021-09-16 04:38:59 +08:00
Him188
062b8766a2 Raise deprecation levels:
- RichMessageOrigin
- SingleMessage.Serializer
- ForceOfflineException
- MessageSubscribersBuilder.sentByTemp
- subscribeTempMessages
- TempMessageSubscribersBuilder
- TempMessageEvent
- TempMessagePostSendEvent
- TempMessagePreSendEvent

close #1296
2021-09-12 20:57:04 +08:00
Him188
238ec52eea Adapt for server time difference, let MessageSource.time refer to server time. Fixes 1519 2021-09-04 21:31:10 +08:00
Him188
5188d88483 Improve CheckableResponse 2021-09-04 19:36:16 +08:00
Him188
d727bae9d0 Add Either.left and Either.right 2021-09-02 16:03:32 +08:00
Him188
f239192677 Add trySafely 2021-09-01 20:05:05 +08:00
Him188
66999aadaf Migrate to Kotlin 1.5.30 and review dependencies:
- Remove redundant atomicfu-common
- Do not expose kotlinx-io and atomicfu
2021-09-01 18:52:36 +08:00
Him188
081e5d9b04 Use String constructor from Kotlin stdlib 2021-09-01 14:37:47 +08:00
Him188
f31f525343 Add util Array<Byte>.toUHexString 2021-09-01 13:55:39 +08:00
Him188
a1dba40f80 Add util CollectionDiff 2021-09-01 13:55:39 +08:00
Him188
f1c2393434 Add util readResource 2021-09-01 13:55:39 +08:00
Him188
f40659b1c7 Make TypeSafeMap() returns TypeSafeMap.EMPTY 2021-09-01 13:55:39 +08:00
Him188
1ffa9eb957 Add toString for TypeSafeMap implementations 2021-09-01 13:55:39 +08:00
Him188
f5fe442cc8 Add simple constructor for TypeSafeMap 2021-09-01 13:55:39 +08:00
Him188
f5b2dbc65d Avoid boxing in TypeSafeMap and support serialization 2021-09-01 13:55:39 +08:00
Him188
9c272ebf1e Migrate more transformers to NoticeProcessorPipeline 2021-09-01 13:55:39 +08:00
Him188
edf1bc9a2e Migrate more transformers to NoticeProcessorPipeline 2021-09-01 13:55:39 +08:00
Him188
41733e23ef Extract utils into multiple files 2021-09-01 13:55:39 +08:00
Him188
1b80fbc1e6 Redesign notice handling and introduce NoticeProcessorPipeline part 3:
- Extract `SyncController`;
- Add super type `ProtocolStruct` to `ProtoBuf` and `JceStruct` to standardize `NoticeProcessorPipeline.process`
- and other implementations for pipeline
2021-09-01 13:55:39 +08:00
Him188
09265190e9 Add UnconsumedNoticesAlerter and cleanup
Co-authored-by: Karlatemp <karlatemp@vip.qq.com>
2021-09-01 13:55:39 +08:00
Him188
dc54679acb Redesign notice handling and introduce NoticeProcessorPipeline 2021-09-01 13:55:39 +08:00
Him188
497a458be4 Add TypeSafeMap 2021-09-01 13:55:39 +08:00
Him188
dad2d965ab Add contracts to cast, safeCast and castOrNull; Add uncheckedCast 2021-09-01 13:55:39 +08:00
Him188
45cc60c8e9 Fix loadService with fallback implementation 2021-08-11 15:24:32 +08:00
Him188
5950e9e1e8 Improve logging: use Log4j internally and support markers
Migrate usages of `MiraiLogger.create` to new API
apiDump for new logging
2021-08-11 15:24:32 +08:00
Him188
40bbab4b5e Use mirai TestOnly annotation in ServerListImpl.<init> 2021-08-08 15:09:21 +08:00
Him188
8d8aca3f1c Introduce Audio for new API, revert changes on Voice 2021-08-05 21:48:20 +08:00
Him188
cf1c5d4d81 Add utility loadService 2021-08-05 21:48:20 +08:00
Him188
f4adc1232f Add ComputeOnNullMutableProperty 2021-08-05 21:48:20 +08:00