mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Allow to start OMEMO in MUC
This commit is contained in:
parent
21f247d0eb
commit
cf528383bd
@ -7973,6 +7973,14 @@ cmd_omemo_start(ProfWin *window, const char *const command, gchar **args)
|
||||
omemo_start_session(chatwin->barejid);
|
||||
chatwin->is_omemo = TRUE;
|
||||
} else if (window->type == WIN_MUC) {
|
||||
ProfMucWin *mucwin = (ProfMucWin*)window;
|
||||
assert(mucwin->memcheck == PROFMUCWIN_MEMCHECK);
|
||||
|
||||
/* TODO: Check room is configured correctly, no anonymous and access to
|
||||
* full jid */
|
||||
omemo_start_muc_sessions(mucwin->barejid);
|
||||
|
||||
mucwin->is_omemo = TRUE;
|
||||
} else {
|
||||
win_println(window, THEME_DEFAULT, '-', "You must be in a regular chat window to start an OMEMO session.");
|
||||
return TRUE;
|
||||
|
@ -294,6 +294,19 @@ omemo_start_session(const char *const barejid)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
omemo_start_muc_sessions(const char *const barejid)
|
||||
{
|
||||
GList *roster = muc_roster(barejid);
|
||||
GList *iter;
|
||||
for (iter = roster; iter != NULL; iter = iter->next) {
|
||||
Occupant *occupant = (Occupant *)iter->data;
|
||||
Jid *jid = jid_create(occupant->jid);
|
||||
omemo_start_session(jid->barejid);
|
||||
jid_destroy(jid);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
omemo_loaded(void)
|
||||
{
|
||||
|
@ -36,6 +36,7 @@ void omemo_trust(const char *const jid, const char *const fingerprint);
|
||||
void omemo_untrust(const char *const jid, const char *const fingerprint);
|
||||
|
||||
void omemo_start_session(const char *const barejid);
|
||||
void omemo_start_muc_sessions(const char *const barejid);
|
||||
void omemo_start_device_session(const char *const jid, uint32_t device_id, GList *prekeys, uint32_t signed_prekey_id, const unsigned char *const signed_prekey, size_t signed_prekey_len, const unsigned char *const signature, size_t signature_len, const unsigned char *const identity_key, size_t identity_key_len);
|
||||
|
||||
gboolean omemo_loaded(void);
|
||||
|
Loading…
Reference in New Issue
Block a user