mirror of
https://github.com/overte-org/overte.git
synced 2025-07-16 02:56:37 +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 <QSizePolicy>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
#include <AddressManager.h>
|
||||||
#include <AccountManager.h>
|
#include <AccountManager.h>
|
||||||
|
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
@ -170,7 +171,7 @@ bool ChatWindow::eventFilter(QObject* sender, QEvent* event) {
|
||||||
} else if (event->type() == QEvent::MouseButtonRelease) {
|
} else if (event->type() == QEvent::MouseButtonRelease) {
|
||||||
QVariant userVar = sender->property("user");
|
QVariant userVar = sender->property("user");
|
||||||
if (userVar.isValid()) {
|
if (userVar.isValid()) {
|
||||||
// Menu::getInstance()->goToUser("@" + userVar.toString());
|
AddressManager::getInstance().goToUser(userVar.toString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -228,14 +228,14 @@ bool AddressManager::handleUsername(const QString& lookupString) {
|
||||||
QRegExp usernameRegex(USERNAME_REGEX_STRING);
|
QRegExp usernameRegex(USERNAME_REGEX_STRING);
|
||||||
|
|
||||||
if (usernameRegex.indexIn(lookupString) != -1) {
|
if (usernameRegex.indexIn(lookupString) != -1) {
|
||||||
lookupUserViaAPI(usernameRegex.cap(1));
|
goToUser(usernameRegex.cap(1));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddressManager::lookupUserViaAPI(const QString& username) {
|
void AddressManager::goToUser(const QString& username) {
|
||||||
QString formattedUsername = QUrl::toPercentEncoding(username);
|
QString formattedUsername = QUrl::toPercentEncoding(username);
|
||||||
// this is a username - pull the captured name and lookup that user's location
|
// this is a username - pull the captured name and lookup that user's location
|
||||||
AccountManager::getInstance().authenticatedRequest(GET_USER_LOCATION.arg(formattedUsername),
|
AccountManager::getInstance().authenticatedRequest(GET_USER_LOCATION.arg(formattedUsername),
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
public slots:
|
public slots:
|
||||||
void handleAPIResponse(const QJsonObject& jsonObject);
|
void handleAPIResponse(const QJsonObject& jsonObject);
|
||||||
void handleAPIError(QNetworkReply& errorReply);
|
void handleAPIError(QNetworkReply& errorReply);
|
||||||
void lookupUserViaAPI(const QString& username);
|
void goToUser(const QString& username);
|
||||||
signals:
|
signals:
|
||||||
void lookupResultIsOffline();
|
void lookupResultIsOffline();
|
||||||
void possibleDomainChangeRequired(const QString& newHostname);
|
void possibleDomainChangeRequired(const QString& newHostname);
|
||||||
|
|
Loading…
Reference in a new issue