+ % if username:
+ % if state == "logged-in":
+ Logged in successfully!
+
+ Logged in as @${username}.
+ You can now close this page.
+ You should be invited to Telegram portals on Matrix momentarily.
+
+ % else:
+ You're already logged in!
+
+ You're logged in as @${username}.
+
+
+ If you want to log in with another account, log out using the logout
+ management command first.
+
+ % endif
+ % else:
+ Log in to Telegram
+ % if error:
+ ${error}
+ % endif
+ % if message:
+ ${message}
+ % endif
+
+ % endif
+
+
+
diff --git a/mautrix_telegram/util/__init__.py b/mautrix_telegram/util/__init__.py
index 53d6aabd..c512529c 100644
--- a/mautrix_telegram/util/__init__.py
+++ b/mautrix_telegram/util/__init__.py
@@ -1 +1,2 @@
from .file_transfer import transfer_file_to_matrix
+from .format_duration import format_duration
diff --git a/mautrix_telegram/util/format_duration.py b/mautrix_telegram/util/format_duration.py
new file mode 100644
index 00000000..ffbac714
--- /dev/null
+++ b/mautrix_telegram/util/format_duration.py
@@ -0,0 +1,34 @@
+# -*- coding: future_fstrings -*-
+# mautrix-telegram - A Matrix-Telegram puppeting bridge
+# Copyright (C) 2018 Tulir Asokan
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see