aboutsummaryrefslogtreecommitdiff
path: root/db.h
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-07-27 21:22:42 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-07-28 16:07:42 +0200
commite21ad3a5aa46635db9dc30b3395aa59588074932 (patch)
treeba055e0201d7329286be59dd8020d90ccea8d5b7 /db.h
parent909ada35ccb617344d244d4e76c9ce85fd2b922b (diff)
server: Protocol v2, DB v2: message replies
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);