MCPcopy Create free account
hub / github.com/daodst/chat / msgOpts2storeOpts

Function msgOpts2storeOpts

server/topic.go:1066–1080  ·  view source on GitHub ↗
(req *MsgBrowseOpts, tag string, lastSeen time.Time)

Source from the content-addressed store, hash-verified

1064}
1065
1066func msgOpts2storeOpts(req *MsgBrowseOpts, tag string, lastSeen time.Time) *types.BrowseOpt {
1067 var opts *types.BrowseOpt
1068 if req != nil {
1069 opts = &types.BrowseOpt{AscOrder: req.Ascnd, Limit: req.Limit}
1070 if req.Since != nil {
1071 opts.Since = *req.Since
1072 }
1073 if req.Before != nil {
1074 opts.Before = *req.Before
1075 }
1076 } else if tag != TAG_UNDEF && !lastSeen.IsZero() {
1077 opts = &types.BrowseOpt{Since: lastSeen}
1078 }
1079 return opts
1080}
1081
1082func mostRecent(vals map[string]time.Time) (tag string, max time.Time) {
1083 for key, val := range vals {

Callers 1

replyGetDataMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected