Closed Bug 1042040 Opened 11 years ago Closed 11 years ago

Define a function to generate unique ID for the XML Stanza which MUST have uniquely generated id/sid.

Categories

(Chat Core :: XMPP, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mayanktg, Assigned: mayanktg)

References

()

Details

Attachments

(1 file, 1 obsolete file)

The XEP:0167-Jingle RTP Session and XEP:0096-SI File Transfer require uniquely generated SID (see RFC 6120 section 4.7.3). So we would be using a common generateId() function which generates these unique IDs.
The patch to generate unique ID/SID for XML stanzas.
Attachment #8460199 - Flags: review?(clokep)
Attachment #8460199 - Flags: feedback?
Attachment #8460199 - Flags: feedback?
Comment on attachment 8460199 [details] [diff] [review] Add a function to generate unique id/sid. Review of attachment 8460199 [details] [diff] [review]: ----------------------------------------------------------------- ::: chat/protocols/xmpp/xmpp.jsm @@ +277,5 @@ > }, > > + /* Generate unique sid for the stanza. Using id and > + unique sid is defined in RFC 6120 (Section 8.2.3, 4.7.3). */ > + generateId: function() { Please put this in the account prototype not the conversation prototype so it can be used by everything. @@ +280,5 @@ > + unique sid is defined in RFC 6120 (Section 8.2.3, 4.7.3). */ > + generateId: function() { > + let uuid = Cc["@mozilla.org/uuid-generator;1"] > + .getService(Ci.nsIUUIDGenerator).generateUUID(); > + return uuid.toString().split("-")[0].slice(1); Why are you only using the first bit? Is there a maximum length? This doesn't seem like a good idea.
Attachment #8460199 - Flags: review?(clokep) → review-
Attachment #8460199 - Attachment is obsolete: true
Attachment #8460245 - Flags: review?(aleth)
Attachment #8460245 - Flags: review?(aleth) → review+
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: