Message notifications working

This commit is contained in:
stopflock
2025-12-02 14:04:04 -06:00
parent bc03dcbe89
commit c4d9cd7986
15 changed files with 230 additions and 16 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ class AuthService {
_helper = OAuth2Helper(
client,
clientId: clientId,
scopes: ['read_prefs', 'write_api'],
scopes: ['read_prefs', 'write_api', 'consume_messages'],
enablePKCE: true,
// tokenStorageKey: _tokenKey, // not supported by this package version
);
+5 -2
View File
@@ -55,8 +55,11 @@ class OSMMessagesService {
final messages = user['messages'];
if (messages == null) return null;
// Get unread count
final unreadCount = messages['unread']?['count'] ?? 0;
// Get unread count from correct path: messages.received.unread
final received = messages['received'];
if (received == null) return null;
final unreadCount = received['unread'] ?? 0;
// Update cache
_lastCheck = DateTime.now();