diff --git a/lib/client.js b/lib/client.js index ad7edf9e4..3db7b6127 100644 --- a/lib/client.js +++ b/lib/client.js @@ -67,7 +67,7 @@ module.exports.MatrixClient.prototype = { * @param {string} options.name The name to give this room. * @param {string} options.topic The topic to give this room. * @param {module:client.callback} callback Optional. - * @return {module:client.Promise} Resolves: {room_id: {string}, + * @return {module:client.Promise} Resolves: {room_id: {string}, * room_alias: {string(opt)}} * @return {module:http-api.MatrixError} Rejects: with an error response. */ diff --git a/lib/http-api.js b/lib/http-api.js index 7e4f67482..f973252d3 100644 --- a/lib/http-api.js +++ b/lib/http-api.js @@ -270,8 +270,8 @@ module.exports.MatrixHttpApi.prototype = { var requestCallback = function(defer, userDefinedCallback, onlyData) { - userDefinedCallback = userDefinedCallback || function(){}; - + userDefinedCallback = userDefinedCallback || function() {}; + return function(err, response, body) { if (!err && response.statusCode >= 400) { err = new module.exports.MatrixError(body); @@ -308,4 +308,5 @@ module.exports.MatrixError = function MatrixError(errorJson) { this.data = errorJson; }; module.exports.MatrixError.prototype = Object.create(Error.prototype); -module.exports.MatrixError.prototype.constructor = module.exports.MatrixError; \ No newline at end of file +/** */ +module.exports.MatrixError.prototype.constructor = module.exports.MatrixError; diff --git a/lib/matrix.js b/lib/matrix.js index c69a535a5..b454ce88c 100644 --- a/lib/matrix.js +++ b/lib/matrix.js @@ -73,4 +73,4 @@ module.exports.createClient = function(opts) { * @param {Object} response The HTTP response which consists of * {statusCode: {Number}, headers: {Object}} * @param {Object} body The parsed HTTP response body. - */ \ No newline at end of file + */ diff --git a/lib/models/event.js b/lib/models/event.js index ed9f12931..1b85542b6 100644 --- a/lib/models/event.js +++ b/lib/models/event.js @@ -77,7 +77,7 @@ module.exports.MatrixEvent.prototype = { */ getAge: function() { return this.event.age; - }, + }, /** * Get the event state_key if it has one. This will return undefined