diff --git a/td.go b/td.go index 7c0f721..8b26342 100644 --- a/td.go +++ b/td.go @@ -110,6 +110,7 @@ func ListenCW(c *tdlib.Client) { func getHistory(c *tdlib.Client) { var lastMsgID64 int64 = int64(math.MaxInt64) var msgCount int32 = 0 + var lastMsgTime Time = time.Now() fmt.Printf("Retrieving chat.\n") @@ -142,7 +143,7 @@ func getHistory(c *tdlib.Client) { if err != nil { if err.Error() == "timeout" { logOnError(err, "Waiting...") - fmt.Printf("Waiting (%d messages retrieved).\n", msgCount) + fmt.Printf("Waiting : %d messages retrieved from %s ...\n", msgCount, lastMsgTime.Format(time.RFC3339)) } else { logOnError(err, "Cannot get history") lastMsgID64 = -1 @@ -176,6 +177,7 @@ func getHistory(c *tdlib.Client) { }) if msg.ID < lastMsgID64 { lastMsgID64 = msg.ID + lastMsgTime = time.Unix(m.Date, 0) } msgCount = msgCount + 1 default: