update 转发消息支持自转发

This commit is contained in:
gallonyin
2023-03-29 00:01:04 +08:00
parent 49e78a76b8
commit 47a529cac4

View File

@@ -158,7 +158,7 @@ object WeworkOperationImpl {
fun relayMessage(
message: WeworkMessageBean,
titleList: List<String>,
receivedName: String,
receivedName: String?,
originalContent: String,
textType: Int,
nameList: List<String>,
@@ -167,6 +167,7 @@ object WeworkOperationImpl {
val startTime = System.currentTimeMillis()
for (title in titleList) {
if (WeworkRoomUtil.intoRoom(title)) {
if (!receivedName.isNullOrEmpty()) {
if (WeworkTextUtil.longClickMessageItem(
//聊天消息列表 1ListView 0RecycleView xViewGroup
AccessibilityUtil.findOneByClazz(getRoot(), Views.ListView),
@@ -175,6 +176,26 @@ object WeworkOperationImpl {
originalContent,
"转发"
)
) {
LogUtils.d("开始转发")
if (relaySelectTarget(nameList, extraText)) {
LogUtils.d("$title: 转发成功")
} else {
LogUtils.e("$title: 转发失败")
error("$title: 转发失败 $originalContent")
}
} else {
LogUtils.e("$title: 长按条目失败")
error("$title: 长按条目失败 $originalContent")
}
} else {
if (WeworkTextUtil.longClickMyMessageItem(
//聊天消息列表 1ListView 0RecycleView xViewGroup
AccessibilityUtil.findOneByClazz(getRoot(), Views.ListView),
textType,
originalContent,
"转发"
)
) {
LogUtils.d("开始转发")
if (relaySelectTarget(nameList, extraText)) {
@@ -183,6 +204,10 @@ object WeworkOperationImpl {
LogUtils.d("$title: 转发失败")
error("$title: 转发失败 $originalContent")
}
} else {
LogUtils.e("$title: 长按条目失败")
error("$title: 长按条目失败 $originalContent")
}
}
} else {
LogUtils.d("$title: 转发失败 未找到房间")