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

Method userIsReader

server/topic.go:247–250  ·  view source on GitHub ↗

userIsReader returns true if the user (specified by `uid`) may read the given topic.

(uid types.Uid)

Source from the content-addressed store, hash-verified

245
246// userIsReader returns true if the user (specified by `uid`) may read the given topic.
247func (t *Topic) userIsReader(uid types.Uid) bool {
248 modeWant, modeGiven := t.getPerUserAcs(uid)
249 return (modeGiven & modeWant).IsReader()
250}
251
252// prepareBroadcastableMessage sets the topic field in `msg` depending on the uid and subscription type.
253func (t *Topic) prepareBroadcastableMessage(msg *ServerComMessage, uid types.Uid, isChanSub bool) {

Callers 1

broadcastToSessionsMethod · 0.95

Calls 2

getPerUserAcsMethod · 0.95
IsReaderMethod · 0.80

Tested by

no test coverage detected