Documentation
¶
Overview ¶
Package xep0153 implements XEP-0153: vCard-Based Avatars. The server injects <x xmlns='vcard-temp:x:update'><photo>SHA1HASH</photo></x> into outgoing presence stanzas so that all clients — including those that do not support XEP-0084 PEP avatars — see the correct avatar.
Additionally, when a user updates their vCard, the module re-broadcasts their current presence to all roster contacts so avatar hash propagates immediately.
Index ¶
- Constants
- type VCardPresence
- func (v *VCardPresence) AccountFeatures(_ context.Context) ([]string, error)
- func (v *VCardPresence) Name() string
- func (v *VCardPresence) ServerFeatures(_ context.Context) ([]string, error)
- func (v *VCardPresence) Start(_ context.Context) error
- func (v *VCardPresence) Stop(_ context.Context) error
- func (v *VCardPresence) StreamFeature(_ context.Context, _ string) (stravaganza.Element, error)
Constants ¶
const ( // ModuleName is the module registration name. ModuleName = "xep0153" // XEPNumber is the XEP number. XEPNumber = "0153" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VCardPresence ¶
type VCardPresence struct {
// contains filtered or unexported fields
}
VCardPresence is the XEP-0153 module.
func New ¶
func New( rep repository.Repository, resMng resourcemanager.Manager, rtr router.Router, hosts *host.Hosts, hk *hook.Hooks, logger kitlog.Logger, ) *VCardPresence
New returns a new VCardPresence instance.
func (*VCardPresence) AccountFeatures ¶
func (v *VCardPresence) AccountFeatures(_ context.Context) ([]string, error)
AccountFeatures returns nil.
func (*VCardPresence) ServerFeatures ¶
func (v *VCardPresence) ServerFeatures(_ context.Context) ([]string, error)
ServerFeatures returns nil — feature is implicit.
func (*VCardPresence) Start ¶
func (v *VCardPresence) Start(_ context.Context) error
Start registers hooks.
func (*VCardPresence) Stop ¶
func (v *VCardPresence) Stop(_ context.Context) error
Stop unregisters hooks.
func (*VCardPresence) StreamFeature ¶
func (v *VCardPresence) StreamFeature(_ context.Context, _ string) (stravaganza.Element, error)
StreamFeature returns nil.