Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/blather.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
digest/sha1
logger
openssl
securerandom

active_support/core_ext/class/attribute
active_support/core_ext/object/blank
Expand Down
4 changes: 3 additions & 1 deletion lib/blather/stanza.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class Stanza < XMPPNode
@@last_id = 0
# @private
@@handler_list = []
# @private
@@id_base = SecureRandom.hex(8)

class_attribute :handler_hierarchy
attr_writer :handler_hierarchy
Expand Down Expand Up @@ -52,7 +54,7 @@ def self.handler_list
# @return [String] a new unique ID
def self.next_id
@@last_id += 1
'blather%04x' % @@last_id
'%s%04x' % [@@id_base, @@last_id]
end

# Check if the stanza is an error stanza
Expand Down