Skip to content

Commit

Permalink
add notify as an option to direct messages
Browse files Browse the repository at this point in the history
  • Loading branch information
flyinbutrs committed Feb 23, 2016
1 parent 1ef5b43 commit c2909f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/hipchat/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ def initialize(token, params)
#
# Send a private message to user.
#
def send(message, message_format='text')
def send(message, message_format='text', notify=false)
response = self.class.post(@api.send_config[:url],
:query => { :auth_token => @token },
:body => {
:message => message,
:message_format => message_format
:message_format => message_format,
:notify => notify
}.send(@api.send_config[:body_format]),
:headers => @api.headers
)
Expand Down
3 changes: 2 additions & 1 deletion spec/support/shared_contexts_for_hipchat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,8 @@ def mock_successful_user_send(message)
stub_request(:post, "https://api.hipchat.com/v2/user/12345678/message").with(
:query => {:auth_token => "blah"},
:body => {:message => "Equal bytes for everyone",
:message_format => "text"},
:message_format => "text",
:notify => false},
:headers => {'Accept' => 'application/json',
'Content-Type' => 'application/json'}).to_return(:status => 200, :body => "", :headers => {})
end
Expand Down

0 comments on commit c2909f9

Please sign in to comment.