js/clients/SparkCore.js
function (isPublic, name, data, ttl, published_at, coreid) {
        var rawFn = function (msg) {
            try {
                msg.setMaxAge(parseInt((ttl && (ttl >= 0)) ? ttl : 60));
                if (published_at) {
                    msg.setTimestamp(moment(published_at).toDate());
                }
            }
            catch (ex) {
                logger.error("onCoreHeard - " + ex);
            }
            return msg;
        };

        var msgName = (isPublic) ? "PublicEvent" : "PrivateEvent";
        var userID = (this.userID || "").toLowerCase() + "/";
        name = (name) ? name.toString() : name;
        if (name && name.indexOf && (name.indexOf(userID) == 0)) {
            name = name.substring(userID.length);
        }

        data = (data) ? data.toString() : data;
        this.sendNONTypeMessage(msgName, { event_name: name, _raw: rawFn }, data);
    }
function (isPublic, name, data, ttl, published_at, coreid) {
        var rawFn = function (msg) {
            try {
                msg.setMaxAge(parseInt((ttl && (ttl >= 0)) ? ttl : 60));
                if (published_at) {
                    msg.setTimestamp(moment(published_at).toDate());
                }
            }
            catch (ex) {
                logger.error("onCoreHeard - " + ex);
            }
            return msg;
        };

        var msgName = (isPublic) ? "PublicEvent" : "PrivateEvent";
        var userID = (this.userID || "").toLowerCase() + "/";
        name = (name) ? name.toString() : name;
        if (name && name.indexOf && (name.indexOf(userID) == 0)) {
            name = name.substring(userID.length);
        }

        data = (data) ? data.toString() : data;
        this.sendNONTypeMessage(msgName, { event_name: name, _raw: rawFn }, data);
    }
function ( isPublic , name , data , ttl , published_at , coreid ) { var rawFn = function ( msg ) { try { msg . setMaxAge ( parseInt ( ( ttl && ( ttl >= 0 ) ) ? ttl : 60 ) ) ; if ( published_at ) { msg . setTimestamp ( moment ( published_at ) . toDate ( ) ) ; } } catch ( ex ) { logger . error ( "onCoreHeard - " + ex ) ; } return msg ; } ; var msgName = ( isPublic ) ? "PublicEvent" : "PrivateEvent" ; var userID = ( this . userID || "" ) . toLowerCase ( ) + "/" ; name = ( name ) ? name . toString ( ) : name ; if ( name && name . indexOf && ( name . indexOf ( userID ) == 0 ) ) { name = name . substring ( userID . length ) ; } data = ( data ) ? data . toString ( ) : data ; this . sendNONTypeMessage ( msgName , { event_name : name , _raw : rawFn } , data ) ; }
sends a received event down to a core
@param isPublic
@param name
@param data
@param ttl
@param published_at
sends a received event down to a core