broadcast profile changes from updateavatarurl.php

This commit is contained in:
Evan Prodromou 2009-11-09 17:41:51 -05:00
parent a6312cb79c
commit 499b3555df

View File

@ -69,6 +69,8 @@ try {
function updateAvatars($user) function updateAvatars($user)
{ {
$touched = false;
if (!have_option('q', 'quiet')) { if (!have_option('q', 'quiet')) {
print "Updating avatars for user '".$user->nickname."' (".$user->id.")..."; print "Updating avatars for user '".$user->nickname."' (".$user->id.")...";
} }
@ -108,11 +110,18 @@ function updateAvatars($user)
if (!$avatar->query($sql)) { if (!$avatar->query($sql)) {
throw new Exception("Can't update avatar for user " . $user->nickname . "."); throw new Exception("Can't update avatar for user " . $user->nickname . ".");
} else {
$touched = true;
}
} }
} }
} }
if ($touched) {
$profile = $user->getProfile();
common_broadcast_profile($profile);
} }
if (have_option('v', 'verbose')) { if (have_option('v', 'verbose')) {
print "DONE.\n"; print "DONE.\n";
} }