mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	edit_history: Don't repeat date rows.
Previously, the logic for when to add a date row to an edit history
entry was checking against the date of the original message (which is
always the first entry in the message history), not the date of the
previous edit. This caused every edit not made on the date of the
original message to show a date row, even if it wasn't the first edit
on that date.
This commit fixes that bug by updating prev_timestamp after processing
each message history entry, whereas before it was only updated after
processing the first one — the original message.
This bug has existed since June 2017, when
84e5fe733c changed how date rows worked;
from only showing one at the top labeled "Earliest" to each entry
having a possibilty of showing one.
			
			
This commit is contained in:
		@@ -23,7 +23,6 @@ exports.fetch_and_render_message_history = function (message) {
 | 
			
		||||
                if (index === 0) {
 | 
			
		||||
                    item.posted_or_edited = "Posted by";
 | 
			
		||||
                    item.body_to_render = msg.rendered_content;
 | 
			
		||||
                    prev_timestamp = timestamp;
 | 
			
		||||
                    item.show_date_row = true;
 | 
			
		||||
                } else if (msg.prev_topic && msg.prev_content) {
 | 
			
		||||
                    item.posted_or_edited = "Edited by";
 | 
			
		||||
@@ -46,6 +45,8 @@ exports.fetch_and_render_message_history = function (message) {
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                content_edit_history.push(item);
 | 
			
		||||
 | 
			
		||||
                prev_timestamp = timestamp;
 | 
			
		||||
            }
 | 
			
		||||
            $('#message-history').attr('data-message-id', message.id);
 | 
			
		||||
            $('#message-history').html(render_message_edit_history({
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user