Skip to content

Commit 7b138d7

Browse files
committed
Use general coach user id to send session announcements see BT#14323
1 parent f7e7b7d commit 7b138d7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

main/inc/lib/ScheduledAnnouncement.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,10 @@ public function getAttachment($id)
289289

290290
/**
291291
* @param int $urlId
292-
* @param int $senderId
293292
*
294293
* @return int
295294
*/
296-
public function sendPendingMessages($urlId = 0, $senderId = 0)
295+
public function sendPendingMessages($urlId = 0)
297296
{
298297
if (!$this->allowed()) {
299298
return 0;
@@ -318,7 +317,9 @@ public function sendPendingMessages($urlId = 0, $senderId = 0)
318317
$urlId
319318
);
320319

321-
if (empty($users)) {
320+
$coachId = $sessionInfo['id_coach'];
321+
322+
if (empty($users) || empty($coachId)) {
322323
continue;
323324
}
324325

@@ -396,7 +397,7 @@ public function sendPendingMessages($urlId = 0, $senderId = 0)
396397
$userInfo['user_id'],
397398
$subject,
398399
$message,
399-
$senderId
400+
$coachId
400401
);
401402
}
402403
}

0 commit comments

Comments
 (0)