Skip to content

Instantly share code, notes, and snippets.

@cognivator
Last active June 28, 2018 16:49
Show Gist options
  • Save cognivator/5124b96e796686f67a956036cc0d1b66 to your computer and use it in GitHub Desktop.
Save cognivator/5124b96e796686f67a956036cc0d1b66 to your computer and use it in GitHub Desktop.
Hipchat - sort and display Rooms & People

Edit HipChat.app/Contents/Resources/chat.html

  1. In _getPeopleList, replace,
...
name: room.name
...

with,

...
name: room.displayName
...
  1. 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
  1. Restart the Hipchat client
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment