summary refs log tree commit diff
path: root/src/Utils.cpp
diff options
context:
space:
mode:
authorRudi Floren <rudi.floren@gmail.com>2018-08-21 08:22:51 +0200
committermujx <mujx@users.noreply.github.com>2018-08-21 06:22:51 +0000
commitc8a59f2d6ec401bf758db1d62210a33aeea9764b (patch)
tree7d59fcefe549d75612a65fad41e20c3aa7e30f25 /src/Utils.cpp
parentRemove pixel ratio from image scaling (diff)
downloadnheko-c8a59f2d6ec401bf758db1d62210a33aeea9764b.tar.xz
Add device ID and device fingerprint to settings page like in Riot. (#407)
Diffstat (limited to 'src/Utils.cpp')
-rw-r--r--src/Utils.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Utils.cpp b/src/Utils.cpp
index 944fdcd5..d6fff47e 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -263,3 +263,18 @@ utils::mxcToHttp(const QUrl &url, const QString &server, int port)
           .arg(QString::fromStdString(mxcParts.server))
           .arg(QString::fromStdString(mxcParts.media_id));
 }
+
+QString
+utils::humanReadableFingerprint(const std::string &ed25519)
+{
+        return humanReadableFingerprint(QString::fromStdString(ed25519));
+}
+QString
+utils::humanReadableFingerprint(const QString &ed25519)
+{
+        QStringList fingerprintList;
+        for (int i = 0; i < ed25519.length(); i = i + 4) {
+                fingerprintList << ed25519.mid(i, 4);
+        }
+        return fingerprintList.join(" ");
+}
\ No newline at end of file