Don't trigger activity when the email didn't change

Signed-off-by: Joas Schilling <coding@schilljs.com>
Este commit está contenido en:
Joas Schilling 2017-05-26 12:49:12 +02:00
padre c1925ddfd0
commit 7ef6f065ca
No se encontró ninguna clave conocida en la base de datos para esta firma
ID de clave GPG: E166FD8976B3BAC8

Ver fichero

@ -117,6 +117,12 @@ class Hooks {
* @throws \BadMethodCallException
*/
public function onChangeEmail(IUser $user, $oldMailAddress) {
if ($oldMailAddress === $user->getEMailAddress()) {
// Email didn't really change, so don't create activities and emails
return;
}
$event = $this->activityManager->generateEvent();
$event->setApp('settings')
->setType('personal_settings')