getemaillistforpmc: function()

in custom/asf.js [375:397]


    getemaillistforpmc: function(pmc, cb) {
        var pmcfull = pmc+".apache.org"
        var listname = "dev@"+pmcfull;
        try {
	    request('https://lists.apache.org/api/preferences.lua', {json:true},(err,cbres,body) => {
	        if (err) {console.log(err);}
	        else if (cbres.statusCode != 200) {console.log(cbres); }
                else {
                    if (body.lists && body.lists[pmcfull]) {
                        if (body.lists[pmcfull]["users"]) {
                            listname = "users@"+pmcfull;
                        } else if (body.lists[pmcfull]["user"]) {
                            listname = "user@"+pmcfull;                            
                        }
                    }
                }
                cb(listname);
            });           
        } catch (error) {
            console.log(error);
            cb(listname);
        }    
    }