From 2cc863c595c9077a7fddfd2613580669a43c8f8a Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Sat, 19 May 2018 20:20:27 +0200
Subject: Little beautifying.
---
.../sprinkles/core/assets/SiteAssets/js/chat.js | 36 +++++++++++-----------
1 file changed, 18 insertions(+), 18 deletions(-)
(limited to 'main')
diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/chat.js b/main/app/sprinkles/core/assets/SiteAssets/js/chat.js
index 115d5fa..5df6b46 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/js/chat.js
+++ b/main/app/sprinkles/core/assets/SiteAssets/js/chat.js
@@ -86,7 +86,7 @@ function InitializeChatServer() {
});
}
- if (ServerMessage === false) { // NO SERVER MESSAGE -> SENT BY USER
+ if (!ServerMessage) { // NO SERVER MESSAGE -> SENT BY USER
// DECRYPT MESSAGE
options = {
message: openpgp.message.readArmored("-----BEGIN PGP MESSAGE-----\r\nVersion: OpenPGP.js v3.0.9\r\nComment: https://openpgpjs.org\r\n\r\n" + Message + "\r\n\-----END PGP MESSAGE-----\r\n"),
@@ -96,9 +96,9 @@ function InitializeChatServer() {
openpgp.decrypt(options).then(function (plaintext) {
plaintext ? console.log("%c[ENCRYPTION LOGGER] Decrypting succeeded!", "font-family: monospace; white-space: pre; display: inline-block; border-radius: 10px; padding: 2px; color: #20c20e; background-color: black;") : console.log("%c[ENCRYPTION LOGGER] Decrypting failed!", "font-family: monospace; white-space: pre; display: inline-block; border-radius: 10px; padding: 2px; color: red; background-color: black;");
DecryptedMessage = plaintext.data;
- if (WasHimself === true) { // -> MESSAGE WAS FROM HIMSELF -> Don't write to chat, as its done directly (on enter function at the bottom, for performance)
+ if (WasHimself) { // -> MESSAGE WAS FROM HIMSELF -> Don't write to chat, as its done directly (on enter function at the bottom, for performance)
console.log("%c[CHATSOCKET LOGGER] Message sending succeeded!", "color: darkorange");
- } else if (WasHimself === false) { // -> MESSAGE WAS FROM OTHER USER
+ } else if (!WasHimself) { // -> MESSAGE WAS FROM OTHER USER
console.log("%c[CHATSOCKET LOGGER] You received a message!", "color: darkorange");
NotifySound.play();
Push.create(Fullname, { // CREATE NOTIFICATION
@@ -129,14 +129,14 @@ function InitializeChatServer() {
$('.ChatMessage').linkify({
target: "_blank"
});
- } else if (ServerMessage === true) { // SERVER MESSAGE
+ } else if (ServerMessage) { // SERVER MESSAGE
if (ServerMessageType === "GroupJoin") { // TYPE: USER JOINED A GROUP
- if (WasHimself === true) { // HIMSELF JOINED A GROUP -> NOTIFY
+ if (WasHimself) { // HIMSELF JOINED A GROUP -> NOTIFY
ChatMessages.empty(); // -> EMPTY MESSAGES ON NEW GROUP JOIN
ChatMessages.append("