aboutsummaryrefslogtreecommitdiff
path: root/plugins/openpgp/src
diff options
context:
space:
mode:
authorhrxi <hrrrxi@gmail.com>2019-09-01 18:18:25 +0200
committerfiaxh <fiaxh@users.noreply.github.com>2019-09-10 19:36:11 +0200
commitd5d305193ce527f1cc3022c406de35d9a85d4ccb (patch)
treed12efc741319a7d71c13f7bf6c2c7579d25fdabe /plugins/openpgp/src
parent9950742bf1903291c271619aea101b0e2f81d19c (diff)
downloaddino-d5d305193ce527f1cc3022c406de35d9a85d4ccb.tar.gz
dino-d5d305193ce527f1cc3022c406de35d9a85d4ccb.zip
Fix some warnings
Instances of `RegexError` are just asserted as `assert_not_reached` as they cannot really fail except for allocation failure if the given regex is valid.
Diffstat (limited to 'plugins/openpgp/src')
-rw-r--r--plugins/openpgp/src/file_transfer/file_decryptor.vala2
-rw-r--r--plugins/openpgp/src/util.vala3
2 files changed, 3 insertions, 2 deletions
diff --git a/plugins/openpgp/src/file_transfer/file_decryptor.vala b/plugins/openpgp/src/file_transfer/file_decryptor.vala
index 7668023e..97eb9f43 100644
--- a/plugins/openpgp/src/file_transfer/file_decryptor.vala
+++ b/plugins/openpgp/src/file_transfer/file_decryptor.vala
@@ -35,7 +35,7 @@ public class PgpFileDecryptor : FileDecryptor, Object {
}
return new MemoryInputStream.from_data(clear_data.data, GLib.free);
} catch (Error e) {
- throw new FileReceiveError.DECRYPTION_FAILED("PGP file decrypt error: %s".printf(e.message));
+ throw new FileReceiveError.DECRYPTION_FAILED("PGP file decryption error: %s".printf(e.message));
}
}
}
diff --git a/plugins/openpgp/src/util.vala b/plugins/openpgp/src/util.vala
index 7c42b578..d40cf6ef 100644
--- a/plugins/openpgp/src/util.vala
+++ b/plugins/openpgp/src/util.vala
@@ -1,6 +1,7 @@
using Gtk;
using Dino.Entities;
+using Xmpp.Util;
namespace Dino.Plugins.OpenPgp {
@@ -10,7 +11,7 @@ public static string markup_colorize_id(string s, bool is_fingerprint) {
for (int i = 0; i < s.length; i += 4) {
string four_chars = s.substring(i, 4).down();
- int raw = (int) four_chars.to_long(null, 16);
+ int raw = (int) from_hex(four_chars);
uint8[] bytes = {(uint8) ((raw >> 8) & 0xff - 128), (uint8) (raw & 0xff - 128)};
Checksum checksum = new Checksum(ChecksumType.SHA1);