MCPcopy
hub / github.com/tinode/chat / usersRemoveUser

Function usersRemoveUser

server/user.go:849–866  ·  view source on GitHub ↗

Stop tracking user and remove him from cache.

(uid types.Uid)

Source from the content-addressed store, hash-verified

847
848// Stop tracking user and remove him from cache.
849func usersRemoveUser(uid types.Uid) {
850 if globals.usersUpdate == nil {
851 return
852 }
853
854 upd := &UserCacheReq{UserId: uid, Gone: true}
855 if !globals.cluster.isRemoteTopic(uid.UserId()) {
856 select {
857 case globals.usersUpdate <- upd:
858 default:
859 }
860 }
861
862 if globals.cluster != nil {
863 // Announce to cluster even if the user is local.
864 globals.cluster.routeUserReq(upd)
865 }
866}
867
868// Account users as members of an active topic. Used for cache management.
869// In case of a cluster this method is called only when the topic is local:

Callers 1

replyDelUserFunction · 0.85

Calls 3

isRemoteTopicMethod · 0.80
UserIdMethod · 0.80
routeUserReqMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…