Add prof_message_t to wrap all message attributes

Probably missing copy of body to plain in carbon and privmessage.
Only covers the incoming message path because goal is OMEMO decryption
of untrusted message.
Cover some of the log functions but not all.
This commit is contained in:
Paul Fariello
2019-06-17 06:23:40 +02:00
parent 3bb3cc625d
commit 44d16e9141
20 changed files with 419 additions and 345 deletions

View File

@@ -471,12 +471,18 @@ api_settings_int_set(const char *const group, const char *const key, int value)
}
void
api_incoming_message(const char *const barejid, const char *const resource, const char *const message)
api_incoming_message(const char *const barejid, const char *const resource, const char *const plain)
{
sv_ev_incoming_message((char*)barejid, (char*)resource, (char*)message, NULL, NULL, FALSE);
prof_message_t *message = message_init();
message->jid = jid_create_from_bare_and_resource(barejid, resource);
message->plain = strdup(plain);
sv_ev_incoming_message(message);
// TODO handle all states
sv_ev_activity((char*)barejid, (char*)resource, FALSE);
message_free(message);
}
void