This commit is contained in:
shoopea 2019-12-29 11:55:15 +08:00
parent 41f3fc9001
commit 34a3c1b29a

View File

@ -103,7 +103,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64) {
bkp := DataBackup{} bkp := DataBackup{}
s := new([]ChatWarsMessage) s := new([]ChatWarsMessage)
msgs := *s bkpmsgs := *s
for lastParsedID64 >= 0 { for lastParsedID64 >= 0 {
prevLastParsedID64 := lastParsedID64 prevLastParsedID64 := lastParsedID64
@ -151,7 +151,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64) {
} }
if m.ID64 != 0 { if m.ID64 != 0 {
msgs = append(msgs, m) bkpmsgs = append(bkpmsgs, m)
msgCount = msgCount + 1 msgCount = msgCount + 1
} }
default: default:
@ -186,7 +186,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64) {
log.Printf("Exported %d messages.\n", msgCount) log.Printf("Exported %d messages.\n", msgCount)
fmt.Printf("Exported %d messages.\n", msgCount) fmt.Printf("Exported %d messages.\n", msgCount)
bkp.Messages = msgs bkp.Messages = bkpmsgs
b, err := json.Marshal(bkp) b, err := json.Marshal(bkp)
logOnError(err, "getHistory : Marshal") logOnError(err, "getHistory : Marshal")