tdlight-java icon indicating copy to clipboard operation
tdlight-java copied to clipboard

GetChatHistory not respecting offset int

Open robzsaunders opened this issue 1 year ago • 1 comments

Hey there @cavallium,

The offset is not doing anything for some reason. In an older version when I used a negative number it flipped the results order... and a positive number just breaks the call all together.

Can you take a look please or let me know how I'm using it wrong?

The expected behavior is with a -1 offset (or positive 1 idk) will skip the first message.

Thanks

GetChatHistory getHist = new GetChatHistory(chanID, 0, -1, 99, false); // what the fuck is going on here
            client.send(getHist).thenAccept(messages -> {
                if (messages instanceof Messages) {
                    Messages messageList = (Messages) messages;
                    for (TdApi.Message message : messageList.messages) {
                        //do stuff
                    }
                }
            });

robzsaunders avatar Apr 10 '24 19:04 robzsaunders

Did you read this? https://tdlight-team.github.io/tdlight-docs/tdlight.api/it/tdlight/jni/TdApi.GetChatHistory.html

cavallium avatar Apr 16 '24 17:04 cavallium