🆕 Messaging
Every friend row in the drawer now has a chat-bubble icon. Click it to slide in an Xbox-Guide-style message pane over the friends list.
Pane features:
- Peer avatar + online-state dot + display name in the header
- Full conversation history grouped by day (Today / Yesterday / date) with timestamps
- Color-coded bubbles — gold-purple gradient for you, slate for them
- Text input at the bottom with auto-grow, 1000-char limit, and a live counter
- Enter to send, Shift+Enter for newline
- Back arrow returns to the friends list without closing the drawer
Unread indicators:
- Per-friend red pip next to the name in the friends list
- Combined badge on the floating friends button (adds together incoming friend requests + total unread messages)
Safety:
- Only mutual friends can exchange messages (simple-mode treats everyone on the server as a friend, consistent with the rest of the feature)
- Rate limit: 20 messages per minute per sender
- Max 1000 chars per message
- FIFO cap of 500 messages per conversation so the JSON store never grows unbounded
- Server-side storage at `plugins/configurations/achievementbadges/messages.json` with atomic writes
Polling:
- 6s poll while a chat pane is open — new messages from the other side appear within a few seconds
- 20s drawer-wide unread poll so badges stay live even when the drawer is closed
API (5 new endpoints)
Under `/Plugins/AchievementBadges/users/{userId}/messages/`:
- `GET /unread-count` — total unread across all threads
- `GET /threads` — list of conversation summaries with last message + per-thread unread
- `GET /{otherUserId}?limit=100` — last N messages in a thread (auto-marks read)
- `POST /{otherUserId}` — send a message `{ "Text": "..." }`
All routes are user-scoped and guarded by the existing `UserOwnershipFilter` — you can only read/write your own conversations.
Upgrade
Safe in-place upgrade from 1.7.x — no schema changes. New messages file initializes empty on first use.