From bf4ad89aea1d5433a212a5969be1ec4d08a5bc86 Mon Sep 17 00:00:00 2001 From: "Duck (Jakob Munih)" Date: Tue, 28 Apr 2009 19:50:50 +0200 Subject: [PATCH] Add notifications --- folks/edit/friends/add.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/folks/edit/friends/add.php b/folks/edit/friends/add.php index 7978c8e8a..189dc3498 100644 --- a/folks/edit/friends/add.php +++ b/folks/edit/friends/add.php @@ -38,7 +38,6 @@ if ($user) { if ($result instanceof PEAR_Error) { $notification->push($result); } elseif ($friends->needsApproval($user)) { - $notification->push(sprintf(_("A confirmation was send to \"%s\"."), $user), 'horde.warning'); $title = sprintf(_("%s added you as a friend on %s"), Auth::getAuth(), $GLOBALS['registry']->get('name', 'horde')); @@ -48,7 +47,12 @@ if ($user) { Util::addParameter(Horde::applicationUrl('edit/friends/approve.php', true, -1), 'user', Auth::getAuth()), Util::addParameter(Horde::applicationUrl('edit/friends/reject.php', true, -1), 'user', Auth::getAuth()), Folks::getUrlFor('user', Auth::getAuth(), true, -1)); - $friends->sendNotification($user, $title, $body); + $result = $friends->sendNotification($user, $title, $body); + if ($result instanceof PEAR_Error) { + $notification->push($result); + } else { + $notification->push(sprintf(_("A confirmation was send to \"%s\"."), $user), 'horde.warning'); + } header('Location: ' . Horde::applicationUrl('edit/friends/index.php')); exit; } else { -- 2.11.0