Skip to content

Conversation

@theandrewykim
Copy link
Contributor

Edits to: #381

Copy link

@hahmed hahmed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@theandrewykim
Copy link
Contributor Author

@hahmed Thanks! And no problem for making the changes.
Just waiting for someone on our API team to give this a look :)

make suggested changes
@theandrewykim theandrewykim force-pushed the hahmed-snooze-conversation branch from ab95c2e to 78851df Compare March 23, 2018 20:50
# Assign
intercom.conversations.assign(id: conversation.id, admin_id: '123', assignee_id: '124')

# Snooze
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it would be useful to clarify that it is epoch time here just in case people are confused with the time format? Also might be good to add one or two examples us snoozing for one hour or a day like you referenced in the test, i.e. nowtime + 5

client.conversations.assign(id: '147', admin_id: '123', assignee_id: '124')
end

it 'snoozes a conversation' do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a test to ensure it does not set time in the past and returns an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@choran Is that necessary? We handle past timestamps with a specific error that raises a a BadRequest error with the SDK.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good 👍


def snooze(reply_data)
snoozed_until = reply_data.fetch(:snoozed_until) { fail 'snoozed_until field is required' }
reply reply_data.merge(message_type: 'snoozed', type: 'admin')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HI @theandrewykim , sorry for the delay here, forgot to get back to this. I was going to merge this but I just had one further question ... should the snoozed_until value be passed in with the replay, similar to assignee_id in the assign? e.g.
reply reply_data.merge(message_type: 'snoozed', type: 'admin', snoozed_until: snoozed_until)
I could be missing something here, i was just comparing it to the assign. Let me know and I can merge it then

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked this again and it looks like the assign is wrong, well not wrong but unnecessary, i.e. adding in the field in the merge after checking it exists in the fetch, so I think this is good

@choran choran self-assigned this Sep 19, 2018
Copy link
Member

@choran choran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@choran choran merged commit 92ab978 into master Oct 3, 2018
@jonnyom jonnyom deleted the hahmed-snooze-conversation branch October 3, 2018 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants