Merge branch 'main' of https://github.com/DEVTomatoCake/JankClient into jank/connection-list-dev-portal
This commit is contained in:
commit
bf0554c98b
27 changed files with 1482 additions and 1229 deletions
|
@ -4,7 +4,7 @@ import {Direct} from "./direct.js";
|
|||
import {Voice} from "./audio.js";
|
||||
import {User} from "./user.js";
|
||||
import {Member} from "./member.js";
|
||||
import {markdown} from "./markdown.js";
|
||||
import {MarkDown} from "./markdown.js";
|
||||
import {Fullscreen} from "./fullscreen.js";
|
||||
import {setTheme, Specialuser} from "./login.js";
|
||||
|
||||
|
@ -93,7 +93,7 @@ class Localuser{
|
|||
outoffocus():void{
|
||||
document.getElementById("servers").textContent="";
|
||||
document.getElementById("channels").textContent="";
|
||||
document.getElementById("messages").textContent="";
|
||||
this.channelfocus.infinite.delete();
|
||||
this.lookingguild=null;
|
||||
this.channelfocus=null;
|
||||
}
|
||||
|
@ -156,22 +156,8 @@ class Localuser{
|
|||
returny();
|
||||
break;
|
||||
case "MESSAGE_UPDATE":
|
||||
if(this.initialized){
|
||||
if(this.channelfocus.id===temp.d.channel_id){
|
||||
const find=temp.d.id;
|
||||
const messagelist=document.getElementById("messages").children;
|
||||
for(const message of messagelist){
|
||||
const all = message["all"];
|
||||
if(all.id===find){
|
||||
all.content=temp.d.content;
|
||||
message["txt"].innerHTML=markdown(temp.d.content).innerHTML;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
this.resolveChannelFromID(temp.d.channel_id).messages.find(e=>e.id===temp.d.channel_id).content=temp.d.content;
|
||||
}
|
||||
}
|
||||
const message=this.resolveChannelFromID(temp.d.channel_id).messageids[temp.d.id];
|
||||
message.giveData(temp.d);
|
||||
break;
|
||||
case "TYPING_START":
|
||||
if(this.initialized){
|
||||
|
@ -547,7 +533,7 @@ class Localuser{
|
|||
reader.readAsDataURL(file);
|
||||
console.log(this.headers);
|
||||
reader.onload = ()=>{
|
||||
fetch(this.info.api.toString()+"/v9/users/@me",{
|
||||
fetch(this.info.api.toString()+"/users/@me",{
|
||||
method:"PATCH",
|
||||
headers:this.headers,
|
||||
body:JSON.stringify({
|
||||
|
@ -559,7 +545,7 @@ class Localuser{
|
|||
|
||||
}
|
||||
updatepronouns(pronouns:string):void{
|
||||
fetch(this.info.api.toString()+"/v9/users/@me/profile",{
|
||||
fetch(this.info.api.toString()+"/users/@me/profile",{
|
||||
method:"PATCH",
|
||||
headers:this.headers,
|
||||
body:JSON.stringify({
|
||||
|
@ -642,7 +628,7 @@ class Localuser{
|
|||
newbio=this.value;
|
||||
regen();
|
||||
}],
|
||||
["button","update user content:","submit",function(){
|
||||
["button","update user content:","submit",()=>{
|
||||
if(file!==null){
|
||||
this.updatepfp(file);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue