It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

A Simple Hack: Sorting rooms and people

This post was originally written by a colleague of mine, @michelgrootjans on our internal Confluence.

Problem

It's inefficient and time consuming to use the People sidebar to find people when there are many of them.

Manual sorting doesn't scale.

Using the 'New Chat' works of course, but why would you need a sidebar then?

I would like my sidebar to be automatically sorted.

Screenshot 2017-10-05 at 21.54.22.jpg

Solution

For OSX users, edit HipChat.app/Contents/Resources/chat.html.(tested and works)

For windows users: edit <hipchat_installation_root>/localweb/hipchat-client.js (not tested, please let us know in the comments if this works for you)

 

I would like to sort conversations based on recency. Feel free to edit this page if you've found how to do this.

I've managed to sort by unread count first, then by alphabetical name. To get this behaviour, add these lines at the beginning of the function orderRooms:

...
}, { key: 'orderRooms', value: function orderRooms(rooms) { // start of hack: sort rooms by [unread, name] rooms = _(rooms).chain() .sortBy('name').reverse() .sortBy('unreadCount').reverse() .value() // end of hack if (this.data.room_order.length) { var results = _.compact(_.map(this.data.room_order, function (jid) {
...

References

 

Thanks again Michel for letting me share this interesting hack with the rest of the world!

2 comments

I solved the same issue a different way, which also let's me change how the names are displayed in the left-nav.

 

In `_getPeopleList`, replace,

...
name: room.name
...

with,

...
name: room.displayName
...

 

Add then add the following at the top of `orderRooms`,

 // Hack Begin

// set some additional name fields
var roomNames = _.map(rooms, function (room) {

// name to sort on
room.sortName = _(room.name).split(', ').reverse().value().join(' ');

// name to display in left-nav
room.displayName = room.sortName;

return room;
});

// sort the rooms
var sortedNames = _.sortBy(roomNames, 'sortName');

// replace original rooms with sorted rooms
rooms = sortedNames;

// Hack End

Worked for me on Windows 10!

Thank you!!!

Comment

Log in or Sign up to comment
Community showcase
Published in Hipchat Cloud

Hipchat Cloud and Stride have reached End of Life (updated)

All good things come to an end - thanks to all our customers and partners who have been along the Hipchat and Stride journey with us.  As of Feb 15th 2019, Hipchat Cloud and Stride have reached ...

33,698 views 7 8
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you