From 7713c01939b19b588e6e99d4b583447b9e2362f6 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 9 Apr 2019 17:58:24 +0200 Subject: Fix error message when trying to login/register when already logged in --- src/Room.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Room.cpp b/src/Room.cpp index 44407c1..d3b91db 100644 --- a/src/Room.cpp +++ b/src/Room.cpp @@ -502,7 +502,7 @@ namespace dchat { std::lock_guard lock(roomModifyMutex); if(loggedIn) - throw std::runtime_error(std::string("You are already logged in as ") + username); + throw std::runtime_error(std::string("You are already logged in as ") + currentUsername); auto storedNodes = database->getStoredNodeUserInfoDecrypted(username, password); loggedIn = true; @@ -524,7 +524,7 @@ namespace dchat { std::lock_guard lock(roomModifyMutex); if(loggedIn) - throw std::runtime_error(std::string("You are already logged in as ") + username); + throw std::runtime_error(std::string("You are already logged in as ") + currentUsername); database->storeUserWithoutNodes(username, password); loggedIn = true; -- cgit v1.2.3