- //Reply from situare
- if (m_currentRequests.contains(reply)) {
-
- qDebug() << "BytesAvailable: " << reply->bytesAvailable();
-
- if (reply->error()) {
- emit error(ErrorContext::NETWORK, reply->error());
- } else {
- QByteArray replyArray = reply->readAll();
- qDebug() << "Reply from: " << reply->url() << "reply " << replyArray;
-
- if(replyArray == ERROR_LAT.toAscii()) {
- qDebug() << "Error: " << ERROR_LAT;
- emit error(ErrorContext::SITUARE, SituareError::UPDATE_FAILED);
- } else if(replyArray == ERROR_LON.toAscii()) {
- qDebug() << "Error: " << ERROR_LON;
- emit error(ErrorContext::SITUARE, SituareError::UPDATE_FAILED);
- } else if(replyArray.contains(ERROR_SESSION.toAscii())) {
- qDebug() << "Error: " << ERROR_SESSION;
- emit error(ErrorContext::SITUARE, SituareError::SESSION_EXPIRED);
- } else if(replyArray.startsWith(OPENING_BRACE_MARK.toAscii())) {
- qDebug() << "JSON string";
- parseUserData(replyArray);
- } else if(replyArray.isEmpty()) {
- if(reply->url().toString().contains(UPDATE_LOCATION.toAscii())) {
- emit updateWasSuccessful();
- } else {
- // session credentials are invalid
- emit error(ErrorContext::SITUARE, SituareError::SESSION_EXPIRED);
- }
- } else {
- // unknown reply
- emit error(ErrorContext::SITUARE, SituareError::ERROR_GENERAL);
+ // assign facebook silhouette image to all who doesn't have a profile image
+ if(url == QUrl(SILHOUETTE_URL)) {
+ if(m_user->profileImageUrl().isEmpty()) {
+ m_user->setProfileImage(AvatarImage::create(image, AvatarImage::Large));
+ emit imageReady(m_user);
+ }
+ foreach(User *friendItem, m_friendsList) {
+ if(friendItem->profileImageUrl().isEmpty()) {
+ friendItem->setProfileImage(AvatarImage::create(image, AvatarImage::Small));
+ emit imageReady(friendItem);