From 0a77411b4755e12a0a6a5cad36f22dd053972322 Mon Sep 17 00:00:00 2001 From: bean5 Date: Thu, 10 Dec 2015 13:44:48 -0700 Subject: [PATCH] Account for longer usernames allowed in v2 of hipchat --- lib/hipchat/room.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/hipchat/room.rb b/lib/hipchat/room.rb index caa3530..d125566 100644 --- a/lib/hipchat/room.rb +++ b/lib/hipchat/room.rb @@ -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)' @@ -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], @@ -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],