Add a single follower to a target
(followTarget followId, followSource followId, followCutoffRoundId ...uint64)
| 128 | |
| 129 | // Add a single follower to a target |
| 130 | func (f *FollowModule) startFollow(followTarget followId, followSource followId, followCutoffRoundId ...uint64) { |
| 131 | |
| 132 | // Make sure they no longer follow whoever they were before. |
| 133 | f.stopFollowing(followSource) |
| 134 | |
| 135 | f.followers[followSource] = followTarget |
| 136 | if _, ok := f.followed[followTarget]; !ok { |
| 137 | f.followed[followTarget] = []followId{} |
| 138 | } |
| 139 | |
| 140 | f.followed[followTarget] = append(f.followed[followTarget], followSource) |
| 141 | |
| 142 | if len(followCutoffRoundId) > 0 && followCutoffRoundId[0] > 0 { |
| 143 | f.followLimits[followSource] = followCutoffRoundId[0] |
| 144 | } |
| 145 | } |
| 146 | |
| 147 | // Remove a single follower from whoever they are following (if any) |
| 148 | func (f *FollowModule) stopFollowing(followSource followId) followId { |
no test coverage detected