Commit Diff
Diff:
2636e3534cd97c0ab59a0980a43ed71f7af92f7d
68fbe433d63bf7a6d23151a159d8db39544fba1b
Commit:
68fbe433d63bf7a6d23151a159d8db39544fba1b
Tree:
0a8241a3765609791b2749740ed3170e801c8916
Author:
Omar Polo <op@omarpolo.com>
Date:
Thu Jan 7 16:30:22 2021 UTC
Message:
add read receipt callback
commit - 2636e3534cd97c0ab59a0980a43ed71f7af92f7d
commit + 68fbe433d63bf7a6d23151a159d8db39544fba1b
blob - cbdf235f847c196aa270795c237cc57ec78ae50b
blob + ffdcdd072709c3c67022508a7cc46e18bbf6e251
--- toxe.c
+++ toxe.c
@@ -507,6 +507,15 @@ handle_friend_connection_status(Tox *tox, uint32_t fnu
PPP(MAKE_KEYWORD("@type"), MAKE_SYMBOL("friend-connection-status"),
MAKE_KEYWORD("friend-number"), MAKE_INTEGER(fnum),
MAKE_KEYWORD("connection-status"), convert_connection(c));
+}
+
+void
+handle_friend_read_receipt(Tox *tox, uint32_t fnum, uint32_t msgid,
+ void *udata)
+{
+ PPP(MAKE_KEYWORD("@type"), MAKE_SYMBOL("friend-read-receipt"),
+ MAKE_KEYWORD("friend-number"), MAKE_INTEGER(fnum),
+ MAKE_KEYWORD("message-id"), MAKE_INTEGER(msgid));
}
@@ -1112,6 +1121,7 @@ main(int argc, char **argv)
tox_callback_friend_status_message(tox, handle_friend_status_message);
tox_callback_friend_status(tox, handle_friend_status);
tox_callback_friend_connection_status(tox, handle_friend_connection_status);
+ tox_callback_friend_read_receipt(tox, handle_friend_read_receipt);
if (!save_tox(tox))
errx(1, "cannot save tox");
blob - 3da68596b917bcd530c251bedfaf6e80d4308bc3
blob + da2e6d713b69d56f4d04db71351f97d9516bce53
--- toxe.h
+++ toxe.h
@@ -92,6 +92,7 @@ void handle_friend_name(Tox*, uint32_t, const uint8
void handle_friend_status_message(Tox*, uint32_t, const uint8_t*, size_t, void*);
void handle_friend_status(Tox*, uint32_t, TOX_USER_STATUS, void*);
void handle_friend_connection_status(Tox*, uint32_t, TOX_CONNECTION, void*);
+void handle_friend_read_receipt(Tox*, uint32_t, uint32_t, void*);
int extract_friend_number(struct cons*, uint32_t*);
int extract_message(struct cons*, char**);
Omar Polo