2016-12-25 00:44:26 +01:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2016-10-12 20:57:59 +02:00
|
|
|
from django.http import HttpRequest, HttpResponse
|
2017-03-03 19:01:52 +01:00
|
|
|
from typing import List, Text
|
2016-10-12 20:57:59 +02:00
|
|
|
|
|
|
|
from zerver.decorator import authenticated_json_post_view,\
|
|
|
|
has_request_variables, REQ, JsonableError
|
|
|
|
from zerver.lib.actions import check_send_typing_notification, \
|
|
|
|
extract_recipients
|
|
|
|
from zerver.lib.response import json_success
|
|
|
|
from zerver.models import UserProfile
|
|
|
|
|
|
|
|
@has_request_variables
|
|
|
|
def send_notification_backend(request, user_profile, operator=REQ('op'),
|
|
|
|
notification_to = REQ('to', converter=extract_recipients, default=[])):
|
2016-12-25 00:44:26 +01:00
|
|
|
# type: (HttpRequest, UserProfile, Text, List[Text]) -> HttpResponse
|
2016-10-12 20:57:59 +02:00
|
|
|
check_send_typing_notification(user_profile, notification_to, operator)
|
|
|
|
return json_success()
|