Allow the 'userIsNotAway' and 'userIsAway' translation messages to be empty.

This commit is contained in:
KHobbits 2012-11-04 21:49:48 +00:00
parent 4967279b8c
commit d674e65c11
2 changed files with 19 additions and 6 deletions

View file

@ -70,8 +70,8 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
}
return result;
}
private boolean isAuthorizedCheck(final String node)
private boolean isAuthorizedCheck(final String node)
{
if (base instanceof OfflinePlayer)
@ -538,7 +538,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
if (broadcast && !isHidden())
{
setDisplayNick();
ess.broadcastMessage(this, _("userIsNotAway", getDisplayName()));
final String msg = _("userIsNotAway", getDisplayName());
if (!msg.isEmpty())
{
ess.broadcastMessage(this, msg);
}
}
}
lastActivity = System.currentTimeMillis();
@ -571,7 +575,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
if (!isHidden())
{
setDisplayNick();
ess.broadcastMessage(this, _("userIsAway", getDisplayName()));
final String msg = _("userIsAway", getDisplayName());
if (!msg.isEmpty())
{
ess.broadcastMessage(this, msg);
}
}
}
}

View file

@ -32,12 +32,13 @@ public class Commandafk extends EssentialsCommand
private void toggleAfk(User user)
{
user.setDisplayNick();
String msg = "";
if (!user.toggleAfk())
{
//user.sendMessage(_("markedAsNotAway"));
if (!user.isHidden())
{
ess.broadcastMessage(user, _("userIsNotAway", user.getDisplayName()));
msg = _("userIsNotAway", user.getDisplayName());
}
user.updateActivity(false);
}
@ -46,8 +47,12 @@ public class Commandafk extends EssentialsCommand
//user.sendMessage(_("markedAsAway"));
if (!user.isHidden())
{
ess.broadcastMessage(user, _("userIsAway", user.getDisplayName()));
msg = _("userIsAway", user.getDisplayName());
}
}
if (!msg.isEmpty())
{
ess.broadcastMessage(user, msg);
}
}
}