From e21ad3a5aa46635db9dc30b3395aa59588074932 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 27 Jul 2020 21:22:42 +0200 Subject: server: Protocol v2, DB v2: message replies --- db.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'db.h') 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); -- cgit v1.2.3-54-g00ecf