Skip to content

Commit

Permalink
fixed kicking client
Browse files Browse the repository at this point in the history
  • Loading branch information
emonq committed Sep 1, 2021
1 parent e224092 commit 217b1be
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions XMYChatServer/xmy_tcpserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void XMY_tcpserver::user_authentication(QJsonObject login_info, QJsonObject& ret
else if(res.value("is_waiting_verification").toInt()==1) result=LOGIN_USER_WAITING_VERIFICATION;
else {
result=LOGIN_SUCCESS;
// if(loginusers.contains(login_info.value("email").toString())) clients.value(loginusers.value(login_info.value("email").toString()))->disconnectFromHost();
if(loginusers.contains(email) && clients.contains(loginusers.value(email))) clients.value(loginusers.value(email))->disconnectFromHost();
loginusers.insert(login_info.value("email").toString(),socketDescriptor);
}
}
Expand Down Expand Up @@ -106,8 +106,6 @@ void XMY_tcpserver::user_create(QJsonObject user_info, QJsonObject& ret_data)

bool XMY_tcpserver::send_message(QString from_email, QString to_email, QString msg)
{
// QNetworkAccessManager* networkmanager = new QNetworkAccessManager();
// connect(networkmanager, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleEndOfRequest(QNetworkReply*)));
XMY_tcpsocket* socket=clients.value(loginusers.value(to_email));
if(socket==NULL) return false;
QJsonObject data;
Expand Down

0 comments on commit 217b1be

Please sign in to comment.