From 528a61c86876de814ff4e65855926a750ba24587 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 17 May 2018 02:12:55 +0200 Subject: Avatars for everybody --- README.md | 3 +++ src/Channel.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44f5995..3de102c 100644 --- a/README.md +++ b/README.md @@ -14,5 +14,8 @@ The user that wants to join the channel using the invite key has to sign a messa If the creator of the invite key can verify that the message they received was signed with the public key that exists in the message and the message can be decrypted using the invite encryption key, then they will respond with the channel node encryption key. The user that created the invite key will then add the user to the channel and the user that wants to join will wait until they receive 'ADD DATA' node that with the public key that they requested to be added with, by receiving and decrypting node data with the key the got from the creator of the invite key. +# Handle incorrect decryption key +When joining a channel using invite key, we might be given an incorrect decryption key. If that is the case then currently the client crashes +because decryption fails. This should be gracefully handled # Screenshot ![Sample screenshot](https://i.imgur.com/z0Ee0Rw.png) diff --git a/src/Channel.cpp b/src/Channel.cpp index a63fcc4..06c0b79 100644 --- a/src/Channel.cpp +++ b/src/Channel.cpp @@ -18,7 +18,6 @@ namespace dchat localUser(_localUser ? _localUser : new OfflineUser("You")) { addUserLocally(localUser); - localUser->avatarUrl = "https://discordemoji.com/assets/emoji/HanekawaSmug.gif"; addLocalMessage(u8"[emoji](https://discordemoji.com/assets/emoji/PepeDab.gif) deaf [emoji](https://discordemoji.com/assets/emoji/COGGERS.gif)", &systemUser, 0, odhtdb::Hash()); addLocalMessage(u8"[emoji](https://discordemoji.com/assets/emoji/PepeDab.gif)[emoji](https://discordemoji.com/assets/emoji/COGGERS.gif)", &systemUser, 0, odhtdb::Hash()); @@ -132,6 +131,7 @@ namespace dchat void Channel::addUserLocally(User *user) { users.push_back(user); + user->avatarUrl = "https://discordemoji.com/assets/emoji/HanekawaSmug.gif"; if(user->isOnlineUser()) { auto onlineUser = static_cast(user); -- cgit v1.2.3