FEATURE: allow users to archive messages

Messages are now in 3 buckets

- Inbox for all new messages
- Sent for all sent messages
- Archive for all messages you are done with

You can select messages from your Inbox or Sent and move them to your Archive,
you can move messages out of your Archive similarly

Similar concept applied to group messages, except that archiving and unarchiving
will apply to all group members
This commit is contained in:
Sam
2015-12-23 11:09:17 +11:00
parent e03861da7e
commit 03ea0bfe22
30 changed files with 290 additions and 57 deletions

View File

@ -134,6 +134,7 @@ class PostCreator
create_embedded_topic
ensure_in_allowed_users if guardian.is_staff?
unarchive_message
@post.advance_draft_sequence
@post.save_reply_relationships
end
@ -268,6 +269,13 @@ class PostCreator
end
end
def unarchive_message
return unless @topic.private_message? && @topic.id
UserArchivedMessage.where(topic_id: @topic.id).destroy_all
GroupArchivedMessage.where(topic_id: @topic.id).destroy_all
end
private
def create_topic