LunaChat v2.8.11 : Fixed issue #160
このコミットが含まれているのは:
1 親
c139bbd79c
コミット
06a817ff35
6ファイル変更
+77
-46
検索条件に一致するファイルはありません
@@ -77,12 +77,6 @@ public class MuteCommand extends SubCommandAbst {
|
||||
public boolean runCommand(
|
||||
CommandSender sender, String label, String[] args) {
|
||||
|
||||
// プレイヤーでなければ終了する
|
||||
if (!(sender instanceof Player)) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgIngame");
|
||||
return true;
|
||||
}
|
||||
|
||||
// 実行引数から、Muteするユーザーを取得する
|
||||
String kickedName = "";
|
||||
if (args.length >= 2) {
|
||||
@@ -92,9 +86,16 @@ public class MuteCommand extends SubCommandAbst {
|
||||
return true;
|
||||
}
|
||||
|
||||
// デフォルト参加チャンネルを取得、取得できない場合はエラー表示して終了する
|
||||
Player kicker = (Player) sender;
|
||||
Channel channel = api.getDefaultChannel(kicker.getName());
|
||||
// 対象チャンネルを取得、取得できない場合はエラー表示して終了する
|
||||
boolean isSpecifiedChannel = false;
|
||||
Channel channel = null;
|
||||
if (args.length >= 3) {
|
||||
channel = api.getChannel(args[2]);
|
||||
isSpecifiedChannel = true;
|
||||
} else if (sender instanceof Player) {
|
||||
Player kicker = (Player) sender;
|
||||
channel = api.getDefaultChannel(kicker.getName());
|
||||
}
|
||||
if (channel == null) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgNoJoin");
|
||||
return true;
|
||||
@@ -121,7 +122,7 @@ public class MuteCommand extends SubCommandAbst {
|
||||
|
||||
// 期限付きMuteの場合、期限の指定が正しいかどうかをチェックする
|
||||
int expireMinutes = -1;
|
||||
if (args.length >= 3) {
|
||||
if (args.length >= 3 && !isSpecifiedChannel) {
|
||||
if ( !args[2].matches("[0-9]+") ) {
|
||||
sendResourceMessage(sender, PREERR, "errmsgInvalidMuteExpireParameter");
|
||||
return true;
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする