@@ -17,6 +17,7 @@ import ( |
| 17 | 17 | "github.com/tenseleyFlow/shithub/internal/issues" |
| 18 | 18 | issuesdb "github.com/tenseleyFlow/shithub/internal/issues/sqlc" |
| 19 | 19 | reposdb "github.com/tenseleyFlow/shithub/internal/repos/sqlc" |
| 20 | + "github.com/tenseleyFlow/shithub/internal/social" |
| 20 | 21 | "github.com/tenseleyFlow/shithub/internal/web/middleware" |
| 21 | 22 | ) |
| 22 | 23 | |
@@ -196,6 +197,11 @@ func (h *Handlers) issueCreate(w http.ResponseWriter, r *http.Request) { |
| 196 | 197 | h.renderIssueCreateError(w, r, owner.Username, row, title, body, err) |
| 197 | 198 | return |
| 198 | 199 | } |
| 200 | + // Auto-watch on first involvement (S26): subscribe the author at |
| 201 | + // `participating` so notifications fan-out (S29) routes future |
| 202 | + // thread events to them. Non-destructive — no-op if the user |
| 203 | + // already has an explicit preference. |
| 204 | + _ = social.AutoWatchOnInvolvement(r.Context(), h.socialDeps(), viewer.ID, row.ID) |
| 199 | 205 | http.Redirect(w, r, |
| 200 | 206 | "/"+owner.Username+"/"+row.Name+"/issues/"+strconv.FormatInt(created.Number, 10), |
| 201 | 207 | http.StatusSeeOther, |
@@ -351,6 +357,8 @@ func (h *Handlers) issueComment(w http.ResponseWriter, r *http.Request) { |
| 351 | 357 | h.handleIssueWriteError(w, r, owner.Username, row, issue, err) |
| 352 | 358 | return |
| 353 | 359 | } |
| 360 | + // Auto-watch on first involvement (S26). |
| 361 | + _ = social.AutoWatchOnInvolvement(r.Context(), h.socialDeps(), viewer.ID, row.ID) |
| 354 | 362 | h.redirectIssue(w, r, owner.Username, row.Name, issue.Number) |
| 355 | 363 | } |
| 356 | 364 | |