You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
Remove defaultDeviceDisplayName
We no longer rely on js-sdk setting the initial_device_display_name and login_id on login, so remove them to make `login` simpler.
This commit is contained in:
@@ -78,9 +78,6 @@ try {
|
|||||||
* tracking things like crypto keys and access tokens. If not specified,
|
* tracking things like crypto keys and access tokens. If not specified,
|
||||||
* end-to-end crypto will be disabled.
|
* end-to-end crypto will be disabled.
|
||||||
*
|
*
|
||||||
* @param {string=} opts.defaultDeviceDisplayName Initial display name to set
|
|
||||||
* on new devices
|
|
||||||
*
|
|
||||||
* @param {Object=} opts.sessionStore A store to be used for end-to-end crypto
|
* @param {Object=} opts.sessionStore A store to be used for end-to-end crypto
|
||||||
* session data. This should be a {@link
|
* session data. This should be a {@link
|
||||||
* module:store/session/webstorage~WebStorageSessionStore|WebStorageSessionStore},
|
* module:store/session/webstorage~WebStorageSessionStore|WebStorageSessionStore},
|
||||||
@@ -109,7 +106,6 @@ function MatrixClient(opts) {
|
|||||||
this.store = opts.store || new StubStore();
|
this.store = opts.store || new StubStore();
|
||||||
|
|
||||||
this.deviceId = opts.deviceId || null;
|
this.deviceId = opts.deviceId || null;
|
||||||
this.defaultDeviceDisplayName = opts.defaultDeviceDisplayName || "js-sdk device";
|
|
||||||
|
|
||||||
var userId = (opts.userId || null);
|
var userId = (opts.userId || null);
|
||||||
this.credentials = {
|
this.credentials = {
|
||||||
@@ -1750,14 +1746,10 @@ MatrixClient.prototype.paginateEventTimeline = function(eventTimeline, opts) {
|
|||||||
MatrixClient.prototype.login = function(loginType, data, callback) {
|
MatrixClient.prototype.login = function(loginType, data, callback) {
|
||||||
var login_data = {
|
var login_data = {
|
||||||
type: loginType,
|
type: loginType,
|
||||||
device_id: this.deviceId,
|
|
||||||
initial_device_display_name: this.defaultDeviceDisplayName,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// merge data into login_data
|
// merge data into login_data
|
||||||
for (var k in data) {
|
login_data.extend(data);
|
||||||
if (data.hasOwnProperty(k)) { login_data[k] = data[k]; }
|
|
||||||
}
|
|
||||||
|
|
||||||
return this._http.authedRequest(
|
return this._http.authedRequest(
|
||||||
callback, "POST", "/login", undefined, login_data
|
callback, "POST", "/login", undefined, login_data
|
||||||
|
|||||||
Reference in New Issue
Block a user