mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	message edit: Add frontend support for stream-change events.
This is part of #6427, adding support for live-updating the Zulip UI to move messages to a new topic. As noted in the comments, there is still a bug to be fixed here involving guest users, but the overall implementation is pretty well tested manually (which is how we test most message-edit UI work since there's so much complexity involved). Co-Authored-By: Wbert Adrián Castro Vera <wbertc@gmail.com>
This commit is contained in:
		@@ -393,8 +393,9 @@ exports.get_unread_messages = function (messages) {
 | 
			
		||||
 | 
			
		||||
exports.update_unread_topics = function (msg, event) {
 | 
			
		||||
    const new_topic = util.get_edit_event_topic(event);
 | 
			
		||||
    const {new_stream_id} = event;
 | 
			
		||||
 | 
			
		||||
    if (new_topic === undefined) {
 | 
			
		||||
    if (new_topic === undefined && new_stream_id === undefined) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -407,8 +408,8 @@ exports.update_unread_topics = function (msg, event) {
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    exports.unread_topic_counter.add(
 | 
			
		||||
        msg.stream_id,
 | 
			
		||||
        new_topic,
 | 
			
		||||
        new_stream_id || msg.stream_id,
 | 
			
		||||
        new_topic || msg.topic,
 | 
			
		||||
        msg.id
 | 
			
		||||
    );
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user