(subs []*pbx.TopicSub)
| 989 | } |
| 990 | |
| 991 | func 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 | |
| 1026 | func pbSubSliceDeserialize(subs []*pbx.TopicSub) []types.Subscription { |
| 1027 | if len(subs) == 0 { |
no test coverage detected
searching dependent graphs…