diff --git a/ajax/otpoll.php b/ajax/otpoll.php index 3496fceb..85df8110 100644 --- a/ajax/otpoll.php +++ b/ajax/otpoll.php @@ -51,10 +51,16 @@ function bogusSession($i) { return $bs; } +header('Content-Type: application/json'); if (preg_match('/^session-list/', $postBody) === 1) { // session-list $bogusSessionList = array(); $bogusSessionList["session_list"] = array(bogusSession(0), bogusSession(1)); print json_encode($bogusSessionList, JSON_PRETTY_PRINT)."\n"; +} else if (preg_match('/^join-session:/', $postBody) === 1) { // join + print "true"; +} else if (preg_match('/^sync-ops:/', $postBody) === 1) { // sync + // completely bogus + print '{"result":"newOps","ops":[],"headSeq":-1}'; } else { print "unknown command"; // TODO send HTTP 400 response } diff --git a/js/office.js b/js/office.js index 548791b3..2a19f77d 100644 --- a/js/office.js +++ b/js/office.js @@ -70,7 +70,7 @@ var officeMain = { collaborative: "owncloud", docUrl: doclocation, loginProcedure: function(cb) { - cb("0", "user", "token"); + cb("0", OC.currentUser, "token"); }, callback: function() { // initialized.