feat: hide fetch old messages after 30 days
This commit is contained in:
parent
90e9e2d192
commit
3fef5c7a69
|
@ -167,8 +167,14 @@ Item {
|
|||
Component {
|
||||
id: fetchMoreMessagesButtonComponent
|
||||
Item {
|
||||
visible: chatsModel.activeChannel.chatType !== Constants.chatTypePrivateGroupChat || chatsModel.activeChannel.isMember
|
||||
id: wrapper
|
||||
property int gapNowAndOldestTimestamp: Date.now() / 1000 - chatsModel.oldestMsgTimestamp
|
||||
|
||||
visible: {
|
||||
|
||||
return gapNowAndOldestTimestamp < Constants.maxNbDaysToFetch * Constants.fetchRangeLast24Hours &&
|
||||
(chatsModel.activeChannel.chatType !== Constants.chatTypePrivateGroupChat || chatsModel.activeChannel.isMember)
|
||||
}
|
||||
id: wrapper
|
||||
height: wrapper.visible ? childrenRect.height + Style.current.smallPadding*2 : 0
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
|
|
@ -13,6 +13,7 @@ QtObject {
|
|||
readonly property int communityChatInvitationOnlyAccess: 2
|
||||
readonly property int communityChatOnRequestAccess: 3
|
||||
|
||||
readonly property int maxNbDaysToFetch: 30
|
||||
readonly property int fetchRangeLast24Hours: 86400
|
||||
readonly property int fetchRangeLast2Days: 172800
|
||||
readonly property int fetchRangeLast3Days: 259200
|
||||
|
|
Loading…
Reference in New Issue