pear icon indicating copy to clipboard operation
pear copied to clipboard

Mail System

Open mmhansen opened this issue 8 years ago • 0 comments

TODOS

  • [x] Come up with a standardization for 'mail' terms. Is the place where messages are called an inbox? is each message called a mail? What do we call a string of messages?
  • [x] Add feature to delete messages
  • [x] Make message times more precise in Inbox. It currently measures to the day. It should measure to the minute for the first 24 hours, and then go to just days
  • [x] Possibly add ability to mark messages as unread, or maybe just the whole conversation as unread?

A user has conversations. Conversations live in an inbox. Each conversation consists of messages


A conversation is the highest level of data stored in the collection. Conversations exist in two respects:

  1. How the user has interacted with it
  2. What the content is

For 1, we must have a conversation which has a boolean for read and unread

For 2, we must have an array of messages which tell me who it is from, and when it was sent. We can get last activity from the send date of the most recent message

A conversation will be between only 2 people

To delete a message, simply remove the conversation from the user's inbox


const message = new Schema({
from: ( a username )
body: ( a string )
sent: ( a timestamp )
})

const conversation = new Schema({
_id: 
messages: [message]
})
const conversation = new Schema ({
pointer: (id of conversation)
read: bool
})

const user = new Schema ({
_id:
...(other stuff)
inbox: [conversation]
})

Any Ideas for what a good mail system looks like?

mmhansen avatar Dec 10 '16 14:12 mmhansen