Chat with your friends!

I think I could add the little post time thing to chats (like posted 3m ago)
I could also add replies, if I get a better understanding about how the db works
possibly a notification system?

2 Likes

also I think i made a 3 minutes ago thing if you didn’t implement yet:

var units = {  
    year  : 24 * 60 * 60 * 1000 * 365,
    month : 24 * 60 * 60 * 1000 * 365/12,
    day   : 24 * 60 * 60 * 1000,
    hour  : 60 * 60 * 1000,
    minute: 60 * 1000,
    second: 1000
}
var rtf = new Intl.RelativeTimeFormat('en', { numeric: 'auto' })
  
var getRelativeTime = (d1, d2 = new Date()) => {
    var elapsed = d1 - d2;
    //d1 = old_time
    //d2 = current_time
    
    // "Math.abs" accounts for both "past" & "future" scenarios
    for (var u in units){
        if (Math.abs(elapsed) > units[u] || u == 'second'){
            return (u == 'second') ? 'just now' : rtf.format(Math.round(elapsed/units[u]), u)
        }
    }
}

usage

getRelativeTime(timestamp, new Date());
1 Like

Are d1 and d2 of type Date?

There’s this really cool thing called “testing”

In what conversation are you ever going to write <script src="script.js">? Like that was entirely your fault, you were warned not to use script tags

I added that before I saw this lol

image

3 Likes

:man_facepalming: I know

Bruh. Then make a HTML format detector.

  1. I went to themes
  2. I selected the hacker theme
  3. I pressed the “Change Theme” button (Was it called that? I don’t remember)
  4. It told me to close the theme tab and refresh chat
  5. I closed the theme tab
  6. I refreshed chat

Done! So basically, I didn’t hack. I guess there’s something wrong the code.

  1. I’m already banned :frowning:
  2. I didn’t even hack to get the hacker theme
1 Like

We already did.

Yep, have to fix that. @QwertyQwerty88?

I’ll unban you.

1 Like

Then why should it excecute script tags?

1 Like

I don’t think it does anymore.

Should remove the auto-ban.

1 Like

@element1010 Does the chat work on iPad?
Edit: I’m still banned :frowning:

It works on any device where you can type and press buttons.

Not anymore.

1 Like

Yay :slight_smile: thanks for unbanning me

@element1010 does <button> or <input> count as XSS?

No, but button is the only one “allowed”. By the way, onclick counts as XSS

1 Like

I was testing so I knew that.

I get an error message when I try onclick

It seems our XSS filter is completely broken, so that’s fun.

Didn’t @element1010 say he was going to remove the auto-ban?
Also every time I attempt XSS I get an error message, so I suppose there’s still a XSS filter

Seems to still exist. @element1010 can we please remove it. I don’t want to spend another minute debugging my garbage code

(also don’t mind the weird comment element put)

1 Like

Wait… is the hacker theme gone? I just decided to ‘purchase’ it for fun rip :laughing:

4 Likes

Well I’m pretty sure Element wanted it gone. I can add it back.

And I figured out how to break the servers with minimal effort…

1 Like