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

Function pbGetQuerySerialize

server/pbconverter.go:559–599  ·  view source on GitHub ↗
(in *MsgGetQuery)

Source from the content-addressed store, hash-verified

557}
558
559func pbGetQuerySerialize(in *MsgGetQuery) *pbx.GetQuery {
560 if in == nil {
561 return nil
562 }
563
564 out := &pbx.GetQuery{
565 What: in.What,
566 }
567
568 if in.Desc != nil {
569 out.Desc = &pbx.GetOpts{
570 IfModifiedSince: timeToInt64(in.Desc.IfModifiedSince),
571 User: in.Desc.User,
572 Topic: in.Desc.Topic,
573 Limit: int32(in.Desc.Limit),
574 }
575 }
576 if in.Sub != nil {
577 out.Sub = &pbx.GetOpts{
578 IfModifiedSince: timeToInt64(in.Sub.IfModifiedSince),
579 User: in.Sub.User,
580 Topic: in.Sub.Topic,
581 Limit: int32(in.Sub.Limit),
582 }
583 }
584 if in.Data != nil {
585 out.Data = &pbx.GetOpts{
586 BeforeId: int32(in.Data.BeforeId),
587 SinceId: int32(in.Data.SinceId),
588 Limit: int32(in.Data.Limit),
589 }
590
591 if len(in.Data.IdRanges) > 0 {
592 out.Data.Ranges = make([]*pbx.SeqRange, len(in.Data.IdRanges))
593 for i, dq := range in.Data.IdRanges {
594 out.Data.Ranges[i] = &pbx.SeqRange{Low: int32(dq.LowId), Hi: int32(dq.HiId)}
595 }
596 }
597 }
598 return out
599}
600
601func pbGetQueryDeserialize(in *pbx.GetQuery) *MsgGetQuery {
602 if in == nil {

Callers 1

pbCliSerializeFunction · 0.85

Calls 1

timeToInt64Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…