Commit Graph

57 Commits

Author SHA1 Message Date
Aditya Bansal 25d9c7eea1 soft_deactivation: Add helper functions.
This commits adds new helper functions which are:
* get_users_for_soft_deactivation(): This function can be used to
fetch a list of human users which pass the criteria of minimum
inactivity period (in days) passed as a parameter to the function.
* do_soft_activate_users(): Given a list of users this function
reactivates them and help them catch up with the missing message
rows for them in the UserMessage table.
2017-08-15 08:33:16 -07:00
Aditya Bansal 0cb909b978 events: Fill in missing messages for a returing soft_deactivated user. 2017-08-15 08:33:16 -07:00
Tim Abbott ce670a7892 soft_deactivation: Document add_missing_messages algorithm. 2017-08-15 08:33:14 -07:00
Tim Abbott 14aaefdd46 soft_deactivation: rename find_and_store_to_insert_stream_msgs.
The original name was very verbose, and a bit less clear.
2017-08-15 08:29:51 -07:00
Tim Abbott 45bc599b02 soft_deactivation: Clean up user_messages_to_insert. 2017-08-15 08:29:51 -07:00
Aditya Bansal 57858596ab soft_deactivation: Add new function 'add_missing_messages'.
This function will help us in creating undisturbed experience for
returning soft deactivated users.

Tweaked by tabbott to fix minor performance and clarity issues.
2017-08-15 08:29:51 -07:00
Aditya Bansal dc5510ce44 soft_deactivation: Add helper functions for deactivating users. 2017-08-15 08:29:28 -07:00