aboutsummaryrefslogtreecommitdiff
path: root/db.h
diff options
context:
space:
mode:
Diffstat (limited to 'db.h')
-rw-r--r--db.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/db.h b/db.h
index d1c105b..13df899 100644
--- a/db.h
+++ b/db.h
@@ -16,6 +16,7 @@ struct db_room_list{
struct db_message{
i64 msgid;
i64 roomid,userid,timestamp;
+ i64 replyid; // message this is a reply to, or -1 if normal message
char *message;
};
@@ -59,10 +60,11 @@ struct db_strings_list db_user_tokens(i64 userid);
bool db_add_token(i64 userid,const char *token);
bool db_delete_token(i64 userid,const char *token);
-i64 db_create_message(i64 roomid,i64 userid,i64 timestamp,const char *message); // returns msgid
+i64 db_create_message(i64 roomid,i64 userid,i64 timestamp,i64 replyid,const char *message); // returns msgid
struct db_message_list db_get_messages(i64 roomid,i64 count); // gets latest `count` messages in rev. chron. order
// if beforeid<0, same as db_get_messages
struct db_message_list db_get_messages_before(i64 roomid,i64 count,i64 beforeid);
+bool db_message_exists(i64 roomid,i64 msgid);
void db_nullify_name_id(struct db_name_id ni);
void db_nullify_room_list(struct db_room_list rl);