From 5086c2e4b7a86b2f72f44a74bc7c5a3bfe6f5eb0 Mon Sep 17 00:00:00 2001 From: ElgarL Date: Fri, 4 Nov 2011 17:51:29 +0000 Subject: Notification of being moved to the default group only happens if it's a demotion/promotion (not on join). --- EssentialsGroupManager/src/Changelog.txt | 3 ++- .../src/org/anjocaido/groupmanager/data/User.java | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/EssentialsGroupManager/src/Changelog.txt b/EssentialsGroupManager/src/Changelog.txt index 5262c7018..d71bc135a 100644 --- a/EssentialsGroupManager/src/Changelog.txt +++ b/EssentialsGroupManager/src/Changelog.txt @@ -69,4 +69,5 @@ v 1.5: If the files have been altered (on disc) it will reload, so long as the in-memory data hasn't changed. If the files on Disc have changed AND there have been changes to it's in-memory data it will show a warning. You then MUST issue a '/mansave force' to overwrite the disc files, or a '/manload' to overwrite the memory data. - - Fix for an error in checkFullUserPermission caused by players disconnecting mid perms update. \ No newline at end of file + - Fix for an error in checkFullUserPermission caused by players disconnecting mid perms update. + - Notification of being moved to the default group only happens if it's a demotion/promotion (not on join). \ No newline at end of file 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())); } } -- cgit v1.2.3