Skip to content

Commit

Permalink
Merge pull request #156 from bean5/dev
Browse files Browse the repository at this point in the history
Account for longer usernames allowed in v2 of hipchat
  • Loading branch information
rberrelleza committed Feb 23, 2016
2 parents af6295d + 0a77411 commit b12358e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/hipchat/room.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def send_message(message)
# +notify+:: true or false
# (default false)
def send(from, message, options_or_notify = {})
if from.length > 15
raise UsernameTooLong, "Username #{from} is `#{from.length} characters long. Limit is 15'"
if from.length > 20
raise UsernameTooLong, "Username #{from} is `#{from.length} characters long. Limit is 20'"
end
options = if options_or_notify == true or options_or_notify == false
warn 'DEPRECATED: Specify notify flag as an option (e.g., :notify => true)'
Expand Down Expand Up @@ -162,8 +162,8 @@ def send(from, message, options_or_notify = {})
end

def share_link(from, message, link)
if from.length > 15
raise UsernameTooLong, "Username #{from} is `#{from.length} characters long. Limit is 15'"
if from.length > 20
raise UsernameTooLong, "Username #{from} is `#{from.length} characters long. Limit is 20'"
end

response = self.class.post(@api.share_link_config[:url],
Expand All @@ -188,8 +188,8 @@ def share_link(from, message, link)
# # Default
# send_file 'nickname', 'some message', File.open("/path/to/file")
def send_file(from, message, file)
if from.length > 15
raise UsernameTooLong, "Username #{from} is `#{from.length} characters long. Limit is 15'"
if from.length > 20
raise UsernameTooLong, "Username #{from} is `#{from.length} characters long. Limit is 20'"
end

response = self.class.post(@api.send_file_config[:url],
Expand Down

0 comments on commit b12358e

Please sign in to comment.