mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Merge branch 'master' into plugins
This commit is contained in:
commit
b529dffaaf
@ -2677,7 +2677,8 @@ cmd_otr(gchar **args, struct cmd_help_t help)
|
|||||||
if (!otr_key_loaded()) {
|
if (!otr_key_loaded()) {
|
||||||
ui_current_print_formatted_line('!', 0, "You have not generated or loaded a private key, use '/otr gen'");
|
ui_current_print_formatted_line('!', 0, "You have not generated or loaded a private key, use '/otr gen'");
|
||||||
} else if (!otr_is_secure(barejid)) {
|
} else if (!otr_is_secure(barejid)) {
|
||||||
message_send("?OTR?", barejid);
|
char *otr_query_message = otr_start_query();
|
||||||
|
message_send(otr_query_message, barejid);
|
||||||
} else {
|
} else {
|
||||||
ui_gone_secure(barejid, otr_is_trusted(barejid));
|
ui_gone_secure(barejid, otr_is_trusted(barejid));
|
||||||
}
|
}
|
||||||
@ -2694,7 +2695,8 @@ cmd_otr(gchar **args, struct cmd_help_t help)
|
|||||||
ui_current_print_formatted_line('!', 0, "You have not generated or loaded a private key, use '/otr gen'");
|
ui_current_print_formatted_line('!', 0, "You have not generated or loaded a private key, use '/otr gen'");
|
||||||
} else {
|
} else {
|
||||||
char *recipient = ui_current_recipient();
|
char *recipient = ui_current_recipient();
|
||||||
message_send("?OTR?", recipient);
|
char *otr_query_message = otr_start_query();
|
||||||
|
message_send(otr_query_message, recipient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,12 @@ _otr_libotr_version(void)
|
|||||||
return OTRL_VERSION;
|
return OTRL_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_otr_start_query(void)
|
||||||
|
{
|
||||||
|
return otrlib_start_query();
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_otr_init(void)
|
_otr_init(void)
|
||||||
{
|
{
|
||||||
@ -454,6 +460,7 @@ otr_init_module(void)
|
|||||||
{
|
{
|
||||||
otr_init = _otr_init;
|
otr_init = _otr_init;
|
||||||
otr_libotr_version = _otr_libotr_version;
|
otr_libotr_version = _otr_libotr_version;
|
||||||
|
otr_start_query = _otr_start_query;
|
||||||
otr_on_connect = _otr_on_connect;
|
otr_on_connect = _otr_on_connect;
|
||||||
otr_keygen = _otr_keygen;
|
otr_keygen = _otr_keygen;
|
||||||
otr_key_loaded = _otr_key_loaded;
|
otr_key_loaded = _otr_key_loaded;
|
||||||
|
@ -29,6 +29,7 @@ void otr_init_module(void);
|
|||||||
|
|
||||||
void (*otr_init)(void);
|
void (*otr_init)(void);
|
||||||
char* (*otr_libotr_version)(void);
|
char* (*otr_libotr_version)(void);
|
||||||
|
char* (*otr_start_query)(void);
|
||||||
void (*otr_on_connect)(ProfAccount *account);
|
void (*otr_on_connect)(ProfAccount *account);
|
||||||
void (*otr_keygen)(ProfAccount *account);
|
void (*otr_keygen)(ProfAccount *account);
|
||||||
|
|
||||||
|
@ -25,6 +25,8 @@
|
|||||||
|
|
||||||
OtrlPolicy otrlib_policy(void);
|
OtrlPolicy otrlib_policy(void);
|
||||||
|
|
||||||
|
char* otrlib_start_query(void);
|
||||||
|
|
||||||
void otrlib_init_ops(OtrlMessageAppOps *ops);
|
void otrlib_init_ops(OtrlMessageAppOps *ops);
|
||||||
|
|
||||||
ConnContext * otrlib_context_find(OtrlUserState user_state, const char * const recipient, char *jid);
|
ConnContext * otrlib_context_find(OtrlUserState user_state, const char * const recipient, char *jid);
|
||||||
|
@ -31,6 +31,12 @@ otrlib_policy(void)
|
|||||||
return OTRL_POLICY_ALLOW_V1 | OTRL_POLICY_ALLOW_V2 ;
|
return OTRL_POLICY_ALLOW_V1 | OTRL_POLICY_ALLOW_V2 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
otrlib_start_query(void)
|
||||||
|
{
|
||||||
|
return "?OTR?v2?";
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cb_display_otr_message(void *opdata, const char *accountname,
|
cb_display_otr_message(void *opdata, const char *accountname,
|
||||||
const char *protocol, const char *username, const char *msg)
|
const char *protocol, const char *username, const char *msg)
|
||||||
|
@ -32,6 +32,12 @@ otrlib_policy(void)
|
|||||||
return OTRL_POLICY_ALLOW_V1 | OTRL_POLICY_ALLOW_V2 | OTRL_POLICY_ALLOW_V3;
|
return OTRL_POLICY_ALLOW_V1 | OTRL_POLICY_ALLOW_V2 | OTRL_POLICY_ALLOW_V3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
otrlib_start_query(void)
|
||||||
|
{
|
||||||
|
return "?OTR?v23?";
|
||||||
|
}
|
||||||
|
|
||||||
static const char*
|
static const char*
|
||||||
cb_otr_error_message(void *opdata, ConnContext *context,
|
cb_otr_error_message(void *opdata, ConnContext *context,
|
||||||
OtrlErrorCode err_code)
|
OtrlErrorCode err_code)
|
||||||
|
Loading…
Reference in New Issue
Block a user