diff options
author | pranomostro <pranomostro@posteo.net> | 2017-07-08 23:53:48 +0200 |
---|---|---|
committer | pranomostro <pranomostro@posteo.net> | 2017-07-09 00:02:27 +0200 |
commit | 254e8e62498d0099bdf939624d7b9d4bc67ef49f (patch) | |
tree | 559247955caa96a6dce2ff0f474a670e09df8d4c /ratox.c | |
parent | 0db821b7bd566f6cfdc0cc5a7bbcc3e5e92adb4c (diff) |
Print own messages to FTEXT_OUT.
Print own messages to FTEXT_OUT as well,
for compatability with lchat (own messages
just vanish if they are not reprinted in
one of these files).
Diffstat (limited to 'ratox.c')
-rw-r--r-- | ratox.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1075,6 +1075,8 @@ static void sendfriendtext(struct friend *f) { ssize_t n; + time_t t; + char buft[64]; uint8_t buf[TOX_MAX_MESSAGE_LENGTH]; TOX_ERR_FRIEND_SEND_MESSAGE err; @@ -1086,6 +1088,11 @@ sendfriendtext(struct friend *f) tox_friend_send_message(tox, f->num, TOX_MESSAGE_TYPE_NORMAL, buf, n, &err); if (err != TOX_ERR_FRIEND_SEND_MESSAGE_OK) weprintf("Failed to send message\n"); + + buf[n]='\0'; + t = time(NULL); + strftime(buft, sizeof(buft), "%F %R", localtime(&t)); + dprintf(f->fd[FTEXT_OUT], "me %s %s\n", buft, buf); } static void |