feat: sign in to IMVU for Access Pass products (#4)
CI / build (push) Successful in 16s
Release / release (push) Successful in 3s
CI / image (push) Successful in 12s

Co-authored-by: dhkatz <[email protected]>
This commit was merged in pull request #4.
This commit is contained in:
dhkatz authored and dhkatz committed 2026-11-08 16:15:05 +00:00
1 parent dd8205602c
commit 145ebf25c1
11 files changed
+1001 -24

No files matched your search

+17 -1
View File
@@ -8,6 +8,7 @@ import (
"os"
"path/filepath"
"sync"
"time"
)
// FileName is the store's file in the data folder.
@@ -19,6 +20,8 @@ type Account struct {
IMVUID int64 `json:"imvuId"`
Username string `json:"username"`
Sealed string `json:"sealed"`
// When IMVU last refused the sign-in with this password (zero: never): it isn't tried again for a while.
RefusedAt time.Time `json:"refusedAt,omitzero"`
}
// Store is the accounts file.
@@ -56,7 +59,7 @@ func (s *Store) Get(id string) (Account, bool) {
return a, ok
}
// Put keeps an account (replacing its password, if it had one).
// Put keeps an account (replacing its password, if it had one; a new password may be tried at once).
func (s *Store) Put(a Account) error {
s.mu.Lock()
defer s.mu.Unlock()
@@ -64,6 +67,19 @@ func (s *Store) Put(a Account) error {
return s.save()
}
// Refused records that IMVU refused the account's sign-in (with its current password).
func (s *Store) Refused(id string, at time.Time) error {
s.mu.Lock()
defer s.mu.Unlock()
a, ok := s.byID[id]
if !ok {
return nil
}
a.RefusedAt = at
s.byID[id] = a
return s.save()
}
// Keep forgets every account not in ids (the hub no longer lists them) and returns how many it forgot.
func (s *Store) Keep(ids map[string]bool) (int, error) {
s.mu.Lock()