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

Function GetTopicCat

server/store/types/types.go:1374–1391  ·  view source on GitHub ↗

GetTopicCat given topic name returns topic category.

(name string)

Source from the content-addressed store, hash-verified

1372
1373// GetTopicCat given topic name returns topic category.
1374func GetTopicCat(name string) TopicCat {
1375 switch name[:3] {
1376 case "usr":
1377 return TopicCatMe
1378 case "p2p":
1379 return TopicCatP2P
1380 case "grp", "chn":
1381 return TopicCatGrp
1382 case "fnd":
1383 return TopicCatFnd
1384 case "sys":
1385 return TopicCatSys
1386 case "slf":
1387 return TopicCatSlf
1388 default:
1389 panic("invalid topic type for name '" + name + "'")
1390 }
1391}
1392
1393// IsEphemeralTopic checks if the topic is ephemeral, i.e. it's a reference to the user,
1394// it's not stored in the 'topics' table like 'me' or 'fnd' topics.

Callers 7

replyOfflineTopicGetSubFunction · 0.92
replyOfflineTopicSetSubFunction · 0.92
noteMethod · 0.92
topicCatFunction · 0.92
notifyOnOrSkipFunction · 0.92
LinkAttachmentsMethod · 0.92
IsEphemeralTopicFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…