Skip to content

Commit

Permalink
Merge pull request #168 from Logicworks/feature/allow-notify-on-user-…
Browse files Browse the repository at this point in the history
…send

add notify as an option to direct messages
  • Loading branch information
rberrelleza committed Feb 23, 2016
2 parents b12358e + c2909f9 commit 6287393
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 @@ -304,7 +304,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 6287393

Please sign in to comment.