MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / startFollow

Method startFollow

modules/follow/follow.go:130–145  ·  view source on GitHub ↗

Add a single follower to a target

(followTarget followId, followSource followId, followCutoffRoundId ...uint64)

Source from the content-addressed store, hash-verified

128
129// Add a single follower to a target
130func (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)
148func (f *FollowModule) stopFollowing(followSource followId) followId {

Callers 2

followUserCommandMethod · 0.95
followMobCommandMethod · 0.95

Calls 1

stopFollowingMethod · 0.95

Tested by

no test coverage detected