This repository has been archived by the owner on Aug 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shamrock
: support upload resource by NtKernel
Signed-off-by: 白池 <[email protected]>
- Loading branch information
1 parent
92ebe0c
commit fca66f3
Showing
24 changed files
with
309 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 1 addition & 8 deletions
9
...uqiuluo/qqinterface/servlet/ark/ArkMsg.kt → ...uluo/qqinterface/servlet/ark/ArkMsgSvc.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...luo/qqinterface/servlet/ark/ArkAppInfo.kt → ...qinterface/servlet/ark/data/ArkAppInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...uqiuluo/qqinterface/servlet/ark/Region.kt → ...uo/qqinterface/servlet/ark/data/Region.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/msg/MessageTempHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package moe.fuqiuluo.qqinterface.servlet.msg | ||
|
||
import com.tencent.qqnt.kernel.nativeinterface.MsgRecord | ||
import moe.fuqiuluo.shamrock.helper.Level | ||
import moe.fuqiuluo.shamrock.helper.LogCenter | ||
import java.util.Collections | ||
|
||
internal object MessageTempHandler { | ||
// 通过MSG SEQ临时监听器 | ||
private val tempMessageListenerMap = Collections.synchronizedMap(HashMap<Long, suspend MsgRecord.() -> Unit>()) | ||
|
||
fun registerTemporaryMsgListener( | ||
msgSeq: Long, | ||
listener: suspend MsgRecord.() -> Unit | ||
) { | ||
LogCenter.log({ "注册临时消息监听器: $msgSeq" }, Level.DEBUG) | ||
tempMessageListenerMap[msgSeq] = listener | ||
} | ||
|
||
fun unregisterTemporaryMsgListener(msgSeq: Long) { | ||
tempMessageListenerMap.remove(msgSeq) | ||
} | ||
|
||
suspend fun notify(record: MsgRecord): Boolean { | ||
tempMessageListenerMap.firstNotNullOfOrNull { | ||
if (it.key == record.msgSeq) it else null | ||
}?.let { | ||
it.value(record) | ||
tempMessageListenerMap.remove(it.key) | ||
return true | ||
} | ||
return false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/structures/RichMedia.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package moe.fuqiuluo.qqinterface.servlet.structures | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class UploadResult( | ||
@SerialName("files") val files: List<CommFileInfo> | ||
) | ||
|
||
@Serializable | ||
data class CommFileInfo( | ||
@SerialName("mode_id") val modeId: Long, | ||
@SerialName("name") val fileName: String, | ||
@SerialName("size") val fileSize: Long, | ||
@SerialName("md5") val md5: String, | ||
@SerialName("uuid") val uuid: String, | ||
@SerialName("sub_id") val subId: String, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ote/service/api/RichMediaUploadHandler.kt → ...rvlet/transfile/RichMediaUploadHandler.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 8 additions & 3 deletions
11
xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/transfile/Transfer.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../qqinterface/servlet/transfile/Contact.kt → ...terface/servlet/transfile/data/Contact.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...qqinterface/servlet/transfile/Resource.kt → ...erface/servlet/transfile/data/Resource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.