diff --git a/kritor/kritor b/kritor/kritor index c49df307..d94600bc 160000 --- a/kritor/kritor +++ b/kritor/kritor @@ -1 +1 @@ -Subproject commit c49df3074cf193cdbdc49c3c29fda66a0d0110e8 +Subproject commit d94600bc7adef49c6dcd5a1973578d4a101c9b38 diff --git a/xposed/src/main/java/kritor/service/FriendService.kt b/xposed/src/main/java/kritor/service/FriendService.kt index 746db319..c5512e84 100644 --- a/xposed/src/main/java/kritor/service/FriendService.kt +++ b/xposed/src/main/java/kritor/service/FriendService.kt @@ -225,8 +225,8 @@ internal object FriendService : FriendServiceGrpcKt.FriendServiceCoroutineImplBa } @Grpc("FriendService", "GetUidByUin") - override suspend fun getUidByUin(request: GetUidRequest): GetUidResponse { - return GetUidResponse.newBuilder().apply { + override suspend fun getUidByUin(request: GetUidByUinRequest): GetUidByUinResponse { + return GetUidByUinResponse.newBuilder().apply { request.targetUinsList.forEach { putUidMap(it, ContactHelper.getUidByUinAsync(it)) } diff --git a/xposed/src/main/java/qq/service/msg/MsgConvertor.kt b/xposed/src/main/java/qq/service/msg/MsgConvertor.kt index 94679017..0800b865 100644 --- a/xposed/src/main/java/qq/service/msg/MsgConvertor.kt +++ b/xposed/src/main/java/qq/service/msg/MsgConvertor.kt @@ -401,10 +401,10 @@ private object MsgConvertor { suspend fun convertInlineKeyboard(record: MsgRecord, element: MsgElement): Result { val inlineKeyboard = element.inlineKeyboardElement val elem = Element.newBuilder() - elem.type = ElementType.BUTTON - elem.setButton(ButtonElement.newBuilder().apply { + elem.type = ElementType.KEYBOARD + elem.setKeyboard(KeyboardElement.newBuilder().apply { inlineKeyboard.rows.forEach { row -> - this.addRows(ButtonRow.newBuilder().apply { + this.addRows(KeyboardRow.newBuilder().apply { row.buttons.forEach buttonsLoop@{ button -> if (button == null) return@buttonsLoop this.addButtons(Button.newBuilder().apply { diff --git a/xposed/src/main/java/qq/service/msg/MultiConvertor.kt b/xposed/src/main/java/qq/service/msg/MultiConvertor.kt index eb4220dc..cc647ce4 100644 --- a/xposed/src/main/java/qq/service/msg/MultiConvertor.kt +++ b/xposed/src/main/java/qq/service/msg/MultiConvertor.kt @@ -227,9 +227,9 @@ suspend fun List.toKritorResponseMessages(contact: Contact): ArrayList { val buttonExtra = commonElem.elem!!.decodeProtobuf() kritorMessages.add( - Element.newBuilder().setButton(ButtonElement.newBuilder().apply { + Element.newBuilder().setKeyboard(KeyboardElement.newBuilder().apply { this.addAllRows(buttonExtra.field1!!.rows!!.map { row -> - ButtonRow.newBuilder().apply { + KeyboardRow.newBuilder().apply { this.addAllButtons(row.buttons!!.map { button -> Button.newBuilder().apply { this.id = button.id diff --git a/xposed/src/main/java/qq/service/msg/NtMsgConvertor.kt b/xposed/src/main/java/qq/service/msg/NtMsgConvertor.kt index 3ef209e0..ed96317e 100644 --- a/xposed/src/main/java/qq/service/msg/NtMsgConvertor.kt +++ b/xposed/src/main/java/qq/service/msg/NtMsgConvertor.kt @@ -97,7 +97,7 @@ object NtMsgConvertor { ElementType.JSON to ::jsonConvertor, ElementType.FORWARD to ::forwardConvertor, ElementType.MARKDOWN to ::markdownConvertor, - ElementType.BUTTON to ::buttonConvertor, + ElementType.KEYBOARD to ::buttonConvertor, ) suspend fun convertToNtMsgs(contact: Contact, msgId: Long, msgs: Messages): ArrayList { @@ -848,7 +848,7 @@ object NtMsgConvertor { elem.elementType = MsgConstant.KELEMTYPEINLINEKEYBOARD val rows = arrayListOf() - val keyboard = sourceButton.button + val keyboard = sourceButton.keyboard keyboard.rowsList.forEach { row -> val buttons = arrayListOf() row.buttonsList.forEach { button -> diff --git a/xposed/src/main/java/qq/service/msg/ReqMessageConvertor.kt b/xposed/src/main/java/qq/service/msg/ReqMessageConvertor.kt index 9bde05cd..40db4993 100644 --- a/xposed/src/main/java/qq/service/msg/ReqMessageConvertor.kt +++ b/xposed/src/main/java/qq/service/msg/ReqMessageConvertor.kt @@ -366,9 +366,9 @@ private object ReqMsgConvertor { suspend fun convertInlineKeyboard(contact: Contact, element: MsgElement): Result { val inlineKeyboard = element.inlineKeyboardElement val elem = Element.newBuilder() - elem.setButton(ButtonElement.newBuilder().apply { + elem.setKeyboard(KeyboardElement.newBuilder().apply { this.addAllRows(inlineKeyboard.rows.map { row -> - ButtonRow.newBuilder().apply { + KeyboardRow.newBuilder().apply { this.addAllButtons(row.buttons.map { button -> Button.newBuilder().apply { this.id = button.id diff --git a/xposed/src/main/java/qq/service/msg/ReqMultiConvertor.kt b/xposed/src/main/java/qq/service/msg/ReqMultiConvertor.kt index 023f386d..f6e6f810 100644 --- a/xposed/src/main/java/qq/service/msg/ReqMultiConvertor.kt +++ b/xposed/src/main/java/qq/service/msg/ReqMultiConvertor.kt @@ -511,13 +511,13 @@ suspend fun List.toRichText(contact: Contact): Result { + Element.ElementType.KEYBOARD -> { val elem = Elem( commonElem = CommonElem( serviceType = 46, elem = ButtonExtra( field1 = Object1( - rows = it.button.rowsList.map { row -> + rows = it.keyboard.rowsList.map { row -> Row(buttons = row.buttonsList.map { button -> val renderData = button.renderData val action = button.action @@ -544,7 +544,7 @@ suspend fun List.toRichText(contact: Contact): Result