aboutsummaryrefslogtreecommitdiff
path: root/main/src/view_model/account_details.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2024-06-20 12:05:20 +0200
committerfiaxh <git@lightrise.org>2024-06-20 12:14:46 +0200
commit21ae42762d8a57da5cb1ec40b46e7510fc3121ad (patch)
treede91ddf080c3e1e433136235265d0d3682a976b8 /main/src/view_model/account_details.vala
parentc8b20d0f5f33fb8b9898d216c3b4c9280abf31da (diff)
downloaddino-21ae42762d8a57da5cb1ec40b46e7510fc3121ad.tar.gz
dino-21ae42762d8a57da5cb1ec40b46e7510fc3121ad.zip
Redesign and rewrite accounts and settings dialog into a combined one
Diffstat (limited to 'main/src/view_model/account_details.vala')
-rw-r--r--main/src/view_model/account_details.vala21
1 files changed, 21 insertions, 0 deletions
diff --git a/main/src/view_model/account_details.vala b/main/src/view_model/account_details.vala
new file mode 100644
index 00000000..a9ddeca5
--- /dev/null
+++ b/main/src/view_model/account_details.vala
@@ -0,0 +1,21 @@
+using Dino;
+using Dino.Entities;
+using Xmpp;
+using Xmpp.Xep;
+
+public class Dino.Ui.ViewModel.AccountDetails : Object {
+ public Entities.Account account { get; set; }
+ public string bare_jid { owned get { return account.bare_jid.to_string(); } }
+ public CompatAvatarPictureModel avatar_model { get; set; }
+ public ConnectionManager.ConnectionState connection_state { get; set; }
+ public ConnectionManager.ConnectionError? connection_error { get; set; }
+
+ public AccountDetails(Account account, StreamInteractor stream_interactor) {
+ var account_conv = new Conversation(account.bare_jid, account, Conversation.Type.CHAT);
+
+ this.account = account;
+ this.avatar_model = new ViewModel.CompatAvatarPictureModel(stream_interactor).set_conversation(account_conv);
+ this.connection_state = stream_interactor.connection_manager.get_state(account);
+ this.connection_error = stream_interactor.connection_manager.get_error(account);
+ }
+} \ No newline at end of file