This commit is contained in:
shoopea 2019-06-11 11:37:06 +08:00
parent 9591c7565d
commit 555fba5ab5
3 changed files with 5 additions and 9 deletions

View File

@ -16,16 +16,13 @@ func clientSendCWMsg(userID64 int64, s string) {
MQTGCmdQueue <- c MQTGCmdQueue <- c
} }
func clientRefreshCWMsg(chatID64 int64, msgID64 int64) { func clientRefreshCWMsg(userID64 int64, chatID64 int64, msgID64 int64) {
c := TGCommand{ c := TGCommand{
Type: commandRefreshMsg, Type: commandRefreshMsg,
FromUserID64: userID64,
FromChatID64: chatID64, FromChatID64: chatID64,
FromMsgID64: msgID64, FromMsgID64: msgID64,
} }
b, _ := json.Marshal(c)
log.Printf("clientRefreshCWMsg:\n%s\n", string(b))
MQTGCmdQueue <- c MQTGCmdQueue <- c
} }

5
job.go
View File

@ -367,7 +367,6 @@ func jobMsgRefresh(j Job) {
err = json.Unmarshal(j.Payload, &p) err = json.Unmarshal(j.Payload, &p)
logOnError(err, "jobMsgRefresh : Unmarshal payload") logOnError(err, "jobMsgRefresh : Unmarshal payload")
log.Printf("jobMsgRefresh : %d\n", p.ObjID64)
m, err := getObjMsg(p.ObjID64) m, err := getObjMsg(p.ObjID64)
logOnError(err, "jobMsgRefresh : getObjMsg") logOnError(err, "jobMsgRefresh : getObjMsg")
@ -375,9 +374,7 @@ func jobMsgRefresh(j Job) {
err = delObj(p.ObjID64) err = delObj(p.ObjID64)
logOnError(err, "jobMsgRefresh : delObj") logOnError(err, "jobMsgRefresh : delObj")
log.Printf("Refreshing message :\n%s\n", m.Text) clientRefreshCWMsg(m.UserID64, m.ChatID64, m.ID64)
clientRefreshCWMsg(m.ChatID64, m.ID64)
err = setJobDone(j.ID64) err = setJobDone(j.ID64)
logOnError(err, "joMsgClient : setJobDone") logOnError(err, "joMsgClient : setJobDone")

View File

@ -334,6 +334,8 @@ func MQTGCmdWorker(id int, cmds <-chan TGCommand) {
Body: []byte(j), Body: []byte(j),
}) })
logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Publishing message.") logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Publishing message.")
} else {
log.Printf("MQTGCmdWorker["+strconv.Itoa(id)+"] : client %d offline.\n", c.FromUserID64)
} }
} }