mirror of https://github.com/procxx/kepka.git
				
				
				
			Fix call discard when hanging up before request.
This commit is contained in:
		
							parent
							
								
									622fbdb64b
								
							
						
					
					
						commit
						b3d5ac1660
					
				|  | @ -136,18 +136,19 @@ void Call::startOutgoing() { | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		auto &phoneCall = call.vphone_call; | ||||||
|  | 		auto &waitingCall = phoneCall.c_phoneCallWaiting(); | ||||||
|  | 		_id = waitingCall.vid.v; | ||||||
|  | 		_accessHash = waitingCall.vaccess_hash.v; | ||||||
| 		setState(State::Waiting); | 		setState(State::Waiting); | ||||||
| 
 | 
 | ||||||
| 		if (_finishAfterRequestingCall) { | 		if (_finishAfterRequestingCall) { | ||||||
| 			hangup(); | 			hangup(); | ||||||
| 			return; | 			return; | ||||||
| 		} | 		} | ||||||
| 		_discardByTimeoutTimer.callOnce(Global::CallReceiveTimeoutMs()); |  | ||||||
| 
 | 
 | ||||||
| 		auto &phoneCall = call.vphone_call.c_phoneCallWaiting(); | 		_discardByTimeoutTimer.callOnce(Global::CallReceiveTimeoutMs()); | ||||||
| 		_id = phoneCall.vid.v; | 		handleUpdate(phoneCall); | ||||||
| 		_accessHash = phoneCall.vaccess_hash.v; |  | ||||||
| 		handleUpdate(call.vphone_call); |  | ||||||
| 	}).fail([this](const RPCError &error) { | 	}).fail([this](const RPCError &error) { | ||||||
| 		handleRequestError(error); | 		handleRequestError(error); | ||||||
| 	}).send(); | 	}).send(); | ||||||
|  |  | ||||||
|  | @ -87,7 +87,9 @@ TopBar::TopBar(QWidget *parent, const base::weak_unique_ptr<Call> &call) : TWidg | ||||||
| 
 | 
 | ||||||
| void TopBar::initControls() { | void TopBar::initControls() { | ||||||
| 	_mute->setClickedCallback([this] { | 	_mute->setClickedCallback([this] { | ||||||
| 		_call->setMute(!_call->isMute()); | 		if (auto call = _call.get()) { | ||||||
|  | 			call->setMute(!call->isMute()); | ||||||
|  | 		} | ||||||
| 	}); | 	}); | ||||||
| 	setMuted(_call->isMute()); | 	setMuted(_call->isMute()); | ||||||
| 	subscribe(_call->muteChanged(), [this](bool mute) { | 	subscribe(_call->muteChanged(), [this](bool mute) { | ||||||
|  | @ -104,8 +106,8 @@ void TopBar::initControls() { | ||||||
| 		} | 		} | ||||||
| 	}); | 	}); | ||||||
| 	_hangup->setClickedCallback([this] { | 	_hangup->setClickedCallback([this] { | ||||||
| 		if (_call) { | 		if (auto call = _call.get()) { | ||||||
| 			_call->hangup(); | 			call->hangup(); | ||||||
| 		} | 		} | ||||||
| 	}); | 	}); | ||||||
| 	_updateDurationTimer.setCallback([this] { updateDurationText(); }); | 	_updateDurationTimer.setCallback([this] { updateDurationText(); }); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue