Documentation
¶
Index ¶
- Constants
- Variables
- func CleanOldFiles(path string, limit uint64)
- func LogBadPresence(presence *stanza.Presence)
- func MeasureStorageSize(path string)
- func ResumableSend(component *xmpp.Component, packet stanza.Packet) error
- func SPAppendFrom(oldArgs []args.V, id int64) []args.V
- func SendMessage(to string, from string, body string, id string, component *xmpp.Component, ...)
- func SendMessageMarker(to string, from string, component *xmpp.Component, markerType MarkerType, ...)
- func SendMessageWithOOB(to string, from string, body string, id string, component *xmpp.Component, ...)
- func SendPresence(component *xmpp.Component, to string, args ...args.V) error
- func SendPubSubAvatarNotification(component *xmpp.Component, jid string, chatId int64, sha1 string, size int64)
- func SendServiceMessage(to string, body string, component *xmpp.Component)
- func SendTextMessage(to string, from string, body string, component *xmpp.Component)
- func SetNickname(to string, from string, nickname string, component *xmpp.Component)
- func SimplePresence(from int64, typ string) []args.V
- func SplitJID(from string) (string, string, bool)
- func SubscribeToTransport(component *xmpp.Component, jid string)
- type MarkerType
- type Reply
Constants ¶
const NSCommand string = "http://jabber.org/protocol/commands"
const NSNick string = "http://jabber.org/protocol/nick"
const NodeAvatarData string = "urn:xmpp:avatar:data"
const NodeAvatarMetadata string = "urn:xmpp:avatar:metadata"
const NodeAvatarMetadataNotify string = NodeAvatarMetadata + "+notify"
const NodeVCard4 string = "urn:xmpp:vcard4"
Variables ¶
var CachedStorageSize uint64
CachedStorageSize estimates the storage size between full rescans
var DirtySessions = false
DirtySessions denotes that some Telegram session configurations were changed and need to be re-flushed to the YamlDB
var IdsDB badger.IdsDB
IdsDB provides a disk-backed bidirectional dictionary of Telegram and XMPP ids
var Jid *stanza.Jid
Jid stores the component's JID object
var MessageOutgoingPermissionVersion = 0
MessageOutgoingPermissionVersion contains a XEP-0356 version to fake outgoing messages by foreign JIDs
var Queue = make(map[string]*stanza.Presence)
Queue stores presences to send later
var QueueLock = sync.Mutex{}
var SPFrom = args.NewString()
SPFrom is a Telegram user id
SPImmed skips queueing
var SPNickname = args.NewString()
SPNickname is a XEP-0172 nickname
var SPPhoto = args.NewString()
SPPhoto is a XEP-0153 hash of avatar in vCard
var SPResource = args.NewString()
SPResource is an optional resource
var SPShow = args.NewString()
SPShow is a availability status
var SPStatus = args.NewString()
SPStatus is a verbose status
var SPType = args.NewString()
SPType is a presence type
var StorageLock = sync.Mutex{}
var StorageQuota uint64
StorageQuota is a value from config parsed to bytes number
var Version string
Version stores this software's version
Functions ¶
func CleanOldFiles ¶ added in v1.2.0
CleanOldFiles purges the oldest files in a directory that exceed the limit
func LogBadPresence ¶
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 ¶
ResumableSend tries to resume the connection once and sends the packet again
func SPAppendFrom ¶ added in v1.9.0
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 ¶
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
SendServiceMessage creates and sends a simple message stanza from transport
func SendTextMessage ¶ added in v1.5.0
SendTextMessage creates and sends a simple message stanza
func SetNickname ¶ added in v1.2.1
SetNickname sets a new nickname for a contact
func SimplePresence ¶ added in v1.9.0
SimplePresence crafts simple presence varargs
func SubscribeToTransport ¶ added in v1.8.0
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 )