Changeset 0.32.0 (#206)

This commit is contained in:
2026-03-19 18:50:27 +00:00
parent 6668e546fe
commit b1266b0d7c
283 changed files with 2187 additions and 1055 deletions

View File

@@ -10,10 +10,10 @@ import (
"github.com/gin-gonic/gin"
"git.gobha.me/xcaliber/chat-switchboard/events"
"git.gobha.me/xcaliber/chat-switchboard/models"
"git.gobha.me/xcaliber/chat-switchboard/notifications"
"git.gobha.me/xcaliber/chat-switchboard/store"
"chat-switchboard/events"
"chat-switchboard/models"
"chat-switchboard/notifications"
"chat-switchboard/store"
)
// ── Handler ─────────────────────────────────
@@ -111,7 +111,7 @@ func (h *NotificationHandler) MarkRead(c *gin.Context) {
// Sync badge across tabs
if h.hub != nil {
payload, _ := json.Marshal(map[string]string{"id": id})
h.hub.SendToUser(userID, events.Event{
h.hub.PublishToUser(userID, events.Event{
Label: "notification.read",
Payload: payload,
Ts: time.Now().UnixMilli(),
@@ -138,7 +138,7 @@ func (h *NotificationHandler) MarkAllRead(c *gin.Context) {
// Sync badge across tabs
if h.hub != nil {
payload, _ := json.Marshal(map[string]string{"action": "mark_all_read"})
h.hub.SendToUser(userID, events.Event{
h.hub.PublishToUser(userID, events.Event{
Label: "notification.read",
Payload: payload,
Ts: time.Now().UnixMilli(),
@@ -341,7 +341,7 @@ func (h *NotificationHandler) Broadcast(c *gin.Context) {
"level": level,
})
for _, uid := range userIDs {
h.hub.SendToUser(uid, events.Event{
h.hub.PublishToUser(uid, events.Event{
Label: "system.broadcast",
Payload: payload,
Ts: time.Now().UnixMilli(),