mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-25 20:18:25 +02:00
* Some progress on message list fetching / display... WIP!
This commit is contained in:
parent
ede00f8937
commit
8dc06cb49d
5 changed files with 56 additions and 8 deletions
|
@ -136,6 +136,16 @@ function createMessageBaseTables() {
|
|||
' message_id INTEGER NOT NULL' +
|
||||
');'
|
||||
);
|
||||
|
||||
dbs.message.run(
|
||||
'CREATE TABLE IF NOT EXISTS user_message_status (' +
|
||||
' user_id INTEGER NOT NULL,' +
|
||||
' message_id INTEGER NOT NULL,' +
|
||||
' status INTEGER NOT NULL,' +
|
||||
' UNIQUE(user_id, message_id, status),' +
|
||||
' FOREIGN KEY(user_id) REFERENCES user(id)' +
|
||||
');'
|
||||
);
|
||||
}
|
||||
|
||||
function createInitialMessageValues() {
|
||||
|
|
|
@ -78,6 +78,11 @@ Message.WellKnownAreaNames = {
|
|||
Private : 'private_mail'
|
||||
};
|
||||
|
||||
Message.Status = {
|
||||
New : 0,
|
||||
Read : 1,
|
||||
};
|
||||
|
||||
Message.MetaCategories = {
|
||||
System : 1, // ENiGMA1/2 stuff
|
||||
FtnProperty : 2, // Various FTN network properties, ftn_cost, ftn_origin, ...
|
||||
|
|
|
@ -11,6 +11,7 @@ var assert = require('assert');
|
|||
exports.getAvailableMessageAreas = getAvailableMessageAreas;
|
||||
exports.getMessageAreaByName = getMessageAreaByName;
|
||||
exports.changeMessageArea = changeMessageArea;
|
||||
exports.getMessageListForArea = getMessageListForArea;
|
||||
|
||||
function getAvailableMessageAreas() {
|
||||
return Config.messages.areas;
|
||||
|
@ -95,15 +96,26 @@ function getMessageListForArea(options, areaName, cb) {
|
|||
function msgRow(err, row) {
|
||||
if(!err) {
|
||||
msgList.push( {
|
||||
id : row.message_id,
|
||||
uuid : row.message_uuid,
|
||||
replyToId : row.reply_to_message_id,
|
||||
id : row.message_id,
|
||||
uuid : row.message_uuid,
|
||||
replyToId : row.reply_to_message_id,
|
||||
toUsername : row.to_user_name,
|
||||
fromUsername : row.from_user_name,
|
||||
subject : row.subject,
|
||||
timestamp : row.modified_timestamp,
|
||||
viewCount : row.view_count,
|
||||
} );
|
||||
}
|
||||
},
|
||||
callback
|
||||
);
|
||||
},
|
||||
function fetchStatus(callback) {
|
||||
callback(null);// :TODO: fixmeh.
|
||||
}
|
||||
]
|
||||
],
|
||||
function complete(err) {
|
||||
cb(err, msgList);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@ exports.pad = pad;
|
|||
exports.replaceAt = replaceAt;
|
||||
exports.isPrintable = isPrintable;
|
||||
exports.debugEscapedString = debugEscapedString;
|
||||
exports.format = format;
|
||||
|
||||
// :TODO: create Unicode verison of this
|
||||
var VOWELS = [ 'a', 'e', 'i', 'o', 'u' ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue