@ -34,10 +34,7 @@ topicsAPI.create = async function (caller, data) {
const payload = { ... data } ;
const payload = { ... data } ;
payload . tags = payload . tags || [ ] ;
payload . tags = payload . tags || [ ] ;
payload . uid = caller . uid ;
apiHelpers . setDefaultPostData ( caller , payload ) ;
payload . req = apiHelpers . buildReqObject ( caller ) ;
payload . timestamp = Date . now ( ) ;
payload . fromQueue = false ;
// Blacklist & Post Queue
// Blacklist & Post Queue
await meta . blacklist . test ( caller . ip ) ;
await meta . blacklist . test ( caller . ip ) ;
@ -58,19 +55,8 @@ topicsAPI.create = async function (caller, data) {
} ;
} ;
topicsAPI . reply = async function ( caller , data ) {
topicsAPI . reply = async function ( caller , data ) {
const payload = {
const payload = { ... data } ;
tid : data . tid ,
apiHelpers . setDefaultPostData ( caller , payload ) ;
uid : caller . uid ,
req : apiHelpers . buildReqObject ( caller ) , // For IP recording
content : data . content ,
timestamp : Date . now ( ) ,
fromQueue : false ,
} ;
if ( data . toPid ) { payload . toPid = data . toPid ; }
if ( data . handle && ! parseInt ( caller . uid , 10 ) ) {
payload . handle = data . handle ;
}
// Blacklist & Post Queue
// Blacklist & Post Queue
await meta . blacklist . test ( caller . ip ) ;
await meta . blacklist . test ( caller . ip ) ;