if (count)
{
LPDISPATCH selectitem = NULL, mailitem = NULL;
- bool selected = true;
+ bool selected = hasMailitemEventReadBeenCalled ();
if (count == 1)
{
// If we call this on a selection with more items
}
}
+/* This flag gets set whenever the mailitem-event READ event
+is called it indicated that no other addin like titus filtered
+out the READ event. If set we invalidate the ribon on SelectionChange
+events in explorer-events as we would normally do that on handling READ*/
+static bool mailitemEventReadCalled = false;
+void
+markMailitemEventReadAsCalled()
+{
+ mailitemEventReadCalled = true;
+}
+
+bool
+hasMailitemEventReadBeenCalled()
+{
+ return mailitemEventReadCalled;
+}
+
void
check_html_preferred()
{
TRACEPOINT;
i18n_init ();
-
+TRACEPOINT
if (!create_responder_window())
{
log_error ("%s:%s: Failed to create the responder window;",
log_error ("%s:%s: Failed to create messagehook. ",
SRCNAME, __func__);
}
-
+TRACEPOINT
/* Clean GpgOL prefixed categories.
They might be left over from a crash or something unexpected
error. We want to avoid pollution with the signed by categories.
m_applicationEventSink = install_ApplicationEvents_sink (m_application);
m_explorersEventSink = install_explorer_sinks (m_application);
check_html_preferred ();
-
+TRACEPOINT
CloseHandle (CreateThread (NULL, 0, init_gpgme_config, nullptr, 0,
NULL));
-
+TRACEPOINT
KeyCache::instance ()->populate ();
return S_OK;
}
* Registry key. */
void check_html_preferred ();
+/* Functions to detect/handle filtered READ events*/
+void markMailitemEventReadAsCalled();
+bool hasMailitemEventReadBeenCalled();
+
#endif /*GPGOLADDIN_H*/
m_close_triggered(false),
m_is_html_alternative(false),
m_needs_encrypt(false),
- m_vd_postponed(false),
+ m_vd_postponed(true),
m_moss_position(0),
m_crypto_flags(0),
m_cached_html_body(nullptr),
m_type == MSGTYPE_SMIME)
{
/* Not a message for us. */
+ log_debug ("N");
TRETURN false;
}
+ log_debug ("Y");
TRETURN true;
}
Mail::isSigned () const
{
TSTART;
- TRETURN m_verify_result.numSignatures() > 0;
+ bool ret = m_verify_result.numSignatures() > 0;
+ log_debug (ret?"Y":"N");
+ TRETURN ret;
}
bool
Mail::isEncrypted () const
{
TSTART;
+ log_debug (!m_decrypt_result.isNull()?"Y":"N");
+
TRETURN !m_decrypt_result.isNull();
}
TSTART;
if (!m_is_signed)
{
+ log_debug("level=0");
TRETURN 0;
}
if (m_uid.isNull ())
{
/* No m_uid matches our sender. */
+ log_debug("level=0");
TRETURN 0;
}
(m_uid.validity () == UserID::Validity::Full &&
level_4_check (m_uid))) && (!in_de_vs_mode () || m_sig.isDeVs()))
{
+ log_debug("level=4");
TRETURN 4;
}
if (m_is_valid && m_uid.validity () == UserID::Validity::Full &&
(!in_de_vs_mode () || m_sig.isDeVs()))
{
+ log_debug("level=3");
TRETURN 3;
}
if (m_is_valid)
{
+ log_debug("level=2");
TRETURN 2;
}
if (m_sig.validity() == Signature::Validity::Marginal)
{
+ log_debug("level=1");
TRETURN 1;
}
+
+ log_debug("level=0");
+
if (m_sig.summary() & Signature::Summary::TofuConflict ||
m_uid.tofuInfo().validity() == TofuInfo::Conflict)
{
TSTART;
int level = get_signature_level ();
int offset = isEncrypted () ? ENCRYPT_ICON_OFFSET : 0;
+ log_debug("CryptoIconID=%d", IDI_LEVEL_0 + level + offset);
TRETURN IDI_LEVEL_0 + level + offset;
}
bool
Mail::realyDecryptedSuccessfully () const
{
- return m_decrypt_result.isNull() || m_decrypt_result.error().code()==0;
+ TSTART;
+ bool ret = m_decrypt_result.isNull() || m_decrypt_result.error().code()==0;
+ log_debug ("%s:%s: return %s", SRCNAME, __func__, ret?"Y":"N");
+ TRETURN ret;
}
bool
Mail::decryptedSuccessfully () const
{
- return m_decrypt_result.isNull() || !m_decrypt_result.error();
+ TSTART;
+ bool ret = m_decrypt_result.isNull() || !m_decrypt_result.error();
+ log_debug ("%s:%s: return %s", SRCNAME, __func__, ret?"Y":"N");
+ TRETURN ret;
}
+bool Mail::isVdPostponed () const
+{
+ log_debug ("%s:%s: %s", SRCNAME, __func__, m_vd_postponed?"Y":"N");
+ return m_vd_postponed;
+};
+
void
Mail::installFolderEventHandler_o()
{
/* returns a copy from copy() with setCopyParent set*/
Mail * getCopy();
- bool isVdPostponed () const { return m_vd_postponed; };
+ bool isVdPostponed () const;
private:
/* Returns a copy of the mail object. */
log_addins ();
addinsLogged = true;
}
+
+ markMailitemEventReadAsCalled();
if (!m_mail->isCryptoMail ())
{
log_debug ("%s:%s: Non crypto mail %p opened. Updating sigstatus.",
MY_MAIL_GETTER
result->vt = VT_BOOL | VT_BYREF;
- result->pboolVal = mail && ((mail->isSigned () &&!mail->isEncrypted()) || mail->realyDecryptedSuccessfully ()) ?
+ result->pboolVal = mail && !mail->isVdPostponed ()
+ && ((mail->isSigned () &&!mail->isEncrypted ()) || mail->realyDecryptedSuccessfully ()) ?
&var_true : &var_false;
TRACEPOINT;
MY_MAIL_GETTER
result->vt = VT_BOOL | VT_BYREF;
- result->pboolVal = mail && (mail->isVdPostponed () ) ?
+ result->pboolVal = mail && (mail->isVdPostponed () && mail->isCryptoMail ()) ?
&var_true : &var_false;
TRACEPOINT;