mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
Small modification, should check for whitespace pattern even if policy is always.
This commit is contained in:
parent
6450e2a704
commit
1bd617d389
@ -206,20 +206,21 @@ void
|
|||||||
handle_incoming_message(char *from, char *message, gboolean priv)
|
handle_incoming_message(char *from, char *message, gboolean priv)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBOTR
|
#ifdef HAVE_LIBOTR
|
||||||
//check for OTR whitespace (opportunistic)
|
gboolean was_decrypted = FALSE;
|
||||||
|
char *newmessage;
|
||||||
|
|
||||||
|
if (!priv) {
|
||||||
|
//check for OTR whitespace (opportunistic or always)
|
||||||
char *policy = prefs_get_string(PREF_OTR_POLICY);
|
char *policy = prefs_get_string(PREF_OTR_POLICY);
|
||||||
if (strcmp(policy, "opportunistic") == 0) {
|
if (strcmp(policy, "opportunistic") == 0 || strcmp(policy, "always") == 0) {
|
||||||
if (strstr(message,OTRL_MESSAGE_TAG_BASE)) {
|
if (strstr(message,OTRL_MESSAGE_TAG_BASE)) {
|
||||||
if (strstr(message, OTRL_MESSAGE_TAG_V2) || strstr(message, OTRL_MESSAGE_TAG_V1)) {
|
if (strstr(message, OTRL_MESSAGE_TAG_V2) || strstr(message, OTRL_MESSAGE_TAG_V1)) {
|
||||||
char *otr_query_message = otr_start_query();
|
char *otr_query_message = otr_start_query();
|
||||||
cons_show("OTR Whitespace pattern detected. Attempting to start OTR session...", message);
|
cons_show("OTR Whitespace pattern detected. Attempting to start OTR session...");
|
||||||
message_send(otr_query_message, from);
|
message_send(otr_query_message, from);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gboolean was_decrypted = FALSE;
|
|
||||||
char *newmessage;
|
|
||||||
if (!priv) {
|
|
||||||
newmessage = otr_decrypt_message(from, message, &was_decrypted);
|
newmessage = otr_decrypt_message(from, message, &was_decrypted);
|
||||||
|
|
||||||
// internal OTR message
|
// internal OTR message
|
||||||
|
Loading…
x
Reference in New Issue
Block a user