Skip to content

Commit

Permalink
Use UserId in CallActor.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Jul 26, 2021
1 parent ff02c55 commit a63ba2b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
22 changes: 11 additions & 11 deletions td/telegram/CallActor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ Status CallActor::do_update_call(telegram_api::phoneCallWaiting &call) {
call_access_hash_ = call.access_hash_;
is_call_id_inited_ = true;
is_video_ |= (call.flags_ & telegram_api::phoneCallWaiting::VIDEO_MASK) != 0;
call_admin_id_ = call.admin_id_;
call_participant_id_ = call.participant_id_;
call_admin_id_ = UserId(call.admin_id_);
// call_participant_id_ = UserId(call.participant_id_);
if (call_id_promise_) {
call_id_promise_.set_value(std::move(call.id_));
}
Expand All @@ -405,8 +405,8 @@ Status CallActor::do_update_call(telegram_api::phoneCallRequested &call) {
call_access_hash_ = call.access_hash_;
is_call_id_inited_ = true;
is_video_ |= (call.flags_ & telegram_api::phoneCallRequested::VIDEO_MASK) != 0;
call_admin_id_ = call.admin_id_;
call_participant_id_ = call.participant_id_;
call_admin_id_ = UserId(call.admin_id_);
// call_participant_id_ = UserId(call.participant_id_);
if (call_id_promise_) {
call_id_promise_.set_value(std::move(call.id_));
}
Expand Down Expand Up @@ -438,8 +438,8 @@ Status CallActor::do_update_call(telegram_api::phoneCallAccepted &call) {
call_id_ = call.id_;
call_access_hash_ = call.access_hash_;
is_call_id_inited_ = true;
call_admin_id_ = call.admin_id_;
call_participant_id_ = call.participant_id_;
call_admin_id_ = UserId(call.admin_id_);
// call_participant_id_ = UserId(call.participant_id_);
if (call_id_promise_) {
call_id_promise_.set_value(std::move(call.id_));
}
Expand Down Expand Up @@ -748,13 +748,13 @@ void CallActor::flush_call_state() {
if (!has_notification_) {
has_notification_ = true;
send_closure(G()->notification_manager(), &NotificationManager::add_call_notification,
DialogId(UserId(call_admin_id_)), local_call_id_);
DialogId(call_admin_id_), local_call_id_);
}
} else {
if (has_notification_) {
has_notification_ = false;
send_closure(G()->notification_manager(), &NotificationManager::remove_call_notification,
DialogId(UserId(call_admin_id_)), local_call_id_);
DialogId(call_admin_id_), local_call_id_);
}
}
}
Expand All @@ -767,9 +767,9 @@ void CallActor::flush_call_state() {
// TODO can't call const function
// send_closure(G()->contacts_manager(), &ContactsManager::get_user_id_object, user_id_, "flush_call_state");
send_closure(G()->td(), &Td::send_update,
make_tl_object<td_api::updateCall>(
make_tl_object<td_api::call>(local_call_id_.get(), is_outgoing_ ? user_id_.get() : call_admin_id_,
is_outgoing_, is_video_, call_state_.get_call_state_object())));
make_tl_object<td_api::updateCall>(make_tl_object<td_api::call>(
local_call_id_.get(), is_outgoing_ ? user_id_.get() : call_admin_id_.get(), is_outgoing_,
is_video_, call_state_.get_call_state_object())));
}
}

Expand Down
4 changes: 2 additions & 2 deletions td/telegram/CallActor.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ class CallActor final : public NetQueryCallback {
bool is_call_id_inited_{false};
bool has_notification_{false};
int64 call_access_hash_{0};
int32 call_admin_id_{0};
int32 call_participant_id_{0};
UserId call_admin_id_;
// UserId call_participant_id_;

CallState call_state_;
bool call_state_need_flush_{false};
Expand Down

0 comments on commit a63ba2b

Please sign in to comment.