Add some missing filters

This commit is contained in:
Lonami Exo 2022-02-04 11:52:04 +01:00
parent 96b4059ae8
commit 4b477e5b27

View File

@ -2,6 +2,24 @@ import re
from .base import Filter
class Incoming:
"""
The update must be something the client received from another user,
and not something the current user sent.
"""
def __call__(self, event):
return not event.out
class Outgoing:
"""
The update must be something the current user sent,
and not something received from another user.
"""
def __call__(self, event):
return event.out
class Pattern:
"""
The update type must match the specified instances for the filter to return `True`.