gateway

package
v1.12.8 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const NSCommand string = "http://jabber.org/protocol/commands"
View Source
const NSNick string = "http://jabber.org/protocol/nick"
View Source
const NodeAvatarData string = "urn:xmpp:avatar:data"
View Source
const NodeAvatarMetadata string = "urn:xmpp:avatar:metadata"
View Source
const NodeAvatarMetadataNotify string = NodeAvatarMetadata + "+notify"
View Source
const NodeVCard4 string = "urn:xmpp:vcard4"

Variables

View Source
var CachedStorageSize uint64

CachedStorageSize estimates the storage size between full rescans

View Source
var DirtySessions = false

DirtySessions denotes that some Telegram session configurations were changed and need to be re-flushed to the YamlDB

IdsDB provides a disk-backed bidirectional dictionary of Telegram and XMPP ids

Jid stores the component's JID object

View Source
var MessageOutgoingPermissionVersion = 0

MessageOutgoingPermissionVersion contains a XEP-0356 version to fake outgoing messages by foreign JIDs

View Source
var Queue = make(map[string]*stanza.Presence)

Queue stores presences to send later

View Source
var QueueLock = sync.Mutex{}
View Source
var SPFrom = args.NewString()

SPFrom is a Telegram user id

SPImmed skips queueing

View Source
var SPNickname = args.NewString()

SPNickname is a XEP-0172 nickname

View Source
var SPPhoto = args.NewString()

SPPhoto is a XEP-0153 hash of avatar in vCard

View Source
var SPResource = args.NewString()

SPResource is an optional resource

View Source
var SPShow = args.NewString()

SPShow is a availability status

View Source
var SPStatus = args.NewString()

SPStatus is a verbose status

View Source
var SPType = args.NewString()

SPType is a presence type

View Source
var StorageLock = sync.Mutex{}
View Source
var StorageQuota uint64

StorageQuota is a value from config parsed to bytes number

View Source
var Version string

Version stores this software's version

Functions

func CleanOldFiles added in v1.2.0

func CleanOldFiles(path string, limit uint64)

CleanOldFiles purges the oldest files in a directory that exceed the limit

func LogBadPresence

func LogBadPresence(presence *stanza.Presence)

LogBadPresence verbosely logs a presence

func MeasureStorageSize added in v1.2.0

func MeasureStorageSize(path string)

MeasureStorageSize replaces the estimated storage size with relevant data from the filesystem

func ResumableSend

func ResumableSend(component *xmpp.Component, packet stanza.Packet) error

ResumableSend tries to resume the connection once and sends the packet again

func SPAppendFrom added in v1.9.0

func SPAppendFrom(oldArgs []args.V, id int64) []args.V

SPAppendFrom appends numeric from and resource to varargs

func SendMessage

func SendMessage(to string, from string, body string, id string, component *xmpp.Component, reply *Reply, replaceId string, isCarbon, requestReceipt bool)

SendMessage creates and sends a message stanza

func SendMessageMarker added in v1.9.0

func SendMessageMarker(to string, from string, component *xmpp.Component, markerType MarkerType, markerId string)

SendMessageMarker creates and sends a message stanza with a XEP-0333 marker

func SendMessageWithOOB added in v1.4.0

func SendMessageWithOOB(to string, from string, body string, id string, component *xmpp.Component, reply *Reply, oob, replaceId string, isCarbon, requestReceipt bool)

SendMessageWithOOB creates and sends a message stanza with OOB URL

func SendPresence

func SendPresence(component *xmpp.Component, to string, args ...args.V) error

SendPresence creates and sends a presence stanza

func SendPubSubAvatarNotification added in v1.9.7

func SendPubSubAvatarNotification(component *xmpp.Component, jid string, chatId int64, sha1 string, size int64)

SendPubSubAvatarNotification encourages clients to fetch an avatar

func SendServiceMessage added in v1.5.0

func SendServiceMessage(to string, body string, component *xmpp.Component)

SendServiceMessage creates and sends a simple message stanza from transport

func SendTextMessage added in v1.5.0

func SendTextMessage(to string, from string, body string, component *xmpp.Component)

SendTextMessage creates and sends a simple message stanza

func SetNickname added in v1.2.1

func SetNickname(to string, from string, nickname string, component *xmpp.Component)

SetNickname sets a new nickname for a contact

func SimplePresence added in v1.9.0

func SimplePresence(from int64, typ string) []args.V

SimplePresence crafts simple presence varargs

func SplitJID added in v1.5.0

func SplitJID(from string) (string, string, bool)

SplitJID tokenizes a JID string to bare JID and resource

func SubscribeToTransport added in v1.8.0

func SubscribeToTransport(component *xmpp.Component, jid string)

SubscribeToTransport ensures a two-way subscription to the transport

Types

type MarkerType added in v1.9.0

type MarkerType byte
const (
	MarkerTypeReceived MarkerType = iota
	MarkerTypeDisplayed
)

type Reply added in v1.5.0

type Reply struct {
	Author string
	Id     string
	Start  uint64
	End    uint64
}

Jump to

Keyboard shortcuts

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