修复:通过转发日志中重试发送/重新匹配规则并发送消息时,{{接收时间}}错误(取当前时间) #275

This commit is contained in:
pppscn 2023-03-25 14:45:44 +08:00
parent 9a0861ded3
commit a0c3ead33e

View File

@ -19,14 +19,13 @@ import com.idormy.sms.forwarder.workers.SendWorker
import com.idormy.sms.forwarder.workers.UpdateLogsWorker
import com.xuexiang.xui.utils.ResUtils
import com.xuexiang.xutil.XUtil
import java.util.*
object SendUtils {
private const val TAG = "SendUtils"
//重新匹配规则并发送消息
fun rematchSendMsg(item: MsgAndLogs) {
val msgInfo = MsgInfo(item.msg.type, item.msg.from, item.msg.content, Date(), item.msg.simInfo, item.msg.simSlot, item.msg.subId)
val msgInfo = MsgInfo(item.msg.type, item.msg.from, item.msg.content, item.msg.time, item.msg.simInfo, item.msg.simSlot, item.msg.subId)
Log.d(TAG, "msgInfo = $msgInfo")
val request = OneTimeWorkRequestBuilder<SendWorker>().setInputData(
@ -41,7 +40,7 @@ object SendUtils {
fun retrySendMsg(logId: Long) {
val item = Core.logs.getOne(logId)
val msgInfo = MsgInfo(item.msg.type, item.msg.from, item.msg.content, Date(), item.msg.simInfo, item.msg.simSlot, item.msg.subId)
val msgInfo = MsgInfo(item.msg.type, item.msg.from, item.msg.content, item.msg.time, item.msg.simInfo, item.msg.simSlot, item.msg.subId)
Log.d(TAG, "msgInfo = $msgInfo")
var senderIndex = 0