Documentation ¶
Index ¶
- Variables
- type OtrEventHandler
- func (e *OtrEventHandler) ConsumeDelayedState(trace int) bool
- func (e *OtrEventHandler) ConsumeSecurityChange() SecurityChange
- func (e *OtrEventHandler) HandleErrorMessage(error otr3.ErrorCode) []byte
- func (e *OtrEventHandler) HandleMessageEvent(event otr3.MessageEvent, message []byte, err error, trace ...interface{})
- func (e *OtrEventHandler) HandleSMPEvent(event otr3.SMPEvent, progressPercent int, question string)
- func (e *OtrEventHandler) HandleSecurityEvent(event otr3.SecurityEvent)
- type SecurityChange
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrorPrefix can be used to make an OTR error by appending an error message // to it. ErrorPrefix = "?OTR Error:" )
Functions ¶
This section is empty.
Types ¶
type OtrEventHandler ¶
type OtrEventHandler struct { SmpQuestion string WaitingForSecret bool Account string Peer string Notifications chan<- string DelayedMessageSent chan<- int Delays map[int]bool PendingDelays int // contains filtered or unexported fields }
OtrEventHandler is used to contain information pertaining to the events of a specific OTR interaction
func (*OtrEventHandler) ConsumeDelayedState ¶ added in v0.3.7
func (e *OtrEventHandler) ConsumeDelayedState(trace int) bool
ConsumeDelayedState returns whether the given trace has been delayed or not, blanking out that status as a side effect
func (*OtrEventHandler) ConsumeSecurityChange ¶
func (e *OtrEventHandler) ConsumeSecurityChange() SecurityChange
ConsumeSecurityChange is called to get the current security change and forget the old one
func (*OtrEventHandler) HandleErrorMessage ¶
func (e *OtrEventHandler) HandleErrorMessage(error otr3.ErrorCode) []byte
HandleErrorMessage is called when asked to handle a specific error message
func (*OtrEventHandler) HandleMessageEvent ¶
func (e *OtrEventHandler) HandleMessageEvent(event otr3.MessageEvent, message []byte, err error, trace ...interface{})
HandleMessageEvent is called to handle a specific message event
func (*OtrEventHandler) HandleSMPEvent ¶
func (e *OtrEventHandler) HandleSMPEvent(event otr3.SMPEvent, progressPercent int, question string)
HandleSMPEvent is called to handle a specific SMP event
func (*OtrEventHandler) HandleSecurityEvent ¶
func (e *OtrEventHandler) HandleSecurityEvent(event otr3.SecurityEvent)
HandleSecurityEvent is called to handle a specific security event
type SecurityChange ¶
type SecurityChange int
SecurityChange describes a change in the security state of a Conversation.
const ( // NoChange happened in the security status NoChange SecurityChange = iota // NewKeys indicates that a key exchange has completed. This occurs // when a conversation first becomes encrypted NewKeys // RenewedKeys indicates that a key exchange has completed. This occurs // when the keys are renegotiated within an encrypted conversation. RenewedKeys // SMPSecretNeeded indicates that the peer has started an // authentication and that we need to supply a secret. Call SMPQuestion // to get the optional, human readable challenge and then Authenticate // to supply the matching secret. SMPSecretNeeded // SMPComplete indicates that an authentication completed. The identity // of the peer has now been confirmed. SMPComplete // SMPFailed indicates that an authentication failed. SMPFailed // ConversationEnded indicates that the peer ended the secure // conversation. ConversationEnded )
Click to show internal directories.
Click to hide internal directories.