Clamp wrong dialog action progress instead of ignoring.

This commit is contained in:
levlam 2021-01-21 23:19:40 +03:00
parent 31265c93f1
commit 6729581d03

View File

@ -6,6 +6,8 @@
//
#include "td/telegram/DialogAction.h"
#include "td/utils/misc.h"
namespace td {
void DialogAction::init(Type type) {
@ -14,11 +16,8 @@ void DialogAction::init(Type type) {
}
void DialogAction::init(Type type, int32 progress) {
if (progress < 0 || progress > 100) {
progress = 0;
}
type_ = type;
progress_ = progress;
progress_ = clamp(progress, 0, 100);
}
DialogAction::DialogAction(Type type, int32 progress) {