Fix deleting shortcut items.
This commit is contained in:
		
							parent
							
								
									fb539b0f70
								
							
						
					
					
						commit
						23e22de6ec
					
				
					 2 changed files with 17 additions and 2 deletions
				
			
		|  | @ -2037,6 +2037,9 @@ void HistoryItem::setRealId(MsgId newId) { | ||||||
| 
 | 
 | ||||||
| 	const auto oldId = std::exchange(id, newId); | 	const auto oldId = std::exchange(id, newId); | ||||||
| 	_flags &= ~(MessageFlag::BeingSent | MessageFlag::Local); | 	_flags &= ~(MessageFlag::BeingSent | MessageFlag::Local); | ||||||
|  | 	if (isBusinessShortcut()) { | ||||||
|  | 		_date = 0; | ||||||
|  | 	} | ||||||
| 	if (isRegular()) { | 	if (isRegular()) { | ||||||
| 		_history->unregisterClientSideMessage(this); | 		_history->unregisterClientSideMessage(this); | ||||||
| 	} | 	} | ||||||
|  | @ -2154,7 +2157,9 @@ bool HistoryItem::canDelete() const { | ||||||
| 		return false; | 		return false; | ||||||
| 	} else if (topicRootId() == id) { | 	} else if (topicRootId() == id) { | ||||||
| 		return false; | 		return false; | ||||||
| 	} else if (!isHistoryEntry() && !isScheduled()) { | 	} else if (!isHistoryEntry() | ||||||
|  | 		&& !isScheduled() | ||||||
|  | 		&& !isBusinessShortcut()) { | ||||||
| 		return false; | 		return false; | ||||||
| 	} | 	} | ||||||
| 	auto channel = _history->peer->asChannel(); | 	auto channel = _history->peer->asChannel(); | ||||||
|  |  | ||||||
|  | @ -164,6 +164,8 @@ private: | ||||||
| 
 | 
 | ||||||
| 	void pushReplyReturn(not_null<HistoryItem*> item); | 	void pushReplyReturn(not_null<HistoryItem*> item); | ||||||
| 	void checkReplyReturns(); | 	void checkReplyReturns(); | ||||||
|  | 	void confirmDeleteSelected(); | ||||||
|  | 	void clearSelected(); | ||||||
| 
 | 
 | ||||||
| 	void uploadFile(const QByteArray &fileContent, SendMediaType type); | 	void uploadFile(const QByteArray &fileContent, SendMediaType type); | ||||||
| 	bool confirmSendingFiles( | 	bool confirmSendingFiles( | ||||||
|  | @ -579,7 +581,7 @@ void ShortcutMessages::listCancelRequest() { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ShortcutMessages::listDeleteRequest() { | void ShortcutMessages::listDeleteRequest() { | ||||||
| 	//confirmDeleteSelected();
 | 	confirmDeleteSelected(); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void ShortcutMessages::listTryProcessKeyInput(not_null<QKeyEvent*> e) { | void ShortcutMessages::listTryProcessKeyInput(not_null<QKeyEvent*> e) { | ||||||
|  | @ -803,6 +805,14 @@ void ShortcutMessages::checkReplyReturns() { | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void ShortcutMessages::confirmDeleteSelected() { | ||||||
|  | 	ConfirmDeleteSelectedItems(_inner); | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void ShortcutMessages::clearSelected() { | ||||||
|  | 	_inner->cancelSelection(); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void ShortcutMessages::uploadFile( | void ShortcutMessages::uploadFile( | ||||||
| 		const QByteArray &fileContent, | 		const QByteArray &fileContent, | ||||||
| 		SendMediaType type) { | 		SendMediaType type) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 John Preston
						John Preston