Skip to content

Commit

Permalink
update 优化消息列表识别
Browse files Browse the repository at this point in the history
  • Loading branch information
gallonyin committed Mar 5, 2023
1 parent 2fdb611 commit f53c4f2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ object WeworkLoopImpl {
} while (messageList != messageList2)
if (messageList.isNotEmpty()) {
val lastMessage = messageList.last()
val lastSyncMessage = if (lastMessage.textType == WeworkMessageBean.TEXT_TYPE_IMAGE) {
val prefix = (lastMessage.nameList.firstOrNull()?.replace("\\(.*\\)$".toRegex(), "") + "").replace("null:", "")
val lastSyncMessage = prefix + if (lastMessage.textType == WeworkMessageBean.TEXT_TYPE_IMAGE) {
"[图片]"
} else {
lastMessage.itemMessageList.lastOrNull()?.text
}
SPUtils.getInstance("lastSyncMessage").put(title, lastSyncMessage)
LogUtils.v("lastSyncMessage: $lastSyncMessage")
if (Constant.pushImage && MultiFileObserver.saveSet.isNotEmpty()) {
val imageMessageList = messageList.filter { it.textType == WeworkMessageBean.TEXT_TYPE_IMAGE }.reversed()
MultiFileObserver.saveSet.reversed().forEachIndexed { index, targetPath ->
Expand Down

0 comments on commit f53c4f2

Please sign in to comment.