From e58ee8170b4b4074641a376b15bda3adb0c58e0e Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Wed, 28 Jun 2023 17:32:49 +0900 Subject: [PATCH 1/3] =?UTF-8?q?[remove/fix]=20-=20=E6=99=82=E9=96=93?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=BF=E3=81=AE=E5=8F=82=E7=85=A7=E3=81=8C?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=81=A6=E3=81=AA=E3=81=8B=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Message.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Message.js b/Message.js index 3a7ab30..2eb2b78 100644 --- a/Message.js +++ b/Message.js @@ -105,12 +105,8 @@ let msgMix = function msgMix(m) { //ファイルが添付されているなら if ( m.fileData.isAttatched ) { console.log("ファイル処理作業始めるわ"); - //添付ファイルへID振り分け - // for ( let index in m.fileData.attatchmentData ) { - // //IDは日付+チャンネルID+ユーザーID+乱数8桁 - // m.fileData.attatchmentData[index].fileid = m.channelid + m.userid + parseInt(Math.random()*99999999); - - // } + let t = new Date(); + let receivedDatePath = t.getFullYear() + "_" + (t.getMonth()+1).toString().padStart(2,0) + "_" + t.getDate().toString().padStart(2,0); writeUploadedFile(m.fileData, m.channelid, receivedDatePath); //ファイル処理開始 From 15fbb0a8d1ba970946f0ca6dce6171ecaaa89c68 Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Wed, 28 Jun 2023 17:48:07 +0900 Subject: [PATCH 2/3] =?UTF-8?q?[fix]=20-=20=E3=83=95=E3=82=A1=E3=82=A4?= =?UTF-8?q?=E3=83=ABID=E3=81=AE=E6=97=A5=E4=BB=98=E3=81=8Cundefined?= =?UTF-8?q?=E3=81=A0=E3=81=A3=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Message.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Message.js b/Message.js index 2eb2b78..2d198a9 100644 --- a/Message.js +++ b/Message.js @@ -104,9 +104,9 @@ let msgMix = function msgMix(m) { //ファイルが添付されているなら if ( m.fileData.isAttatched ) { - console.log("ファイル処理作業始めるわ"); + //ID振り分け用の時間データ let t = new Date(); - + let receivedDatePath = t.getFullYear() + "_" + (t.getMonth()+1).toString().padStart(2,0) + "_" + t.getDate().toString().padStart(2,0); writeUploadedFile(m.fileData, m.channelid, receivedDatePath); //ファイル処理開始 @@ -680,7 +680,7 @@ let msgRecord = function msgRecord(json) { //ファイルIDの振り分け for ( let index in json.fileData.attatchmentData ) { //IDは日付+ユーザーID+乱数8桁 - json.fileData.attatchmentData[index].fileid = json.time + json.userid + parseInt(Math.random()*99999999); + json.fileData.attatchmentData[index].fileid = receivedTime + json.userid + parseInt(Math.random()*99999999); } From 2fefd3fa5f7179daa1be25f5d91a7b24ff4b4d9f Mon Sep 17 00:00:00 2001 From: NfoAlex <40430040+NfoAlex@users.noreply.github.com> Date: Wed, 28 Jun 2023 17:48:14 +0900 Subject: [PATCH 3/3] =?UTF-8?q?[remove]=20-=20=E4=B8=8D=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Message.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/Message.js b/Message.js index 2d198a9..e3be838 100644 --- a/Message.js +++ b/Message.js @@ -693,8 +693,6 @@ let msgRecord = function msgRecord(json) { size: json.fileData.attatchmentData[index].size, type: json.fileData.attatchmentData[index].type, }; - //delete json.fileData.attatchmentData[index].name; - //delete json.fileData.attatchmentData[index].size; } catch(e) { console.log("Message :: msgRecord : ファイルID記録に失敗"); }