lib/blather/jid.rb in blather-0.5.7 vs lib/blather/jid.rb in blather-0.5.8
- old
+ new
@@ -81,13 +81,10 @@
if @domain.nil? && @resource.nil?
@node, @domain, @resource = @node.to_s.scan(PATTERN).first
end
- @node.downcase! if @node
- @domain.downcase! if @domain
-
raise ArgumentError, 'Node too long' if (@node || '').length > 1023
raise ArgumentError, 'Domain too long' if (@domain || '').length > 1023
raise ArgumentError, 'Resource too long' if (@resource || '').length > 1023
end
@@ -127,10 +124,10 @@
# String representations are compared, see JID#to_s
#
# @param [#to_s] other a JID to comare against
# @return [Fixnum<-1, 0, 1>]
def <=>(other)
- to_s <=> other.to_s
+ to_s.downcase <=> other.to_s.downcase
end
alias_method :eql?, :==
# Test if JID is stripped
#