Closed Bug 953587 Opened 10 years ago Closed 10 years ago

Sort nicklist on chat conversation

Categories

(Instantbird Graveyard :: Conversation, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: romain, Assigned: bugzilla)

Details

Attachments

(2 files)

*** Original post on bio 140 at 2008-10-03 00:09:00 UTC ***

Actually it is not sorted alphabetically.

Should we display OP then Voiced, and then members and sort each category or mix everyone ?
Attached patch Sort nicklistSplinter Review
*** Original post on bio 140 as attmnt 121 by goulagman AT instantbird.org at 2008-10-14 21:29:00 UTC ***

Use dichotomic sort
Attachment #8351865 - Flags: review?
Assignee: nobody → bugzilla
Status: NEW → ASSIGNED
Comment on attachment 8351865 [details] [diff] [review]
Sort nicklist

*** Original change on bio 140 attmnt 121 at 2008-10-14 21:47:06 UTC ***

>diff -r eb0e14059222 instantbird/base/content/instantbird/conversation.xml

>          // Compute the color based on the nick
>-         var nick = name.match(/[a-zA-Z0-9]+/)[0].toLowerCase();
>+         var nick = name.match(/[a-zA-Z0-9|]+/)[0].toLowerCase();

This has bitrotted...

>@@ -500,8 +500,35 @@
> 
>          this.buddies[name] = item;
>          var nicklist = document.getAnonymousElementByAttribute(this, "anonid", "nicklist");

Is this line still used?

> 
>-         // FIXME: move this item to the right position if its name changed

Keep the comment, just remove the "FIXME:" :)

>+         var nicklist = document.getAnonymousElementByAttribute(this, "anonid", "nicklist");
>+         nicklist.removeItemAt(getIndexOfItem(item));

Does this line actually work?
Attachment #8351865 - Flags: review? → review-
Attached patch V2Splinter Review
*** Original post on bio 140 as attmnt 122 by goulagman AT instantbird.org at 2008-10-14 22:21:00 UTC ***

Remove useless line
Fix line that doesn't work

Use binary sort (this is the correct english word)
Attachment #8351866 - Flags: review?
Comment on attachment 8351866 [details] [diff] [review]
V2

*** Original change on bio 140 attmnt 122 at 2008-10-17 01:15:40 UTC ***

This looks good but I think it's better to ignore the case. I just pushed this as 417:516b1c3e7ae0 with 2 toLowerCase calls added.
Attachment #8351866 - Flags: review? → review+
*** Original change on bio 140 at 2008-10-17 01:16:10 UTC was without comment, so any subsequent comment numbers will be shifted ***
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.