Documentation ¶
Index ¶
- Variables
- func Enroll(config *Config, xio XIO) bool
- func EscapeNonASCII(in string) string
- func SetupRawLog(filename string, xmppConfig *xmpp.Config) (err error)
- func StripHTML(msg []byte) (out []byte)
- func UnescapeNonASCII(in string) (string, error)
- func UserDom(account string) (user, domain string, err error)
- func XIOTerm_Exit()
- func XIOTerm_Init()
- type Config
- type KnownFingerprint
- type LineLogger
- type PriorityList
- type Session
- func (s *Session) AddUser(uid string)
- func (s *Session) AuthOOBCommand(to string, fingerprint string)
- func (s *Session) AuthQACommand(to, question, secret string)
- func (s *Session) CompleteFind(f string) (string, bool)
- func (s *Session) CompleteLock()
- func (s *Session) CompleteNext() string
- func (s *Session) CompleteUnlock()
- func (s *Session) Dial(addr, user, domain, resource, password string, cfg *xmpp.Config) (err error)
- func (s *Session) DoEditDoneRoster()
- func (s *Session) DoEditRoster()
- func (s *Session) EditRoster(roster []xmpp.RosterEntry)
- func (s *Session) EndConversation(to string)
- func (s *Session) FetchRoster() (err error)
- func (s *Session) GetFingerprint() []byte
- func (s *Session) GetLastTarget() string
- func (s *Session) GetRoster() []xmpp.RosterEntry
- func (s *Session) GetState(jid string) (state string, ok bool)
- func (s *Session) GetVersion(user string)
- func (s *Session) Handle()
- func (s *Session) HandleConfirmOrDeny(jid string, isConfirm bool)
- func (s *Session) IgnoreList()
- func (s *Session) IgnoreUser(uid string)
- func (s *Session) JoinMUC(to, nick, password string) error
- func (s *Session) LastAction()
- func (s *Session) LeaveMUC(to string) error
- func (s *Session) LoadEditedRoster(edit rosterEdit)
- func (s *Session) Msg(to string, msg string, encch chan<- bool)
- func (s *Session) MsgF(to string, encch chan<- bool, format string, a ...interface{})
- func (s *Session) MsgN(to string, msg string)
- func (s *Session) MsgNF(to string, format string, a ...interface{})
- func (s *Session) OptLastTarget(possibleName string) (ok bool)
- func (s *Session) PrintConversationInfo(uid string, conversation *otr.Conversation)
- func (s *Session) PrintConversations()
- func (s *Session) ProcessClientMessage(stanza *xmpp.ClientMessage)
- func (s *Session) ProcessIQ(stanza *xmpp.ClientIQ) interface{}
- func (s *Session) ProcessPresence(stanza *xmpp.ClientPresence)
- func (s *Session) Quit()
- func (s *Session) ReadMessages(stanzaChan chan<- xmpp.Stanza)
- func (s *Session) SetLastTarget(lt string)
- func (s *Session) SetPromptForTarget(target string, isEncrypted bool)
- func (s *Session) ToggleStatusUpdates()
- func (s *Session) UnignoreUser(uid string)
- type XIO
- type XIOAutoCompleteCallbackI
- type XIOTerm
- func (xio *XIOTerm) Alert(msg string)
- func (xio *XIOTerm) Critical(msg string)
- func (xio *XIOTerm) Debug(format string, a ...interface{})
- func (xio *XIOTerm) Destroy()
- func (xio *XIOTerm) FormStringForPrinting(s string) string
- func (xio *XIOTerm) Info(msg string)
- func (xio *XIOTerm) Message(timestamp, from, to, channel string, msg []byte, isEncrypted bool, doBell bool, ...)
- func (xio *XIOTerm) ReadLine() (line string, err error)
- func (xio *XIOTerm) ReadPassword(msg string) (password string, err error)
- func (xio *XIOTerm) Resize()
- func (xio *XIOTerm) SetAutoCompleteCallback(f XIOAutoCompleteCallbackI)
- func (xio *XIOTerm) SetPrompt(prompt string)
- func (xio *XIOTerm) SetPromptEnc(target string, isEncrypted bool)
- func (xio *XIOTerm) StatusUpdate(timestamp, from, channel, show, status string, gone bool)
- func (xio *XIOTerm) Warn(msg string)
- func (xio *XIOTerm) Write(s string)
Constants ¶
This section is empty.
Variables ¶
View Source
var NEWLINE = []byte{'\n'}
View Source
var OTRWhiteSpaceTagV1 = []byte("\x20\x09\x20\x09\x20\x20\x09\x20")
View Source
var OTRWhiteSpaceTagV2 = []byte("\x20\x20\x09\x09\x20\x20\x09\x20")
View Source
var OTRWhiteSpaceTagV3 = []byte("\x20\x20\x09\x09\x20\x20\x09\x09")
View Source
var OTRWhitespaceTag = append(OTRWhitespaceTagStart, OTRWhiteSpaceTagV2...)
View Source
var OTRWhitespaceTagStart = []byte("\x20\x09\x20\x20\x09\x09\x09\x09\x20\x09\x20\x09\x20\x09\x20\x20")
OTRWhitespaceTagStart may be appended to plaintext messages to signal to the remote client that we support OTR. It should be followed by one of the version specific tags, below. See "Tagged plaintext messages" in http://www.cypherpunks.ca/otr/Protocol-v3-4.0.0.html.
Functions ¶
func EscapeNonASCII ¶
escapeNonASCII replaces tabs and other non-printable characters with a "\x01" form of hex escaping. It works on a byte-by-byte basis.
func UnescapeNonASCII ¶
UnescapeNonASCII undoes the transformation of escapeNonASCII.
func XIOTerm_Exit ¶
func XIOTerm_Exit()
func XIOTerm_Init ¶
func XIOTerm_Init()
Types ¶
type Config ¶
type Config struct { Account string Server string `json:",omitempty"` Resource string `json:",omitempty"` Proxies []string `json:",omitempty"` Password string `json:",omitempty"` Port int `json:",omitempty"` PrivateKey []byte KnownFingerprints []KnownFingerprint RawLogFile string `json:",omitempty"` NotifyCommand []string `json:",omitempty"` IdleSecondsBeforeNotification int `json:",omitempty"` Bell bool HideStatusUpdates bool UseTor bool OTRAutoTearDown bool OTRAutoAppendTag bool OTRAutoStartSession bool ServerCertificateSHA256 string `json:",omitempty"` AlwaysEncrypt bool `json:",omitempty"` AlwaysEncryptWith []string `json:",omitempty"` // contains filtered or unexported fields }
func ParseConfig ¶
func (*Config) HasFingerprint ¶
func (*Config) ShouldEncryptTo ¶
func (*Config) UserIdForFingerprint ¶
type KnownFingerprint ¶
type LineLogger ¶
type LineLogger struct {
// contains filtered or unexported fields
}
func NewLineLogger ¶
func NewLineLogger(xio XIO) *LineLogger
type PriorityList ¶
type PriorityList struct {
// contains filtered or unexported fields
}
func (*PriorityList) Insert ¶
func (pl *PriorityList) Insert(value string)
func (*PriorityList) Next ¶
func (pl *PriorityList) Next() string
type Session ¶
func (*Session) AuthOOBCommand ¶
func (*Session) AuthQACommand ¶
func (*Session) CompleteLock ¶
func (s *Session) CompleteLock()
func (*Session) CompleteNext ¶
func (*Session) CompleteUnlock ¶
func (s *Session) CompleteUnlock()
func (*Session) DoEditDoneRoster ¶
func (s *Session) DoEditDoneRoster()
func (*Session) DoEditRoster ¶
func (s *Session) DoEditRoster()
func (*Session) EditRoster ¶
func (s *Session) EditRoster(roster []xmpp.RosterEntry)
editRoster runs in a goroutine and writes the roster to a file that the user can edit.
func (*Session) EndConversation ¶
func (*Session) FetchRoster ¶
func (*Session) GetFingerprint ¶
func (*Session) GetLastTarget ¶
func (*Session) GetRoster ¶
func (s *Session) GetRoster() []xmpp.RosterEntry
func (*Session) GetVersion ¶
func (*Session) HandleConfirmOrDeny ¶
func (*Session) IgnoreList ¶
func (s *Session) IgnoreList()
func (*Session) IgnoreUser ¶
func (*Session) LastAction ¶
func (s *Session) LastAction()
func (*Session) LoadEditedRoster ¶
func (s *Session) LoadEditedRoster(edit rosterEdit)
func (*Session) OptLastTarget ¶
func (*Session) PrintConversationInfo ¶
func (s *Session) PrintConversationInfo(uid string, conversation *otr.Conversation)
func (*Session) PrintConversations ¶
func (s *Session) PrintConversations()
func (*Session) ProcessClientMessage ¶
func (s *Session) ProcessClientMessage(stanza *xmpp.ClientMessage)
func (*Session) ProcessPresence ¶
func (s *Session) ProcessPresence(stanza *xmpp.ClientPresence)
func (*Session) ReadMessages ¶
func (*Session) SetLastTarget ¶
func (*Session) SetPromptForTarget ¶
func (*Session) ToggleStatusUpdates ¶
func (s *Session) ToggleStatusUpdates()
func (*Session) UnignoreUser ¶
type XIO ¶
type XIO interface { Info(msg string) Warn(msg string) Debug(format string, a ...interface{}) Alert(msg string) Critical(msg string) ReadPassword(msg string) (password string, err error) SetPrompt(prompt string) SetPromptEnc(target string, isEncrypted bool) Message(timestamp, from, fromres, to string, msg []byte, isEncrypted bool, doBell bool, delayed bool) StatusUpdate(timestamp, from, to, show string, status string, gone bool) FormStringForPrinting(s string) string Write(s string) ReadLine() (line string, err error) SetAutoCompleteCallback(f XIOAutoCompleteCallbackI) Resize() Destroy() }
func NewXIOTerm ¶
func NewXIOTerm() (x XIO)
type XIOTerm ¶
type XIOTerm struct {
// contains filtered or unexported fields
}
func (*XIOTerm) FormStringForPrinting ¶
FormStringForPrinting takes a string form the form and returns an escaped version with codes to make it show as red.
func (*XIOTerm) ReadPassword ¶
func (*XIOTerm) SetAutoCompleteCallback ¶
func (xio *XIOTerm) SetAutoCompleteCallback(f XIOAutoCompleteCallbackI)
func (*XIOTerm) SetPromptEnc ¶
func (*XIOTerm) StatusUpdate ¶
Click to show internal directories.
Click to hide internal directories.