Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Windows
pEp for Outlook
Commits
99e1bdbb
Commit
99e1bdbb
authored
Apr 27, 2021
by
Thomas
Browse files
Compare optional fields case-insensitively
parent
91bb7461
Changes
1
Hide whitespace changes
Inline
Side-by-side
PEPMessage.cs
View file @
99e1bdbb
...
...
@@ -2669,53 +2669,44 @@ namespace pEp
{
if
(
optField
.
Name
!=
null
)
{
switch
(
optField
.
Name
)
if
(
optField
.
Name
.
Equals
(
PEPMessage
.
PR_PEP_AUTO_CONSUME_NAME
,
StringComparison
.
InvariantCultureIgnoreCase
)
||
(
optField
.
Name
.
Equals
(
PEPMessage
.
PR_PEP_AUTO_CONSUME_NAME_OLD
,
StringComparison
.
InvariantCultureIgnoreCase
)))
{
case
PEPMessage
.
PR_PEP_AUTO_CONSUME_NAME
:
case
PEPMessage
.
PR_PEP_AUTO_CONSUME_NAME_OLD
:
{
newMessage
.
AutoConsume
=
optField
.
Value
;
break
;
}
case
PEPMessage
.
PR_PEP_FORCE_PROTECTION_NAME
:
{
newMessage
.
ForceProtectionId
=
optField
.
Value
;
break
;
}
case
PEPMessage
.
PR_PEP_KEY_IMPORT_NAME
:
case
PEPMessage
.
PR_PEP_KEY_IMPORT_NAME_OLD
:
{
newMessage
.
KeyImport
=
optField
.
Value
;
break
;
}
case
PEPMessage
.
PR_KEY_LIST_NAME
:
{
newMessage
.
KeyList
=
optField
.
Value
;
break
;
}
case
PEPMessage
.
PR_PEP_NEVER_UNSECURE_NAME
:
{
// If it exists it's true, value doesn't matter
newMessage
.
NeverUnsecure
=
true
;
break
;
}
case
PEPMessage
.
PR_PEP_PROTOCOL_VERSION_NAME
:
{
newMessage
.
PEPProtocolVersion
=
optField
.
Value
;
break
;
}
case
PEPMessage
.
PR_ENC_STATUS_NAME
:
{
try
{
newMessage
.
Rating
=
AdapterExtensions
.
ParseRatingString
(
optField
.
Value
);
}
catch
{
newMessage
.
Rating
=
pEpRating
.
pEpRatingUndefined
;
}
break
;
}
newMessage
.
AutoConsume
=
optField
.
Value
;
}
else
if
(
optField
.
Name
.
Equals
(
PEPMessage
.
PR_PEP_FORCE_PROTECTION_NAME
,
StringComparison
.
InvariantCultureIgnoreCase
))
{
newMessage
.
ForceProtectionId
=
optField
.
Value
;
}
else
if
(
optField
.
Name
.
Equals
(
PEPMessage
.
PR_PEP_KEY_IMPORT_NAME
,
StringComparison
.
InvariantCultureIgnoreCase
)
||
(
optField
.
Name
.
Equals
(
PEPMessage
.
PR_PEP_KEY_IMPORT_NAME_OLD
,
StringComparison
.
InvariantCultureIgnoreCase
)))
{
newMessage
.
KeyImport
=
optField
.
Value
;
}
else
if
(
optField
.
Name
.
Equals
(
PEPMessage
.
PR_KEY_LIST_NAME
,
StringComparison
.
InvariantCultureIgnoreCase
))
{
newMessage
.
KeyList
=
optField
.
Value
;
}
else
if
(
optField
.
Name
.
Equals
(
PEPMessage
.
PR_PEP_NEVER_UNSECURE_NAME
,
StringComparison
.
InvariantCultureIgnoreCase
))
{
// If it exists it's true, value doesn't matter
newMessage
.
NeverUnsecure
=
true
;
}
else
if
(
optField
.
Name
.
Equals
(
PEPMessage
.
PR_PEP_PROTOCOL_VERSION_NAME
,
StringComparison
.
InvariantCultureIgnoreCase
))
{
newMessage
.
PEPProtocolVersion
=
optField
.
Value
;
}
else
if
(
optField
.
Name
.
Equals
(
PEPMessage
.
PR_ENC_STATUS_NAME
,
StringComparison
.
InvariantCultureIgnoreCase
))
{
try
{
newMessage
.
Rating
=
AdapterExtensions
.
ParseRatingString
(
optField
.
Value
);
}
catch
{
newMessage
.
Rating
=
pEpRating
.
pEpRatingUndefined
;
}
break
;
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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