From 60bc6754cc8f53c89054b6a71019ab88e8394a8d Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Fri, 9 Jun 2023 19:32:30 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[fix]=20-=20=E3=83=81=E3=83=A3=E3=83=B3?= =?UTF-8?q?=E3=83=8D=E3=83=AB=E4=BD=9C=E6=88=90=E6=99=82=E3=81=AE=E7=9B=A3?= =?UTF-8?q?=E6=9F=BB=E8=A8=98=E9=8C=B2=E5=9E=8B=E3=81=8C=E9=96=93=E9=81=95?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infoUpdate.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infoUpdate.js b/infoUpdate.js index afcca78..e16edf3 100644 --- a/infoUpdate.js +++ b/infoUpdate.js @@ -426,7 +426,8 @@ let channelCreate = async function channelCreate(dat) { dat.reqSender.userid, { type: "channel", - targetid: newChannelId, + userid: "", + channelid: newChannelId, messageid: "" }, { From 9a4e52e646ce00b76719b204a69d433a055e46d2 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Fri, 9 Jun 2023 19:41:52 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[add]=20-=20=E3=83=81=E3=83=A3=E3=83=B3?= =?UTF-8?q?=E3=83=8D=E3=83=AB=E6=9B=B4=E6=96=B0=E6=99=82=E3=81=AB=E7=9B=A3?= =?UTF-8?q?=E6=9F=BB=E3=83=AD=E3=82=B0=E3=81=AB=E8=A8=98=E9=8C=B2=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infoUpdate.js | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/infoUpdate.js b/infoUpdate.js index e16edf3..e0406cf 100644 --- a/infoUpdate.js +++ b/infoUpdate.js @@ -200,6 +200,66 @@ let changeServerSettings = function changeServerSettings(dat) { //チャンネル設定の更新 let changeChannelSettings = function changeChannelSettings(dat) { + //名前を変更するなら監査記録 + if ( db.dataServer.channels[dat.targetid].name !== dat.channelname ) { + //監査ログへの記録処理 + recordModeration( + dat.reqSender.userid, + { + type: "channel", + userid: "", + channelid: dat.targetid, + messageid: "" + }, + { + actionname: "channelEditName", + valueBefore: db.dataServer.channels[dat.targetid].name, + valueAfter: dat.channelname + } + ); + + } + + //概要を変更するなら監査記録 + if ( db.dataServer.channels[dat.targetid].description !== dat.description ) { + //監査ログへの記録処理 + recordModeration( + dat.reqSender.userid, + { + type: "channel", + userid: "", + channelid: dat.targetid, + messageid: "" + }, + { + actionname: "channelEditDesc", + valueBefore: db.dataServer.channels[dat.targetid].description, + valueAfter: dat.description + } + ); + + } + + //公開範囲を変更するなら監査記録 + if ( db.dataServer.channels[dat.targetid].scope !== dat.scope ) { + //監査ログへの記録処理 + recordModeration( + dat.reqSender.userid, + { + type: "channel", + userid: "", + channelid: dat.targetid, + messageid: "" + }, + { + actionname: "channelEditScioe", + valueBefore: db.dataServer.channels[dat.targetid].scope, + valueAfter: dat.scope + } + ); + + } + //名前と概要と公開範囲を更新 db.dataServer.channels[dat.targetid].name = dat.channelname; db.dataServer.channels[dat.targetid].description = dat.description; From 473328b0cf711181d39e190d03646200ffca190c Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Fri, 9 Jun 2023 19:42:11 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[fix]=20-=20=E3=83=81=E3=83=A3=E3=83=B3?= =?UTF-8?q?=E3=83=8D=E3=83=AB=E5=89=8A=E9=99=A4=E6=99=82=E3=81=AE=E7=9B=A3?= =?UTF-8?q?=E6=9F=BB=E8=A8=98=E9=8C=B2=E5=9E=8B=E3=81=8C=E9=96=93=E9=81=95?= =?UTF-8?q?=E3=81=A3=E3=81=A6=E3=81=84=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infoUpdate.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/infoUpdate.js b/infoUpdate.js index e0406cf..b7b9729 100644 --- a/infoUpdate.js +++ b/infoUpdate.js @@ -539,6 +539,23 @@ let channelRemove = function channelRemove(dat) { } + + //監査ログへの記録処理 + recordModeration( + dat.reqSender.userid, + { + type: "channel", + userid: "", + channelid: dat.channelid, + messageid: "" + }, + { + actionname: "channelDelete", + valueBefore: "", + valueAfter: "" + } + ); + //サーバー情報をファイルへ書き込み fs.writeFileSync("./user.json", JSON.stringify(db.dataUser, null, 4)); fs.writeFileSync("./server.json", JSON.stringify(db.dataServer, null, 4)); From c5a1b5248b2fe0be72d43bca9867f05fe238dab1 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Fri, 9 Jun 2023 19:42:32 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[fix]=20-=20BAN=E8=A7=A3=E9=99=A4=E6=99=82?= =?UTF-8?q?=E3=81=AE=E7=9B=A3=E6=9F=BB=E3=81=AE=E8=A8=98=E9=8C=B2=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E3=81=8C=E9=96=93=E9=81=95=E3=81=A3=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infoUpdate.js | 54 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/infoUpdate.js b/infoUpdate.js index b7b9729..dc65647 100644 --- a/infoUpdate.js +++ b/infoUpdate.js @@ -109,23 +109,45 @@ let mod = function mod(dat) { //ユーザーのBAN case "ban": - console.log("infoUpdate :: mod : BANしました -> " + dat.targetid); + console.log("infoUpdate :: mod : BAN状態を更新 -> " + dat.targetid); + //BAN状態を更新 db.dataUser.user[dat.targetid].state.banned = dat.action.value; - //監査ログへの記録処理 - recordModeration( - dat.reqSender.userid, - { - type: "user", - userid: dat.targetid, - channelid: "", - messageid: "" - }, - { - actionname: "userBan", - valueBefore: dat.targetid, - valueAfter: "BANNED" - } - ); + //BAN状態に応じて監査ログへの記録 + if ( dat.action.value ) { + //監査ログへの記録処理 + recordModeration( + dat.reqSender.userid, + { + type: "user", + userid: dat.targetid, + channelid: "", + messageid: "" + }, + { + actionname: "userBan", + valueBefore: "false", + valueAfter: "true" + } + ); + + } else { + //監査ログへの記録処理 + recordModeration( + dat.reqSender.userid, + { + type: "user", + userid: dat.targetid, + channelid: "", + messageid: "" + }, + { + actionname: "userPardon", + valueBefore: "true", + valueAfter: "false" + } + ); + + } break; From cb5fca0cf969595a6dbc210fe13a78e5d0223217 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Fri, 9 Jun 2023 19:50:06 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[add]=20-=20=E3=82=B5=E3=83=BC=E3=83=90?= =?UTF-8?q?=E3=83=BC=E8=A8=AD=E5=AE=9A=E3=82=92=E5=A4=89=E3=81=88=E3=81=9F?= =?UTF-8?q?=E3=81=A8=E3=81=8D=E3=81=AB=E7=9B=A3=E6=9F=BB=E8=A8=98=E9=8C=B2?= =?UTF-8?q?=E3=82=92=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infoUpdate.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/infoUpdate.js b/infoUpdate.js index dc65647..1233bf2 100644 --- a/infoUpdate.js +++ b/infoUpdate.js @@ -216,6 +216,22 @@ let changeServerSettings = function changeServerSettings(dat) { //設定更新 db.dataServer.registration = dat.registration; + //監査ログへの記録処理 + recordModeration( + dat.reqSender.userid, + { + type: "server", + userid: "", + channelid: "", + messageid: "" + }, + { + actionname: "serverEditConfig", + valueBefore: "", + valueAfter: "" + } + ); + fs.writeFileSync("./server.json", JSON.stringify(db.dataServer, null, 4)); }