Skip to content

Commit

Permalink
Bug fixes chat
Browse files Browse the repository at this point in the history
  • Loading branch information
xxxcucus committed Aug 10, 2024
1 parent 2a7009d commit 3da9eab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ void PlayersListWidget::requestChatMessages() {
}

void PlayersListWidget::itemDoubleClicked(QListWidgetItem* item) {
emit playerDoubleClicked(item->text());
QString playerAndStatus = item->text();
QStringList playerAndStatusParts = playerAndStatus.split(" ", Qt::SkipEmptyParts);
if (!playerAndStatus.isEmpty())
emit playerDoubleClicked(playerAndStatusParts[0]);
}

/*void PlayersListWidget::updatePlayersList(const QStringList& players) {
Expand Down Expand Up @@ -163,5 +166,6 @@ long int PlayersListWidget::getPlayerId(const QString& player) {
return p.m_UserId;
}

qDebug() << "GetPlayerId " << player << "id 0";
return 0L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ void ReceiveChatMessagesCommObj::processResponse(const QJsonObject& retJson) {
receivedMessage.m_ReceiverName = messageObject.value("receiverName").toString();
receivedMessage.m_Message = messageObject.value("message").toString();
receivedMessage.m_CreatedAt = CommunicationTools::parseDateFromString(messageObject.value("createdAt").toString());
receivedMessages.push_back(receivedMessage);
}
}

emit chatMessagesReceived(receivedMessages);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct UserWithLastLoginViewModel {
m_UserId = jsonObject.value("userid").toString().toLong();
QString lastLoginString = jsonObject.value("lastLogin").toString();
m_LastLogin = CommunicationTools::parseDateFromString(lastLoginString);
qDebug() << "UserwithLastLogin created " << m_UserName << " " << m_UserId;
}

UserWithLastLoginViewModel(const QString& username, long int userid) {
Expand Down

0 comments on commit 3da9eab

Please sign in to comment.