Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add timestamps for enter and leave messages #596

Merged
merged 1 commit into from
May 18, 2020
Merged

Add timestamps for enter and leave messages #596

merged 1 commit into from
May 18, 2020

Conversation

sionleroux
Copy link
Contributor

Summary

Enter and leave messages don't have timestamps, unlike other events like text messages. Hubot doesn't have a place for them e.g. for enter messages in the EnterMessage class, but Slack supports them and other actions regarding enter/leave events in Slack expect you to use a timestamp, so you need to be able to get it from somewhere.

This change works around the fact that they're not present in Hubot's classes by inserting a ts field after the message object has been created. It includes tests to confirm that Slack's event timestamp is successfully passed on to Hubot.

Resolves #575

Requirements

Enter and leave messages don't have timestamps, unlike other events like
text messages.  Hubot doesn't have a place for them e.g. for enter
messages in the EnterMessage class, but Slack supports them and other
actions regarding enter/leave events in Slack expect you to use a
timestamp, so you need to be able to get it from somewhere.

This change works around the fact that they're not present in Hubot's
classes by inserting a `ts` field after the message object has been
created.  It includes tests to confirm that Slack's event timestamp is
successfully passed on to Hubot.

Resolves #575
@codecov
Copy link

codecov bot commented May 5, 2020

Codecov Report

Merging #596 into master will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #596      +/-   ##
==========================================
+ Coverage   85.10%   85.25%   +0.14%     
==========================================
  Files           6        6              
  Lines         396      400       +4     
  Branches       88       88              
==========================================
+ Hits          337      341       +4     
  Misses         34       34              
  Partials       25       25              
Impacted Files Coverage Δ
src/bot.coffee 76.06% <100.00%> (+0.84%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ff495d...115a9a0. Read the comment docs.

Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

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

LGTM - I will merge this soon and include it in the next release.

@seratch seratch added this to the 4.8.0 milestone May 15, 2020
@seratch seratch added the enhancement M-T: A feature request for new functionality label May 15, 2020
@seratch seratch self-assigned this May 15, 2020
@sionleroux
Copy link
Contributor Author

Thanks! 😁

@seratch seratch merged commit 9db6a0c into slackapi:master May 18, 2020
@sionleroux sionleroux deleted the join-part-timestamps branch May 18, 2020 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enter/leave messages don't have timestamps
2 participants