The inventory's product list (test.showInventory) gets the community products the person has: local packs, and hub products in their library. Hiding one is answered by the proxy (and removes a hub product from the library). When the library changes, the client is told to load its inventory again, with the server event IMVU sends after a purchase. A product whose revision or info changes gets a new local ID, since the client keeps product info for good; names lose characters the client's pages could take as HTML. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
c281fb572c
commit
ca7a86ce89
8 files changed
+225
-5
No files matched your search
@@ -145,7 +145,18 @@ func run(logger *log.Logger, listen, ready string, parentPID int, trace bool, pa
|
||||
prods.Observer = client
|
||||
client.OnChat = prods.Others
|
||||
fetcher.OnReady = prods.Ready
|
||||
fetcher.OnLibrary = prods.RefreshInventory
|
||||
prods.Want = fetcher.Want
|
||||
prods.HubDir, prods.Owned = hubProducts, fetcher.Owned
|
||||
prods.OnHide = func(id string) {
|
||||
if fetch.IsHubID(id) {
|
||||
go func() {
|
||||
if err := client.Call(context.Background(), "DELETE", "/api/v1/library/"+id, nil, nil); err != nil {
|
||||
logger.Printf("hub: removing %s from the library: %v", id, err)
|
||||
}
|
||||
}()
|
||||
}
|
||||
}
|
||||
}
|
||||
client.OnLibrary = func() { fetcher.SyncLibrary(context.Background()) }
|
||||
go client.Run(context.Background())
|
||||
|
||||
Reference in new issue
Block a user