mirror of https://github.com/procxx/kepka.git
				
				
				
			Copy correct text for a forwarded reply message.
This commit is contained in:
		
							parent
							
								
									7c6bb132ce
								
							
						
					
					
						commit
						a5e0b19b79
					
				| 
						 | 
					@ -1288,6 +1288,15 @@ TextWithEntities HistoryMessage::selectedText(TextSelection selection) const {
 | 
				
			||||||
		result.text += qstr("\n\n");
 | 
							result.text += qstr("\n\n");
 | 
				
			||||||
		TextUtilities::Append(result, std::move(logEntryOriginalResult));
 | 
							TextUtilities::Append(result, std::move(logEntryOriginalResult));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if (auto reply = Get<HistoryMessageReply>()) {
 | 
				
			||||||
 | 
							if (selection == FullSelection && reply->replyToMsg) {
 | 
				
			||||||
 | 
								TextWithEntities wrapped;
 | 
				
			||||||
 | 
								wrapped.text.reserve(lang(lng_in_reply_to).size() + reply->replyToMsg->author()->name.size() + 4 + result.text.size());
 | 
				
			||||||
 | 
								wrapped.text.append('[').append(lang(lng_in_reply_to)).append(' ').append(reply->replyToMsg->author()->name).append(qsl("]\n"));
 | 
				
			||||||
 | 
								TextUtilities::Append(wrapped, std::move(result));
 | 
				
			||||||
 | 
								result = wrapped;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if (auto forwarded = Get<HistoryMessageForwarded>()) {
 | 
						if (auto forwarded = Get<HistoryMessageForwarded>()) {
 | 
				
			||||||
		if (selection == FullSelection) {
 | 
							if (selection == FullSelection) {
 | 
				
			||||||
			auto fwdinfo = forwarded->_text.originalTextWithEntities(AllTextSelection, ExpandLinksAll);
 | 
								auto fwdinfo = forwarded->_text.originalTextWithEntities(AllTextSelection, ExpandLinksAll);
 | 
				
			||||||
| 
						 | 
					@ -1301,15 +1310,6 @@ TextWithEntities HistoryMessage::selectedText(TextSelection selection) const {
 | 
				
			||||||
			result = wrapped;
 | 
								result = wrapped;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (auto reply = Get<HistoryMessageReply>()) {
 | 
					 | 
				
			||||||
		if (selection == FullSelection && reply->replyToMsg) {
 | 
					 | 
				
			||||||
			TextWithEntities wrapped;
 | 
					 | 
				
			||||||
			wrapped.text.reserve(lang(lng_in_reply_to).size() + reply->replyToMsg->author()->name.size() + 4 + result.text.size());
 | 
					 | 
				
			||||||
			wrapped.text.append('[').append(lang(lng_in_reply_to)).append(' ').append(reply->replyToMsg->author()->name).append(qsl("]\n"));
 | 
					 | 
				
			||||||
			TextUtilities::Append(wrapped, std::move(result));
 | 
					 | 
				
			||||||
			result = wrapped;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	return result;
 | 
						return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue