xep0191

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName represents blocklist module name.
	ModuleName = "blocklist"

	// XEPNumber represents blocklist XEP number.
	XEPNumber = "0191"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockList added in v0.53.0

type BlockList struct {
	// contains filtered or unexported fields
}

BlockList represents blocklist (XEP-0191) module type.

func New

func New(
	router router.Router,
	hosts *host.Hosts,
	resMng *c2s.ResourceManager,
	rep repository.Repository,
	sn *sonar.Sonar,
) *BlockList

New returns a new initialized BlockList instance.

func (*BlockList) AccountFeatures added in v0.53.0

func (m *BlockList) AccountFeatures(_ context.Context) ([]string, error)

AccountFeatures returns blocklist account disco features.

func (*BlockList) InterceptStanza added in v0.53.0

func (m *BlockList) InterceptStanza(ctx context.Context, stanza stravaganza.Stanza, id int) (stravaganza.Stanza, error)

InterceptStanza will be used by blocklist module to determine whether a stanza should be blocked.

func (*BlockList) Interceptors added in v0.53.0

func (m *BlockList) Interceptors() []module.StanzaInterceptor

Interceptors returns blocklist stanza interceptors.

func (*BlockList) MatchesNamespace added in v0.53.0

func (m *BlockList) MatchesNamespace(namespace string, serverTarget bool) bool

MatchesNamespace tells whether namespace matches blocklist module.

func (*BlockList) Name added in v0.53.0

func (m *BlockList) Name() string

Name returns blocklist module name.

func (*BlockList) ProcessIQ added in v0.53.0

func (m *BlockList) ProcessIQ(ctx context.Context, iq *stravaganza.IQ) error

ProcessIQ process a blocklist iq.

func (*BlockList) ServerFeatures added in v0.53.0

func (m *BlockList) ServerFeatures(_ context.Context) ([]string, error)

ServerFeatures returns blocklist server disco features.

func (*BlockList) Start added in v0.53.0

func (m *BlockList) Start(_ context.Context) error

Start starts blocklist module.

func (*BlockList) Stop added in v0.53.0

func (m *BlockList) Stop(_ context.Context) error

Stop stops blocklist module.

func (*BlockList) StreamFeature added in v0.53.0

func (m *BlockList) StreamFeature(_ context.Context, _ string) (stravaganza.Element, error)

StreamFeature returns blocklist module stream feature.

Jump to

Keyboard shortcuts

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