upd
This commit is contained in:
parent
c20116fa44
commit
5dc1275c71
6
td.go
6
td.go
@ -111,6 +111,8 @@ func getHistory(c *tdlib.Client) {
|
||||
var lastMsgID64 int64 = int64(math.MaxInt64)
|
||||
var msgCount int32 = 0
|
||||
|
||||
fmt.Printf("Retrieving chat.\n", msgCount)
|
||||
|
||||
conn, err := amqp.Dial("amqp://" + cfg.Rabbit.User + ":" + cfg.Rabbit.Password + "@" + cfg.Rabbit.Host + "/" + cfg.Rabbit.Queue)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@ -145,7 +147,7 @@ func getHistory(c *tdlib.Client) {
|
||||
logOnError(err, "Cannot get history")
|
||||
lastMsgID64 = -1
|
||||
}
|
||||
} else {
|
||||
} else if msgs.TotalCount > 0 {
|
||||
for _, msg := range msgs.Messages {
|
||||
switch msg.Content.GetMessageContentEnum() {
|
||||
case tdlib.MessageTextType:
|
||||
@ -180,6 +182,8 @@ func getHistory(c *tdlib.Client) {
|
||||
log.Printf("getHistory : no handler for %s\n", msg.Content.GetMessageContentEnum())
|
||||
}
|
||||
}
|
||||
} else {
|
||||
lastMsgID64 = -1
|
||||
}
|
||||
}
|
||||
log.Printf("Exported %d messages.\n", msgCount)
|
||||
|
Loading…
Reference in New Issue
Block a user