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

Prepare message from string or object #150

Merged
merged 1 commit into from
Aug 22, 2016
Merged

Prepare message from string or object #150

merged 1 commit into from
Aug 22, 2016

Conversation

timkinnane
Copy link
Contributor

Closes #146.

sendMessageByRoomId now accepts the default string message but will also take an message object, which can contain attachments. If message object is sent, it will readdress that message to the given room ID.

@timkinnane
Copy link
Contributor Author

Example of taking an attachment from one message and sending it to someone else with hubot, inside listener:

if msg.envelope.message.hasOwnProperty('attachment')
  newMsg = {
    msg: "See attached:",
    attachments: [msg.envelope.message.attachment]
  }
  robot.adapter.chatdriver.sendMessageByRoomId newMsg, roomID
else
  # wasn't sent attachment

@geekgonecrazy
Copy link
Contributor

You know this kind of makes my customMessage method useless 😁 But good addition. Thanks 👍

@geekgonecrazy geekgonecrazy merged commit 1fec2b6 into RocketChat:master Aug 22, 2016
@timkinnane
Copy link
Contributor Author

Oh @geekgonecrazy, I didn't even see that 😛
I was following from work by @ngenerio that allowed the receiver to accept attachments on the message object, extending the send method to allow passing the original message directly through. Thanks for the merge!

@geekgonecrazy
Copy link
Contributor

@timkinnane sure thing. I'm looking to cut a release soon. Just have to verify #154 fixes things for users with version 0.37.0 of Rocket.Chat. My tests indicate yes. Just want to ensure its not just me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants