|
|
|
@ -28,11 +28,13 @@ if (isset($_SESSION['userName'])) {
@@ -28,11 +28,13 @@ if (isset($_SESSION['userName'])) {
|
|
|
|
|
'avatar' => $mcAvatar |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
* Step 2: try to obtain avatar from DHT |
|
|
|
|
* |
|
|
|
|
* */ |
|
|
|
|
} else if ($dhtAvatarRevisions = $_twister->getDHTAvatarRevisions($userName)) { |
|
|
|
|
if ($dhtAvatarRevisions = $_twister->getDHTAvatarRevisions($userName)) { |
|
|
|
|
|
|
|
|
|
// Add DHT version if not exists |
|
|
|
|
foreach ((array) $dhtAvatarRevisions as $dhtAvatarRevision) { |
|
|
|
@ -96,6 +98,7 @@ if (isset($_SESSION['userName'])) {
@@ -96,6 +98,7 @@ if (isset($_SESSION['userName'])) {
|
|
|
|
|
// Save identity icon into the cache pool |
|
|
|
|
$_memcache->set('api.user.avatar.' . $userName, $identityIcon, MEMCACHE_COMPRESS, MEMCACHE_DHT_AVATAR_TIMEOUT); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// User not found in the local database registry |
|
|
|
|
} else { |
|
|
|
|