-
Notifications
You must be signed in to change notification settings - Fork 0
/
dm_local.js
54 lines (43 loc) · 964 Bytes
/
dm_local.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
var dm = require ('./dm.js');
exports.addUser = function (u,p, cb) {
var exists = dm.addUser(u,p);
cb (exists);
}
exports.addSubject = function (s, cb) {
var id = dm.addSubject (s);
cb (id);
}
exports.getSubjectList = function (cb) {
var list = dm.getSubjectList ();
cb (list);
}
exports.getUserList = function (cb) {
var list = dm.getUserList ();
cb (list);
}
exports.login = function (u, p, cb) {
var ok = dm.login (u,p);
cb (ok);
}
exports.addPrivateMessage = function (msg, cb){
dm.addPrivateMessage (msg);
cb();
}
exports.getPrivateMessageList = function (u1, u2, cb) {
var list = dm.getPrivateMessageList (u1,u2);
cb (list);
}
function getSubject (sbj, cb) {
var id = dm.getSubject (sbj);
cb (id);
}
// adds a public message to storage
exports.addPublicMessage = function (msg, cb)
{
dm.addPublicMessage (msg);
cb ();
}
exports.getPublicMessageList = function (sbj, cb) {
var list = dm.getPublicMessageList (sbj);
cb (list);
}