fix: chat UI
This commit is contained in:
@@ -96,6 +96,17 @@ type openDMReq struct {
|
||||
Handle string `json:"handle"`
|
||||
}
|
||||
|
||||
// Unread — GET /chat/unread. Drives the nav badge, so it stays a single
|
||||
// count rather than anything the caller has to aggregate.
|
||||
func (h *ChatHandler) Unread(w http.ResponseWriter, r *http.Request) {
|
||||
n, err := h.svc.UnreadCount(r.Context(), middleware.UserID(r.Context()))
|
||||
if err != nil {
|
||||
writeChatError(w, err)
|
||||
return
|
||||
}
|
||||
response.JSON(w, http.StatusOK, map[string]int{"count": n})
|
||||
}
|
||||
|
||||
// OpenDM — POST /chat/conversations/dm. Idempotent: returns the existing
|
||||
// thread when there is one, so the client can call it every time it opens a
|
||||
// profile without checking first.
|
||||
|
||||
Reference in New Issue
Block a user