AmendHub

Download

jcs

/

subtext

/

mail.h

 

(View History)

jcs   mail: Rewrite, yet again Latest amendment: 110 on 2022-05-24

1 /*
2 * Copyright (c) 2022 joshua stein <jcs@jcs.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16
17 #ifndef __MAIL_H__
18 #define __MAIL_H__
19
20 #include "bile.h"
21 #include "session.h"
22
23 struct mail_message {
24 /* key */
25 unsigned long recipient_user_id;
26
27 unsigned long id;
28 time_t time;
29 time_t read;
30 unsigned long sender_user_id;
31 size_t subject_size;
32 char *subject;
33 size_t body_size;
34 char *body;
35 unsigned long parent_message_id;
36 };
37
38 void mail_menu(struct session *s);
39 void mail_compose(struct session *s, char *to, char *subject, char *body);
40 size_t mail_find_ids_for_user(struct user *user, size_t *nmail_ids,
41 unsigned long **mail_ids, size_t offset, size_t limit, bool only_unread);
42
43 #endif