/**
  * When renaming an account, ensure that the presence records are updated.
  * @param $userId int
  * @param $oldName string
  * @param $newName string
  * @return bool
  */
 static function onRenameUserComplete($userId, $oldName, $newName)
 {
     $oldCentral = new CentralAuthUser($oldName);
     $newCentral = new CentralAuthUser($newName);
     if ($newCentral->exists() && $oldCentral->renameInProgressOn(wfWikiID())) {
         // This is a global rename, just update the row.
         $oldCentral->updateLocalName(wfWikiID(), $newName);
     } else {
         $oldCentral->removeLocalName(wfWikiID());
         $newCentral->addLocalName(wfWikiID());
     }
     return true;
 }