diff --git a/src/ui/chatwin.c b/src/ui/chatwin.c index 859921b9..4b0fd889 100644 --- a/src/ui/chatwin.c +++ b/src/ui/chatwin.c @@ -351,7 +351,6 @@ chatwin_outgoing_carbon(ProfChatWin *chatwin, ProfMessage *message) ProfWin *window = (ProfWin*)chatwin; - // TODO id set? win_print_outgoing(window, enc_char, message->id, message->replace_id, "%s", message->plain); int num = wins_get_num(window); status_bar_active(num, WIN_CHAT, chatwin->barejid); diff --git a/src/xmpp/message.c b/src/xmpp/message.c index a3f37baf..0caef0f6 100644 --- a/src/xmpp/message.c +++ b/src/xmpp/message.c @@ -1055,6 +1055,21 @@ _handle_carbons(xmpp_stanza_t *const stanza) message->mucuser = TRUE; } + // id + const char *id = xmpp_stanza_get_id(message_stanza); + if (id) { + message->id = strdup(id); + } + + // replace id + xmpp_stanza_t *replace_id_stanza = xmpp_stanza_get_child_by_ns(message_stanza, STANZA_NS_LAST_MESSAGE_CORRECTION); + if (replace_id_stanza) { + const char *replace_id = xmpp_stanza_get_id(replace_id_stanza); + if (replace_id) { + message->replace_id = strdup(replace_id); + } + } + // check omemo encryption #ifdef HAVE_OMEMO message->plain = omemo_receive_message(message_stanza, &message->trusted);