aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-11-28 23:12:51 +0100
committerdec05eba <dec05eba@protonmail.com>2022-11-28 23:12:51 +0100
commit94152da2ef18a673a996e3d5cfb3780a8f5f7feb (patch)
tree792a486ea8cdca345e17a5b377eb42701b432a1b
parente12e7e960ee36607f6107a28c0935e8c2a006632 (diff)
Matrix: ignore expired and revoked signatures for gpg encrypt
-rw-r--r--src/Body.cpp1
-rw-r--r--src/plugins/Matrix.cpp6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index cc0edfa..fedf25d 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -1183,6 +1183,7 @@ namespace QuickMedia {
const float height_diff = item->height - item->prev_height;
item->prev_height = item->height;
+ // TODO: This messes up local anime when watching an anime and then going back. The selected item is at the top and we cant see previous items unless we scroll up, even if there aren't enough items to cause a scroll.
if(attach_side == AttachSide::TOP) {
if(index < selected_item) {
page_scroll -= height_diff;
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index d93c64a..6040edd 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -123,6 +123,7 @@ namespace QuickMedia {
string_split(output, '\n', [&](const char *str, size_t size) {
GpgLineType line_type = GpgLineType::UNKNOWN;
int column = 0;
+ bool invalid_signature = false;
string_split_view(std::string_view(str, size), ':', [&](const char *str, size_t size) {
std::string_view section(str, size);
@@ -131,8 +132,11 @@ namespace QuickMedia {
line_type = GpgLineType::UID;
else if(section == "fpr")
line_type = GpgLineType::FPR;
+ } else if(column == 1) {
+ if(line_type == GpgLineType::UID)
+ invalid_signature = (section == "e" || section == "r"); // Expired or revoked
} else if(column == 9) {
- if(line_type == GpgLineType::UID) {
+ if(line_type == GpgLineType::UID && !invalid_signature) {
// Assumes that each uid is preceeded with fpr
const std::string user_email = std::string(gpg_display_name_extract_email(section));
if(!user_email.empty() && users_by_email.find(user_email) != users_by_email.end()) {