mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-22 18:16:21 +00:00
Add OMEMO message encryption and decryption
This commit is contained in:
34
src/log.c
34
src/log.c
@@ -304,6 +304,23 @@ chat_log_pgp_msg_out(const char *const barejid, const char *const msg)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
chat_log_omemo_msg_out(const char *const barejid, const char *const msg)
|
||||
{
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
const char *jid = connection_get_fulljid();
|
||||
Jid *jidp = jid_create(jid);
|
||||
char *pref_omemo_log = prefs_get_string(PREF_OMEMO_LOG);
|
||||
if (strcmp(pref_omemo_log, "on") == 0) {
|
||||
_chat_log_chat(jidp->barejid, barejid, msg, PROF_OUT_LOG, NULL);
|
||||
} else if (strcmp(pref_omemo_log, "redact") == 0) {
|
||||
_chat_log_chat(jidp->barejid, barejid, "[redacted]", PROF_OUT_LOG, NULL);
|
||||
}
|
||||
prefs_free_string(pref_omemo_log);
|
||||
jid_destroy(jidp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
chat_log_otr_msg_in(const char *const barejid, const char *const msg, gboolean was_decrypted, GDateTime *timestamp)
|
||||
{
|
||||
@@ -338,6 +355,23 @@ chat_log_pgp_msg_in(const char *const barejid, const char *const msg, GDateTime
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
chat_log_omemo_msg_in(const char *const barejid, const char *const msg, GDateTime *timestamp)
|
||||
{
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
const char *jid = connection_get_fulljid();
|
||||
Jid *jidp = jid_create(jid);
|
||||
char *pref_omemo_log = prefs_get_string(PREF_OMEMO_LOG);
|
||||
if (strcmp(pref_omemo_log, "on") == 0) {
|
||||
_chat_log_chat(jidp->barejid, barejid, msg, PROF_IN_LOG, timestamp);
|
||||
} else if (strcmp(pref_omemo_log, "redact") == 0) {
|
||||
_chat_log_chat(jidp->barejid, barejid, "[redacted]", PROF_IN_LOG, timestamp);
|
||||
}
|
||||
prefs_free_string(pref_omemo_log);
|
||||
jid_destroy(jidp);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
chat_log_msg_in(const char *const barejid, const char *const msg, GDateTime *timestamp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user