diff options
| author | frosty <frostinator33@airmail.cc> | 2026-10-26 10:21:57 -0400 |
|---|---|---|
| committer | frosty <frostinator33@airmail.cc> | 2026-10-26 10:21:57 -0400 |
| commit | 74aecd8b0986d07b50b7ce310d64e645b8b54e38 (patch) | |
| tree | 560e6434f183eb54cd779936f3a4c9575146a066 /plugins/omemo/src/ui/util.vala | |
| parent | 3d7e90d401da02d430a87db0ec7e1db3a6f1a68f (diff) | |
| parent | 4436001bb361ad4f9e4e05819214ecf0ea77c063 (diff) | |
Merge 'upstream/master'
Diffstat (limited to 'plugins/omemo/src/ui/util.vala')
| -rw-r--r-- | plugins/omemo/src/ui/util.vala | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/plugins/omemo/src/ui/util.vala b/plugins/omemo/src/ui/util.vala deleted file mode 100644 index e250ff4d..00000000 --- a/plugins/omemo/src/ui/util.vala +++ /dev/null @@ -1,40 +0,0 @@ -using Xmpp.Util; - -namespace Dino.Plugins.Omemo { - -public static string fingerprint_from_base64(string b64) { - uint8[] arr = Base64.decode(b64); - - arr = arr[1:arr.length]; - string s = ""; - foreach (uint8 i in arr) { - string tmp = i.to_string("%x"); - if (tmp.length == 1) tmp = "0" + tmp; - s = s + tmp; - } - - return s; -} - -public static string fingerprint_markup(string s) { - return "<span font_family='monospace' font='9'>" + format_fingerprint(s) + "</span>"; -} - -public static string format_fingerprint(string s) { - string markup = ""; - for (int i = 0; i < s.length; i += 4) { - string four_chars = s.substring(i, 4).down(); - - if (i % 32 == 0 && i != 0) markup += "\n"; - markup += four_chars; - if (i % 16 == 12 && i % 32 != 28) { - markup += " "; - } - if (i % 8 == 4 && i % 16 != 12) { - markup += "\u00a0"; // Non-breaking space - } - } - return markup; -} - -} |
