events

package
v0.3.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2019 License: GPL-3.0 Imports: 5 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChatMessage added in v0.3.9

type ChatMessage struct {
	From jid.WithResource
	When time.Time
	Body string

	*data.ClientMessage // TODO: remove me
}

TODO: This feels like bad naming - it implies it's for any chat, but realistically should only be for group chats. The event name should actually take that into account ChatMessage represents a message event in a chat room

type ChatPresence added in v0.3.9

type ChatPresence struct {
	Session access.Session
	*data.ClientPresence
}

ChatPresence represents a presence event in a chat room

type DelayedMessageSent added in v0.3.7

type DelayedMessageSent struct {
	Session access.Session
	Peer    jid.Any
	Tracer  int
}

DelayedMessageSent represents the event that a delayed message is sent

type Event

type Event struct {
	Type    EventType
	Session access.Session
}

Event represents a Session event

type EventType

type EventType int

EventType represents the type of Session event

const (
	Disconnected EventType = iota
	Connecting
	Connected
	ConnectionLost

	RosterReceived
	Ping
	PongReceived
)

Session event types

type FileTransfer added in v0.3.9

type FileTransfer struct {
	Session access.Session
	Peer    jid.WithResource

	Mime             string
	DateLastModified string
	Name             string
	Size             int64
	Description      string
	IsDirectory      bool

	Answer  chan<- *string // one time use
	Control *sdata.FileTransferControl
}

FileTransfer represents an event associated with file transfers

type Log

type Log struct {
	Level   LogLevel
	Message string
}

Log contains information one specific log event

type LogLevel

type LogLevel int

LogLevel is the current log level

const (
	Info LogLevel = iota
	Warn
	Alert
)

The different available log levels

type Message

type Message struct {
	Session   access.Session
	From      jid.Any
	When      time.Time
	Body      []byte
	Encrypted bool
}

Message represents a message event

type Notification

type Notification struct {
	Session      access.Session
	Peer         jid.Any
	Notification string
}

Notification represents a notification event

type Peer

type Peer struct {
	Session access.Session
	Type    PeerType
	// This can be either with or without Resource depending on the peer type
	From jid.Any
}

Peer represents an event associated to a peer

type PeerType

type PeerType int

PeerType represents the type of Peer event

const (
	IQReceived PeerType = iota

	OTREnded
	OTRNewKeys
	OTRRenewedKeys

	SubscriptionRequest
	Subscribed
	Unsubscribe
)

Peer types

type Presence

type Presence struct {
	Session access.Session
	*data.ClientPresence
	Gone bool
}

Presence represents a presence event

type SMP added in v0.3.9

type SMP struct {
	Type     SMPType
	Session  access.Session
	From     jid.WithResource
	Resource string
	Body     string
}

SMP is an event related to SMP

type SMPType added in v0.3.9

type SMPType int

SMPType denotes the type of an SMP event

const (
	SecretNeeded SMPType = iota
	Success
	Failure
)

SMP types

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL