From 4170f0ff951791a7eae7437d852847a4ce20ddea Mon Sep 17 00:00:00 2001 From: shoopea Date: Fri, 17 Jan 2020 12:27:01 +0800 Subject: [PATCH] update --- job.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/job.go b/job.go index 74e0e08..e78f11d 100644 --- a/job.go +++ b/job.go @@ -160,7 +160,7 @@ func setJobPayload(jobID64 int64, payload []byte) error { muxObjJob.Lock() j := cacheObjJob[jobID64] - j.Payload = b + j.Payload = payload cacheObjJob[jobID64] = j muxObjJob.Unlock() @@ -1506,6 +1506,10 @@ func jobGWithdraw(j Job) { } if id == cacheObjSubType[`msg_msg_job_gwithdraw_ack`] { + m, err := getObjMsg(j.Trigger) + logOnError(err, "jobGWithdraw : getObjMsg") + rule, err := getMsgParsingRule(m) + logOnError(err, "jobGWithdraw : getMsgParsingRule") cwm, err := parseSubTypeMessageJobGWithdrawAck(m, rule.re) logOnError(err, "jobGWithdraw : parseSubTypeMessageJobGWithdrawAck") in, err := hex.DecodeString(cwm.Ref) @@ -1544,7 +1548,7 @@ func jobGWithdraw(j Job) { p.Validated = true for _, d := range p.CleanupMsg { delmsg := tb.StoredMessage{ - MessageID: fmt.Sprintf("%d", d.MsgID64), + MessageID: fmt.Sprintf("%d", d.ID64), ChatID: d.ChatID64, } err = bot.Delete(delmsg) @@ -1561,7 +1565,7 @@ func jobGWithdraw(j Job) { } else { err = rescheduleJob(j.ID64, 0, time.Unix(maxUnixTimestamp, 0).UTC()) logOnError(err, "jobGWithdraw : rescheduleJob") - setJobCallback(j.ID64, int64(bot.Me.ID), cacheObjTypeId[`msg_job_gwithdraw_ack`]) + setJobCallback(j.ID64, int64(bot.Me.ID), cacheObjSubType[`msg_job_gwithdraw_ack`]) return } @@ -1682,7 +1686,7 @@ func jobGWithdraw(j Job) { b, _ := json.Marshal(p) id, err := createJob(cacheObjSubType[`job_gwithdraw`], objJobPriority, j.UserID64, 0, time.Unix(maxUnixTimestamp, 0).UTC(), b) logOnError(err, "jobGWithdraw : createJob") - setJobCallback(id, int64(bot.Me.ID), cacheObjTypeId[`msg_job_gwithdraw_ack`]) + setJobCallback(id, int64(bot.Me.ID), cacheObjSubType[`msg_job_gwithdraw_ack`]) sha256 := sha256.Sum256([]byte(cfg.Telegram.Token)) sha128 := sha256[:aes.BlockSize]