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

Function pbTopicSubSerialize

server/pbconverter.go:967–989  ·  view source on GitHub ↗
(sub *MsgTopicSub)

Source from the content-addressed store, hash-verified

965}
966
967func pbTopicSubSerialize(sub *MsgTopicSub) *pbx.TopicSub {
968 out := &pbx.TopicSub{
969 UpdatedAt: timeToInt64(sub.UpdatedAt),
970 DeletedAt: timeToInt64(sub.DeletedAt),
971 Online: sub.Online,
972 Acs: pbAccessModeSerialize(&sub.Acs),
973 ReadId: int32(sub.ReadSeqId),
974 RecvId: int32(sub.RecvSeqId),
975 Public: interfaceToBytes(sub.Public),
976 Trusted: interfaceToBytes(sub.Trusted),
977 Private: interfaceToBytes(sub.Private),
978 UserId: sub.User,
979 Topic: sub.Topic,
980 TouchedAt: timeToInt64(sub.TouchedAt),
981 SeqId: int32(sub.SeqId),
982 DelId: int32(sub.DelId),
983 }
984 if sub.LastSeen != nil {
985 out.LastSeenTime = timeToInt64(sub.LastSeen.When)
986 out.LastSeenUserAgent = sub.LastSeen.UserAgent
987 }
988 return out
989}
990
991func pbTopicSubSliceDeserialize(subs []*pbx.TopicSub) []MsgTopicSub {
992 if len(subs) == 0 {

Callers 1

pbTopicSubSliceSerializeFunction · 0.85

Calls 3

timeToInt64Function · 0.85
pbAccessModeSerializeFunction · 0.85
interfaceToBytesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…