renaming handle method to username

This commit is contained in:
balzack 2024-08-28 18:51:22 -07:00
parent bed9b22b04
commit f08e738f9a
5 changed files with 11 additions and 11 deletions

View File

@ -33,10 +33,6 @@ export class MockIdentityModule implements Identity {
public async setProfileImage(image: string): Promise<void> {
}
public async getHandleStatus(handle: string): Promise<boolean> {
return false;
}
public getProfileImageUrl(): string {
return '';
}

View File

@ -61,6 +61,10 @@ export class MockSettingsModule implements Settings {
public async forgetSeal(): Promise<void> {
}
public async getUsernameStatus(username: string): Promise<boolean> {
return false;
}
public async setLogin(username: string, password: string): Promise<void> {
}
}

View File

@ -37,6 +37,7 @@ export interface Ring {
}
export interface Settings {
getUsernameStatus(username: string): Promise<boolean>;
setLogin(username: string, password: string): Promise<void>;
enableNotifications(): Promise<void>;
disableNotifications(): Promise<void>;
@ -57,7 +58,6 @@ export interface Settings {
export interface Identity {
setProfileData(name: string, location: string, description: string): Promise<void>;
setProfileImage(image: string): Promise<void>;
getHandleStatus(handle: string): Promise<boolean>;
getProfileImageUrl(): string;

View File

@ -7,7 +7,6 @@ import { getProfile } from './net/getProfile';
import { getProfileImageUrl } from './net/getProfileImageUrl';
import { setProfileData } from './net/setProfileData';
import { setProfileImage } from './net/setProfileImage';
import { getUsername } from './net/getUsername';
import { ProfileEntity, defaultProfileEntity } from './entities';
const CLOSE_POLL_MS = 100;
@ -119,11 +118,6 @@ export class IdentityModule implements Identity {
await setProfileImage(node, secure, token, image);
}
public async getHandleStatus(handle: string): Promise<boolean> {
const { node, secure, token } = this;
return await getUsername(handle, token, node, secure);
}
public getProfileImageUrl(): string {
const { node, secure, token, revision } = this;
return getProfileImageUrl(node, secure, token, revision);

View File

@ -14,6 +14,7 @@ import { setAccountNotifications } from './net/setAccountNotifications';
import { setAccountSearchable } from './net/setAccountSearchable';
import { setAccountSeal } from './net/setAccountSeal';
import { clearAccountSeal } from './net/clearAccountSeal';
import { getUsername } from './net/getUsername';
const CLOSE_POLL_MS = 100;
const RETRY_POLL_MS = 2000;
@ -213,6 +214,11 @@ export class SettingsModule implements Settings {
this.emitter.emit('config', this.getStatus());
}
public async getUsernameStatus(username: string): Promise<boolean> {
const { node, secure, token } = this;
return await getUsername(username, token, node, secure);
}
public async setLogin(username: string, password: string): Promise<void> {
const { node, secure, token } = this;
await setAccountLogin(node, secure, token, username, password);