update job msg del

This commit is contained in:
shoopea 2020-01-13 16:32:42 +08:00
parent a5e9039637
commit 48e359f19d

6
job.go
View File

@ -601,12 +601,12 @@ func jobMsgDelete(j Job) {
id, err := getObjSubTypeId(j.Trigger)
if id == p.MsgTypeID64 {
if p.Delay == 0 {
obj, err = getObjMsg(j.Trigger)
obj, err := getObjMsg(j.Trigger)
clientDelTGMsg(j.UserID64, obj.ID64, obj.ChatID64)
} else {
p.ObjMsgID64 = j.Trigger
b, _ := json.Marshal(p)
_, err = createJob(cacheObjSubType[`job_msg_del`], objJobPriority, j.UserID64, time.Now().Add(p.Delay).UTC(), b)
_, err = createJob(cacheObjSubType[`job_msg_del`], objJobPriority, j.UserID64, 0, time.Now().Add(p.Delay).UTC(), b)
}
} else {
log.Printf("jobMsgDelete : cannot identify msg to delete")
@ -617,7 +617,7 @@ func jobMsgDelete(j Job) {
clientDelTGMsg(j.UserID64, obj.ID64, obj.ChatID64)
} else {
b, _ := json.Marshal(p)
_, err = createJob(cacheObjSubType[`job_msg_del`], objJobPriority, j.UserID64, time.Now().Add(p.Delay).UTC(), b)
_, err = createJob(cacheObjSubType[`job_msg_del`], objJobPriority, j.UserID64, 0, time.Now().Add(p.Delay).UTC(), b)
}
}