mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-25 12:35:01 +01:00
Merge pull request #743 from vector-im/make-hsapi-public
Make hs api public
This commit is contained in:
commit
4a2ea5f7f4
@ -19,7 +19,7 @@ export type {ILogItem} from "./logging/types";
|
|||||||
export {IDBLogPersister} from "./logging/IDBLogPersister";
|
export {IDBLogPersister} from "./logging/IDBLogPersister";
|
||||||
export {ConsoleReporter} from "./logging/ConsoleReporter";
|
export {ConsoleReporter} from "./logging/ConsoleReporter";
|
||||||
export {Platform} from "./platform/web/Platform.js";
|
export {Platform} from "./platform/web/Platform.js";
|
||||||
export {Client, LoadStatus} from "./matrix/Client.js";
|
export {Client, LoadStatus, LoginFailure} from "./matrix/Client.js";
|
||||||
export {RoomStatus} from "./matrix/room/common";
|
export {RoomStatus} from "./matrix/room/common";
|
||||||
export {AttachmentUpload} from "./matrix/room/AttachmentUpload";
|
export {AttachmentUpload} from "./matrix/room/AttachmentUpload";
|
||||||
export {CallIntent} from "./matrix/calls/callEventTypes";
|
export {CallIntent} from "./matrix/calls/callEventTypes";
|
||||||
|
@ -133,6 +133,14 @@ export class Session {
|
|||||||
this.needsKeyBackup = new ObservableValue(false);
|
this.needsKeyBackup = new ObservableValue(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get hsApi() {
|
||||||
|
return this._hsApi;
|
||||||
|
}
|
||||||
|
|
||||||
|
get sessionInfo() {
|
||||||
|
return this._sessionInfo;
|
||||||
|
}
|
||||||
|
|
||||||
get fingerprintKey() {
|
get fingerprintKey() {
|
||||||
return this._e2eeAccount?.identityKeys.ed25519;
|
return this._e2eeAccount?.identityKeys.ed25519;
|
||||||
}
|
}
|
||||||
|
@ -302,6 +302,14 @@ export class HomeServerApi {
|
|||||||
return this._get(`/profile/${encodeURIComponent(userId)}`);
|
return this._get(`/profile/${encodeURIComponent(userId)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setProfileDisplayName(userId, displayName, options?: BaseRequestOptions): IHomeServerRequest {
|
||||||
|
return this._put(`/profile/${encodeURIComponent(userId)}/displayname`, {}, { displayname: displayName }, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
setProfileAvatarUrl(userId, avatarUrl, options?: BaseRequestOptions): IHomeServerRequest {
|
||||||
|
return this._put(`/profile/${encodeURIComponent(userId)}/avatar_url`, {}, { avatar_url: avatarUrl }, options);
|
||||||
|
}
|
||||||
|
|
||||||
createRoom(payload: Record<string, any>, options?: BaseRequestOptions): IHomeServerRequest {
|
createRoom(payload: Record<string, any>, options?: BaseRequestOptions): IHomeServerRequest {
|
||||||
return this._post(`/createRoom`, {}, payload, options);
|
return this._post(`/createRoom`, {}, payload, options);
|
||||||
}
|
}
|
||||||
|
@ -151,9 +151,10 @@ export class RoomBeingCreated extends EventEmitter<{change: never}> {
|
|||||||
createOptions.room_alias_name = this.options.alias;
|
createOptions.room_alias_name = this.options.alias;
|
||||||
}
|
}
|
||||||
if (this.options.type !== undefined) {
|
if (this.options.type !== undefined) {
|
||||||
createOptions.creation_content = {
|
let type: string | undefined = undefined;
|
||||||
type: this.options.type === RoomType.World ? "org.matrix.msc3815.world" : undefined,
|
if (this.options.type === RoomType.World) type = "org.matrix.msc3815.world";
|
||||||
};
|
if (this.options.type === RoomType.Profile) type = "org.matrix.msc3815.profile";
|
||||||
|
createOptions.creation_content = { type };
|
||||||
}
|
}
|
||||||
if (this.options.isFederationDisabled === true) {
|
if (this.options.isFederationDisabled === true) {
|
||||||
if (createOptions.creation_content === undefined) createOptions.creation_content = {};
|
if (createOptions.creation_content === undefined) createOptions.creation_content = {};
|
||||||
|
@ -48,7 +48,8 @@ export enum RoomVisibility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export enum RoomType {
|
export enum RoomType {
|
||||||
World
|
World,
|
||||||
|
Profile,
|
||||||
}
|
}
|
||||||
|
|
||||||
type RoomResponse = {
|
type RoomResponse = {
|
||||||
|
Loading…
Reference in New Issue
Block a user