def on_chat_saved(sender, instance, **kw): """Broad cast this event to all channel listeners""" if kw.get('created'): from comet.api import broadcast_message from omchat.api import ChatRc, dump_rc broadcast_message('omchat', { 'action': 'chat-created', 'data': dump_rc(ChatRc, instance) })
def notify_editing_done(request): """broad this to all channel listeners""" author = request.POST.get('author') if not author: author = request.META['REMOTE_ADDR'] broadcast_message('omchat', { 'action': 'chat-editing-done', 'data': author }) return json_resp()