mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Merge branch 'develop' of github.com:HabitRPG/habitrpg into negue-copyMessageTodo
This commit is contained in:
@@ -23,6 +23,12 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
||||
return _.detect(Groups.myGuilds(), function(g) { return g._id === group._id });
|
||||
}
|
||||
|
||||
// Similarly, if we're dealing with the user's current party, return true.
|
||||
if(group.type === 'party') {
|
||||
var currentParty = Groups.party();
|
||||
if(currentParty._id && currentParty._id === group._id) return true;
|
||||
}
|
||||
|
||||
if (!group.members) return false;
|
||||
var memberIds = _.map(group.members, function(x){return x._id});
|
||||
return ~(memberIds.indexOf(userid));
|
||||
@@ -214,6 +220,18 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
||||
$scope.usernames = [];
|
||||
}
|
||||
|
||||
$scope.filterUser = function(msg) {
|
||||
if (!$scope.query || !msg.user) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ignore casing when checking for username
|
||||
var user = msg.user.toLowerCase();
|
||||
var text = $scope.query.text.toLowerCase();
|
||||
|
||||
return user.indexOf(text) == 0;
|
||||
}
|
||||
|
||||
$scope.addNewUser = function(user) {
|
||||
if($.inArray(user.user,$scope.usernames) == -1) {
|
||||
user.username = user.user;
|
||||
|
||||
Reference in New Issue
Block a user