Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler interface {
RegisterCallback(title, instructions string, fields []interface{}) error
}
EventHandler represents the main notifications that the session can emit It's really more an observer than an even handler
type Factory ¶
type Factory func(*config.ApplicationConfig, *config.Account, func(tls.Verifier, tls.Factory) xi.Dialer) Session
Factory is a function that can create new Sessions
type OfflineError ¶
type OfflineError struct {
Msg string
}
OfflineError is returned when we try to do an action that can only be done when online
func (*OfflineError) Error ¶
func (v *OfflineError) Error() string
type Session ¶
type Session interface { ApprovePresenceSubscription(jid.WithoutResource, string) error AutoApprove(string) AwaitVersionReply(<-chan data.Stanza, string) Close() CommandManager() otrclient.CommandManager Config() *config.ApplicationConfig Conn() xi.Conn Connect(string, tls.Verifier) error ConversationManager() otrclient.ConversationManager CreateSymmetricKeyFor(jid.Any) []byte DenyPresenceSubscription(jid.WithoutResource, string) error DisplayName() string EncryptAndSendTo(jid.Any, string) (int, bool, error) GetConfig() *config.Account GetInMemoryLog() *bytes.Buffer GroupDelimiter() string HandleConfirmOrDeny(jid.WithoutResource, bool) IsConnected() bool IsDisconnected() bool ManuallyEndEncryptedChat(jid.Any) error PrivateKeys() []otr3.PrivateKey R() *roster.List ReloadKeys() RemoveContact(string) RequestPresenceSubscription(jid.WithoutResource, string) error Send(jid.Any, string, bool) error SendMUCMessage(to, from, body string) error SendPing() SetCommandManager(otrclient.CommandManager) SetConnector(Connector) SetLastActionTime(time.Time) SetSessionEventHandler(EventHandler) SetWantToBeOnline(bool) Subscribe(chan<- interface{}) Timeout(data.Cookie, time.Time) SendIQError(*data.ClientIQ, interface{}) SendIQResult(*data.ClientIQ, interface{}) PublishEvent(interface{}) SendFileTo(jid.Any, string, func() bool, func(bool)) *sdata.FileTransferControl SendDirTo(jid.Any, string, func() bool, func(bool)) *sdata.FileTransferControl StartSMP(jid.WithResource, string, string) FinishSMP(jid.WithResource, string) AbortSMP(jid.WithResource) GetAndWipeSymmetricKeyFor(jid.Any) []byte HasRoom(jid.Bare, chan<- *muc.RoomListing) (<-chan bool, <-chan error) GetRooms(jid.Domain, string) (<-chan *muc.RoomListing, <-chan *muc.ServiceListing, <-chan error) JoinRoom(jid.Bare, string, string) error CreateInstantRoom(jid.Bare) <-chan error CreateReservedRoom(jid.Bare) (<-chan *muc.RoomConfigForm, <-chan error) SubmitRoomConfigurationForm(jid.Bare, *muc.RoomConfigForm) (<-chan bool, <-chan error) CancelRoomConfiguration(jid.Bare) <-chan error GetChatServices(jid.Domain) (<-chan jid.Domain, <-chan error, func()) GetRoomListing(jid.Bare, chan<- *muc.RoomListing) RequestRoomDiscoInfo(jid.Bare) LeaveRoom(room jid.Bare, nickname string) (<-chan bool, <-chan error) DestroyRoom(room jid.Bare, reason string, alternativeRoom jid.Bare, password string) (<-chan bool, <-chan error) UpdateOccupantAffiliation(roomID jid.Bare, occupantNickname string, occupantRealJID jid.Full, affiliation mdata.Affiliation, reason string) (<-chan bool, <-chan error) UpdateOccupantRole(roomID jid.Bare, occupantNickname string, role mdata.Role, reason string) (<-chan bool, <-chan error) KickOccupant(roomID jid.Bare, occupantNickname string, reason string) (<-chan bool, <-chan error) Log() coylog.Logger NewRoom(jid.Bare) *muc.Room }
Session is an interface that defines the functionality of a Session
Click to show internal directories.
Click to hide internal directories.