diff --git a/lib/client.js b/lib/client.js index c5f8c3f3e..0943daec2 100644 --- a/lib/client.js +++ b/lib/client.js @@ -2423,32 +2423,11 @@ MatrixClient.prototype.register = function(username, password, * @return {module:http-api.MatrixError} Rejects: with an error response. */ MatrixClient.prototype.registerRequest = function(data, kind, callback) { - var request_data = {}; - - // only add these if the app is sending something other than auth data - // subsequent calls to register with the same session will - // overwrite the parameters if any are passed, so it's important - // that if the app give no data, we send no data. - var number_of_params = Object.keys(data).length; - if (data.auth) { - --number_of_params; - } - if (number_of_params > 0) { - request_data = { - device_id: this.deviceId, - initial_device_display_name: this.defaultDeviceDisplayName, - }; - } - // merge data into request_data - for (var k in data) { - if (data.hasOwnProperty(k)) { request_data[k] = data[k]; } - } - var params = {}; if (kind) { params.kind = kind; } return this._http.request( - callback, "POST", "/register", params, request_data + callback, "POST", "/register", params, data ); };