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

Function pbGetQueryDeserialize

server/pbconverter.go:601–639  ·  view source on GitHub ↗
(in *pbx.GetQuery)

Source from the content-addressed store, hash-verified

599}
600
601func pbGetQueryDeserialize(in *pbx.GetQuery) *MsgGetQuery {
602 if in == nil {
603 return nil
604 }
605
606 msg := MsgGetQuery{
607 What: in.GetWhat(),
608 }
609
610 if desc := in.GetDesc(); desc != nil {
611 msg.Desc = &MsgGetOpts{
612 IfModifiedSince: int64ToTime(desc.GetIfModifiedSince()),
613 Limit: int(desc.GetLimit()),
614 }
615 }
616 if sub := in.GetSub(); sub != nil {
617 msg.Sub = &MsgGetOpts{
618 IfModifiedSince: int64ToTime(sub.GetIfModifiedSince()),
619 Limit: int(sub.GetLimit()),
620 }
621 }
622 if data := in.GetData(); data != nil {
623 msg.Data = &MsgGetOpts{
624 BeforeId: int(data.GetBeforeId()),
625 SinceId: int(data.GetSinceId()),
626 Limit: int(data.GetLimit()),
627 }
628
629 if ranges := data.GetRanges(); len(ranges) > 0 {
630 msg.Data.IdRanges = make([]MsgRange, len(ranges))
631 for i, sr := range ranges {
632 msg.Data.IdRanges[i].LowId = int(sr.GetLow())
633 msg.Data.IdRanges[i].HiId = int(sr.GetHi())
634 }
635 }
636 }
637
638 return &msg
639}
640
641func pbSetDescSerialize(in *MsgSetDesc) *pbx.SetDesc {
642 if in == nil {

Callers 1

pbCliDeserializeFunction · 0.85

Calls 12

int64ToTimeFunction · 0.85
GetIfModifiedSinceMethod · 0.80
GetLimitMethod · 0.80
GetBeforeIdMethod · 0.80
GetSinceIdMethod · 0.80
GetRangesMethod · 0.80
GetLowMethod · 0.80
GetWhatMethod · 0.45
GetDescMethod · 0.45
GetSubMethod · 0.45
GetDataMethod · 0.45
GetHiMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…