change channel to receiver
This commit is contained in:
parent
781d6cf467
commit
d37c883d89
@ -40,7 +40,7 @@ CREATE TABLE `dms` (
|
|||||||
`dms_text` varchar(4000) NOT NULL,
|
`dms_text` varchar(4000) NOT NULL,
|
||||||
`dms_time` bigint NOT NULL,
|
`dms_time` bigint NOT NULL,
|
||||||
`dms_special_text` varchar(100) DEFAULT NULL,
|
`dms_special_text` varchar(100) DEFAULT NULL,
|
||||||
`dms_channel` varchar(100) DEFAULT NULL,
|
`dms_receiver` varchar(100) DEFAULT NULL,
|
||||||
`dms_is_private` tinyint DEFAULT '0',
|
`dms_is_private` tinyint DEFAULT '0',
|
||||||
`dms_from_bot` tinyint DEFAULT '0',
|
`dms_from_bot` tinyint DEFAULT '0',
|
||||||
`dms_reply_id` bigint unsigned DEFAULT NULL,
|
`dms_reply_id` bigint unsigned DEFAULT NULL,
|
||||||
|
@ -16,8 +16,8 @@ module.exports = {
|
|||||||
"dms_user_name","dms_text","dms_time","dms_special_text","dms_id","dms_from_bot","dms_reply_id"
|
"dms_user_name","dms_text","dms_time","dms_special_text","dms_id","dms_from_bot","dms_reply_id"
|
||||||
]
|
]
|
||||||
|
|
||||||
let sql = `select ${columns.join(",")} from ipost.dms where (dms_channel = ?) order by dms_id desc;`
|
let sql = `select ${columns.join(",")} from ipost.dms where (dms_receiver = ?) order by dms_id desc;`
|
||||||
con.query(sql, [xor(encodeURIComponent(res.locals.username),otherperson)], function (err, result) {
|
con.query(sql, [otherperson], function (err, result) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
res.json(result)
|
res.json(result)
|
||||||
});
|
});
|
||||||
|
@ -70,8 +70,8 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let sql = `insert into ipost.dms (dms_user_name,dms_text,dms_time,dms_channel,dms_from_bot,dms_reply_id) values (?,?,?,?,?,?);`
|
let sql = `insert into ipost.dms (dms_user_name,dms_text,dms_time,dms_receiver,dms_from_bot,dms_reply_id) values (?,?,?,?,?,?);`
|
||||||
let values = [encodeURIComponent(res.locals.username),req.body.message,Date.now(),xor(encodeURIComponent(res.locals.username),otherperson),res.locals.isbot,reply_id]
|
let values = [encodeURIComponent(res.locals.username),req.body.message,Date.now(),otherperson,res.locals.isbot,reply_id]
|
||||||
con.query(sql, values, function (err, result) {
|
con.query(sql, values, function (err, result) {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
// let post_obj = {
|
// let post_obj = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user