Skip to content

Node.js based forum software built for the modern web

closed #2765

Julian Lamba7c873f0702
diff --git a/src/groups.js b/src/groups.js
index 54ff60a195..4d5d5fde0f 100644
--- a/src/groups.js
+++ b/src/groups.js
@@ -135,7 +135,19 @@ var async = require('async'),
userObj.isOwner = isOwner;
next(null, userObj);
});
- }, next);
+ }, function(err, users) {
+ if (err) {
+ return next();
+ }
+
+ next(null, users.sort(function(a, b) {
+ if (a.isOwner === b.isOwner) {
+ return 0;
+ } else {
+ return a.isOwner && !b.isOwner ? -1 : 1;
+ }
+ }));
+ });
}
], next);
} else {