mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Use user ids in JS-side "pm-with" filter.
We now convert our pm-with search operand to a list of user ids for matching against messages, rather than using emails. On the message side we look at user ids from display_recipient.
This commit is contained in:
		@@ -101,9 +101,19 @@ function message_matches_search_term(message, operator, operand) {
 | 
			
		||||
 | 
			
		||||
    case 'pm-with':
 | 
			
		||||
        // TODO: use user_ids, not emails here
 | 
			
		||||
        return (message.type === 'private') &&
 | 
			
		||||
            (util.normalize_recipients(message.reply_to) ===
 | 
			
		||||
            util.normalize_recipients(operand));
 | 
			
		||||
        if (message.type !== 'private') {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        var operand_ids = people.pm_with_operand_ids(operand);
 | 
			
		||||
        if (!operand_ids) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
        var message_ids = people.pm_with_user_ids(message);
 | 
			
		||||
        if (!message_ids) {
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return _.isEqual(operand_ids, message_ids);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return true; // unknown operators return true (effectively ignored)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user