user filter

This commit is contained in:
shoopea 2019-05-04 18:10:15 +08:00
parent 05ef0ceccb
commit 6b028742a7

4
td.go
View File

@ -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 {