aboutsummaryrefslogtreecommitdiffhomepage
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/app/sprinkles/core/assets/SiteAssets/css/LightTheme.css5
-rw-r--r--main/app/sprinkles/core/assets/SiteAssets/js/chat.js11
-rw-r--r--main/app/sprinkles/core/assets/SiteAssets/php/Chatserver/src/ChatProcessor.php7
3 files changed, 15 insertions, 8 deletions
diff --git a/main/app/sprinkles/core/assets/SiteAssets/css/LightTheme.css b/main/app/sprinkles/core/assets/SiteAssets/css/LightTheme.css
index 637172d..36508b3 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/css/LightTheme.css
+++ b/main/app/sprinkles/core/assets/SiteAssets/css/LightTheme.css
@@ -92,7 +92,10 @@ img {
}
.Navbar {
- background-color: #e4e4e4;
+ background-color: #FDFEFF;
+ -webkit-box-shadow: 0 -1px 5px rgba(50, 50, 50, 0.3);
+ -moz-box-shadow: 0 -1px 5px rgba(50, 50, 50, 0.3);
+ box-shadow: 0 -1px 5px rgba(50, 50, 50, 0.3);
}
.NavbarLine {
diff --git a/main/app/sprinkles/core/assets/SiteAssets/js/chat.js b/main/app/sprinkles/core/assets/SiteAssets/js/chat.js
index 5df6b46..6dc67f0 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/js/chat.js
+++ b/main/app/sprinkles/core/assets/SiteAssets/js/chat.js
@@ -90,7 +90,7 @@ function InitializeChatServer() {
// 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"),
- //publicKeys: openpgp.key.readArmored(PublicKey[Username]).keys, // FOR VERIFICATION
+ publicKeys: openpgp.key.readArmored(PublicKey[Username]).keys, // FOR VERIFICATION
privateKeys: [privKeyObj]
};
openpgp.decrypt(options).then(function (plaintext) {
@@ -98,7 +98,7 @@ function InitializeChatServer() {
DecryptedMessage = plaintext.data;
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) { // -> MESSAGE WAS FROM OTHER USER
+ } else if (!WasHimself) { // -> MESSAGE WAS FROM OTHER USER -> decrypt
console.log("%c[CHATSOCKET LOGGER] You received a message!", "color: darkorange");
NotifySound.play();
Push.create(Fullname, { // CREATE NOTIFICATION
@@ -171,6 +171,9 @@ function InitializeChatServer() {
} else if (ServerMessageType === "SetReceiver") { // TYPE: SERVER CHECKED ACCESS -- MOSTLY HANDLED IN BACKEND
if (Success) {
console.log("%c[CHATSOCKET LOGGER] Setting receiver succeeded!", "color: green");
+ $(".SelectReceiver").hide();
+ $(".SelectedReceiver > *").addClass("animated slideInRight");
+ $(".ChatTab .headerWrap .header .HeaderCaption").text(ReceiversUsername);
$(".SelectedReceiver").show();
} else if (!Success) {
console.log("%c[CHATSOCKET LOGGER] Setting receiver failed!", "color: red");
@@ -274,7 +277,7 @@ function InitializeChatServer() {
ChatSocket.send(JSON.stringify({
ClientMessageType: "ChatMessage",
- EncryptedWithKey: current_username,
+ EncryptedWithKeyOfUsername: current_username,
Message: EncryptedMessage
}));
ChatTextInput.val("");
@@ -293,7 +296,7 @@ function InitializeChatServer() {
ChatSocket.send(JSON.stringify({
ClientMessageType: "ChatMessage",
- EncryptedWithKey: ReceiversUsername,
+ EncryptedWithKeyOfUsername: ReceiversUsername,
Message: EncryptedMessage
}));
ChatTextInput.val("");
diff --git a/main/app/sprinkles/core/assets/SiteAssets/php/Chatserver/src/ChatProcessor.php b/main/app/sprinkles/core/assets/SiteAssets/php/Chatserver/src/ChatProcessor.php
index fc40429..62ec9a2 100644
--- a/main/app/sprinkles/core/assets/SiteAssets/php/Chatserver/src/ChatProcessor.php
+++ b/main/app/sprinkles/core/assets/SiteAssets/php/Chatserver/src/ChatProcessor.php
@@ -121,13 +121,14 @@ class ChatProcessor implements MessageComponentInterface
$MessageObject->Fullname = $this->userInfo[$conn->resourceId]->full_name;
$MessageObject->Avatar = $this->userInfo[$conn->resourceId]->avatar;
$MessageObject->Message = htmlspecialchars($data->Message);
- $MessageJson = json_encode($MessageObject, TRUE);
- if ($data->EncryptedWithKey === $this->userInfo[$ReceiversResourceId]->user_name) {
+ if ($data->EncryptedWithKeyOfUsername === $this->userInfo[$ReceiversResourceId]->user_name) {
$MessageObject->WasHimself = FALSE;
+ $MessageJson = json_encode($MessageObject, TRUE);
$this->users[$ReceiversResourceId]->send($MessageJson); // SEND TO RECEIVER
- } else if ($data->EncryptedWithKey === $MessageObject->Username) {
+ } else if ($data->EncryptedWithKeyOfUsername === $MessageObject->Username) {
$MessageObject->WasHimself = TRUE;
+ $MessageJson = json_encode($MessageObject, TRUE);
$this->users[$conn->resourceId]->send($MessageJson); // SEND TO SENDER (FOR VERIFICATION)
}
break;