2008-05-29 04:49:03 +02:00
|
|
|
# mock notify module
|
|
|
|
|
2017-08-13 13:18:56 +02:00
|
|
|
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
|
|
|
|
2008-05-29 04:49:03 +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 = []
|
2017-08-13 13:18:56 +02:00
|
|
|
app.ged.remove_event_handler('notification', ged.GUI2,
|
2013-04-07 23:41:15 +02:00
|
|
|
self._nec_notification)
|
|
|
|
|
|
|
|
def __init__(self):
|
2017-08-13 13:18:56 +02:00
|
|
|
app.ged.register_event_handler('notification', ged.GUI2,
|
2013-04-07 23:41:15 +02:00
|
|
|
self._nec_notification)
|
|
|
|
|
|
|
|
|
2008-05-29 04:49:03 +02:00
|
|
|
def notify(event, jid, account, parameters, advanced_notif_num = None):
|
2010-02-08 15:08:40 +01:00
|
|
|
notifications.append((event, jid, account, parameters, advanced_notif_num))
|
2008-05-29 04:49:03 +02:00
|
|
|
|
|
|
|
def get_advanced_notification(event, account, contact):
|
2010-02-08 15:08:40 +01:00
|
|
|
return None
|