Source

openju / openju / bl / notify.py

# -*- coding: utf-8 -*-

from openju.model import Notification

def get_user_notifications(user):
    return Notification.objects(user=user)

def notify_message_posted(user, message_id):
    """ Used for notifying each friend about posted message """
    notification = (
        Notification(
            action = 'message_posted',
            user = user,
            meta = dict(
                message_id = message_id)))
    notification.save()