Fix ref duration

This commit is contained in:
Isaac
2024-11-29 21:46:10 +04:00
parent 7eed291fbf
commit ef3b593aa6
5 changed files with 69 additions and 55 deletions

View File

@@ -589,6 +589,18 @@ func _internal_removeChatManagingBot(account: Account, chatId: EnginePeer.Id) ->
}
}
public func formatPermille(_ value: Int32) -> String {
return formatPermille(Int(value))
}
public func formatPermille(_ value: Int) -> String {
if value % 10 == 0 {
return "\(value / 10)"
} else {
return String(format: "%.1f", Double(value) / 10.0)
}
}
func _internal_updateStarRefProgram(account: Account, id: EnginePeer.Id, program: (commissionPermille: Int32, durationMonths: Int32?)?) -> Signal<Never, NoError> {
return account.postbox.transaction { transaction -> Api.InputUser? in
return transaction.getPeer(id).flatMap(apiInputUser)