From c2909f95c48058530f77bb8d6ce3a78da5e0bf60 Mon Sep 17 00:00:00 2001 From: Dan Rosenbloom Date: Mon, 22 Feb 2016 20:55:59 -0500 Subject: [PATCH] add notify as an option to direct messages --- lib/hipchat/user.rb | 5 +++-- spec/support/shared_contexts_for_hipchat.rb | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/hipchat/user.rb b/lib/hipchat/user.rb index 7d9d9d4..ed553ec 100644 --- a/lib/hipchat/user.rb +++ b/lib/hipchat/user.rb @@ -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 ) diff --git a/spec/support/shared_contexts_for_hipchat.rb b/spec/support/shared_contexts_for_hipchat.rb index 57ef97f..36e4d44 100644 --- a/spec/support/shared_contexts_for_hipchat.rb +++ b/spec/support/shared_contexts_for_hipchat.rb @@ -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