mirror of https://github.com/zulip/zulip.git
soft_deactivation: Add a helper for queuing soft_reactivation.
Signed-off-by: Zixuan James Li <359101898@qq.com>
This commit is contained in:
parent
bb6bd900cd
commit
3e95b59f2e
|
@ -377,6 +377,14 @@ def get_soft_deactivated_users_for_catch_up(filter_kwargs: Any) -> List[UserProf
|
||||||
return users_to_catch_up
|
return users_to_catch_up
|
||||||
|
|
||||||
|
|
||||||
|
def queue_soft_reactivation(user_profile_id: int) -> None:
|
||||||
|
event = {
|
||||||
|
"type": "soft_reactivate",
|
||||||
|
"user_profile_id": user_profile_id,
|
||||||
|
}
|
||||||
|
queue_json_publish("deferred_work", event)
|
||||||
|
|
||||||
|
|
||||||
def soft_reactivate_if_personal_notification(
|
def soft_reactivate_if_personal_notification(
|
||||||
user_profile: UserProfile, unique_triggers: Set[str], mentioned_user_group_name: Optional[str]
|
user_profile: UserProfile, unique_triggers: Set[str], mentioned_user_group_name: Optional[str]
|
||||||
) -> None:
|
) -> None:
|
||||||
|
@ -400,8 +408,4 @@ def soft_reactivate_if_personal_notification(
|
||||||
if not private_message and not personal_mention:
|
if not private_message and not personal_mention:
|
||||||
return
|
return
|
||||||
|
|
||||||
event = {
|
queue_soft_reactivation(user_profile.id)
|
||||||
"type": "soft_reactivate",
|
|
||||||
"user_profile_id": user_profile.id,
|
|
||||||
}
|
|
||||||
queue_json_publish("deferred_work", event)
|
|
||||||
|
|
Loading…
Reference in New Issue