import { IAGServer } from 'debe-socket-server' ; export function addFilterMiddleware ( server ) { server . setMiddleware ( server . MIDDLEWARE_OUTBOUND , async ( middlewareStream ) => { for await ( let action of middlewareStream ) { if ( action . type === action . PUBLISH_OUT ) { let [ origin , ... data ] = action . data ; if ( origin === action . socket . id ) { action . block ( ) ; continue ; } action . data = data ; } action . allow ( ) ; } } ) ; }