aboutsummaryrefslogtreecommitdiff
path: root/ssh/tomsg_clientlib.h
diff options
context:
space:
mode:
Diffstat (limited to 'ssh/tomsg_clientlib.h')
-rw-r--r--ssh/tomsg_clientlib.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/ssh/tomsg_clientlib.h b/ssh/tomsg_clientlib.h
index ab1bde5..8a4aae4 100644
--- a/ssh/tomsg_clientlib.h
+++ b/ssh/tomsg_clientlib.h
@@ -126,6 +126,7 @@ enum tomsg_event_type {
TOMSG_EV_INVITE, // join
TOMSG_EV_SEND, // send
TOMSG_EV_HISTORY, // history
+ TOMSG_EV_GET_MESSAGE, // get_message
TOMSG_EV_PING, // -
TOMSG_EV_IS_ONLINE, // is_online
TOMSG_EV_USER_ACTIVE, // user_active
@@ -139,6 +140,7 @@ struct history_message {
char *username;
int64_t timestamp;
int64_t msgid;
+ int64_t replyid; // -1 if normal message, the replied-to message id otherwise
char *message;
};
@@ -180,6 +182,10 @@ struct tomsg_event {
struct history_message *messages;
} history;
struct {
+ char *room_name;
+ struct history_message message;
+ } get_message;
+ struct {
char *username;
int64_t online_count;
} is_online;
@@ -245,8 +251,12 @@ enum tomsg_retval tomsg_invite(
// If 'tag' is not NULL, will write the message request tag to the referenced
// location. This tag will also be given in the TOMSG_EV_SEND response, so that
// the response can be linked to the original message.
+// If 'replyid' is -1, will send a normal message. If not, it must be the id of
+// an earlier message in the same room, and this will send a reply to the
+// indicated message.
enum tomsg_retval tomsg_send(
struct tomsg_client *client, const char *room_name, const char *message,
+ int64_t replyid,
int64_t *tag // output
);
@@ -257,6 +267,9 @@ enum tomsg_retval tomsg_history(
struct tomsg_client *client, const char *room_name,
int64_t count, int64_t before_msgid);
+// Send a get_message command to the server.
+enum tomsg_retval tomsg_get_message(struct tomsg_client *client, int64_t msgid);
+
// Send a ping command to the server.
enum tomsg_retval tomsg_ping(struct tomsg_client *client);