mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 13:12:17 +08:00
Shamrock
: 支持新年龙表情,点开提交查看评论获取使用方法
This commit is contained in:
parent
b3d853dec3
commit
e0e7a9fc2e
@ -500,7 +500,8 @@ internal object MessageMaker {
|
||||
private suspend fun createFaceElem(chatType: Int, msgId: Long, peerId: String, data: JsonObject): Result<MsgElement> {
|
||||
data.checkAndThrow("id")
|
||||
|
||||
val big = data["big"].asBooleanOrNull ?: false
|
||||
val serverId = data["id"].asInt
|
||||
val big = (data["big"].asBooleanOrNull ?: false) || serverId == 394
|
||||
|
||||
val elem = MsgElement()
|
||||
elem.elementType = MsgConstant.KELEMTYPEFACE
|
||||
@ -512,17 +513,24 @@ internal object MessageMaker {
|
||||
// 4 is market face
|
||||
// 5 is vas poke
|
||||
face.faceType = if (big) 3 else 2
|
||||
val serverId = data["id"].asInt
|
||||
face.faceIndex = serverId
|
||||
face.faceText = QQSysFaceUtil.getFaceDescription(QQSysFaceUtil.convertToLocal(serverId))
|
||||
face.imageType = 0
|
||||
if (big) {
|
||||
if (serverId == 394) {
|
||||
face.stickerId = 40.toString()
|
||||
face.packId = "1"
|
||||
face.sourceType = 1
|
||||
face.stickerType = 3
|
||||
face.randomType = 1
|
||||
face.resultId = data["result"].asStringOrNull ?: Random.nextInt(1 .. 5).toString()
|
||||
} else if (big) {
|
||||
face.imageType = 0
|
||||
face.stickerId = 30.toString()
|
||||
face.packId = "1"
|
||||
face.sourceType = 1
|
||||
face.stickerType = 1
|
||||
face.randomType = 1
|
||||
} else {
|
||||
face.imageType = 0
|
||||
face.packId = "0"
|
||||
}
|
||||
elem.faceElement = face
|
||||
|
@ -83,6 +83,17 @@ internal sealed class MessageElemConverter: IMessageConvert {
|
||||
)
|
||||
)
|
||||
}
|
||||
394 -> {
|
||||
//LogCenter.log(face.toString())
|
||||
return MessageSegment(
|
||||
type = "face",
|
||||
data = hashMapOf(
|
||||
"id" to face.faceIndex,
|
||||
"big" to (face.faceType == 3),
|
||||
"result" to (face.resultId ?: "1")
|
||||
)
|
||||
)
|
||||
}
|
||||
else -> return MessageSegment(
|
||||
type = "face",
|
||||
data = hashMapOf(
|
||||
@ -123,7 +134,7 @@ internal sealed class MessageElemConverter: IMessageConvert {
|
||||
else -> unknownChatType(chatType)
|
||||
},
|
||||
"subType" to image.picSubType,
|
||||
"type" to if (image.isFlashPic) "flash" else if(image.original) "original" else "show"
|
||||
"type" to if (image.isFlashPic == true) "flash" else if(image.original) "original" else "show"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user