Add file PyProject;
Support display of a single pubsub node item; Update document README; Modularize code;
This commit is contained in:
parent
37aa7e8f40
commit
5e495579c2
32 changed files with 2431 additions and 2059 deletions
22
jabbercard/xmpp/instance.py
Normal file
22
jabbercard/xmpp/instance.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from slixmpp import ClientXMPP
|
||||
|
||||
class XmppInstance(ClientXMPP):
|
||||
def __init__(self, jid, password, jid_bare):
|
||||
super().__init__(jid, password)
|
||||
|
||||
self.jid_bare = jid_bare
|
||||
|
||||
self.register_plugin('xep_0030') # XEP-0030: Service Discovery
|
||||
self.register_plugin('xep_0045') # XEP-0045: Multi-User Chat
|
||||
self.register_plugin('xep_0054') # XEP-0054: vcard-temp
|
||||
self.register_plugin('xep_0060') # XEP-0060: Publish-Subscribe
|
||||
self.register_plugin('xep_0369') # XEP-0369: Mediated Information eXchange (MIX)
|
||||
|
||||
self.add_event_handler("session_start", self.on_session_start)
|
||||
|
||||
async def on_session_start(self, event):
|
||||
self.send_presence()
|
||||
#self.disconnect()
|
Loading…
Add table
Add a link
Reference in a new issue