 a0ffa15885
			
		
	
	
		a0ffa15885
		
	
	
	
	
		
			
			Also use uint32 for bool-bitfields, otherwise:
int a : 1 = 0;
...
const auto test = true;
const auto b = test ? 1 : 0;
if (a != b) {
    a = b;
    ...
}
Assert(a == b); // Violation, because a == -1, not 1 (after a = b).
		
	
			
		
			
				
	
	
		
			41 lines
		
	
	
	
		
			880 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			41 lines
		
	
	
	
		
			880 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
| This file is part of Telegram Desktop,
 | |
| the official desktop application for the Telegram messaging service.
 | |
| 
 | |
| For license and copyright information please follow this link:
 | |
| https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
 | |
| */
 | |
| #pragma once
 | |
| 
 | |
| #include "base/weak_ptr.h"
 | |
| 
 | |
| #include <QtGui/QImage>
 | |
| 
 | |
| namespace Ui {
 | |
| 
 | |
| class EmptyUserpic;
 | |
| 
 | |
| [[nodiscard]] float64 ForumUserpicRadiusMultiplier();
 | |
| 
 | |
| struct PeerUserpicView {
 | |
| 	[[nodiscard]] bool null() const {
 | |
| 		return cached.isNull() && !cloud && empty.null();
 | |
| 	}
 | |
| 
 | |
| 	QImage cached;
 | |
| 	std::shared_ptr<QImage> cloud;
 | |
| 	base::weak_ptr<const EmptyUserpic> empty;
 | |
| 	uint32 paletteVersion : 31 = 0;
 | |
| 	uint32 forum : 1 = 0;
 | |
| };
 | |
| 
 | |
| [[nodiscard]] bool PeerUserpicLoading(const PeerUserpicView &view);
 | |
| 
 | |
| void ValidateUserpicCache(
 | |
| 	PeerUserpicView &view,
 | |
| 	const QImage *cloud,
 | |
| 	const EmptyUserpic *empty,
 | |
| 	int size,
 | |
| 	bool forum);
 | |
| 
 | |
| } // namespace Ui
 |