MCPcopy Index your code
hub / github.com/tinode/chat / pbTopicSubSliceDeserialize

Function pbTopicSubSliceDeserialize

server/pbconverter.go:991–1024  ·  view source on GitHub ↗
(subs []*pbx.TopicSub)

Source from the content-addressed store, hash-verified

989}
990
991func pbTopicSubSliceDeserialize(subs []*pbx.TopicSub) []MsgTopicSub {
992 if len(subs) == 0 {
993 return nil
994 }
995
996 out := make([]MsgTopicSub, len(subs))
997 for i := range subs {
998 out[i] = MsgTopicSub{
999 UpdatedAt: int64ToTime(subs[i].GetUpdatedAt()),
1000 DeletedAt: int64ToTime(subs[i].GetDeletedAt()),
1001 Online: subs[i].GetOnline(),
1002 ReadSeqId: int(subs[i].GetReadId()),
1003 RecvSeqId: int(subs[i].GetRecvId()),
1004 Public: bytesToInterface(subs[i].GetPublic()),
1005 Trusted: bytesToInterface(subs[i].GetTrusted()),
1006 Private: bytesToInterface(subs[i].GetPrivate()),
1007 User: subs[i].GetUserId(),
1008 Topic: subs[i].GetTopic(),
1009 TouchedAt: int64ToTime(subs[i].GetTouchedAt()),
1010 SeqId: int(subs[i].GetSeqId()),
1011 DelId: int(subs[i].GetDelId()),
1012 }
1013 if acs := subs[i].GetAcs(); acs != nil {
1014 out[i].Acs = *pbAccessModeDeserialize(acs)
1015 }
1016 if subs[i].GetLastSeenTime() > 0 {
1017 out[i].LastSeen = &MsgLastSeenInfo{
1018 When: int64ToTime(subs[i].GetLastSeenTime()),
1019 UserAgent: subs[i].GetLastSeenUserAgent(),
1020 }
1021 }
1022 }
1023 return out
1024}
1025
1026func pbSubSliceDeserialize(subs []*pbx.TopicSub) []types.Subscription {
1027 if len(subs) == 0 {

Callers 1

pbServDeserializeFunction · 0.85

Calls 15

int64ToTimeFunction · 0.85
bytesToInterfaceFunction · 0.85
pbAccessModeDeserializeFunction · 0.85
GetUpdatedAtMethod · 0.45
GetDeletedAtMethod · 0.45
GetOnlineMethod · 0.45
GetReadIdMethod · 0.45
GetRecvIdMethod · 0.45
GetPublicMethod · 0.45
GetTrustedMethod · 0.45
GetPrivateMethod · 0.45
GetUserIdMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…