Closed rpk7524 closed 11 years ago
Twilio supports HTTP cookies for conversation tracking. See https://www.twilio.com/docs/api/twiml/sms/your_response
I'm not sure if it's possible to set the outbound cookie when I create an SMS to reply to a message. Will investigate.
The cookie method is not sufficient. We might need to make all messages from a given recipient go into one Conversation.
Write a specification that works off of the author and time (two separate specifications, then and them together). See some sample code in find conversations, but it needs to be refactored into multiple specs. I think a month or two from the last reply is probably sufficient to make a new conversation. Be aware that you need to use author, not get recipient for the spec. Also, findOne, not findAll. If you ensure that twilio always sets conversations modified on handle new message and reply, you can use that instead of the last messages created (easier spec to write).
Now works. Does not find by date as suggested above though -- texts are added to the existing conversation always.
Sponsor would like it to be a week instead of a month. Need to 'and' specifications together
I understand how to and the predicates together (using the example in ConversationServiceImpl.java), but I don't understand how to express the condition "if creation time is more recent than a week ago". i assume i need to use criteriaBuilder.gt for this
Would modifying the CreatedSinceSpecification to create a new specification that worked off of the modified date property work?
Twilio needs to check if an incoming message should be assigned to an existing conversation.
Reproduction steps: User sends message to ASKSG twilio phone #. Conversation is created, with message. Senator replies to message. New message is attached to existing conversation. User replies back. Error: New conversation is created, with message. Expected: Incoming message is attached to existing conversation.