Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Messagelib
Commits
ca9b12cf
Commit
ca9b12cf
authored
Sep 10, 2022
by
Sandro Knauß
🐝
Browse files
send also for know issues a nearexpiry message.
parent
bcdfa234
Changes
3
Hide whitespace changes
Inline
Side-by-side
messagecomposer/src/composer/composerviewbase.cpp
View file @
ca9b12cf
...
...
@@ -722,7 +722,11 @@ QVector<MessageComposer::Composer *> ComposerViewBase::generateCryptoMessages(bo
connect
(
nearExpiryChecker
.
data
(),
&
NearExpiryChecker
::
expiryMessage
,
this
,
[
&
canceled
](
const
GpgME
::
Key
&
key
,
QString
msg
,
NearExpiryChecker
::
ExpiryInformation
info
)
{
[
&
canceled
](
const
GpgME
::
Key
&
key
,
QString
msg
,
NearExpiryChecker
::
ExpiryInformation
info
,
bool
isNewMessage
)
{
if
(
!
isNewMessage
)
{
return
;
}
if
(
canceled
)
{
return
;
}
...
...
messagecomposer/src/composer/nearexpirychecker.cpp
View file @
ca9b12cf
...
...
@@ -311,9 +311,8 @@ void NearExpiryChecker::checkKeyNearExpiry(const GpgME::Key &key, bool isOwnKey,
return
;
}
const
GpgME
::
Subkey
subkey
=
key
.
subkey
(
0
);
if
(
d
->
alreadyWarnedFingerprints
.
count
(
subkey
.
fingerprint
()))
{
return
;
// already warned about this one (and so about it's issuers)
}
const
bool
newMessage
=
!
d
->
alreadyWarnedFingerprints
.
count
(
subkey
.
fingerprint
());
if
(
subkey
.
neverExpires
())
{
return
;
...
...
@@ -324,7 +323,7 @@ void NearExpiryChecker::checkKeyNearExpiry(const GpgME::Key &key, bool isOwnKey,
const
QString
msg
=
key
.
protocol
()
==
GpgME
::
OpenPGP
?
formatOpenPGPMessage
(
key
,
secsTillExpiry
,
isOwnKey
,
isSigningKey
)
:
formatSMIMEMessage
(
key
,
orig_key
,
secsTillExpiry
,
isOwnKey
,
isSigningKey
,
ca
);
d
->
alreadyWarnedFingerprints
.
insert
(
subkey
.
fingerprint
());
Q_EMIT
expiryMessage
(
key
,
msg
,
isOwnKey
?
OwnKeyExpired
:
OtherKeyExpired
);
Q_EMIT
expiryMessage
(
key
,
msg
,
isOwnKey
?
OwnKeyExpired
:
OtherKeyExpired
,
newMessage
);
}
else
{
const
int
daysTillExpiry
=
1
+
int
(
secsTillExpiry
/
secsPerDay
);
const
int
threshold
=
ca
...
...
@@ -335,7 +334,7 @@ void NearExpiryChecker::checkKeyNearExpiry(const GpgME::Key &key, bool isOwnKey,
const
QString
msg
=
key
.
protocol
()
==
GpgME
::
OpenPGP
?
formatOpenPGPMessage
(
key
,
secsTillExpiry
,
isOwnKey
,
isSigningKey
)
:
formatSMIMEMessage
(
key
,
orig_key
,
secsTillExpiry
,
isOwnKey
,
isSigningKey
,
ca
);
d
->
alreadyWarnedFingerprints
.
insert
(
subkey
.
fingerprint
());
Q_EMIT
expiryMessage
(
key
,
msg
,
isOwnKey
?
OwnKeyNearExpiry
:
OtherKeyNearExpiry
);
Q_EMIT
expiryMessage
(
key
,
msg
,
isOwnKey
?
OwnKeyNearExpiry
:
OtherKeyNearExpiry
,
newMessage
);
}
}
if
(
key
.
isRoot
())
{
...
...
messagecomposer/src/composer/nearexpirychecker.h
View file @
ca9b12cf
...
...
@@ -51,7 +51,7 @@ public:
void
checkKey
(
const
GpgME
::
Key
&
key
)
const
;
Q_SIGNALS:
void
expiryMessage
(
const
GpgME
::
Key
&
key
,
QString
msg
,
MessageComposer
::
NearExpiryChecker
::
ExpiryInformation
info
)
const
;
void
expiryMessage
(
const
GpgME
::
Key
&
key
,
QString
msg
,
MessageComposer
::
NearExpiryChecker
::
ExpiryInformation
info
,
bool
isNewMessage
)
const
;
private:
friend
class
::
NearExpiryCheckerTest
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment