mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	refactor: Change params for subs.mark_subscribed().
We pass in sub instead of stream_name, to support callers that already do lookups by stream id. And then we make the second optional argument be subscribers, since that is all we were using from the old `attrs` argument.
This commit is contained in:
		@@ -177,8 +177,13 @@ function dispatch_normal_event(event) {
 | 
			
		||||
        var email;
 | 
			
		||||
 | 
			
		||||
        if (event.op === 'add') {
 | 
			
		||||
            _.each(event.subscriptions, function (sub) {
 | 
			
		||||
                subs.mark_subscribed(sub.name, sub);
 | 
			
		||||
            _.each(event.subscriptions, function (rec) {
 | 
			
		||||
                var sub = stream_data.get_sub_by_id(rec.stream_id);
 | 
			
		||||
                if (sub) {
 | 
			
		||||
                    subs.mark_subscribed(sub, rec.subscribers);
 | 
			
		||||
                } else {
 | 
			
		||||
                    blueslip.error('Subscribing to unknown stream' + rec.stream_id);
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
        } else if (event.op === 'peer_add') {
 | 
			
		||||
            // TODO: remove email shim here and fix called functions
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user