2016-10-12 20:57:59 +02:00
|
|
|
from django.http import HttpRequest, HttpResponse
|
2020-02-28 18:23:57 +01:00
|
|
|
from typing import List
|
2016-10-12 20:57:59 +02:00
|
|
|
|
2019-02-02 23:53:22 +01:00
|
|
|
from zerver.decorator import has_request_variables, REQ
|
2020-02-28 18:23:57 +01:00
|
|
|
from zerver.lib.actions import check_send_typing_notification
|
2016-10-12 20:57:59 +02:00
|
|
|
from zerver.lib.response import json_success
|
2020-02-28 18:23:57 +01:00
|
|
|
from zerver.lib.validator import check_int, check_list
|
2016-10-12 20:57:59 +02:00
|
|
|
from zerver.models import UserProfile
|
|
|
|
|
|
|
|
@has_request_variables
|
2017-12-18 15:07:43 +01:00
|
|
|
def send_notification_backend(
|
2020-02-28 18:23:57 +01:00
|
|
|
request: HttpRequest,
|
|
|
|
user_profile: UserProfile,
|
|
|
|
operator: str=REQ('op'),
|
|
|
|
notification_to: List[int]=REQ('to', validator=check_list(check_int))) -> HttpResponse:
|
2016-10-12 20:57:59 +02:00
|
|
|
check_send_typing_notification(user_profile, notification_to, operator)
|
|
|
|
return json_success()
|