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

Method stopFollowing

modules/follow/follow.go:148–174  ·  view source on GitHub ↗

Remove a single follower from whoever they are following (if any)

(followSource followId)

Source from the content-addressed store, hash-verified

146
147// Remove a single follower from whoever they are following (if any)
148func (f *FollowModule) stopFollowing(followSource followId) followId {
149
150 wasFollowing := followId{}
151
152 if followTarget, ok := f.followers[followSource]; ok {
153 delete(f.followers, followSource)
154
155 wasFollowing = followTarget
156
157 for idx, fId := range f.followed[followTarget] {
158 if fId == followSource {
159 f.followed[followTarget] = append(f.followed[followTarget][0:idx], f.followed[followTarget][idx+1:]...)
160
161 if len(f.followed[followTarget]) == 0 {
162 delete(f.followed, followTarget)
163 }
164
165 break
166 }
167 }
168 }
169
170 // If there was a limit, delete it.
171 delete(f.followLimits, followSource)
172
173 return wasFollowing
174}
175
176// Remove all followers from a target
177func (f *FollowModule) loseFollowers(followTarget followId) []followId {

Callers 7

startFollowMethod · 0.95
loseFollowersMethod · 0.95
onNewRoundMethod · 0.95
onPartyChangeMethod · 0.95
roomChangeHandlerMethod · 0.95
followUserCommandMethod · 0.95
followMobCommandMethod · 0.95

Calls 1

deleteFunction · 0.85

Tested by

no test coverage detected