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) id, err := getObjSubTypeId(j.Trigger)
if id == p.MsgTypeID64 { if id == p.MsgTypeID64 {
if p.Delay == 0 { if p.Delay == 0 {
obj, err = getObjMsg(j.Trigger) obj, err := getObjMsg(j.Trigger)
clientDelTGMsg(j.UserID64, obj.ID64, obj.ChatID64) clientDelTGMsg(j.UserID64, obj.ID64, obj.ChatID64)
} else { } else {
p.ObjMsgID64 = j.Trigger p.ObjMsgID64 = j.Trigger
b, _ := json.Marshal(p) 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 { } else {
log.Printf("jobMsgDelete : cannot identify msg to delete") log.Printf("jobMsgDelete : cannot identify msg to delete")
@ -617,7 +617,7 @@ func jobMsgDelete(j Job) {
clientDelTGMsg(j.UserID64, obj.ID64, obj.ChatID64) clientDelTGMsg(j.UserID64, obj.ID64, obj.ChatID64)
} else { } else {
b, _ := json.Marshal(p) 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)
} }
} }