Chat log from Mike and Todd

From contact method Todd's Email Contact Method
Item Deme Email integration plan
Item version number 24
Chat with mikemintz@gmail.com
about email comment issues.

1:34 PM mikemintz: Hey Todd
1:35 PM me: hi
mikemintz: Can we just chat in text this time?
me: sure
mikemintz: Then we can have a log easier too
me: ok
mikemintz: Okay
so let's talk comment name and email subject
me: ok
1:36 PM mikemintz: i think it was your reply to 3b that tripped me up, although your reply to 2 is also different from what i expected
1:37 PM me: can you paste it in?
mikemintz: but let's just start from baseline, that will be much easier
let's first talk in terms of web only
and then add email subject lines in at the end
right now, here is what happens:
1:38 PM user posts top comment: they set the comment name manually (if they leave it blank, and the viewer were to allow it, it would just be referred to as "TextComment 123" as per the deme convention, although I think the viewer currently requires it)
1:40 PM If the user posts a response via the web, currently they may not set a title. It is automatically set to "Re: [parent]" and collapses multiple Re into one
oh sorry, incorrect
if they do not set a title, that is what happens
in fact, it's the default title
although currently the form doesn't have a field for title
1:41 PM okay well it's not how i expected it to be, but ideally i would say the title defaults to "Re: parent" (collapsing), and they may change the title if they wish
1:42 PM So what do you think about that?
1:43 PM On web, comment name defaults to "Re: [parent]" (collapsing), but user may change it to anything
1:44 PM and top comments encourage users to type titles
me: I think that's okay. BTW, this is what happens if you open comment as a document and comment on it. The form is missing a title only if you click Respond within the comment viewer.
1:45 PM mikemintz: yeah i just saw that. i think there is a lot of weird stuff going on with these popup forms which we'll have to address, but we can leave that for after we do email integration
it seems like these popup forms aren't really using the full deme new item form
(for example, the new subscription popup doesn't set permissions, so by default you don't have permission to edit your own subscription)
1:46 PM me: yes, true. also, we have problems like the newsroll viewer allowing you to see titles of articles you don't have permission to view.
1:47 PM mikemintz: okay that may just be a missing {% ifagentcan %} tag
me: we just need to standardize I guess
1:48 PM mikemintz: okay, so back to comment name. we agree that on the web, it will stay as it is now (or as it should be now), and there will be no instances where someone posts a comment on the web and the body of the comment gets prepended with a title?
1:49 PM me: wait - I thought we wanted to make it so user can type a title for any comment
mikemintz: yes, but when they do so, it becomes comment.name
not part of comment.body
me: okay
1:50 PM mikemintz: okay, so now in email world
deme is split into two completely separate email components
incoming email -> comment script
and action notice -> outgoing email code
let's first discuss incoming email -> comment
1:51 PM as in my comment, there are two types of incoming emails to deme: (a) top comment, and (b) reply comment
we agree that in the case of (a) top comment email, subject becomes comment.name
me: yes
1:52 PM mikemintz: in the case of (b), describe what you'd like to happen
me: subject: {prefix} Re: <top comment name>
1:53 PM body:
<reply comment name>
<comment body>
mikemintz: i think you're describing outgoing emails
me: sorry, I was
mikemintz: (that's next after we resolve incoming emails to deme, converting them to comments)
me: okay, so here's the web version
1:54 PM comment title: <reply comment name>
mikemintz: sorry i'm still confused
for incoming emails, or back to how it worked on the web-only?
1:55 PM me: this is for both
1:56 PM mikemintz: okay, so for incoming emails, the script gets email_subject and email_body, and has to generate comment.name and comment.body (we've already resolved how to set comment.creator and comment.item)
we can condition based on whether email_subject matches some regular expression like (re: )* \[list name\] (re: )* parentname
1:57 PM it will be hard to get it perfect since some email clients may truncate, or names of lists and comments may change
but we can at least start by assuming we know whether the user has changed the subject line
me: oka
1:59 PM mikemintz: so how do you propose we populate comment.name and comment.body based on email_subject and email_body?
2:01 PM me: if the subject line changes the comment name, then change comment name to subject line
if it doesn't change it, then set it to Re: top comment name
2:02 PM mikemintz: okay, that makes sense to me. so two follow-up questions:
1. can we assume if a user changes the subject, they are going to wipe and re-create it, so i can just say "if it doesn't start with re:, then take the whole subject as the new comment name"?
2. are you sure we don't want "Re: parent comment name"?
2:03 PM me: 1. I think that's okay
2:04 PM 2. I'm confused, why would we want that?
2:05 PM mikemintz: well, say we're having a conversation on "Email Integration Plan". Mike posts comment with name "Can you clarify this?" and Todd responds comment with name "Here's how it's done". if Mike responds to Todd's comment by email without changing the subject line, it seems like comment.name should be "Re: Here's how it's done" not "Re: Can you clarify this?"
2:08 PM me: okay, so I agree. I think the solution is for the script processing an incoming email to look at the subject line and see if any part of it matches the top comment name. If it doesn't, then use the subject line as the new comment name.
2:09 PM mikemintz: so you take back "1. I think that's okay"?
me: right
mikemintz: okay
me: that's why I said "I think"
:)
mikemintz: it just gets a lot more tricky since we have to know exactly how we generate outgoing subject lines in order to know how we process incoming subject lines
but let's say we can figure that out
2:10 PM now let's talk about outgoing emails based on action notices
me: okay I like that assumption
mikemintz: you've already said the current subject line / from / to / etc is sufficient for now on the non-comment action notices
me: I think so yes
2:11 PM mikemintz: so for comment action notices, here's what we have. it's either (a) top comment or (b) reply, it has comment.name, and it has comment.body
we need to generate email_subject and email_body
2:12 PM and to warn you, i'm a little uncomfortable modifying the body in any way, because email clients check to see the body is identical (at least gmail seems to) to do threading properly with incoming/outgoing messages
me: hmmm
mikemintz: so if i send a message "hello" and deme echoes it back to me as "Subject\nhello", it won't get threaded as nicely
2:13 PM another weird thing: if two emails are completely identical, except for something in the brackets at the front of the subject line, gmail will only display one of the emails
so when you're subscribed to something multiple times, and get multiple emails only differing by the email list name, gmail only displays one (arbitrarily it seems)
if you add something random to the end of the subject line, you get it twice
2:14 PM me: ok
mikemintz: and i'm also having very weird issues when getting an incoming email like this:

From: mike mintz
Reply-to: comment@deme
To: list@deme

it has no reply all, and if i click "reply" it goes to list@deme not comment@deme
2:15 PM i'm thinking maybe it's because it's from my address, so of course if i want to reply, i really want to send another message to the "to address" since that would be extending the conversation
but that really sucks if someone tries to respond to their own comment by email
2:16 PM me: yes. I can't think of an easy way around that.
2:17 PM mikemintz: one easy way is to forget the list address and just have the comment address
a hard way is to just use the list address, and do threading by some other means
2:20 PM but i'm not a fan of the latter, gets very confusing since lists are really just items you happen to be subscribed to
2:21 PM me: maybe the easy way is the way to go... hmmm
that would also solve the reply all problem
mikemintz: yes, the obvious downside is nobody knows how to start new threads
2:22 PM i suppose we can append text to the bottom of the message (like where the unsubscribe links usually go, i'm sure gmail deals with that nicely)
2:23 PM me: subject prefix could also tell them, e.g. Subject: [deme_team@deme] <comment name>
That's what we used to do in PHP Deme
mikemintz: yep that's easy to implement too
2:24 PM but not too pretty
me: right
2:25 PM The main issue is whether this would cause people to post top level comments to a comment thread by mistake
But maybe the solution as you say is to have stuff at the bottom of the message to train them.
2:26 PM And then also to have the subject prefix to remind everyone what the list address is.
2:27 PM mikemintz: would we then not have the email list name in the subject?
2:30 PM me: We would have it, yes, if the list admin wants it there. But the full address would be cumbersome, e.g. [deme_team@deme.stanford.edu] before the comment name
mikemintz: are you in your office right now? i might just come over now
me: yes
2:31 PM mikemintz: okay i'll see you around 3pm
me: okay.

For Internet Explorer users: Click on the Tools menu, located at the top of your browser window. When the drop-down menu appears, select the option labeled Full Screen.

For Chrome users:Click on the Chrome "wrench" icon, located in the upper right hand corner of your browser window. When the drop-down menu appears, select the choice labeled Full Screen.

For Firefox user:Click on the View menu, located at the top of your browser window. When the drop-down menu appears, select the option labeled Full Screen.

For Safari users: Safari currently does not support the ability to go fullscreen.