Skip to content

Commit

Permalink
user / contextUser
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamindavid committed Jan 11, 2014
1 parent 322ac59 commit d578896
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions like/notifications/Like_OnLikeEntriesNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public function event()
*/
public function action(Event $event)
{
$liker = craft()->userSession->getUser();
$contextUser = craft()->userSession->getUser();

if(!$liker) {
if(!$contextUser) {
return;
}

Expand All @@ -30,11 +30,12 @@ public function action(Event $event)
return;
}

$to = $element->author;
$user = $element->author;

$variables['user'] = $liker;
$variables['user'] = $user;
$variables['contextUser'] = $contextUser;
$variables['entry'] = $element;

craft()->notifications->sendNotification($this->getHandle(), $to, $variables);
craft()->notifications->sendNotification($this->getHandle(), $user, $variables);
}
}
11 changes: 6 additions & 5 deletions like/notifications/Like_OnLikeMeNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public function event()
*/
public function action(Event $event)
{
$liker = craft()->userSession->getUser();
$contextUser = craft()->userSession->getUser();

if(!$liker) {
if(!$contextUser) {
return;
}

Expand All @@ -30,10 +30,11 @@ public function action(Event $event)
return;
}

$to = $element;
$user = $element;

$variables['user'] = $liker;
$variables['user'] = $user;
$variables['contextUser'] = $contextUser;

craft()->notifications->sendNotification($this->getHandle(), $to, $variables);
craft()->notifications->sendNotification($this->getHandle(), $user, $variables);
}
}

0 comments on commit d578896

Please sign in to comment.