From ed705e79f0d073bee0ed6173587815578b0252b6 Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 3 Sep 2024 21:15:28 -0400 Subject: [PATCH] fix chat room crash in aim 2.0 --- server/oscar/handler/routes.go | 3 ++- state/user_store.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/server/oscar/handler/routes.go b/server/oscar/handler/routes.go index 37f39c1c..ad19b72b 100644 --- a/server/oscar/handler/routes.go +++ b/server/oscar/handler/routes.go @@ -100,11 +100,12 @@ func NewChatRouter(h Handlers) oscar.Router { router.Register(wire.OService, wire.OServiceClientOnline, h.ClientOnline) router.Register(wire.OService, wire.OServiceClientVersions, h.OServiceHandler.ClientVersions) router.Register(wire.OService, wire.OServiceIdleNotification, h.OServiceHandler.IdleNotification) + router.Register(wire.OService, wire.OServiceNoop, h.OServiceHandler.Noop) router.Register(wire.OService, wire.OServiceRateParamsQuery, h.OServiceHandler.RateParamsQuery) router.Register(wire.OService, wire.OServiceRateParamsSubAdd, h.OServiceHandler.RateParamsSubAdd) + router.Register(wire.OService, wire.OServiceSetPrivacyFlags, h.OServiceHandler.SetPrivacyFlags) router.Register(wire.OService, wire.OServiceSetUserInfoFields, h.OServiceHandler.SetUserInfoFields) router.Register(wire.OService, wire.OServiceUserInfoQuery, h.OServiceHandler.UserInfoQuery) - router.Register(wire.OService, wire.OServiceSetPrivacyFlags, h.OServiceHandler.SetPrivacyFlags) return router } diff --git a/state/user_store.go b/state/user_store.go index fdb52bea..3e4f8656 100644 --- a/state/user_store.go +++ b/state/user_store.go @@ -794,7 +794,7 @@ func (f SQLiteUserStore) ChatRoomByCookie(cookie string) (ChatRoom, error) { &creator, ) if errors.Is(err, sql.ErrNoRows) { - err = ErrChatRoomNotFound + err = fmt.Errorf("%w: %s", ErrChatRoomNotFound, cookie) } chatRoom.creator = NewIdentScreenName(creator)