diff --git a/td.go b/td.go index d44143f..69354da 100644 --- a/td.go +++ b/td.go @@ -80,6 +80,8 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { chat = *chatID64 } + fmt.Printf("Exporting historic messages for chat %d from user %d ...\n", chat, *senderUserID64) + for lastMsgID64 >= 0 { msgs, err := c.GetChatHistory(chat, lastMsgID64, 0, 10, false) if err != nil { @@ -116,7 +118,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { } } - if m.ID64 != 0 { + if m.ID64 != 0 && (*senderUserID64 == 0 || m.SenderUserID64 == *senderUserID64) { MQCWMsgQueue <- m if m.ID64 < lastMsgID64 {