Skip to content

Commit

Permalink
Merge pull request lkeme#60 from lu79432/feature/202012/forward
Browse files Browse the repository at this point in the history
[merge] UnFollow
  • Loading branch information
lkeme committed Feb 24, 2021
2 parents 1c6c35e + a49a56e commit 734a499
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/plugin/Forward.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class Forward

private static $msg = '从未中奖,从未放弃[doge]';

private static $draw_follow = [];


public static function run()
{
Expand Down Expand Up @@ -162,8 +164,11 @@ private static function clearDynamic()
}
// 取关
foreach (self::$un_follows as $uid) {
Log::info("[动态抽奖]-未中奖-取关 {$uid}");
User::setUserFollow($uid, true);
// 非转发抽奖动态关注的up 不取关
if (isset(self::$draw_follow[$uid])) {
Log::info("[动态抽奖]-未中奖-取关 {$uid}");
User::setUserFollow($uid, true);
}
}
}

Expand Down Expand Up @@ -217,6 +222,7 @@ private static function addToGroup(int $need_follow_uid, int $anchor_id = 0, int
if (!in_array($need_follow_uid, $default_follows)) {
User::setUserFollow($need_follow_uid); // 关注
User::tagAddUsers($need_follow_uid, self::$group_id); // 转到分组中
self::$draw_follow[$need_follow_uid] = 1; // 记录转发抽奖关注的up
}
}

Expand Down

0 comments on commit 734a499

Please sign in to comment.