Commit Diff
Diff:
5a65beeacb00125c0143847a69c3ededbe0593d6
2636e3534cd97c0ab59a0980a43ed71f7af92f7d
Commit:
2636e3534cd97c0ab59a0980a43ed71f7af92f7d
Tree:
4052b6f61570766c975d1e0805d4e9f4c6694300
Author:
Omar Polo <op@omarpolo.com>
Date:
Thu Jan 7 16:08:31 2021 UTC
Message:
hfriend_send_msg: return the friend-number and message id
commit - 5a65beeacb00125c0143847a69c3ededbe0593d6
commit + 2636e3534cd97c0ab59a0980a43ed71f7af92f7d
blob - 14d1f91cf53b97d602bbbbcbf0e745b7d7d46623
blob + cbdf235f847c196aa270795c237cc57ec78ae50b
--- toxe.c
+++ toxe.c
@@ -691,7 +691,7 @@ err:
int
hfriend_send_msg(Tox *tox, struct cons *opts)
{
- uint32_t fnum;
+ uint32_t fnum, msgid;
char *msg, *errstr;
TOX_MESSAGE_TYPE t;
TOX_ERR_FRIEND_SEND_MESSAGE err;
@@ -711,14 +711,16 @@ hfriend_send_msg(Tox *tox, struct cons *opts)
goto err;
}
- tox_friend_send_message(tox, fnum, t, msg, strlen(msg), &err);
+ msgid = tox_friend_send_message(tox, fnum, t, msg, strlen(msg), &err);
if (err != TOX_ERR_FRIEND_SEND_MESSAGE_OK) {
errstr = "failure to send the message";
goto err;
}
- PPP(MAKE_KEYWORD("@type"), MAKE_SYMBOL("friend-send-message"),
- MAKE_KEYWORD("@status"), MAKE_SYMBOL("t"));
+ PPP(MAKE_KEYWORD("@type"), MAKE_SYMBOL("friend-send-message"),
+ MAKE_KEYWORD("friend-number"), MAKE_INTEGER(fnum),
+ MAKE_KEYWORD("message-id"), MAKE_INTEGER(msgid),
+ MAKE_KEYWORD("@status"), MAKE_SYMBOL("t"));
return 1;
err:
Omar Polo