fix job msg del

This commit is contained in:
shoopea 2020-01-13 17:03:56 +08:00
parent e547dd58b2
commit 3a73d6e55a

7
job.go
View File

@ -611,9 +611,11 @@ func jobMsgDelete(j Job) {
logOnError(err, "jobMsgDelete : getObjMsg("+strconv.FormatInt(j.Trigger, 10)+")")
clientDelTGMsg(j.UserID64, obj.ID64, obj.ChatID64)
} else {
delay = p.Delay
p.Delay = 0
p.ObjMsgID64 = j.Trigger
b, _ := json.Marshal(p)
_, err = createJob(cacheObjSubType[`job_msg_del`], objJobPriority, j.UserID64, 0, time.Now().Add(p.Delay).UTC(), b)
_, err = createJob(cacheObjSubType[`job_msg_del`], objJobPriority, j.UserID64, 0, time.Now().Add(delay).UTC(), b)
}
} else {
log.Printf("jobMsgDelete : cannot identify msg to delete")
@ -624,9 +626,10 @@ func jobMsgDelete(j Job) {
logOnError(err, "jobMsgDelete : getObjMsg("+strconv.FormatInt(p.ObjMsgID64, 10)+")")
clientDelTGMsg(j.UserID64, obj.ID64, obj.ChatID64)
} else {
delay := p.Delay
p.Delay = 0
b, _ := json.Marshal(p)
_, err = createJob(cacheObjSubType[`job_msg_del`], objJobPriority, j.UserID64, 0, time.Now().Add(p.Delay).UTC(), b)
_, err = createJob(cacheObjSubType[`job_msg_del`], objJobPriority, j.UserID64, 0, time.Now().Add(delay).UTC(), b)
}
}