Remove the hosted rooms' old owner mapping
CI / build (push) Successful in 28s

Hosted rooms' instance IDs start with their owner's IMVU account now, so the client asks about their
products as the owner itself, and the mapping from 2100000000 is never used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
dhkatzandClaude Opus 5.5 committed 2026-10-30 07:05:25 -07:00
1 parent 2df46da3ad
commit 56c47e806f
6 files changed
+6 -79

No files matched your search

+1 -38
View File
@@ -367,13 +367,6 @@ func (p *Products) authorizeProducts2(x *proxy.Exchange, call *xmlrpc.Call) erro
type auth struct {
user, product int64
}
// In a room hosted by T5DE's hub, the client asks about the room's products as user 2100000000 (the first part
// of the room's ID): IMVU is asked about the room owner's instead, and answers go back as 2100000000.
owner := int64(0)
if p.HostedOwner != nil {
owner = p.HostedOwner()
}
hostedAsked := map[int64]bool{}
var community []auth
forward := []xmlrpc.Value{table[0]}
asked := map[auth]bool{}
@@ -387,10 +380,6 @@ func (p *Products) authorizeProducts2(x *proxy.Exchange, call *xmlrpc.Call) erro
if !ok1 || !ok2 {
return nil
}
if user == HostedOwnerID && owner > 0 {
user, hostedAsked[product] = owner, true
row = []xmlrpc.Value{user, product}
}
if !IsCommunity(product) {
if !asked[auth{user, product}] {
forward, asked[auth{user, product}] = append(forward, row), true
@@ -405,33 +394,9 @@ func (p *Products) authorizeProducts2(x *proxy.Exchange, call *xmlrpc.Call) erro
}
}
}
if len(community) == 0 && len(hostedAsked) == 0 {
if len(community) == 0 {
return nil
}
// hostedBack gives rows asked about as 2100000000 that user ID back.
hostedBack := func(columns []xmlrpc.Value, rows []xmlrpc.Value) {
userCol, productCol := -1, -1
for i, c := range columns {
switch c {
case "userId":
userCol = i
case "productId":
productCol = i
}
}
if userCol < 0 || productCol < 0 {
return
}
for _, row := range rows {
r, ok := row.([]xmlrpc.Value)
if !ok || len(r) <= userCol || len(r) <= productCol {
continue
}
if product, _ := r[productCol].(int64); r[userCol] == owner && hostedAsked[product] {
r[userCol] = int64(HostedOwnerID)
}
}
}
ours := func(columns []xmlrpc.Value) []xmlrpc.Value {
var rows []xmlrpc.Value
for _, a := range community {
@@ -464,7 +429,6 @@ func (p *Products) authorizeProducts2(x *proxy.Exchange, call *xmlrpc.Call) erro
columns[i] = c
}
out := append([]xmlrpc.Value{columns}, ours(columns)...)
hostedBack(columns, out[1:])
x.Response = localResponse(200, "text/xml", (&xmlrpc.Response{Params: []xmlrpc.Value{out}}).Marshal())
return nil
}
@@ -492,7 +456,6 @@ func (p *Products) authorizeProducts2(x *proxy.Exchange, call *xmlrpc.Call) erro
return body, errors.New("products: unexpected authorizeProducts2 columns")
}
all := append(rows, ours(columns)...)
hostedBack(columns, all[1:])
r.Params[0] = all
return r.Marshal(), nil
}