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

RESOLVED FIXED in 1.6

Status

defect
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: mayanktg, Assigned: mayanktg)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

5 years ago
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.
(Assignee)

Comment 1

5 years ago
The patch to generate unique ID/SID for XML stanzas.
Attachment #8460199 - Flags: review?(clokep)
Attachment #8460199 - Flags: feedback?
(Assignee)

Updated

5 years ago
Attachment #8460199 - Flags: feedback?

Comment 2

5 years ago
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-
(Assignee)

Comment 3

5 years ago
Attachment #8460199 - Attachment is obsolete: true
Attachment #8460245 - Flags: review?(aleth)

Updated

5 years ago
Attachment #8460245 - Flags: review?(aleth) → review+

Updated

5 years ago
Keywords: checkin-needed
https://hg.mozilla.org/comm-central/rev/3280f8215f89
Status: NEW → RESOLVED
Last Resolved: 5 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.