feat: improve group member events and push delivery
This commit is contained in:
@@ -2950,7 +2950,7 @@ func (a *adapter) SubsForTopic(topic string, keepDeleted bool, opts *t.QueryOpt)
|
||||
// Filter out deleted rows.
|
||||
q += " AND deletedat IS NULL"
|
||||
}
|
||||
limit := a.maxResults
|
||||
limit := 0
|
||||
if opts != nil {
|
||||
// Ignore IfModifiedSince - we must return all entries
|
||||
// Those unmodified will be stripped of Public & Private.
|
||||
@@ -2959,13 +2959,16 @@ func (a *adapter) SubsForTopic(topic string, keepDeleted bool, opts *t.QueryOpt)
|
||||
q += " AND userid=?"
|
||||
args = append(args, store.DecodeUid(opts.User))
|
||||
}
|
||||
limit = a.maxResults
|
||||
if opts.Limit > 0 && opts.Limit < limit {
|
||||
limit = opts.Limit
|
||||
}
|
||||
}
|
||||
|
||||
q += " LIMIT ?"
|
||||
args = append(args, limit)
|
||||
if limit > 0 {
|
||||
q += " LIMIT ?"
|
||||
args = append(args, limit)
|
||||
}
|
||||
|
||||
ctx, cancel := a.getContext()
|
||||
if cancel != nil {
|
||||
|
||||
@@ -1779,8 +1779,9 @@ func (a *adapter) TenantSubsForTopic(id t.TenantID, topic string, keepDeleted bo
|
||||
if !keepDeleted {
|
||||
q += " AND deletedat IS NULL"
|
||||
}
|
||||
limit := a.maxResults
|
||||
limit := 0
|
||||
if opts != nil {
|
||||
limit = a.maxResults
|
||||
if !opts.User.IsZero() {
|
||||
q += " AND userid=?"
|
||||
args = append(args, decodeUID(opts.User))
|
||||
@@ -1789,8 +1790,10 @@ func (a *adapter) TenantSubsForTopic(id t.TenantID, topic string, keepDeleted bo
|
||||
limit = opts.Limit
|
||||
}
|
||||
}
|
||||
q += " LIMIT ?"
|
||||
args = append(args, limit)
|
||||
if limit > 0 {
|
||||
q += " LIMIT ?"
|
||||
args = append(args, limit)
|
||||
}
|
||||
ctx, cancel := a.getContext()
|
||||
if cancel != nil {
|
||||
defer cancel()
|
||||
|
||||
Reference in New Issue
Block a user