mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Add activity.short_huddle_name().
(imported from commit e3f0389298631fd06169dbc9559691470ac19d00)
This commit is contained in:
		@@ -74,6 +74,24 @@ exports.full_huddle_name = function (huddle) {
 | 
			
		||||
    return names.join(', ');
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.short_huddle_name = function (huddle) {
 | 
			
		||||
    var emails = huddle.split(',');
 | 
			
		||||
 | 
			
		||||
    var names = _.map(emails.slice(0,2), function (email) {
 | 
			
		||||
        var person = people_dict.get(email);
 | 
			
		||||
        return person ? person.full_name : email;
 | 
			
		||||
    });
 | 
			
		||||
    var others = emails.length - 2;
 | 
			
		||||
 | 
			
		||||
    if (others === 1) {
 | 
			
		||||
        names.push("+ 1 other");
 | 
			
		||||
    } else if (others >= 2) {
 | 
			
		||||
        names.push("+ " + others + " others");
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return names.join(', ');
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
exports.huddle_fraction_present = function (huddle, presence_info) {
 | 
			
		||||
    var emails = huddle.split(',');
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user