| 1064 | } |
| 1065 | |
| 1066 | func 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 | |
| 1082 | func mostRecent(vals map[string]time.Time) (tag string, max time.Time) { |
| 1083 | for key, val := range vals { |