書式に含まれる部品の目印を取り除く
このコミットが含まれているのは:
2ファイル変更
+12
-2
検索条件に一致するファイルはありません
@@ -71,7 +71,7 @@ public class ClickableFormat {
|
||||
|
||||
LunaChatAPI api = LunaChat.getAPI();
|
||||
|
||||
ClickableFormat msg = new ClickableFormat(new KeywordReplacer(Utility.replaceColorCode(format)));
|
||||
ClickableFormat msg = new ClickableFormat(new KeywordReplacer(Utility.replaceColorCode(withoutPartMarkers(format))));
|
||||
|
||||
if ( channel != null ) {
|
||||
|
||||
@@ -141,7 +141,7 @@ public class ClickableFormat {
|
||||
*/
|
||||
public static ClickableFormat makeChannelClickableMessage(String format, String channelName) {
|
||||
|
||||
ClickableFormat msg = new ClickableFormat(new KeywordReplacer(Utility.replaceColorCode(format)));
|
||||
ClickableFormat msg = new ClickableFormat(new KeywordReplacer(Utility.replaceColorCode(withoutPartMarkers(format))));
|
||||
String stripped = Utility.stripColorCode(channelName);
|
||||
msg.replaceWithRunCommand("%channel%",
|
||||
channelName,
|
||||
|
||||
@@ -121,6 +121,16 @@ public class ClickableFormatTest extends TestCase {
|
||||
assertNotNull(findByClickEvent(comps, ClickEvent.runCommand("/lunachat join r")));
|
||||
}
|
||||
|
||||
public void testTemplateMarkersAreDropped() {
|
||||
|
||||
ClickableFormat f = ClickableFormat.makeFormat("\uE0009\uE001%username: %msg", new ChannelMemberDummy());
|
||||
f.replaceMessage("%msg", "hello");
|
||||
Component comps = f.makeComponent();
|
||||
|
||||
assertEquals("9うっちぃ: hello", plain(comps));
|
||||
assertEquals(1, countClickEvents(comps));
|
||||
}
|
||||
|
||||
public void testChannelMessage() {
|
||||
|
||||
Component comps = Messages.joinMessage("&b", "r", "ucchy");
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする