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

Function GrpToChn

server/store/types/types.go:212–221  ·  view source on GitHub ↗

GrpToChn converts group topic name to corresponding channel name. If it's a non-group channel topic, the name is returned unchanged. If it's neither, an empty string is returned.

(grp string)

Source from the content-addressed store, hash-verified

210// If it's a non-group channel topic, the name is returned unchanged.
211// If it's neither, an empty string is returned.
212func GrpToChn(grp string) string {
213 if strings.HasPrefix(grp, "grp") {
214 return strings.Replace(grp, "grp", "chn", 1)
215 }
216 // Return unchanged if it's a channel already.
217 if strings.HasPrefix(grp, "chn") {
218 return grp
219 }
220 return ""
221}
222
223// IsChannel checks if the given topic name is a reference to a channel.
224// The "nch" should not be considered a channel reference because it can only be used by the topic owner at the time of

Callers 11

genDbFunction · 0.92
channelSubUnsubMethod · 0.92
pushForDataMethod · 0.92
pushForChanDeleteFunction · 0.92
replySetDescMethod · 0.92
replyLeaveUnsubMethod · 0.92
originalMethod · 0.92
topicNameForUserFunction · 0.92
TopicMasterMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…