Some logging for some strange issues...

This commit is contained in:
Sebastian Wolf 2021-12-14 23:22:21 +01:00
parent fe9cd73798
commit 7bfa4a54e0
No known key found for this signature in database
GPG key ID: CEA9522B5F38A90A

View file

@ -702,10 +702,14 @@ Page {
}
onTriggered: {
Debug.log("scroll position changed, message index: ", lastQueuedIndex);
Debug.log("unread count: ", chatInformation.unread_count);
var messageToRead = chatModel.getMessage(lastQueuedIndex);
if (messageToRead['@type'] === "sponsoredMessage") {
Debug.log("sponsored message to read: ", messageToRead.id);
tdLibWrapper.viewSponsoredMessage(chatInformation.id, messageToRead.id);
} else if (chatInformation.unread_count > 0 && lastQueuedIndex > -1) {
Debug.log("message to read: ", messageToRead.id);
if (messageToRead && messageToRead.id) {
tdLibWrapper.viewMessage(chatInformation.id, messageToRead.id, false);
}