From 0a0bc0575ac06ce2f880687bddda1b3bd63184ec Mon Sep 17 00:00:00 2001 From: lolcat Date: Mon, 18 Dec 2023 02:17:19 -0500 Subject: [PATCH] sort of partial fix, still broken --- client.js | 224 +++++++++++++++++++++++++++++++------------------- settings.conf | 4 +- 2 files changed, 140 insertions(+), 88 deletions(-) diff --git a/client.js b/client.js index d93cf92..4700431 100644 --- a/client.js +++ b/client.js @@ -88,30 +88,56 @@ function removehtml(html){ /* Websocket functions */ -async function send(channel, text){ +async function send(channel, text/*, file = null, forcemime = null*/){ if(typeof channel == "object"){ channel = channel.channel; } - for(var i=0; i{/red-fg}{/bold} " + msg.text.trim() .replace( @@ -485,8 +536,9 @@ function appendmessage(msg, user, render = true){ return "{light-red-fg}" + match + "{/light-red-fg}" } ) + - filetext - ); + filetext; + + messagelist.setContent(textbuffer); if(render){ messagelist.setScrollPerc(100); @@ -498,21 +550,21 @@ deek.on("login", function(channel){ messagelist = blessed.box({ - parent:screen, - label:'{bold}{cyan-fg}#' + channel.name + '{/cyan-fg}{/bold}', - tags:true, - border:'line', - width:"100%", - top:0, - left:0, - bottom:1, - scrollable:true, - scrollbar:{ + parent: screen, + label: '{bold}{cyan-fg}#' + channel.name + '{/cyan-fg}{/bold}', + tags: true, + border: 'line', + width: "100%", + top: 0, + left: 0, + bottom: 1, + scrollable: true, + scrollbar: { ch:'', - track:{ - bg:'cyan' + track: { + bg: 'cyan' }, - style:{ + style: { inverse:true } } @@ -561,7 +613,7 @@ deek.on("login", function(channel){ } } - messagelist.pushLine("{light-gray-fg} * Connected to channel " + channel.name + " (id:" + channel.id + "){/light-gray-fg}"); + //messagelist.pushLine("{light-gray-fg} * Connected to channel " + channel.name + " (id:" + channel.id + "){/light-gray-fg}"); input.focus(); messagelist.setScrollPerc(100); @@ -640,14 +692,14 @@ deek.on("login", function(channel){ deek.on("enter", async function(user){ - messagelist.pushLine("{light-gray-fg} * {bold}" + blessed.escape(user.name) + "{/bold} from " + user.country.name + " has joined{/light-gray-fg}"); + //messagelist.pushLine("{light-gray-fg} * {bold}" + blessed.escape(user.name) + "{/bold} from " + user.country.name + " has joined{/light-gray-fg}"); messagelist.setScrollPerc(100); screen.render(); }); deek.on("exit", async function(user){ - messagelist.pushLine("{light-gray-fg} * {bold}" + blessed.escape(user.name) + "{/bold} has left{/light-gray-fg}"); + //messagelist.pushLine("{light-gray-fg} * {bold}" + blessed.escape(user.name) + "{/bold} has left{/light-gray-fg}"); messagelist.setScrollPerc(100); screen.render(); }); @@ -659,7 +711,7 @@ deek.on("message", async function(msg, user){ deek.on("close", async function(channel){ - messagelist.pushLine("{light-red-fg}It's over. Disconnected from channel " + channel.name + " (id:" + channel.id + "){/light-red-fg}"); + //messagelist.pushLine("{light-red-fg}It's over. Disconnected from channel " + channel.name + " (id:" + channel.id + "){/light-red-fg}"); messagelist.setScrollPerc(100); screen.render(); }); diff --git a/settings.conf b/settings.conf index 6ec060c..27821d7 100644 --- a/settings.conf +++ b/settings.conf @@ -2,5 +2,5 @@ # Now with 100% less accidently commited passwords # Create an account by visiting https://deek.chat -username=your_user_name_here -password=your_password_here +username=lul4_nokia +password=ehfuiwhfuiewhfiuewhfiuwehfuihewiufewiuf