Add support for incoming/outgoing filters.
A filter accepts and returns a stanza, but potentially modified.
To prevent sending/receiving a stanza, a filter may return None.
Incoming:
self.add_filter('in', in_filter)
Outgoing:
self.add_filter('out', out_filter)
Filters are applied in the order thay are added. However, you may
add an order parameter, which is the place in the list to insert the
filter:
self.add_filter('in', in_filter, order=0)
This commit is contained in:
@@ -1251,7 +1251,7 @@ class StanzaBase(ElementBase):
|
||||
stanza sent immediately. Useful for stream
|
||||
initialization. Defaults to ``False``.
|
||||
"""
|
||||
self.stream.send_raw(self.__str__(), now=now)
|
||||
self.stream.send(self, now=now)
|
||||
|
||||
def __copy__(self):
|
||||
"""Return a copy of the stanza object that does not share the
|
||||
|
||||
Reference in New Issue
Block a user