mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Add /mark_all_as_read endpoint.
This change simplifies how we mark all messages as read. It also speeds up the backend by taking advantage of our partial index for unread messages. We also use a new statsd indicator.
This commit is contained in:
		@@ -10,12 +10,8 @@ exports.mark_all_as_read = function mark_all_as_read(cont) {
 | 
			
		||||
    unread_ui.update_unread_counts();
 | 
			
		||||
 | 
			
		||||
    channel.post({
 | 
			
		||||
        url:      '/json/messages/flags',
 | 
			
		||||
        url:      '/json/mark_all_as_read',
 | 
			
		||||
        idempotent: true,
 | 
			
		||||
        data:     {messages: JSON.stringify([]),
 | 
			
		||||
                   all:      true,
 | 
			
		||||
                   op:       'add',
 | 
			
		||||
                   flag:     'read'},
 | 
			
		||||
        success:  cont});
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user