tweaks
This commit is contained in:
@@ -43,6 +43,13 @@ class Guild extends SnowFlake{
|
|||||||
this.setnotifcation();
|
this.setnotifcation();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.contextmenu.addbutton(
|
||||||
|
()=>I18n.getTranslation("user.editServerProfile"),
|
||||||
|
function(){
|
||||||
|
this.member.showEditProfile();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
Guild.contextmenu.addbutton(
|
Guild.contextmenu.addbutton(
|
||||||
()=>I18n.getTranslation("guild.leave"),
|
()=>I18n.getTranslation("guild.leave"),
|
||||||
function(this: Guild){
|
function(this: Guild){
|
||||||
|
@@ -4,7 +4,7 @@ import{ Guild }from"./guild.js";
|
|||||||
import{ SnowFlake }from"./snowflake.js";
|
import{ SnowFlake }from"./snowflake.js";
|
||||||
import{ memberjson, presencejson }from"./jsontypes.js";
|
import{ memberjson, presencejson }from"./jsontypes.js";
|
||||||
import { I18n } from "./i18n.js";
|
import { I18n } from "./i18n.js";
|
||||||
import { Dialog, Options } from "./settings.js";
|
import { Dialog, Options, Settings } from "./settings.js";
|
||||||
|
|
||||||
class Member extends SnowFlake{
|
class Member extends SnowFlake{
|
||||||
static already = {};
|
static already = {};
|
||||||
@@ -179,6 +179,11 @@ class Member extends SnowFlake{
|
|||||||
body: JSON.stringify(json),
|
body: JSON.stringify(json),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
showEditProfile(){
|
||||||
|
const settings=new Settings("");
|
||||||
|
this.editProfile(settings.addButton(I18n.getTranslation("user.editServerProfile"),{ltr:true}));
|
||||||
|
settings.show();
|
||||||
|
}
|
||||||
editProfile(options:Options){
|
editProfile(options:Options){
|
||||||
if(this.hasPermission("CHANGE_NICKNAME")){
|
if(this.hasPermission("CHANGE_NICKNAME")){
|
||||||
const hypotheticalProfile = document.createElement("div");
|
const hypotheticalProfile = document.createElement("div");
|
||||||
|
@@ -201,9 +201,7 @@ class User extends SnowFlake{
|
|||||||
()=>I18n.getTranslation("user.editServerProfile"),
|
()=>I18n.getTranslation("user.editServerProfile"),
|
||||||
function(this: User, member: Member | undefined){
|
function(this: User, member: Member | undefined){
|
||||||
if(!member) return;
|
if(!member) return;
|
||||||
const settings=new Settings(I18n.getTranslation("user.editServerProfile"));
|
member.showEditProfile();
|
||||||
member.editProfile(settings.addButton(I18n.getTranslation("user.editServerProfile"),{ltr:true}));
|
|
||||||
settings.show();
|
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
member=>{
|
member=>{
|
||||||
|
Reference in New Issue
Block a user