Tokenize smsg response correctly.

This commit is contained in:
cnaude 2015-06-24 20:13:34 -07:00
parent d5d3f02a9d
commit 2c4344289e
2 changed files with 8 additions and 2 deletions

View File

@ -82,7 +82,7 @@ public class SMsg implements IRCCommandInterface {
String targetMsg = plugin.tokenizer.gameChatTokenizer(player, template, msg);
String responseTemplate = plugin.getMsgTemplate("MAIN", "", TemplateName.GAME_PCHAT_RESPONSE);
if (!responseTemplate.isEmpty()) {
String responseMsg = plugin.tokenizer.msgChatResponseTokenizer(player.getName(), responseTemplate, msg);
String responseMsg = plugin.tokenizer.msgChatResponseTokenizer(player, msg, responseTemplate);
sender.sendMessage(responseMsg);
}
plugin.logDebug("Tokenized message: " + targetMsg);

View File

@ -328,7 +328,7 @@ public class ChatTokenizer {
.replace("%NAME%", pName)
.replace("%MESSAGE%", plugin.colorConverter.gameColorsToIrc(message)));
}
/**
* Game chat to game (private messages)
*
@ -761,4 +761,10 @@ public class ChatTokenizer {
.replace("%MESSAGE%", message)
);
}
public String msgChatResponseTokenizer(Player player, String message, String template) {
return template
.replace("%TARGET%", player.getName())
.replace("%MESSAGE%", message);
}
}