mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Ensure received devicelist contains our own device id
This commit is contained in:
parent
756fefb09a
commit
95da03ac28
@ -173,9 +173,18 @@ omemo_prekeys(GList ** const prekeys, GList ** const ids, GList ** const lengths
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
omemo_set_device_list(const char *const jid, GList * const device_list)
|
omemo_set_device_list(const char *const jid, GList * device_list)
|
||||||
{
|
{
|
||||||
/* TODO handle self device_list to ensure we still are on the list */
|
xmpp_ctx_t * const ctx = connection_get_ctx();
|
||||||
|
char *barejid = xmpp_jid_bare(ctx, session_get_account_name());
|
||||||
|
|
||||||
|
if (g_strcmp0(jid, barejid) == 0) {
|
||||||
|
if (!g_list_find(device_list, GINT_TO_POINTER(omemo_ctx.device_id))) {
|
||||||
|
device_list = g_list_append(device_list, GINT_TO_POINTER(omemo_ctx.device_id));
|
||||||
|
omemo_devicelist_publish(device_list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
g_hash_table_insert(omemo_ctx.device_list, strdup(jid), device_list);
|
g_hash_table_insert(omemo_ctx.device_list, strdup(jid), device_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ void omemo_identity_key(unsigned char **output, size_t *length);
|
|||||||
void omemo_signed_prekey(unsigned char **output, size_t *length);
|
void omemo_signed_prekey(unsigned char **output, size_t *length);
|
||||||
void omemo_signed_prekey_signature(unsigned char **output, size_t *length);
|
void omemo_signed_prekey_signature(unsigned char **output, size_t *length);
|
||||||
void omemo_prekeys(GList ** const prekeys, GList ** const ids, GList ** const lengths);
|
void omemo_prekeys(GList ** const prekeys, GList ** const ids, GList ** const lengths);
|
||||||
void omemo_set_device_list(const char *const jid, GList * const device_list);
|
void omemo_set_device_list(const char *const jid, GList * device_list);
|
||||||
|
|
||||||
void omemo_start_session(ProfAccount *account, char *barejid);
|
void omemo_start_session(ProfAccount *account, char *barejid);
|
||||||
gboolean omemo_loaded(void);
|
gboolean omemo_loaded(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user