gajim-plural/test/lib/notify.py

29 lines
752 B
Python
Raw Normal View History

# mock notify module
from gajim.common import app
2017-08-12 02:39:55 +02:00
from gajim.common import ged
2013-04-07 23:41:15 +02:00
notifications = []
2013-04-07 23:41:15 +02:00
class Notification:
def _nec_notification(self, obj):
global notifications
notifications.append(obj)
def clean(self):
global notifications
notifications = []
app.ged.remove_event_handler('notification', ged.GUI2,
2013-04-07 23:41:15 +02:00
self._nec_notification)
def __init__(self):
app.ged.register_event_handler('notification', ged.GUI2,
2013-04-07 23:41:15 +02:00
self._nec_notification)
def notify(event, jid, account, parameters, advanced_notif_num = None):
notifications.append((event, jid, account, parameters, advanced_notif_num))
def get_advanced_notification(event, account, contact):
return None