|
@@ -10,24 +10,6 @@ import (
|
|
|
"github.com/mk6i/open-oscar-server/wire"
|
|
"github.com/mk6i/open-oscar-server/wire"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
-type BuddyService interface {
|
|
|
|
|
- AddBuddies(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x03_0x04_BuddyAddBuddies) (*wire.SNACMessage, error)
|
|
|
|
|
- BroadcastBuddyDeparted(ctx context.Context, screenName state.IdentScreenName) error
|
|
|
|
|
- DelBuddies(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x03_0x05_BuddyDelBuddies) error
|
|
|
|
|
- RightsQuery(ctx context.Context, inFrame wire.SNACFrame) wire.SNACMessage
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-type ChatService interface {
|
|
|
|
|
- ChannelMsgToHost(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x0E_0x05_ChatChannelMsgToHost) (*wire.SNACMessage, error)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-type ChatNavService interface {
|
|
|
|
|
- CreateRoom(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x0E_0x02_ChatRoomInfoUpdate) (wire.SNACMessage, error)
|
|
|
|
|
- ExchangeInfo(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x0D_0x03_ChatNavRequestExchangeInfo) (wire.SNACMessage, error)
|
|
|
|
|
- RequestChatRights(ctx context.Context, inFrame wire.SNACFrame) wire.SNACMessage
|
|
|
|
|
- RequestRoomInfo(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x0D_0x04_ChatNavRequestRoomInfo) (wire.SNACMessage, error)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
type ICBMService interface {
|
|
type ICBMService interface {
|
|
|
ChannelMsgToHost(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x04_0x06_ICBMChannelMsgToHost) (*wire.SNACMessage, error)
|
|
ChannelMsgToHost(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x04_0x06_ICBMChannelMsgToHost) (*wire.SNACMessage, error)
|
|
|
ClientEvent(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x04_0x14_ICBMClientEvent) error
|
|
ClientEvent(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x04_0x14_ICBMClientEvent) error
|
|
@@ -61,18 +43,6 @@ type LocateService interface {
|
|
|
DirInfo(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x0B_LocateGetDirInfo) (wire.SNACMessage, error)
|
|
DirInfo(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x02_0x0B_LocateGetDirInfo) (wire.SNACMessage, error)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-type DirSearchService interface {
|
|
|
|
|
- InfoQuery(ctx context.Context, inFrame wire.SNACFrame, inBody wire.SNAC_0x0F_0x02_InfoQuery) (wire.SNACMessage, error)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-type PermitDenyService interface {
|
|
|
|
|
- AddDenyListEntries(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x09_0x07_PermitDenyAddDenyListEntries) error
|
|
|
|
|
- AddPermListEntries(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x09_0x05_PermitDenyAddPermListEntries) error
|
|
|
|
|
- DelDenyListEntries(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x09_0x08_PermitDenyDelDenyListEntries) error
|
|
|
|
|
- DelPermListEntries(ctx context.Context, instance *state.SessionInstance, inBody wire.SNAC_0x09_0x06_PermitDenyDelPermListEntries) error
|
|
|
|
|
- RightsQuery(ctx context.Context, inFrame wire.SNACFrame) wire.SNACMessage
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// BuddyListRegistry is the interface for keeping track of users with active
|
|
// BuddyListRegistry is the interface for keeping track of users with active
|
|
|
// buddy lists. Once registered, a user becomes visible to other users' buddy
|
|
// buddy lists. Once registered, a user becomes visible to other users' buddy
|
|
|
// lists and vice versa.
|
|
// lists and vice versa.
|
|
@@ -81,14 +51,6 @@ type BuddyListRegistry interface {
|
|
|
UnregisterBuddyList(ctx context.Context, user state.IdentScreenName) error
|
|
UnregisterBuddyList(ctx context.Context, user state.IdentScreenName) error
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-type TOCConfigStore interface {
|
|
|
|
|
- // SetTOCConfig sets the user's TOC config. The TOC config is the server-side
|
|
|
|
|
- // buddy list functionality for TOC. This configuration is not available to
|
|
|
|
|
- // OSCAR clients.
|
|
|
|
|
- SetTOCConfig(ctx context.Context, user state.IdentScreenName, config string) error
|
|
|
|
|
- User(ctx context.Context, screenName state.IdentScreenName) (*state.User, error)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// CookieBaker defines methods for issuing and verifying AIM authentication tokens ("cookies").
|
|
// CookieBaker defines methods for issuing and verifying AIM authentication tokens ("cookies").
|
|
|
// These tokens are used for authenticating client sessions with AIM services.
|
|
// These tokens are used for authenticating client sessions with AIM services.
|
|
|
type CookieBaker interface {
|
|
type CookieBaker interface {
|
|
@@ -101,10 +63,6 @@ type CookieBaker interface {
|
|
|
Issue(data []byte) ([]byte, error)
|
|
Issue(data []byte) ([]byte, error)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-type AdminService interface {
|
|
|
|
|
- InfoChangeRequest(ctx context.Context, instance *state.SessionInstance, inFrame wire.SNACFrame, inBody wire.SNAC_0x07_0x04_AdminInfoChangeRequest) (wire.SNACMessage, error)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// SessionRetriever provides methods to retrieve OSCAR sessions.
|
|
// SessionRetriever provides methods to retrieve OSCAR sessions.
|
|
|
type SessionRetriever interface {
|
|
type SessionRetriever interface {
|
|
|
AllSessions() []*state.Session
|
|
AllSessions() []*state.Session
|
|
@@ -123,20 +81,6 @@ type FeedbagService interface {
|
|
|
Use(ctx context.Context, instance *state.SessionInstance) error
|
|
Use(ctx context.Context, instance *state.SessionInstance) error
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// Phase 2: Additional interfaces for messaging and presence
|
|
|
|
|
-
|
|
|
|
|
-// MessageRelayer relays messages between users
|
|
|
|
|
-type MessageRelayer interface {
|
|
|
|
|
- RelayToScreenName(ctx context.Context, recipient state.IdentScreenName, msg wire.SNACMessage)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-// OfflineMessageManager manages offline message storage and retrieval
|
|
|
|
|
-type OfflineMessageManager interface {
|
|
|
|
|
- SaveMessage(ctx context.Context, msg state.OfflineMessage) (int, error)
|
|
|
|
|
- RetrieveMessages(ctx context.Context, recipient state.IdentScreenName) ([]state.OfflineMessage, error)
|
|
|
|
|
- DeleteMessages(ctx context.Context, recipient state.IdentScreenName) error
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// BuddyBroadcaster broadcasts buddy presence updates
|
|
// BuddyBroadcaster broadcasts buddy presence updates
|
|
|
type BuddyBroadcaster interface {
|
|
type BuddyBroadcaster interface {
|
|
|
BroadcastBuddyArrived(ctx context.Context, screenName state.IdentScreenName, userInfo wire.TLVUserInfo) error
|
|
BroadcastBuddyArrived(ctx context.Context, screenName state.IdentScreenName, userInfo wire.TLVUserInfo) error
|