Fix inline bots with photos.
This commit is contained in:
		
							parent
							
								
									f792b0052f
								
							
						
					
					
						commit
						7de15ce5cf
					
				
					 2 changed files with 10 additions and 9 deletions
				
			
		| 
						 | 
					@ -107,7 +107,8 @@ std::unique_ptr<Result> Result::create(uint64 queryId, const MTPBotInlineResult
 | 
				
			||||||
		message = &r.vsend_message;
 | 
							message = &r.vsend_message;
 | 
				
			||||||
	} break;
 | 
						} break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	bool badAttachment = (result->_photo && !result->_photo->access) || (result->_document && !result->_document->isValid());
 | 
						auto badAttachment = (result->_photo && result->_photo->full->isNull())
 | 
				
			||||||
 | 
							|| (result->_document && !result->_document->isValid());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!message) {
 | 
						if (!message) {
 | 
				
			||||||
		return nullptr;
 | 
							return nullptr;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1324,10 +1324,10 @@ Image *getImage(const MTPDwebDocumentNoProxy &document) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Image *getImage(const MTPDwebDocument &document, QSize box) {
 | 
					Image *getImage(const MTPDwebDocument &document, QSize box) {
 | 
				
			||||||
	const auto size = getImageSize(document.vattributes.v);
 | 
						//const auto size = getImageSize(document.vattributes.v);
 | 
				
			||||||
	if (size.isEmpty()) {
 | 
						//if (size.isEmpty()) {
 | 
				
			||||||
		return blank();
 | 
						//	return blank();
 | 
				
			||||||
	}
 | 
						//}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// We don't use size from WebDocument, because it is not reliable.
 | 
						// We don't use size from WebDocument, because it is not reliable.
 | 
				
			||||||
	// It can be > 0 and different from the real size that we get in upload.WebFile result.
 | 
						// It can be > 0 and different from the real size that we get in upload.WebFile result.
 | 
				
			||||||
| 
						 | 
					@ -1342,10 +1342,10 @@ Image *getImage(const MTPDwebDocument &document, QSize box) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Image *getImage(const MTPDwebDocumentNoProxy &document, QSize box) {
 | 
					Image *getImage(const MTPDwebDocumentNoProxy &document, QSize box) {
 | 
				
			||||||
	const auto size = getImageSize(document.vattributes.v);
 | 
						//const auto size = getImageSize(document.vattributes.v);
 | 
				
			||||||
	if (size.isEmpty()) {
 | 
						//if (size.isEmpty()) {
 | 
				
			||||||
		return blank();
 | 
						//	return blank();
 | 
				
			||||||
	}
 | 
						//}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return getImage(qs(document.vurl), box);
 | 
						return getImage(qs(document.vurl), box);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue