Skip to content

Commit

Permalink
fix: CopyMarkdown
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Jun 25, 2024
1 parent 1004858 commit b4bd8e8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/src/main/java/me/hd/hook/CopyMarkdown.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,13 @@ object CopyMarkdown : CommonSwitchFunctionHook(
val item = CustomMenu.createItemIconNt(msg, "复制内容", R.drawable.ic_item_copy_72dp, R.id.item_copy_code) {
val ctx = ContextUtils.getCurrentActivity()
val msgRecord = XposedHelpers.callMethod(msg, "getMsgRecord") as MsgRecord
val content = msgRecord.elements[0].markdownElement.content
copyToClipboard(ctx, content)
Toasts.success(ctx, "复制内容成功")
msgRecord.elements.forEach { element ->
element.markdownElement?.let { markdownElement ->
val content = markdownElement.content
copyToClipboard(ctx, content)
Toasts.success(ctx, "复制成功")
}
}
}
param.result = listOf(item) + param.result as List<*>
}
Expand Down

0 comments on commit b4bd8e8

Please sign in to comment.