Source code for slixmpp.plugins.xep_0421.occupant_id
# Slixmpp: The Slick XMPP Library# Copyright (C) 2020 "Maxime “pep” Buquet <pep@bouah.net>"# This file is part of Slixmpp.# See the file LICENSE for copying permission.fromslixmppimportJID,Message,Presencefromslixmpp.pluginsimportBasePluginfromslixmpp.xmlstreamimportregister_stanza_pluginfromslixmpp.plugins.xep_0421importstanzafromslixmpp.plugins.xep_0421.stanzaimportOccupantId
[docs]classXEP_0421(BasePlugin):'''XEP-0421: Anonymous unique occupant identifiers for MUCs'''name='xep_0421'description='XEP-0421: Anonymous unique occupant identifiers for MUCs'dependencies={'xep_0030','xep_0045'}stanza=stanzanamespace=stanza.NSdefplugin_init(self)->None:# XXX: This should be MucMessage. Someday..register_stanza_plugin(Message,OccupantId)register_stanza_plugin(Presence,OccupantId)asyncdefhas_feature(self,jid:JID)->bool:info=awaitself.xmpp['xep_0030'].get_info(jid)returnself.namespaceininfo.get_features()