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

Function ParseUserId

server/store/types/types.go:201–207  ·  view source on GitHub ↗

ParseUserId parses user ID of the form "usrXXXXXX".

(s string)

Source from the content-addressed store, hash-verified

199
200// ParseUserId parses user ID of the form "usrXXXXXX".
201func ParseUserId(s string) Uid {
202 var uid Uid
203 if strings.HasPrefix(s, "usr") {
204 (&uid).UnmarshalText([]byte(s)[3:])
205 }
206 return uid
207}
208
209// GrpToChn converts group topic name to corresponding channel name.
210// If it's a non-group channel topic, the name is returned unchanged.

Callers 15

mainFunction · 0.92
initTopicMeFunction · 0.92
initTopicFndFunction · 0.92
initTopicP2PFunction · 0.92
initTopicNewGrpFunction · 0.92
initTopicSlfFunction · 0.92
updateAcsFromPresMsgMethod · 0.92
handleCallEventMethod · 0.92
msgOpts2storeOptsFunction · 0.92
topicUnregMethod · 0.92
replyOfflineTopicGetDescFunction · 0.92

Calls 1

UnmarshalTextMethod · 0.45

Tested by 15

TestAuthAddRecordFunction · 0.74
TestUserGetFunction · 0.74
TestUserGetAllFunction · 0.74
TestUserGetByCredFunction · 0.74
TestCredGetActiveFunction · 0.74
TestCredGetAllFunction · 0.74
TestAuthGetUniqueRecordFunction · 0.74
TestAuthGetRecordFunction · 0.74
TestTopicsForUserFunction · 0.74
TestUsersForTopicFunction · 0.74
TestOwnTopicsFunction · 0.74
TestSubscriptionGetFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…