mirror of https://github.com/procxx/kepka.git
				
				
				
			Don't apply entry from dialogs if postponed.
This commit is contained in:
		
							parent
							
								
									f7144a55e2
								
							
						
					
					
						commit
						a84c7e0b06
					
				|  | @ -297,6 +297,10 @@ void Histories::sendDialogRequests() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Histories::dialogEntryApplied(not_null<History*> history) { | void Histories::dialogEntryApplied(not_null<History*> history) { | ||||||
|  | 	const auto state = lookup(history); | ||||||
|  | 	if (state->postponedRequestEntry) { | ||||||
|  | 		return; | ||||||
|  | 	} | ||||||
| 	history->dialogEntryApplied(); | 	history->dialogEntryApplied(); | ||||||
| 	if (const auto callbacks = _dialogRequestsPending.take(history)) { | 	if (const auto callbacks = _dialogRequestsPending.take(history)) { | ||||||
| 		for (const auto &callback : *callbacks) { | 		for (const auto &callback : *callbacks) { | ||||||
|  | @ -308,13 +312,11 @@ void Histories::dialogEntryApplied(not_null<History*> history) { | ||||||
| 			callback(); | 			callback(); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 	if (const auto state = lookup(history)) { | 	if (state && state->sentReadTill && state->sentReadDone) { | ||||||
| 		if (state->sentReadTill && state->sentReadDone) { |  | ||||||
| 		history->setInboxReadTill(base::take(state->sentReadTill)); | 		history->setInboxReadTill(base::take(state->sentReadTill)); | ||||||
| 		checkEmptyState(history); | 		checkEmptyState(history); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| void Histories::applyPeerDialogs(const MTPmessages_PeerDialogs &dialogs) { | void Histories::applyPeerDialogs(const MTPmessages_PeerDialogs &dialogs) { | ||||||
| 	Expects(dialogs.type() == mtpc_messages_peerDialogs); | 	Expects(dialogs.type() == mtpc_messages_peerDialogs); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue