mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
fix for goToUser from ChatWindow
This commit is contained in:
parent
348bcdb37a
commit
88a75a3585
3 changed files with 5 additions and 4 deletions
|
@ -17,6 +17,7 @@
|
|||
#include <QSizePolicy>
|
||||
#include <QTimer>
|
||||
|
||||
#include <AddressManager.h>
|
||||
#include <AccountManager.h>
|
||||
|
||||
#include "Application.h"
|
||||
|
@ -170,7 +171,7 @@ bool ChatWindow::eventFilter(QObject* sender, QEvent* event) {
|
|||
} else if (event->type() == QEvent::MouseButtonRelease) {
|
||||
QVariant userVar = sender->property("user");
|
||||
if (userVar.isValid()) {
|
||||
// Menu::getInstance()->goToUser("@" + userVar.toString());
|
||||
AddressManager::getInstance().goToUser(userVar.toString());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -228,14 +228,14 @@ bool AddressManager::handleUsername(const QString& lookupString) {
|
|||
QRegExp usernameRegex(USERNAME_REGEX_STRING);
|
||||
|
||||
if (usernameRegex.indexIn(lookupString) != -1) {
|
||||
lookupUserViaAPI(usernameRegex.cap(1));
|
||||
goToUser(usernameRegex.cap(1));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void AddressManager::lookupUserViaAPI(const QString& username) {
|
||||
void AddressManager::goToUser(const QString& username) {
|
||||
QString formattedUsername = QUrl::toPercentEncoding(username);
|
||||
// this is a username - pull the captured name and lookup that user's location
|
||||
AccountManager::getInstance().authenticatedRequest(GET_USER_LOCATION.arg(formattedUsername),
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
public slots:
|
||||
void handleAPIResponse(const QJsonObject& jsonObject);
|
||||
void handleAPIError(QNetworkReply& errorReply);
|
||||
void lookupUserViaAPI(const QString& username);
|
||||
void goToUser(const QString& username);
|
||||
signals:
|
||||
void lookupResultIsOffline();
|
||||
void possibleDomainChangeRequired(const QString& newHostname);
|
||||
|
|
Loading…
Reference in a new issue