2021-07-02 18:46:58 +00:00
|
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
// License, version 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
|
|
|
#ifndef _WEECHAT_XMPP_OMEMO_H_
|
|
|
|
#define _WEECHAT_XMPP_OMEMO_H_
|
|
|
|
|
2021-07-22 05:58:45 +00:00
|
|
|
extern const char *OMEMO_ADVICE;
|
|
|
|
|
2021-07-07 17:27:06 +00:00
|
|
|
struct t_omemo
|
|
|
|
{
|
2021-07-25 08:15:12 +00:00
|
|
|
struct signal_context *context;
|
2021-07-27 21:27:03 +00:00
|
|
|
struct signal_protocol_store_context *store_context;
|
|
|
|
|
2021-07-29 03:06:48 +00:00
|
|
|
struct t_omemo_db *db;
|
2021-12-31 14:49:52 +00:00
|
|
|
char *db_path;
|
2021-07-07 17:27:06 +00:00
|
|
|
|
2021-07-25 18:28:34 +00:00
|
|
|
struct ratchet_identity_key_pair *identity;
|
2021-07-07 17:27:06 +00:00
|
|
|
|
|
|
|
uint32_t device_id;
|
|
|
|
};
|
|
|
|
|
2021-12-31 14:49:52 +00:00
|
|
|
struct t_omemo_bundle_req
|
|
|
|
{
|
|
|
|
char *id;
|
|
|
|
char *jid;
|
|
|
|
char *device;
|
|
|
|
char *message_text;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct t_omemo_devicelist_req
|
|
|
|
{
|
|
|
|
char *id;
|
|
|
|
struct t_omemo_bundle_req bundle_req;
|
|
|
|
};
|
|
|
|
|
|
|
|
xmpp_stanza_t *omemo__get_bundle(xmpp_ctx_t *context, char *from, char *to,
|
|
|
|
struct t_omemo *omemo);
|
|
|
|
|
2021-07-25 08:15:12 +00:00
|
|
|
void omemo__init(struct t_gui_buffer *buffer, struct t_omemo **omemo,
|
2021-07-27 21:27:03 +00:00
|
|
|
const char *account_name);
|
2021-07-25 18:28:34 +00:00
|
|
|
|
2021-12-31 14:49:52 +00:00
|
|
|
void omemo__handle_devicelist(struct t_omemo *omemo, const char *jid,
|
|
|
|
xmpp_stanza_t *items);
|
|
|
|
|
|
|
|
void omemo__handle_bundle(struct t_omemo *omemo, const char *jid,
|
|
|
|
uint32_t device_id, xmpp_stanza_t *items);
|
|
|
|
|
2022-01-10 20:40:05 +00:00
|
|
|
char *omemo__decode(struct t_account *account, const char *jid,
|
2021-12-31 14:49:52 +00:00
|
|
|
xmpp_stanza_t *encrypted);
|
2021-07-25 18:28:34 +00:00
|
|
|
|
2022-01-10 20:40:05 +00:00
|
|
|
xmpp_stanza_t *omemo__encode(struct t_account *account, const char *jid,
|
|
|
|
const char *unencrypted);
|
2021-07-07 17:27:06 +00:00
|
|
|
|
|
|
|
void omemo__free(struct t_omemo *omemo);
|
2021-07-02 18:46:58 +00:00
|
|
|
|
|
|
|
#endif /*WEECHAT_XMPP_OMEMO_H*/
|