Age | Commit message (Collapse) | Author |
|
|
|
|
|
Can now be used as so:
>>> msg['chat_state']
''
>>> msg
<message />
>>> msg['chat_state'] = 'paused'
>>> msg
<message>
<paused xmlns="http://jabber.org/protocol/chatstates" />
</message>
>>> msg['chat_state']
'paused'
>>> del msg['chat_state']
>>> msg
<message />
|
|
Now done more responsibly, saving any existing signal handlers
and calling them when an interrupt occurs in addition to the
one Sleek installs.
NOTE: You may need to explicitly use "kill <process id>" in
order to trigger the proper signal handler execution, and
to raise the "killed" event.
|
|
class name mismatch
|
|
|
|
This should prevent some reference cycles that will cause garbage
collection issues.
|
|
Don't keep a reference to stanzas in Callback objects.
|
|
|
|
|
|
Instead of the actual callback object, return just the name of
the callback object created when using iq.send(callback=..).
This will help prevent memory leaks by not keeping an additional
reference to the object, but still allows for the callback to be
canceled by using self.remove_handler("handler_name").
|
|
Waiting until the actual run step means that the handler is not
marked for deletion when checked in the __spawn_event() thread,
causing the callback to stay in the handler list.
|
|
Allows for a callback to be canceled by unregistering the
returned handler.
|
|
This allows exceptions to include the original
content of a stanza in the error response by including
the parameter clear=False when raising the exception.
|
|
Now has docs and uses the new plugin format.
|
|
|
|
|
|
|
|
This print syntax is deprecated in python3, so
the plugin was working only with python2
|
|
Also, remove trailing spaces in all files
of this plugin
|
|
setNodeConfiguration.
|
|
|
|
|
|
|
|
|
|
Now uses the correct namespaces and condition names.
|
|
This allows you to determine the order in which substanzas
were added in the original XML.
|
|
|
|
|
|
Use stanza.values instead of _get/set_stanza_values where used.
ElementBase stanzas can now use .tag
May use class method tag_name() for stanza classes.
ElementBase now has .clear() method.
|
|
May now use register_stanza_plugin(Foo, Bar, iterable=True)
to add to the set of stanza classes used for iterable
substanzas. It is no longer necessary to manually specify
the contents of subitem if the new method is used.
|
|
|
|
A stanza object may add is_extension = True to its class definition
to provide a single new interface to a parent stanza.
For example:
import sleekxmpp
from sleekxmpp import Iq
from sleekxmpp.xmlstream import ElementBase, register_stanza_plugin, ET
class Foo(ElementBase):
"""
Test adding just an attribute to a parent stanza.
Adding subelements works as expected.
"""
is_extension = True
interfaces = set(('foo',))
plugin_attrib = 'foo'
def setup(self, xml):
# Don't include an XML element in the parent stanza
# since we're adding just an attribute.
# If adding a regular subelement, no need to do this.
self.xml = ET.Element('')
def set_foo(self, val):
self.parent()._set_attr('foo', val)
def get_foo(self):
return self.parent()._get_attr('foo')
def del_foo(self):
self.parent()._del_attr('foo')
register_stanza_plugin(Iq, Foo)
i1 = Iq()
i2 = Iq(xml=ET.fromstring("<iq xmlns='jabber:client' foo='bar' />"))
>>> i1['foo'] = '3'
>>> i1
'3'
>>> i1
'<iq id="0" foo="3" />'
>>> i2
'<iq id="0" foo="bar" />'
>>> i2['foo']
'bar'
>>> del i2['foo']
>>> i2
'<iq id="0" />'
|
|
|
|
|
|
Just log that the resolution timed out, and fall back
to the hostname from the JID in this case
|
|
If no JID is specified for the item, use xmpp.boundjid.full.
|
|
|
|
None values were not being treated properly.
|
|
Note that the stream may automatically attempt to
reconnect when a stream error is received.
|
|
Will be most useful for debugging and responding to failed
connection attempts.
|
|
|
|
|
|
Fixes the intermittent DEBUG ((),) messages that give no
explanation.
Will now show as:
DEBUG Scheduled event: ((), )
|
|
|
|
|
|
|
|
|
|
|
|
|