mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 14:03:30 +00:00 
			
		
		
		
	compose: Check if raw_content is present when quoting.
				
					
				
			If `raw_content` is already present for the selected message, there is no need to make a request to the server.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							6546fb3f1d
						
					
				
				
					commit
					f37e4df471
				
			@@ -388,10 +388,17 @@ exports.on_topic_narrow = function () {
 | 
			
		||||
exports.quote_and_reply = function (opts) {
 | 
			
		||||
    var textarea = $("#compose-textarea");
 | 
			
		||||
    var message_id = current_msg_list.selected_id();
 | 
			
		||||
    var message = current_msg_list.selected_message();
 | 
			
		||||
 | 
			
		||||
    exports.respond_to_message(opts);
 | 
			
		||||
    compose_ui.insert_syntax_and_focus("[Quoting…]\n", textarea);
 | 
			
		||||
 | 
			
		||||
    if (message && message.raw_content) {
 | 
			
		||||
        compose_ui.replace_syntax('[Quoting…]', '```quote\n' + message.raw_content + '\n```', textarea);
 | 
			
		||||
        $("#compose-textarea").trigger("autosize.resize");
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    channel.get({
 | 
			
		||||
        url: '/json/messages/' + message_id,
 | 
			
		||||
        idempotent: true,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user