diff --git a/td/telegram/InputGroupCallId.cpp b/td/telegram/InputGroupCallId.cpp index 74c2f04d4..1bc29c7d0 100644 --- a/td/telegram/InputGroupCallId.cpp +++ b/td/telegram/InputGroupCallId.cpp @@ -15,8 +15,11 @@ InputGroupCallId::InputGroupCallId(const tl_object_ptrid_), access_hash(input_group_call->access_hash_) { } -Result InputGroupCallId::from_group_call_id(const string &group_call_id) { +Result InputGroupCallId::from_group_call_id(const string &group_call_id, bool allow_empty) { if (group_call_id.empty()) { + if (!allow_empty) { + return Status::Error(400, "Empty group call identifier specified"); + } return InputGroupCallId(); } diff --git a/td/telegram/InputGroupCallId.h b/td/telegram/InputGroupCallId.h index b8583e1e6..e8f1d1313 100644 --- a/td/telegram/InputGroupCallId.h +++ b/td/telegram/InputGroupCallId.h @@ -28,7 +28,7 @@ class InputGroupCallId { InputGroupCallId(int64 group_call_id, int64 access_hash) : group_call_id(group_call_id), access_hash(access_hash) { } - static Result from_group_call_id(const string &group_call_id); + static Result from_group_call_id(const string &group_call_id, bool allow_empty = false); string get_group_call_id() const;