function subscribe(project) {

        if (project && !project.subscribed && socketMessage.session) {

            var confirmPostStream = function (response, myarg) {
                if (response.status === 'ok') {
                    project.subscribed = true;
                } else {
                    Y.log("post " + response.status + " for " + project.title + ' ' + JSON.stringify(response));
                }
            };

            // keep subscribed so we can get updates for previously loaded projects
            // unsubscribeAll() ;

            // it's okay to subscribe even before we get an ok reply to unsubribes
            postJson('/stream/' + socketMessage.session + '/project/' + project.id, null, confirmPostStream);
        }

    }
// we automatically receive user/profile events
we automatically receive user/profile events
we automatically receive user / profile events
function subscribe(project) {
        if (project && !project.subscribed && socketMessage.session) {
            var confirmPostStream = function (response, myarg) {
                if (response.status === 'ok') {
                    project.subscribed = true;
                } else {
                    Y.log("post " + response.status + " for " + project.title + ' ' + JSON.stringify(response));
                }
            };
            postJson('/stream/' + socketMessage.session + '/project/' + project.id, null, confirmPostStream);
        }
    }
function subscribe ( project ) { if ( project && ! project . subscribed && socketMessage . session ) { var confirmPostStream = function ( response , myarg ) { if ( response . status === 'ok' ) { project . subscribed = true ; } else { Y . log ( "post " + response . status + " for " + project . title + ' ' + JSON . stringify ( response ) ) ; } } ; postJson ( '/stream/' + socketMessage . session + '/project/' + project . id , null , confirmPostStream ) ; } }
we automatically receive user/profile events
we automatically receive user / profile events
// keep subscribed so we can get updates for previously loaded projects // unsubscribeAll() ; // it's okay to subscribe even before we get an ok reply to unsubribes