Fixed work with _msgIdToEdit in FileLoadTask.
- Added check is allowed media editing in paintEvent. - Fixes #5885.
This commit is contained in:
		
							parent
							
								
									3744bdcbe7
								
							
						
					
					
						commit
						37af963717
					
				
					 3 changed files with 5 additions and 2 deletions
				
			
		|  | @ -726,7 +726,9 @@ void EditCaptionBox::paintEvent(QPaintEvent *e) { | ||||||
| 			nameright = 0; | 			nameright = 0; | ||||||
| 			statustop = st::msgFileStatusTop - st::msgFilePadding.top(); | 			statustop = st::msgFileStatusTop - st::msgFilePadding.top(); | ||||||
| 		} | 		} | ||||||
| 		const auto editButton = _editMedia->width() + st::editMediaButtonSkip; | 		const auto editButton = _isAllowedEditMedia | ||||||
|  | 			? _editMedia->width() + st::editMediaButtonSkip | ||||||
|  | 			: 0; | ||||||
| 		const auto namewidth = w - nameleft - editButton; | 		const auto namewidth = w - nameleft - editButton; | ||||||
| 		const auto x = (width() - w) / 2, y = st::boxPhotoPadding.top(); | 		const auto x = (width() - w) / 2, y = st::boxPhotoPadding.top(); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -539,6 +539,7 @@ FileLoadTask::FileLoadTask( | ||||||
| , _type(type) | , _type(type) | ||||||
| , _caption(caption) | , _caption(caption) | ||||||
| , _msgIdToEdit(msgIdToEdit) { | , _msgIdToEdit(msgIdToEdit) { | ||||||
|  | 	Expects(_msgIdToEdit == 0 || IsServerMsgId(_msgIdToEdit)); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| FileLoadTask::FileLoadTask( | FileLoadTask::FileLoadTask( | ||||||
|  |  | ||||||
|  | @ -323,7 +323,7 @@ private: | ||||||
| 	VoiceWaveform _waveform; | 	VoiceWaveform _waveform; | ||||||
| 	SendMediaType _type; | 	SendMediaType _type; | ||||||
| 	TextWithTags _caption; | 	TextWithTags _caption; | ||||||
| 	MsgId _msgIdToEdit; | 	MsgId _msgIdToEdit = 0; | ||||||
| 
 | 
 | ||||||
| 	std::shared_ptr<FileLoadResult> _result; | 	std::shared_ptr<FileLoadResult> _result; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 23rd
						23rd