diff options
author | ElgarL <ElgarL@palmergames.com> | 2011-11-04 17:51:29 +0000 |
---|---|---|
committer | ElgarL <ElgarL@palmergames.com> | 2011-11-04 17:51:29 +0000 |
commit | 4ac5551c6bc97794389026259614303d7d8da662 (patch) | |
tree | e00af27ae5f0146f5436be5399389684ae97c973 /EssentialsGroupManager/src/org/anjocaido | |
parent | 52c2110a2b7e8be079588e5abe2bd7b1a89546ef (diff) | |
download | Essentials-4ac5551c6bc97794389026259614303d7d8da662.tar Essentials-4ac5551c6bc97794389026259614303d7d8da662.tar.gz Essentials-4ac5551c6bc97794389026259614303d7d8da662.tar.lz Essentials-4ac5551c6bc97794389026259614303d7d8da662.tar.xz Essentials-4ac5551c6bc97794389026259614303d7d8da662.zip |
Notification of being moved to the default group only happens if it's a
demotion/promotion (not on join).
Diffstat (limited to 'EssentialsGroupManager/src/org/anjocaido')
-rw-r--r-- | EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java index bcfa8e01b..85b69f101 100644 --- a/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java +++ b/EssentialsGroupManager/src/org/anjocaido/groupmanager/data/User.java @@ -117,13 +117,18 @@ public class User extends DataUnit implements Cloneable { getDataSource().addGroup(group); } group = getDataSource().getGroup(group.getName()); + // Do we notify of the group change? + String defaultGroupName = getDataSource().getDefaultGroup().getName(); + // if we are not in the default group + // or we are in the default group and the move is to a different group. + boolean notify = (this.group != defaultGroupName) || ((this.group == defaultGroupName) && (group.getName() != defaultGroupName)) ; this.group = group.getName(); flagAsChanged(); if (GroupManager.isLoaded()) { if (GroupManager.BukkitPermissions.player_join = false) GroupManager.BukkitPermissions.updateAllPlayers(); - GroupManager.notify(this.getName(), String.format(" moved to the group %s.", group.getName())); + if (notify) GroupManager.notify(this.getName(), String.format(" moved to the group %s.", group.getName())); } } |