From 6b028742a72285b19dbedfc86cd9fbcc14bf97c2 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 4 May 2019 18:10:15 +0800 Subject: [PATCH] user filter --- td.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 {