Skip to content
This repository has been archived by the owner on Jul 27, 2019. It is now read-only.

Commit

Permalink
Tokenize smsg response correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnaude committed Jun 25, 2015
1 parent f998a7f commit 1f81ed9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/cnaude/purpleirc/Commands/SMsg.java
Expand Up @@ -82,7 +82,7 @@ public void dispatch(CommandSender sender, String[] args) {
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);
Expand Down
Expand Up @@ -761,4 +761,10 @@ public String msgChatResponseTokenizer(String target, String message, String tem
.replace("%MESSAGE%", message)
);
}

public String msgChatResponseTokenizer(Player player, String message, String template) {
return template
.replace("%TARGET%", player.getName())
.replace("%MESSAGE%", message);
}
}

0 comments on commit 1f81ed9

Please sign in to comment.