Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -53,7 +53,7 @@ class expertUserNudge extends Task
|
||||
*/
|
||||
public function execute() : mixed
|
||||
{
|
||||
if ( ! Settings::i()->forums_solved_nudge_experts or !Bridge::i()->featureIsEnabled( 'experts' ) )
|
||||
if ( ! Settings::i()->cloud_experts_email or ! Settings::i()->cloud_experts_email_day_start or ! Settings::i()->cloud_experts_email_day_end or !Bridge::i()->featureIsEnabled( 'experts' ) )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ class expertUserNudge extends Task
|
||||
|
||||
$where = [
|
||||
[ Db::i()->in( 'approved', array( -2, -3 ), TRUE ) ],
|
||||
[ 'start_date > ? and start_date < ? and topic_answered_pid=0', ( time() - ( 365 * 86400) ), ( time() - ( (int) Settings::i()->forums_solved_nudge_experts * 86400 ) ) ], //@todo limit by nudges sent/date?
|
||||
[ 'start_date > ? and start_date < ? and topic_answered_pid=0', ( time() - ( (int) Settings::i()->cloud_experts_email_day_end * 86400) ), ( time() - ( (int) Settings::i()->cloud_experts_email_day_start * 86400 ) ) ], //@todo limit by nudges sent/date?
|
||||
[ Db::i()->in( 'forum_id', iterator_to_array( Db::i()->select( 'id', 'forums_forums', '(' . Db::i()->bitwiseWhere( Forum::$bitOptions['forums_bitoptions'], 'bw_solved_set_by_member' ) . ') AND (' . Db::i()->bitwiseWhere( Forum::$bitOptions['forums_bitoptions'], 'bw_solved_set_by_moderator' ) . ')' ) ) ) ],
|
||||
[ Db::i()->in( 'forum_id', array_keys( $nodeExperts ) ) ]
|
||||
];
|
||||
@@ -95,8 +95,12 @@ class expertUserNudge extends Task
|
||||
try
|
||||
{
|
||||
$expert = Member::load( $expertId );
|
||||
if( !$expert->members_bitoptions['expert_user_disabled'] and !$expert->members_bitoptions['expert_user_blocked'] and ( $expert->expert_nudge < time() - ( 86400 * 7 ) ) )
|
||||
if( !$expert->members_bitoptions['expert_user_disabled'] and !$expert->members_bitoptions['expert_user_blocked'] and ( $expert->expert_nudge < time() - ( 86400 * Settings::i()->cloud_experts_topics_notify_gap ) ) )
|
||||
{
|
||||
/* Avoid race conditions */
|
||||
$expert->expert_nudge = time();
|
||||
$expert->save();
|
||||
|
||||
$topicIds = [];
|
||||
foreach( $topics as $topic )
|
||||
{
|
||||
@@ -129,9 +133,6 @@ class expertUserNudge extends Task
|
||||
$notification->recipients->attach( $expert );
|
||||
$notification->send();
|
||||
}
|
||||
|
||||
$expert->expert_nudge = time();
|
||||
$expert->save();
|
||||
}
|
||||
}
|
||||
catch ( OutOfRangeException $e ) {}
|
||||
|
||||
Reference in new issue
Block a user