Skip to content

Commit

Permalink
Account for longer usernames allowed in v2 of hipchat
Browse files Browse the repository at this point in the history
  • Loading branch information
bean5 authored and bean5 committed Dec 10, 2015
1 parent d37c637 commit 0a77411
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 @@ -159,8 +159,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 @@ -185,8 +185,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 0a77411

Please sign in to comment.