mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-08 05:36:58 +08:00
Cleanup
This commit is contained in:
parent
644842e191
commit
ec82232aa3
@ -118,7 +118,7 @@ internal class OnlinePush {
|
||||
}
|
||||
}
|
||||
34 -> {
|
||||
var groupUinorCode = readUInt().toLong()
|
||||
var groupUinOrCode = readUInt().toLong()
|
||||
if (readByte().toInt() == 1) {
|
||||
val target = readUInt().toLong()
|
||||
val groupUin = content.fromUin
|
||||
|
@ -7,6 +7,8 @@
|
||||
* https://github.com/mamoe/mirai/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package androidPacketTests
|
||||
|
||||
import net.mamoe.mirai.utils.cryptor.decryptBy
|
||||
@ -24,6 +26,7 @@ fun ByteArray.decryptBy16Zero() = this.decryptBy(ByteArray(16))
|
||||
fun ByteArray.dropTCPHead(): ByteArray = this.drop(16 * 3 + 6).toByteArray()
|
||||
|
||||
|
||||
@Suppress("LocalVariableName")
|
||||
fun loadPrivateKey(s: String): ECPrivateKey {
|
||||
fun fromHex(
|
||||
hex: String
|
||||
|
@ -258,6 +258,7 @@ fun String.generateProtoBufDataClass(): GeneratedClass {
|
||||
}
|
||||
|
||||
fun adjustPropertyName(_name: String): String {
|
||||
@Suppress("NAME_SHADOWING")
|
||||
var name = _name
|
||||
when {
|
||||
name.startsWith("str") -> {
|
||||
|
@ -26,7 +26,7 @@ import java.util.zip.Inflater
|
||||
/**
|
||||
* Ktor HttpClient. 不同平台使用不同引擎.
|
||||
*/
|
||||
@KtorExperimentalAPI
|
||||
@UseExperimental(KtorExperimentalAPI::class)
|
||||
actual val Http: HttpClient
|
||||
get() = HttpClient(CIO)
|
||||
|
||||
|
@ -11,6 +11,7 @@ package net.mamoe.mirai.japt.internal
|
||||
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import kotlinx.io.core.ByteReadPacket
|
||||
import kotlinx.io.core.readBytes
|
||||
import net.mamoe.mirai.Bot
|
||||
import net.mamoe.mirai.BotAccount
|
||||
import net.mamoe.mirai.data.AddFriendResult
|
||||
@ -39,7 +40,7 @@ internal class BlockingBotImpl(private val bot: Bot) : BlockingBot {
|
||||
override fun getGroup(id: Long): BlockingGroup = runBlocking { bot.getGroup(id).blocking() }
|
||||
override fun getNetwork(): BotNetworkHandler = bot.network
|
||||
override fun login() = runBlocking { bot.login() }
|
||||
override fun downloadAsByteArray(image: Image): ByteArray = bot.run { runBlocking { image.downloadAsByteArray() } }
|
||||
override fun downloadAsByteArray(image: Image): ByteArray = bot.run { runBlocking { image.download().readBytes() } }
|
||||
override fun download(image: Image): ByteReadPacket = bot.run { runBlocking { image.download() } }
|
||||
override fun addFriend(id: Long, message: String?, remark: String?): AddFriendResult = runBlocking { bot.addFriend(id, message, remark) }
|
||||
override fun approveFriendAddRequest(id: Long, remark: String?) = runBlocking { bot.approveFriendAddRequest(id, remark) }
|
||||
|
Loading…
Reference in New Issue
Block a user