policy
[citadel.git] / citadel / policy.c
1 #include <stdlib.h>
2 #include <unistd.h>
3 #include <stdio.h>
4 #include <sys/stat.h>
5 #include <string.h>
6 #include <pthread.h>
7 #include <time.h>
8 #include <limits.h>
9 #include "citadel.h"
10 #include "server.h"
11 #include "database.h"
12 #include "config.h"
13 #include "room_ops.h"
14 #include "sysdep_decls.h"
15 #include "support.h"
16 #include "user_ops.h"
17 #include "msgbase.h"
18 #include "serv_chat.h"
19 #include "citserver.h"
20
21
22 /*
23  * Retrieve the applicable expire policy for a specific room
24  */
25 void GetExpirePolicy(struct ExpirePolicy *epbuf, struct quickroom *qrbuf) {
26         struct floor flbuf;
27
28         /* If the room has its own policy, return it */ 
29         if (qrbuf->QRep.expire_mode != 0) {
30                 memcpy(epbuf, &qrbuf->QRep, sizeof(struct ExpirePolicy));
31                 return;
32                 }
33
34         /* Otherwise, if the floor has its own policy, return it */     
35         getfloor(&flbuf, qrbuf->QRfloor);
36         if (flbuf.f_ep.expire_mode != 0) {
37                 memcpy(epbuf, &flbuf.f_ep, sizeof(struct ExpirePolicy));
38                 return;
39                 }
40
41         /* Otherwise, fall back on the system default */
42         memcpy(epbuf, &config.c_ep, sizeof(struct ExpirePolicy));
43         }
44
45
46 /*
47  * Get Policy EXpire
48  */
49 void cmd_gpex(char *argbuf) {
50         cprintf("%d Command not yet implemented.\n", ERROR);
51         }
52
53
54 /*
55  * Set Policy EXpire
56  */
57 void cmd_spex(char *argbuf) {
58         cprintf("%d Command not yet implemented.\n", ERROR);
59         }
60
61