mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-30 12:00:34 +08:00
XMPP: Don't send messages from spy users back to them.
This commit is contained in:
parent
094a747db3
commit
5196237c46
@ -124,14 +124,17 @@ public class EssentialsXMPP extends JavaPlugin implements IEssentialsXMPP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void broadcastMessage(final IUser sender, final String message)
|
||||
public void broadcastMessage(final IUser sender, final String message, final String xmppAddress)
|
||||
{
|
||||
ess.broadcastMessage(sender, message);
|
||||
try
|
||||
{
|
||||
for (String address : getSpyUsers())
|
||||
{
|
||||
sendMessage(address, message);
|
||||
if (!address.equalsIgnoreCase(xmppAddress))
|
||||
{
|
||||
sendMessage(address, message);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -24,5 +24,5 @@ public interface IEssentialsXMPP extends Plugin
|
||||
|
||||
boolean toggleSpy(final Player user);
|
||||
|
||||
void broadcastMessage(final IUser sender, final String message);
|
||||
void broadcastMessage(final IUser sender, final String message, final String xmppAddress);
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public class XMPPManager extends Handler implements MessageListener, ChatManager
|
||||
break;
|
||||
default:
|
||||
final IUser sender = parent.getUserByAddress(StringUtils.parseBareAddress(chat.getParticipant()));
|
||||
parent.broadcastMessage(sender, "="+sender.getDisplayName()+": "+ message);
|
||||
parent.broadcastMessage(sender, "="+sender.getDisplayName()+": "+ message, StringUtils.parseBareAddress(chat.getParticipant()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user