Generalize post reply notifications (#6)
## Summary - Notify the direct parent post author for replies throughout nested conversations - Skip root creation, self-replies, edits, disabled mail, and recipients without email - Link directly to each reply and use per-reply Resend idempotency Co-authored-by: codegirl-007 <s.raide@gmail.com>
This commit was merged in pull request #6.
This commit is contained in:
@@ -8,10 +8,10 @@ import (
|
||||
// Recording is a test Notifier that records calls.
|
||||
type Recording struct {
|
||||
mu sync.Mutex
|
||||
Msgs []QuestionAnswered
|
||||
Msgs []PostReply
|
||||
}
|
||||
|
||||
func (r *Recording) NotifyQuestionAnswered(_ context.Context, msg QuestionAnswered) error {
|
||||
func (r *Recording) NotifyPostReply(_ context.Context, msg PostReply) error {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
r.Msgs = append(r.Msgs, msg)
|
||||
@@ -25,10 +25,10 @@ func (r *Recording) Len() int {
|
||||
}
|
||||
|
||||
// Snapshot returns a copy of recorded messages.
|
||||
func (r *Recording) Snapshot() []QuestionAnswered {
|
||||
func (r *Recording) Snapshot() []PostReply {
|
||||
r.mu.Lock()
|
||||
defer r.mu.Unlock()
|
||||
out := make([]QuestionAnswered, len(r.Msgs))
|
||||
out := make([]PostReply, len(r.Msgs))
|
||||
copy(out, r.Msgs)
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user