Commit Graph

473 Commits

Author SHA1 Message Date
Him188
455ed6fbeb Move NormalMember.isMuted from extension to member function. fix #1037 2021-04-10 12:58:10 +08:00
Him188
8d3a4fbf5b
Deprecate RemoteFile.moveTo(String) for ambiguous behavior (#1180) 2021-04-09 18:33:12 +08:00
Him188
e20313636a Make Group.setEssenceMessage static 2021-04-08 18:17:00 +08:00
Him188
770615f137 Ensure Mirai impl initialized on serialization, fix #1086 2021-04-07 23:28:41 +08:00
Him188
944099a977 Add _MiraiInstance to allow internal instance overrides 2021-04-07 21:49:44 +08:00
Him188
620771211e Merge remote-tracking branch 'mirai/dev' into dev 2021-04-05 23:58:54 +08:00
Him188
f0093a0cca Fix ignored exceptions in PlatformLogger on Android 2021-04-05 23:58:37 +08:00
Him188
45aca5f37d
Add ForwardMessageBuilder.toRawForwardMessage and make RawForwardMessage stable (#1162)
* Add `ForwardMessageBuilder.toRawForwardMessage` and make RawForwardMessage stable.

* apiDump
2021-04-05 22:35:52 +08:00
AdoptOSS
21e8852e0f
buildscript: fix task not found errors when android sdk not available (#1161)
* buildscript: fix task not found errors when android sdk not available

* fix: this shadowed by run

* cleanup: code style

* improve: avoid breaking index map
2021-04-05 22:35:38 +08:00
Him188
7521e6d17f
Rename RichMessageOrigin to MessageOrigin (#1116)
* Rename `RichMessageOrigin` to `MessageOrigin`

* apiDump

* Change `MessageOrigin.origin` parameter type from `RichMessage` to `SingleMessage`;
Rename `RichMessageKind` to `MessageOriginKind`

* Make MessageOriginKind serializable and update docs

* Ensure binary compatibility with <2.6 and provide migration helpers

* apiDump
2021-04-04 00:31:33 +08:00
Him188
cccdb3cdf2
Update docs for messages (#1142)
* Update docs for messages

* Update docs for messages

* Update docs for messages

* Update docs for messages

* Update docs/Messages.md

Co-authored-by: Karlatemp <karlatemp@vip.qq.com>

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

Co-authored-by: Karlatemp <karlatemp@vip.qq.com>

* Update docs for messages

* Update docs for messages

* Revert inappropriate changes

* Fix doc

Co-authored-by: Karlatemp <karlatemp@vip.qq.com>
2021-04-03 22:39:55 +08:00
Him188
ea1f43b9c5
Fast login (#1154)
* wtlogin10

* Fast login Packet Implement (#1125)

* Correct group syncing logic again, Fix #1120

* Implement fast login packet, thanks to MiraiGo

* Delete duplicated tlv

* Refresh Token when exchanging and solve connection dropping issue (#1128)

* Correct group syncing logic again, Fix #1120

* Implement fast login packet, thanks to MiraiGo

* Delete duplicated tlv

* Schedule token exchanging every 10 minutes, solve connection dropping issue

* Refresh Token when exchanging, and correct token expire time

* Remove useless params for doFastLogin

* Fix missed register and tgt update (#1131)

* Correct group syncing logic again, Fix #1120

* Implement fast login packet, thanks to MiraiGo

* Delete duplicated tlv

* Schedule token exchanging every 10 minutes, solve connection dropping issue

* Refresh Token when exchanging, and correct token expire time

* Remove useless params for doFastLogin

* Fix missed register and tgt update

* Add login lock

* Add login lock

* Remove key refresh

* Remove heartbeat period override

* Login: Update tlv and solve constant connection dropping issue (#1150)

* Correct group syncing logic again, Fix #1120

* Implement fast login packet, thanks to MiraiGo

* Delete duplicated tlv

* Schedule token exchanging every 10 minutes, solve connection dropping issue

* Refresh Token when exchanging, and correct token expire time

* Remove useless params for doFastLogin

* Fix missed register and tgt update

* Update tlv, add tlv11d and tlv11a decoding

* Add stat heartbeat, solve constant connection dropping issue

* Update apidump for new configuration

* Add comment for statHeartbeatPeriodMillis

* Change old naming

* Add since version

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

Co-authored-by: sandtechnology <20417547+sandtechnology@users.noreply.github.com>
2021-04-03 22:31:14 +08:00
Him188
1c486854a8 Fix FileMessage.Key 2021-03-30 21:42:05 +08:00
Him188
430c2c59ad
Support UnsupportedMessage (#1112)
* Support UnsupportedMessage

* Fix serialize

* `UnsupportedMessage.contentToString`: use `struct.contentHashCode()`

Co-authored-by: Karlatemp <karlatemp@vip.qq.com>
2021-03-26 23:54:17 +08:00
Him188
0f41c225f9 Move SerialDescriptor.copy to mirai-core-utils 2021-03-26 20:42:51 +08:00
Him188
fef0b4220a Merge remote-tracking branch 'mirai/dev' into dev 2021-03-26 10:07:13 +08:00
Him188
7ed8502e68 Fix docs on IMirai.FileCacheStrategy 2021-03-26 10:06:48 +08:00
Him188
c071ac5773
Update docs of Nudge, clearification 2021-03-23 23:57:20 +08:00
Him188
f8da762d2f Merge remote-tracking branch 'mirai/dev' into dev 2021-03-22 12:52:39 +08:00
Him188
c006a48de5 Update docs about FileCacheStrategy, close #1046 2021-03-22 12:52:18 +08:00
Him188
ee1ea33898 Remove inappropriate use of DSL marker on ForwardMessageBuilder.add 2021-03-22 11:24:26 +08:00
Him188
0c3c85f61c Add members to make ForwardMessageBuilder easier to use from Java, close #1087 2021-03-22 11:24:26 +08:00
Him188
f42747f6ac Make buildMessageChain not @JvmSynthetic 2021-03-22 11:21:22 +08:00
Him188
daa7453d73 Add UserOrBot.nameCardOrNick 2021-03-22 11:16:34 +08:00
Him188
146433d56f Add common UserOrBot.nick 2021-03-22 11:16:34 +08:00
Him188
9f52a26fbd Fix FileMessage mirai code 2021-03-20 22:31:12 +08:00
Him188
0112d4622e Rename ExternalResource.Companion.uploadAsFileTo to uploadAsFile to keep consistency 2021-03-20 16:49:02 +08:00
Him188
09cbc55ef6 RemoteFile.FileInfo.resolveToFile: use FileSupport than Group 2021-03-20 16:45:01 +08:00
Him188
7f6812727a Update RemoteFile docs and mark RemoteFile as stable 2021-03-20 16:45:00 +08:00
Him188
74d59982ae Add more extensions for RemoteFile and ExternalResource 2021-03-20 15:59:58 +08:00
Him188
b328328ddd Add docs for RemoteFile and mark some API as stable 2021-03-20 15:59:58 +08:00
Him188
b5d8306902 Add RemoteFile.listFilesCollection()
Co-authored-by: Karlatemp <karlatemp@vip.qq.com>
2021-03-20 15:59:58 +08:00
Him188
5f02c35e66 Merge remote-tracking branch 'mirai/dev' into dev 2021-03-20 15:33:48 +08:00
Him188
af58c163d2 - Add FileMessage.internalId hence support serialization
- Add FileMessage.Serializer
- Add FileMessage.create and IMirai.createFileMessage to construct manually
- Mark FileMessage as stable
- Move TestMiraiCode from mirai-core-api to mirai-core

fix #1082
2021-03-20 15:33:08 +08:00
Karlatemp
f9353b6aef
Compiled code verify (#1080)
* Compiled code verify

* Run `verifyCompiledClasses` in `check` task

* Redesign verification

Co-authored-by: Bo Zhang <bo@gradle.com>

* Disable console verify

* Decoupling

Co-authored-by: Bo Zhang <bo@gradle.com>
2021-03-20 13:34:04 +08:00
Karlatemp
3152e24523
Fix operations of RemoteFile (#1104)
* Fix operations of RemoteFile

* apiDump

* Remove duplicate method

* Don't setup fileId
2021-03-18 12:30:06 +08:00
Karlatemp
5cd62319b7
Update docs of RemoteFile 2021-03-17 23:41:49 +08:00
Him188
e256ec06d3
Support file operations (#1069)
* Proto structs for group file

* RemoteFile fundamental abstraction and proto structs

* Configure JVM target for mirai-console-intellij

* Add Group.filesRoot

* Fix build

* Implement a FileSystem for RemoteFile resolution

* Fix RemoteFile FileSystem and implement resolve and listFiles

* Implement file info query and file download

* Support uploading group file

* Support file feeds

* 2.5-M2-dev-1

* Fix tests

* 2.5-M2-dev-2

* Add uuid-based resolving, support getting file details

* Support FileMessage receive

* Support sending FileMessage

* 2.5-M2-dev-3

* Add DownloadInfo.id

* Improve RemoteFile.delete

* Support move, delete, rename, mkdir. Simplify listFiles

* - Rename RemoteFile.write to .upload.
- Prefer id matching
- Improve move

* Add permission checks

* Improve permission checks

* Rearrange functions and add constant ROOT_PATH

* Introduce FileSupported, add extensions

* Introduce ProgressionCallback

* Fix docs and uploadFileAndSend

* Remove empty FileHighway.kt

* Add test testNormalize

* Add RemoteFile.contact, change RemoteFile.uploadAndSend return type to MessageReceipt

* Move @JvmBlockingBridge to file

* Change FileMessage.toRemoteFile parameter type Group to FileSupported

* Add impl notes #1082
2021-03-08 18:34:45 +08:00
Him188
b7c0f40d7e Revert "Implement multiplatform EventChannel for android specially"
This reverts commit dd7aed88
2021-02-26 15:34:51 +08:00
Him188
7fd281c496 Remove reflection API calls which are unsupported by Android 2021-02-25 11:19:18 +08:00
Him188
aaab3ae109 Merge branch 'dev' into android_target
# Conflicts:
#	build.gradle.kts
2021-02-25 10:39:51 +08:00
Him188
2c14f0016f Disable atomicFU compiler plugin 2021-02-25 09:35:51 +08:00
Him188
abf9baefc1 Remove @file:JvmName on PlatformLogger actual declarations, fix potential compiling issue 2021-02-25 07:54:36 +08:00
Karlatemp
7a7c88b783
Android api level check 2021-02-25 00:12:58 +08:00
Him188
dd7aed885d Implement multiplatform EventChannel for android specially 2021-02-24 15:57:54 +08:00
Him188
7b80ac5a0c Replace usage of java.util.List.removeIf to Kotlin's MutableList.removeAll 2021-02-24 15:15:47 +08:00
Him188
ba61194fa4 Move StandardCharImageLoginSolver from common to jvm 2021-02-24 15:15:43 +08:00
Him188
d3583162a5 Replace usage of List.replaceAll with Kotlin's 2021-02-24 15:15:31 +08:00
Him188
95688e37af
Update to Kotlin 1.4.30 and bump other dependencies versions (#1049)
- kotlin-stdlib and compiler 1.4.30
- kotlinx-serialization 1.1.0-RC
- kotlinx-coroutines 1.4.2
- ktor 1.5.1
- atomicfu 0.15.1
- yamlkt 0.9.0
- kotlin-jvm-blocking-bridge 1.10.0
- intellij 2020.3.2
- kotlin-intellij 203-1.4.30-release-IJ7148.5
- Gradle 6.8.2
2021-02-24 12:15:19 +08:00
Him188
9c3a175b02 Configure binary compatibility validator for android target 2021-02-24 11:36:03 +08:00