mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Don't display "delete for everyone" on dices sent in previous 24 hours
Show single "Delete" button for "joined" and "deleted" peers
This commit is contained in:
@@ -974,10 +974,14 @@ func chatAvailableMessageActionsImpl(postbox: Postbox, accountPeerId: PeerId, me
|
||||
optionsMap[id]!.insert(.deleteLocally)
|
||||
} else if let peer = transaction.getPeer(id.peerId) {
|
||||
var isAction = false
|
||||
var isDice = false
|
||||
for media in message.media {
|
||||
if media is TelegramMediaAction || media is TelegramMediaExpiredContent {
|
||||
isAction = true
|
||||
}
|
||||
if media is TelegramMediaDice {
|
||||
isDice = true
|
||||
}
|
||||
}
|
||||
if let channel = peer as? TelegramChannel {
|
||||
if message.flags.contains(.Incoming) {
|
||||
@@ -1064,6 +1068,11 @@ func chatAvailableMessageActionsImpl(postbox: Postbox, accountPeerId: PeerId, me
|
||||
} else if limitsConfiguration.canRemoveIncomingMessagesInPrivateChats {
|
||||
canDeleteGlobally = true
|
||||
}
|
||||
|
||||
let timestamp = Int32(CFAbsoluteTimeGetCurrent() + NSTimeIntervalSince1970)
|
||||
if isDice && Int64(message.timestamp) + 60 * 60 * 24 > Int64(timestamp) {
|
||||
canDeleteGlobally = false
|
||||
}
|
||||
if message.flags.contains(.Incoming) {
|
||||
hadPersonalIncoming = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user