diff options
Diffstat (limited to 'db.h')
-rw-r--r-- | db.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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,13 +60,15 @@ 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); +struct db_message db_get_message(i64 msgid); // returns {msgid=-1} if nonexistent void db_nullify_name_id(struct db_name_id ni); void db_nullify_room_list(struct db_room_list rl); void db_nullify_user_list(struct db_user_list ul); +void db_nullify_message(struct db_message ml); void db_nullify_message_list(struct db_message_list ml); void db_nullify_strings_list(struct db_strings_list sl); |