6 lines
260 B
JavaScript
6 lines
260 B
JavaScript
export function incoming(messages,known,call=''){
|
|
if(!known)return {bulletins:[],mail:[]};
|
|
const fresh=messages.filter(m=>!known.has(m.id)&&m.from!==call);
|
|
return {bulletins:fresh.filter(m=>m.type==='B'),mail:fresh.filter(m=>m.type==='P'||m.type==='T')};
|
|
}
|