This patch updates the MyAvatar.cpp file.

It adds a check MyAvatar::goToLocationFromResponse to see if the user is online, if the teleport to the avatar is done and if not a message is shown which said that the user is not online
This commit is contained in:
MarcelEdward 2014-09-03 16:59:00 +02:00
parent e62834c197
commit 9662dced09

View file

@ -1897,7 +1897,12 @@ void MyAvatar::resetSize() {
void MyAvatar::goToLocationFromResponse(const QJsonObject& jsonObject) {
QJsonObject locationObject = jsonObject["data"].toObject()["address"].toObject();
goToLocationFromAddress(locationObject);
bool isOnline = jsonObject["data"].toObject()["online"].toBool();
if (isOnline ) {
goToLocationFromAddress(locationObject);
} else {
QMessageBox::warning(Application::getInstance()->getWindow(), "", "The user is not online.");
}
}
void MyAvatar::goToLocationFromAddress(const QJsonObject& locationObject) {