mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
* Notifications: taking push server into account for checking user is online for popup or email notifications
This commit is contained in:
parent
0e3143d45d
commit
3972abdf52
@ -104,6 +104,16 @@ class Push extends Msg
|
||||
return self::$online;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get given user is online / connected to push-server
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function isOnline($account_id)
|
||||
{
|
||||
return in_array($account_id, $this->online());
|
||||
}
|
||||
|
||||
/**
|
||||
* Check and if neccessary set push backend
|
||||
*
|
||||
|
@ -489,6 +489,7 @@ class notifications {
|
||||
Api\Translation::add_app('notifications');
|
||||
|
||||
$available_chains = $this->get_available_chains('routing');
|
||||
$push = new Api\Json\Push();
|
||||
|
||||
foreach ($this->receivers as $receiver) {
|
||||
$user_notified = false;
|
||||
@ -574,7 +575,7 @@ class notifications {
|
||||
// This is to make popup_or_email option sensfull since
|
||||
// we save popup notifications in database anyway, email
|
||||
// notifications should be based on user availability.
|
||||
if ($backend == 'popup' && $action== 'fail' && !Api\Session::notifications_active($receiver->account_id))
|
||||
if ($backend === 'popup' && $action === 'fail' && !$push->isOnline($receiver->account_id))
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user